@ar.io/sdk
Version:
[](https://codecov.io/gh/ar-io/ar-io-sdk)
56 lines (55 loc) • 2.13 kB
TypeScript
import Arweave from 'arweave';
import { Logger } from '../common/index.js';
import { SpawnANTState } from '../types/ant.js';
import { AoClient, AoEpochData, AoEpochDistributed, AoSigner, ContractSigner, WalletAddress } from '../types/index.js';
export type SpawnANTParams = {
signer: AoSigner;
module?: string;
ao?: AoClient;
scheduler?: string;
state?: SpawnANTState;
stateContractTxId?: string;
antRegistryId?: string;
logger?: Logger;
authority?: string;
/**
* @deprecated Compiled modules are now being used instead of luaCodeTxId
*/
luaCodeTxId?: string;
/**
* @deprecated no longer in use due to compiled modules being preferred
*/
arweave?: Arweave;
};
export declare function spawnANT({ signer, module, ao, scheduler, state, antRegistryId, logger, authority, }: SpawnANTParams): Promise<string>;
export declare function evolveANT({ signer, processId, luaCodeTxId, ao, logger, arweave, }: {
signer: AoSigner;
processId: string;
luaCodeTxId?: string;
ao?: AoClient;
logger?: Logger;
arweave?: Arweave;
}): Promise<string>;
export declare function isAoSigner(value: unknown): value is AoSigner;
export declare function createAoSigner(signer: ContractSigner): AoSigner;
export declare const defaultTargetManifestId = "-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";
export declare const defaultANTLogoId = "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A";
export declare function initANTStateForAddress({ owner, targetId, ttlSeconds, keywords, controllers, description, ticker, name, logo, }: Partial<SpawnANTState> & {
targetId?: string;
ttlSeconds?: number;
owner: WalletAddress;
}): SpawnANTState;
/**
* Uses zod schema to parse the epoch data
*/
export declare function parseAoEpochData(value: unknown): AoEpochData<AoEpochDistributed>;
export declare function errorMessageFromOutput(output: {
Error?: string;
Messages?: {
Tags?: {
name: string;
value: string;
}[];
}[];
}): string | undefined;
export declare function removeUnicodeFromError(error: string): string;