Variable methodsConst

methods: {
    _getPollInterval: ((type: "block" | "microblock", __namedParameters: {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => number);
    aensBid: ((name: `${string}.chain`, nameFee: string | number | BigNumber, options: Omit<AensClaimOptions, "nameFee">) => ReturnType<typeof aensClaim>);
    aensClaim: ((name: `${string}.chain`, salt: number, options: AensClaimOptions) => Promise<AensClaimReturnType>);
    aensPreclaim: ((name: `${string}.chain`, options: AensPreclaimOptions) => Promise<Readonly<Awaited<ReturnType<typeof sendTransaction>> & {
        claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>);
        commitmentId: string;
        salt: number;
    }>>);
    aensQuery: ((name: `${string}.chain`, opt: {
        onNode: Node;
    } & AensUpdateOptions & AensTransferOptions) => Promise<Readonly<TransformNodeType<NameEntry> & {
        extendTtl: ((nameTtl: number, options?: Omit<Parameters<typeof aensQuery>[1], "onNode" | "onCompiler" | "onAccount">) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
        id: Name;
        owner: AccountAddress;
        pointers: KeyPointers | NamePointer[];
        revoke: ((options?: Omit<Parameters<typeof aensRevoke>[1], "onNode" | "onCompiler" | "onAccount"> & {
            onAccount?: AccountBase;
        }) => ReturnType<typeof aensRevoke>);
        transfer: ((account: AccountAddress, options?: Parameters<typeof aensQuery>[1]) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
        ttl: number;
        update: ((pointers: KeyPointers, options?: Omit<Parameters<typeof aensQuery>[1], "onNode" | "onCompiler" | "onAccount"> & {
            onAccount?: AccountBase;
        }) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
    }>>);
    aensRevoke: ((name: `${string}.chain`, options: AensRevokeOptions) => ReturnType<typeof sendTransaction>);
    aensTransfer: ((name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions) => ReturnType<typeof sendTransaction>);
    aensUpdate: ((name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions) => ReturnType<typeof sendTransaction>);
    awaitHeight: ((height: number, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<number>);
    buildAuthTxHash: ((transaction: `tx_${string}`, options: {
        fee?: Int;
        gasPrice?: Int;
        onNode: Node;
    }) => Promise<Buffer>);
    buildAuthTxHashByGaMetaTx: ((transaction: `tx_${string}`, options: {
        onNode: Node;
    }) => Promise<Buffer>);
    createDelegationSignature: ((contractAddress: `ct_${string}`, ids: (`${string}.chain` | `kh_${string}` | `mh_${string}` | `bf_${string}` | `bx_${string}` | `bs_${string}` | `ch_${string}` | `ct_${string}` | `cb_${string}` | `ck_${string}` | `cv_${string}` | `tx_${string}` | `th_${string}` | `ok_${string}` | `ov_${string}` | `oq_${string}` | `or_${string}` | `ak_${string}` | `sg_${string}` | `cm_${string}` | `pp_${string}` | `nm_${string}` | `st_${string}` | `pi_${string}` | `ss_${string}` | `cs_${string}` | `ba_${string}`)[], options: {
        omitAddress?: boolean;
        onAccount: AccountBase;
        onNode: Node;
    }) => Promise<Uint8Array>);
    createGeneralizedAccount: ((authFnName: string, args: any[], __namedParameters: CreateGeneralizedAccountOptions) => Promise<Readonly<{
        gaContractId: ContractAddress;
        owner: AccountAddress;
        rawTx: Transaction;
        transaction: TxHash;
    }>>);
    extendOracleTtl: ((options: ExtendOracleTtlOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>);
    getAccount: ((address: `ct_${string}` | `ak_${string}`, options: {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<TransformNodeType<Account>>);
    getBalance: ((address: `ct_${string}` | `ok_${string}` | `ak_${string}`, options: {
        format?: AE_AMOUNT_FORMATS;
    } & {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<string>);
    getContract: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<ContractObject>>);
    getContractByteCode: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<ByteCode>>);
    getCurrentGeneration: ((options: {
        onNode: Node;
    }) => Promise<TransformNodeType<Generation>>);
    getGeneration: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<Generation>>);
    getHeight: ((__namedParameters: {
        onNode: Node;
    }) => Promise<number>);
    getKeyBlock: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<KeyBlock>>);
    getMicroBlockHeader: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<MicroBlockHeader>>);
    getMicroBlockTransactions: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<SignedTx[]>>);
    getName: ((name: `${string}.chain`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<NameEntry>>);
    getOracleObject: ((oracleId: `ok_${string}`, options: {
        onAccount: AccountBase;
        onNode: Node;
    }) => Promise<GetOracleObjectReturnType>);
    getQueryObject: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, options: RespondToQueryOptions & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<GetQueryObjectReturnType>);
    payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof sendTransaction>);
    poll: ((th: `th_${string}`, options: {
        blocks?: number;
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<TransformNodeType<SignedTx>>);
    pollForQueries: ((oracleId: `ok_${string}`, onQuery: ((query: {
        fee: bigint;
        id: string;
        oracleId: string;
        query: string;
        response: string;
        responseTtl: { type: TTLType; value: string; };
        senderId: string;
        senderNonce: string;
        ttl: number;
    }) => void), options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => (() => void));
    pollForQueryResponse: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<string>);
    postQueryToOracle: ((oracleId: `ok_${string}`, query: string, options: PostQueryToOracleOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getQueryObject>>>);
    registerOracle: ((queryFormat: string, responseFormat: string, options: RegisterOracleOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>);
    resolveName: (<Type>(nameOrId: `${string}.chain` | `${Type}_${string}`, key: string, options: {
        onNode: Node;
        resolveByNode?: boolean;
        verify?: boolean;
    }) => Promise<Generic<Type | Name>>);
    respondToQuery: ((queryId: `oq_${string}`, response: string, options: RespondToQueryOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>);
    sendTransaction: ((txUnsigned: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>);
    spend: ((amount: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: SpendOptions) => ReturnType<typeof sendTransaction>);
    transferFunds: ((fraction: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: TransferFundsOptions) => ReturnType<typeof sendTransaction>);
    txDryRun: ((tx: `tx_${string}`, accountAddress: `ak_${string}`, options: {
        combine?: boolean;
        onNode: Node;
        top?: number | `kh_${string}` | `mh_${string}`;
        txEvents?: boolean;
    }) => Promise<{
        txEvents?: TransformNodeType<DryRunResults["txEvents"]>;
    } & TransformNodeType<DryRunResult>>);
    waitForTxConfirm: ((txHash: `th_${string}`, options: {
        confirm?: number;
        onNode: Node;
    } & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<number>);
} = ...

Type declaration

  • _getPollInterval: ((type: "block" | "microblock", __namedParameters: {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => number)
      • (type: "block" | "microblock", __namedParameters: {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): number
      • Parameters

        • type: "block" | "microblock"
        • __namedParameters: {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }
          • Optional _expectedMineRate?: number
          • Optional _maxPollInterval?: number
          • Optional _microBlockCycle?: number

        Returns number

  • aensBid: ((name: `${string}.chain`, nameFee: string | number | BigNumber, options: Omit<AensClaimOptions, "nameFee">) => ReturnType<typeof aensClaim>)
      • (name: `${string}.chain`, nameFee: string | number | BigNumber, options: Omit<AensClaimOptions, "nameFee">): ReturnType<typeof aensClaim>
      • Bid to name auction

        Returns

        Transaction result

        Example

        const name = 'test.chain'
        const bidFee = computeBidFee(name, { startFee, increment: 0.42 })

        await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })

        Parameters

        • name: `${string}.chain`

          Domain name

        • nameFee: string | number | BigNumber

          Name fee (bid fee)

        • options: Omit<AensClaimOptions, "nameFee">

          Options

        Returns ReturnType<typeof aensClaim>

  • aensClaim: ((name: `${string}.chain`, salt: number, options: AensClaimOptions) => Promise<AensClaimReturnType>)
      • (name: `${string}.chain`, salt: number, options: AensClaimOptions): Promise<AensClaimReturnType>
      • Claim a previously preclaimed registration. This can only be done after the preclaim step

        Returns

        the result of the claim

        Example

        const name = 'test.chain'
        const salt = preclaimResult.salt // salt from pre-claim transaction

        await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })

        Parameters

        • name: `${string}.chain`

          AENS name

        • salt: number

          Salt from pre-claim, or 0 if it's a bid

        • options: AensClaimOptions

          options

        Returns Promise<AensClaimReturnType>

  • aensPreclaim: ((name: `${string}.chain`, options: AensPreclaimOptions) => Promise<Readonly<Awaited<ReturnType<typeof sendTransaction>> & {
        claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>);
        commitmentId: string;
        salt: number;
    }>>)
      • (name: `${string}.chain`, options: AensPreclaimOptions): Promise<Readonly<Awaited<ReturnType<typeof sendTransaction>> & {
            claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>);
            commitmentId: string;
            salt: number;
        }>>
      • Preclaim a name. Sends a hash of the name and a random salt to the node

        Example

        const name = 'test.chain'
        const salt = preclaimResult.salt // salt from pre-claim transaction

        await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })
        {
        ...transactionResult,
        claim, // Claim function (options={}) => claimTransactionResult
        salt,
        commitmentId
        }

        Parameters

        Returns Promise<Readonly<Awaited<ReturnType<typeof sendTransaction>> & {
            claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>);
            commitmentId: string;
            salt: number;
        }>>

  • aensQuery: ((name: `${string}.chain`, opt: {
        onNode: Node;
    } & AensUpdateOptions & AensTransferOptions) => Promise<Readonly<TransformNodeType<NameEntry> & {
        extendTtl: ((nameTtl: number, options?: Omit<Parameters<typeof aensQuery>[1], "onNode" | "onCompiler" | "onAccount">) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
        id: Name;
        owner: AccountAddress;
        pointers: KeyPointers | NamePointer[];
        revoke: ((options?: Omit<Parameters<typeof aensRevoke>[1], "onNode" | "onCompiler" | "onAccount"> & {
            onAccount?: AccountBase;
        }) => ReturnType<typeof aensRevoke>);
        transfer: ((account: AccountAddress, options?: Parameters<typeof aensQuery>[1]) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
        ttl: number;
        update: ((pointers: KeyPointers, options?: Omit<Parameters<typeof aensQuery>[1], "onNode" | "onCompiler" | "onAccount"> & {
            onAccount?: AccountBase;
        }) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>);
    }>>)
  • aensRevoke: ((name: `${string}.chain`, options: AensRevokeOptions) => ReturnType<typeof sendTransaction>)
      • (name: `${string}.chain`, options: AensRevokeOptions): ReturnType<typeof sendTransaction>
      • Revoke a name

        Returns

        Transaction result

        Example

        const name = 'test.chain'
        const nameObject = await sdkInstance.aensQuery(name)

        await sdkInstance.aensRevoke(name, { fee, ttl , nonce })
        // or
        await nameObject.revoke({ fee, ttl, nonce })

        Parameters

        Returns ReturnType<typeof sendTransaction>

  • aensTransfer: ((name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions) => ReturnType<typeof sendTransaction>)
      • (name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions): ReturnType<typeof sendTransaction>
      • Transfer a domain to another account

        Returns

        Transaction result

        Example

        const name = 'test.chain'
        const recipientPub = 'ak_asd23dasdas...'
        const nameObject = await sdkInstance.aensQuery(name)

        await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })
        // or
        await nameObject.transfer(recipientPub, { ttl, fee, nonce })

        Parameters

        • name: `${string}.chain`

          AENS name

        • account: `ak_${string}`

          Recipient account publick key

        • options: AensTransferOptions

          Options

        Returns ReturnType<typeof sendTransaction>

  • aensUpdate: ((name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions) => ReturnType<typeof sendTransaction>)
      • (name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions): ReturnType<typeof sendTransaction>
      • Update a name

        Throws

        Invalid pointer array error

        Example

        const name = 'test.chain'
        const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']
        const nameObject = await sdkInstance.aensQuery(name)

        await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
        // or
        await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })

        Parameters

        Returns ReturnType<typeof sendTransaction>

  • awaitHeight: ((height: number, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<number>)
      • (height: number, options: {
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): Promise<number>
      • Wait for the chain to reach a specific height

        Returns

        Current chain height

        Parameters

        • height: number

          Height to wait for

        • options: {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options

        Returns Promise<number>

  • buildAuthTxHash: ((transaction: `tx_${string}`, options: {
        fee?: Int;
        gasPrice?: Int;
        onNode: Node;
    }) => Promise<Buffer>)
      • (transaction: `tx_${string}`, options: {
            fee?: Int;
            gasPrice?: Int;
            onNode: Node;
        }): Promise<Buffer>
      • Build a transaction hash the same as Auth.tx_hash by GaMetaTx payload

        Returns

        Transaction hash

        Parameters

        • transaction: `tx_${string}`

          tx-encoded transaction

        • options: {
              fee?: Int;
              gasPrice?: Int;
              onNode: Node;
          }

          Options

          • Optional fee?: Int

            GaMetaTx fee, required in Ceres

          • Optional gasPrice?: Int

            GaMetaTx gasPrice, required in Ceres

          • onNode: Node

            Node to use

        Returns Promise<Buffer>

  • buildAuthTxHashByGaMetaTx: ((transaction: `tx_${string}`, options: {
        onNode: Node;
    }) => Promise<Buffer>)
      • (transaction: `tx_${string}`, options: {
            onNode: Node;
        }): Promise<Buffer>
      • Build a transaction hash the same as Auth.tx_hash by GaMetaTx

        Returns

        Transaction hash

        Parameters

        • transaction: `tx_${string}`

          tx-encoded signed GaMeta transaction

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<Buffer>

  • createDelegationSignature: ((contractAddress: `ct_${string}`, ids: (`${string}.chain` | `kh_${string}` | `mh_${string}` | `bf_${string}` | `bx_${string}` | `bs_${string}` | `ch_${string}` | `ct_${string}` | `cb_${string}` | `ck_${string}` | `cv_${string}` | `tx_${string}` | `th_${string}` | `ok_${string}` | `ov_${string}` | `oq_${string}` | `or_${string}` | `ak_${string}` | `sg_${string}` | `cm_${string}` | `pp_${string}` | `nm_${string}` | `st_${string}` | `pi_${string}` | `ss_${string}` | `cs_${string}` | `ba_${string}`)[], options: {
        omitAddress?: boolean;
        onAccount: AccountBase;
        onNode: Node;
    }) => Promise<Uint8Array>)
      • (contractAddress: `ct_${string}`, ids: (`${string}.chain` | `kh_${string}` | `mh_${string}` | `bf_${string}` | `bx_${string}` | `bs_${string}` | `ch_${string}` | `ct_${string}` | `cb_${string}` | `ck_${string}` | `cv_${string}` | `tx_${string}` | `th_${string}` | `ok_${string}` | `ov_${string}` | `oq_${string}` | `or_${string}` | `ak_${string}` | `sg_${string}` | `cm_${string}` | `pp_${string}` | `nm_${string}` | `st_${string}` | `pi_${string}` | `ss_${string}` | `cs_${string}` | `ba_${string}`)[], options: {
            omitAddress?: boolean;
            onAccount: AccountBase;
            onNode: Node;
        }): Promise<Uint8Array>
      • Helper to generate a signature to delegate

        • pre-claim/claim/transfer/revoke of a name to a contract.
        • register/extend/respond of an Oracle to a contract.

        Returns

        Signature

        Example

        const aeSdk = new AeSdk({ ... })
        const contractAddress = 'ct_asd2ks...'
        const aensName = 'example.chain'
        const onAccount = new MemoryAccount(...) // Sign with a specific account
        // Preclaim signature
        const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })
        // Claim, transfer and revoke signature
        const aensDelegationSig = await aeSdk
        .createDelegationSignature(contractAddress, [aensName], { onAccount })

        const oracleQueryId = 'oq_...'
        const onAccount = new MemoryAccount(...) // Sign with a specific account
        // Oracle register and extend signature
        const oracleDelegationSig = await aeSdk
        .createDelegationSignature(contractAddress, [], { onAccount })
        // Oracle respond signature
        const respondSig = await aeSdk
        .createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })

        Parameters

        • contractAddress: `ct_${string}`

          Address of contract to delegate access

        • ids: (`${string}.chain` | `kh_${string}` | `mh_${string}` | `bf_${string}` | `bx_${string}` | `bs_${string}` | `ch_${string}` | `ct_${string}` | `cb_${string}` | `ck_${string}` | `cv_${string}` | `tx_${string}` | `th_${string}` | `ok_${string}` | `ov_${string}` | `oq_${string}` | `or_${string}` | `ak_${string}` | `sg_${string}` | `cm_${string}` | `pp_${string}` | `nm_${string}` | `st_${string}` | `pi_${string}` | `ss_${string}` | `cs_${string}` | `ba_${string}`)[]

          The list of id's to prepend

        • options: {
              omitAddress?: boolean;
              onAccount: AccountBase;
              onNode: Node;
          }

          Options

          • Optional omitAddress?: boolean

            Prepend delegation signature with an account address

          • onAccount: AccountBase

            Account to use

          • onNode: Node

            Node to use

        Returns Promise<Uint8Array>

  • createGeneralizedAccount: ((authFnName: string, args: any[], __namedParameters: CreateGeneralizedAccountOptions) => Promise<Readonly<{
        gaContractId: ContractAddress;
        owner: AccountAddress;
        rawTx: Transaction;
        transaction: TxHash;
    }>>)
  • extendOracleTtl: ((options: ExtendOracleTtlOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>)
  • getAccount: ((address: `ct_${string}` | `ak_${string}`, options: {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<TransformNodeType<Account>>)
      • (address: `ct_${string}` | `ak_${string}`, options: {
            hash?: `kh_${string}` | `mh_${string}`;
            height?: number;
            onNode: Node;
        }): Promise<TransformNodeType<Account>>
      • Get account by account public key

        Parameters

        • address: `ct_${string}` | `ak_${string}`

          Account address (public key)

        • options: {
              hash?: `kh_${string}` | `mh_${string}`;
              height?: number;
              onNode: Node;
          }

          Options

          • Optional hash?: `kh_${string}` | `mh_${string}`

            Get account on specific block by micro block hash or key block hash

          • Optional height?: number

            Get account on specific block by block height

          • onNode: Node

            Node to use

        Returns Promise<TransformNodeType<Account>>

  • getBalance: ((address: `ct_${string}` | `ok_${string}` | `ak_${string}`, options: {
        format?: AE_AMOUNT_FORMATS;
    } & {
        hash?: `kh_${string}` | `mh_${string}`;
        height?: number;
        onNode: Node;
    }) => Promise<string>)
      • (address: `ct_${string}` | `ok_${string}` | `ak_${string}`, options: {
            format?: AE_AMOUNT_FORMATS;
        } & {
            hash?: `kh_${string}` | `mh_${string}`;
            height?: number;
            onNode: Node;
        }): Promise<string>
      • Request the balance of specified account

        Parameters

        • address: `ct_${string}` | `ok_${string}` | `ak_${string}`

          The public account address to obtain the balance for

        • options: {
              format?: AE_AMOUNT_FORMATS;
          } & {
              hash?: `kh_${string}` | `mh_${string}`;
              height?: number;
              onNode: Node;
          }

          Options

        Returns Promise<string>

  • getContract: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<ContractObject>>)
  • getContractByteCode: ((contractId: `ct_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<ByteCode>>)
  • getCurrentGeneration: ((options: {
        onNode: Node;
    }) => Promise<TransformNodeType<Generation>>)
  • getGeneration: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<Generation>>)
      • (hashOrHeight: number | `kh_${string}`, options: {
            onNode: Node;
        }): Promise<TransformNodeType<Generation>>
      • Get generation by hash or height

        Returns

        Generation

        Parameters

        • hashOrHeight: number | `kh_${string}`

          Generation hash or height

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<TransformNodeType<Generation>>

  • getHeight: ((__namedParameters: {
        onNode: Node;
    }) => Promise<number>)
      • (__namedParameters: {
            onNode: Node;
        }): Promise<number>
      • Obtain current height of the chain

        Returns

        Current chain height

        Parameters

        • __namedParameters: {
              onNode: Node;
          }

        Returns Promise<number>

  • getKeyBlock: ((hashOrHeight: number | `kh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<KeyBlock>>)
      • (hashOrHeight: number | `kh_${string}`, options: {
            onNode: Node;
        }): Promise<TransformNodeType<KeyBlock>>
      • Get key block

        Returns

        Key Block

        Parameters

        • hashOrHeight: number | `kh_${string}`

          Key block hash or height

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<TransformNodeType<KeyBlock>>

  • getMicroBlockHeader: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<MicroBlockHeader>>)
  • getMicroBlockTransactions: ((hash: `mh_${string}`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<SignedTx[]>>)
      • (hash: `mh_${string}`, options: {
            onNode: Node;
        }): Promise<TransformNodeType<SignedTx[]>>
      • Get micro block transactions

        Returns

        Transactions

        Parameters

        • hash: `mh_${string}`

          Micro block hash

        • options: {
              onNode: Node;
          }

          Options

          • onNode: Node

            Node to use

        Returns Promise<TransformNodeType<SignedTx[]>>

  • getName: ((name: `${string}.chain`, options: {
        onNode: Node;
    }) => Promise<TransformNodeType<NameEntry>>)
  • getOracleObject: ((oracleId: `ok_${string}`, options: {
        onAccount: AccountBase;
        onNode: Node;
    }) => Promise<GetOracleObjectReturnType>)
  • getQueryObject: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, options: RespondToQueryOptions & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<GetQueryObjectReturnType>)
      • (oracleId: `ok_${string}`, queryId: `oq_${string}`, options: RespondToQueryOptions & {
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): Promise<GetQueryObjectReturnType>
      • Constructor for OracleQuery Object (helper object for using OracleQuery)

        Returns

        OracleQuery object

        Parameters

        • oracleId: `ok_${string}`

          Oracle public key

        • queryId: `oq_${string}`

          Oracle Query id

        • options: RespondToQueryOptions & {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options

        Returns Promise<GetQueryObjectReturnType>

  • payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof sendTransaction>)
  • poll: ((th: `th_${string}`, options: {
        blocks?: number;
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<TransformNodeType<SignedTx>>)
      • (th: `th_${string}`, options: {
            blocks?: number;
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): Promise<TransformNodeType<SignedTx>>
      • Wait for a transaction to be mined

        Returns

        The transaction as it was mined

        Parameters

        • th: `th_${string}`

          The hash of transaction to poll

        • options: {
              blocks?: number;
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options

        Returns Promise<TransformNodeType<SignedTx>>

  • pollForQueries: ((oracleId: `ok_${string}`, onQuery: ((query: {
        fee: bigint;
        id: string;
        oracleId: string;
        query: string;
        response: string;
        responseTtl: { type: TTLType; value: string; };
        senderId: string;
        senderNonce: string;
        ttl: number;
    }) => void), options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => (() => void))
      • (oracleId: `ok_${string}`, onQuery: ((query: {
            fee: bigint;
            id: string;
            oracleId: string;
            query: string;
            response: string;
            responseTtl: { type: TTLType; value: string; };
            senderId: string;
            senderNonce: string;
            ttl: number;
        }) => void), options: {
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): (() => void)
      • Poll for oracle queries

        Returns

        Callback to stop polling function

        Parameters

        • oracleId: `ok_${string}`

          Oracle public key

        • onQuery: ((query: {
              fee: bigint;
              id: string;
              oracleId: string;
              query: string;
              response: string;
              responseTtl: { type: TTLType; value: string; };
              senderId: string;
              senderNonce: string;
              ttl: number;
          }) => void)

          OnQuery callback

            • (query: {
                  fee: bigint;
                  id: string;
                  oracleId: string;
                  query: string;
                  response: string;
                  responseTtl: { type: TTLType; value: string; };
                  senderId: string;
                  senderNonce: string;
                  ttl: number;
              }): void
            • Parameters

              • query: {
                    fee: bigint;
                    id: string;
                    oracleId: string;
                    query: string;
                    response: string;
                    responseTtl: { type: TTLType; value: string; };
                    senderId: string;
                    senderNonce: string;
                    ttl: number;
                }
                • fee: bigint
                • id: string

                  Base58Check encoded tagged value

                • oracleId: string

                  Base58Check encoded tagged pubkey

                • query: string
                • response: string
                • responseTtl: { type: TTLType; value: string; }
                • senderId: string

                  Base58Check encoded tagged pubkey

                • senderNonce: string
                • ttl: number

              Returns void

        • options: {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options object

        Returns (() => void)

          • (): void
          • Returns void

  • pollForQueryResponse: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, options: {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<string>)
      • (oracleId: `ok_${string}`, queryId: `oq_${string}`, options: {
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): Promise<string>
      • Poll for oracle query response

        Returns

        OracleQuery object

        Parameters

        • oracleId: `ok_${string}`

          Oracle public key

        • queryId: `oq_${string}`

          Oracle Query id

        • options: {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options object

        Returns Promise<string>

  • postQueryToOracle: ((oracleId: `ok_${string}`, query: string, options: PostQueryToOracleOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getQueryObject>>>)
  • registerOracle: ((queryFormat: string, responseFormat: string, options: RegisterOracleOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>)
  • resolveName: (<Type>(nameOrId: `${string}.chain` | `${Type}_${string}`, key: string, options: {
        onNode: Node;
        resolveByNode?: boolean;
        verify?: boolean;
    }) => Promise<Generic<Type | Name>>)
      • <Type>(nameOrId: `${string}.chain` | `${Type}_${string}`, key: string, options: {
            onNode: Node;
            resolveByNode?: boolean;
            verify?: boolean;
        }): Promise<Generic<Type | Name>>
      • Resolve AENS name and return name hash

        Returns

        Address or AENS name hash

        Type Parameters

        Parameters

        • nameOrId: `${string}.chain` | `${Type}_${string}`

          AENS name or address

        • key: string

          in AENS pointers record

        • options: {
              onNode: Node;
              resolveByNode?: boolean;
              verify?: boolean;
          }

          Options

          • onNode: Node

            Node to use

          • Optional resolveByNode?: boolean

            Enables pointer resolving using node

          • Optional verify?: boolean

            To ensure that name exist and have a corresponding pointer // TODO: avoid that to don't trust to current api gateway

        Returns Promise<Generic<Type | Name>>

  • respondToQuery: ((queryId: `oq_${string}`, response: string, options: RespondToQueryOptions) => Promise<Awaited<ReturnType<typeof sendTransaction>> & Awaited<ReturnType<typeof getOracleObject>>>)
  • sendTransaction: ((txUnsigned: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>)
  • spend: ((amount: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: SpendOptions) => ReturnType<typeof sendTransaction>)
      • (amount: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: SpendOptions): ReturnType<typeof sendTransaction>
      • Send coins to another account

        Returns

        Transaction

        Parameters

        • amount: string | number

          Amount to spend

        • recipientIdOrName: `${string}.chain` | `ak_${string}`

          Address or name of recipient account

        • options: SpendOptions

          Options

        Returns ReturnType<typeof sendTransaction>

  • transferFunds: ((fraction: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: TransferFundsOptions) => ReturnType<typeof sendTransaction>)
      • (fraction: string | number, recipientIdOrName: `${string}.chain` | `ak_${string}`, options: TransferFundsOptions): ReturnType<typeof sendTransaction>
      • Spend a fraction of coin balance to another account. Useful if needed to drain account balance completely, sending funds to another account (with fraction set to 1).

        Example

        // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
        const { blockHeight } = await aeSdk.transferFunds(
        0.42,
        'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
        );
        console.log('Transaction mined at', blockHeight);

        Parameters

        • fraction: string | number

          Fraction of balance to spend (between 0 and 1)

        • recipientIdOrName: `${string}.chain` | `ak_${string}`

          Address or name of recipient account

        • options: TransferFundsOptions

          Options

        Returns ReturnType<typeof sendTransaction>

  • txDryRun: ((tx: `tx_${string}`, accountAddress: `ak_${string}`, options: {
        combine?: boolean;
        onNode: Node;
        top?: number | `kh_${string}` | `mh_${string}`;
        txEvents?: boolean;
    }) => Promise<{
        txEvents?: TransformNodeType<DryRunResults["txEvents"]>;
    } & TransformNodeType<DryRunResult>>)
      • (tx: `tx_${string}`, accountAddress: `ak_${string}`, options: {
            combine?: boolean;
            onNode: Node;
            top?: number | `kh_${string}` | `mh_${string}`;
            txEvents?: boolean;
        }): Promise<{
            txEvents?: TransformNodeType<DryRunResults["txEvents"]>;
        } & TransformNodeType<DryRunResult>>
      • Transaction dry-run

        Parameters

        • tx: `tx_${string}`

          transaction to execute

        • accountAddress: `ak_${string}`

          address that will be used to execute transaction

        • options: {
              combine?: boolean;
              onNode: Node;
              top?: number | `kh_${string}` | `mh_${string}`;
              txEvents?: boolean;
          }

          Options

          • Optional combine?: boolean

            Enables combining of similar requests to a single dry-run call

          • onNode: Node

            Node to use

          • Optional top?: number | `kh_${string}` | `mh_${string}`

            hash of block on which to make dry-run

          • Optional txEvents?: boolean

            collect and return on-chain tx events that would result from the call

        Returns Promise<{
            txEvents?: TransformNodeType<DryRunResults["txEvents"]>;
        } & TransformNodeType<DryRunResult>>

  • waitForTxConfirm: ((txHash: `th_${string}`, options: {
        confirm?: number;
        onNode: Node;
    } & {
        interval?: number;
        onNode: Node;
    } & {
        _expectedMineRate?: number;
        _maxPollInterval?: number;
        _microBlockCycle?: number;
    }) => Promise<number>)
      • (txHash: `th_${string}`, options: {
            confirm?: number;
            onNode: Node;
        } & {
            interval?: number;
            onNode: Node;
        } & {
            _expectedMineRate?: number;
            _maxPollInterval?: number;
            _microBlockCycle?: number;
        }): Promise<number>
      • Wait for transaction confirmation

        Returns

        Current Height

        Parameters

        • txHash: `th_${string}`

          Transaction hash

        • options: {
              confirm?: number;
              onNode: Node;
          } & {
              interval?: number;
              onNode: Node;
          } & {
              _expectedMineRate?: number;
              _maxPollInterval?: number;
              _microBlockCycle?: number;
          }

          Options

        Returns Promise<number>

Generated using TypeDoc