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 send>> & { claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>); commitmentId: string; height: number; 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 send>); aensTransfer: ((name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions) => ReturnType<typeof send>); aensUpdate: ((name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions) => ReturnType<typeof send>); awaitHeight: ((height: number, options: { interval?: number; onNode: Node } & { _expectedMineRate?: number; _maxPollInterval?: number; _microBlockCycle?: number }) => Promise<number>); buildAuthTxHash: ((transaction: `tx_${string}`, options: { onNode: Node }) => Promise<Uint8Array>); createAensDelegationSignature: ((contractId: `ct_${string}`, opt: any) => Promise<string>); createGeneralizedAccount: ((authFnName: string, source: string, args: any[], options: CreateGeneralizedAccountOptions) => Promise<Readonly<{ gaContractId: ContractAddress; owner: AccountAddress; rawTx: Transaction; transaction: TxHash }>>); createMetaTx: ((rawTransaction: `tx_${string}`, authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }, authFnName: string, options: { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object) => Promise<Transaction>); createOracleDelegationSignature: ((contractId: `ct_${string}`, opt: any) => Promise<string>); extendOracleTtl: ((oracleId: `ok_${string}`, options: ExtendOracleTtlOptions) => Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>); getAccount: ((address: `ct_${string}` | `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }) => Promise<TransformNodeType<<internal>.Account>>); getBalance: ((address: `ct_${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<<internal>.ByteCode>>); getContractInstance: ((options: { aci?: <internal>.Aci; bytecode?: `cb_${string}`; contractAddress?: `ct_${string}` | `${string}.chain`; fileSystem?: Record<string, string>; onAccount?: AccountBase; onCompiler: Compiler; onNode: Node; source?: string; validateBytecode?: boolean; [key: string]: any }) => Promise<ContractInstance>); 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>); getVmVersion: { (txType: ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }): Promise<CtVersion>; (txType: Tag, ctVersion: Partial<Pick<CtVersion, "abiVersion">> & { onNode: Node }): Promise<Pick<CtVersion, "abiVersion">> }; height: ((__namedParameters: { onNode: Node }) => Promise<number>); isGA: ((address: `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }) => Promise<boolean>); payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof send>); 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: ((queries: { 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 send>> & Awaited<ReturnType<typeof getQueryObject>>>); prepareTxParams: ((txType: Tag, params: PrepareTxParamsOptions) => Promise<{ nonce: number; ttl: number }>); registerOracle: ((queryFormat: string, responseFormat: string, options: RegisterOracleOptions) => Promise<Awaited<ReturnType<typeof send>> & 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: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, response: string, options: RespondToQueryOptions) => Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>); send: ((tx: `tx_${string}`, options: SendOptions) => Promise<SendReturnType>); sendTransaction: ((tx: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>); signUsingGA: ((tx: `tx_${string}`, __namedParameters: { authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }; authFun: string } & { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object) => Promise<Transaction>); spend: ((amount: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: SpendOptions) => ReturnType<typeof send>); transferFunds: ((fraction: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: TransferFundsOptions) => ReturnType<typeof send>); txDryRun: ((tx: `tx_${string}`, accountAddress: `ak_${string}`, options: { combine?: boolean; onNode: Node; top?: number; 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, incrementPercentage)

        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 send>> & { claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>); commitmentId: string; height: number; salt: number }>>)
      • (name: `${string}.chain`, options: AensPreclaimOptions): Promise<Readonly<Awaited<ReturnType<typeof send>> & { claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>); commitmentId: string; height: number; 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 send>> & { claim: ((opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>); commitmentId: string; height: number; 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 send>)
      • (name: `${string}.chain`, options: AensRevokeOptions): ReturnType<typeof send>
      • 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 send>

  • aensTransfer: ((name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions) => ReturnType<typeof send>)
      • (name: `${string}.chain`, account: `ak_${string}`, options: AensTransferOptions): ReturnType<typeof send>
      • 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 send>

  • aensUpdate: ((name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions) => ReturnType<typeof send>)
      • (name: `${string}.chain`, pointers: KeyPointers, options: AensUpdateOptions): ReturnType<typeof send>
      • 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 send>

  • 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: { onNode: Node }) => Promise<Uint8Array>)
      • (transaction: `tx_${string}`, options: { onNode: Node }): Promise<Uint8Array>
      • Build a transaction hash the same as Auth.tx_hash

        Returns

        Transaction hash

        Parameters

        • transaction: `tx_${string}`

          tx-encoded transaction

        • options: { onNode: Node }

          Options

          • onNode: Node

            Node to use

        Returns Promise<Uint8Array>

  • createAensDelegationSignature: ((contractId: `ct_${string}`, opt: any) => Promise<string>)
      • (contractId: `ct_${string}`, opt: any): Promise<string>
      • Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to a contract.

        Returns

        Signature for delegation

        Example

        const aeSdk = new AeSdk({ ... })
        const contractId = 'ct_asd2ks...' // contract address
        const name = 'example.chain' // AENS name
        const onAccount = await aeSdk.address() // Sign with a specific account
        // Preclaim signature
        const preclaimSig = await aeSdk.createAensDelegationSignature(contractId, { onAccount: current })
        // Claim, transfer and revoke signature
        const aensDelegationSig = await contract.createAensDelegationSignature(
        contractId, { name, onAccount: current }
        )

        Parameters

        • contractId: `ct_${string}`

          Contract Id

        • opt: any

          Options

        Returns Promise<string>

  • createGeneralizedAccount: ((authFnName: string, source: string, args: any[], options: CreateGeneralizedAccountOptions) => Promise<Readonly<{ gaContractId: ContractAddress; owner: AccountAddress; rawTx: Transaction; transaction: TxHash }>>)
  • createMetaTx: ((rawTransaction: `tx_${string}`, authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }, authFnName: string, options: { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object) => Promise<Transaction>)
      • (rawTransaction: `tx_${string}`, authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }, authFnName: string, options: { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object): Promise<Transaction>
      • Create a metaTx transaction

        Returns

        Transaction string

        Parameters

        • rawTransaction: `tx_${string}`

          Inner transaction

        • authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }

          Object with gaMeta params

          • Optional args?: any[]
          • Optional callData?: `cb_${string}`
          • Optional gasLimit?: number
          • Optional source?: string
        • authFnName: string

          Authorization function name

        • options: { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object

          Options

        Returns Promise<Transaction>

  • createOracleDelegationSignature: ((contractId: `ct_${string}`, opt: any) => Promise<string>)
      • (contractId: `ct_${string}`, opt: any): Promise<string>
      • Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.

        Returns

        Signature for delegation

        Example

        const aeSdk = new AeSdk({ ... })
        const contractId = 'ct_asd2ks...' // contract address
        const queryId = 'oq_...' // Oracle Query Id
        const onAccount = await aeSdk.address() // Sign with a specific account
        // Oracle register and extend signature
        const oracleDelegationSig = await aeSdk.createOracleDelegationSignature(contractId)
        // Oracle respond signature
        const respondSig = await aeSdk.createOracleDelegationSignature(contractId, { queryId })

        Parameters

        • contractId: `ct_${string}`

          Contract Id

        • opt: any

          Options

        Returns Promise<string>

  • extendOracleTtl: ((oracleId: `ok_${string}`, options: ExtendOracleTtlOptions) => Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>)
  • getAccount: ((address: `ct_${string}` | `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }) => Promise<TransformNodeType<<internal>.Account>>)
      • (address: `ct_${string}` | `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }): Promise<TransformNodeType<<internal>.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<<internal>.Account>>

  • getBalance: ((address: `ct_${string}` | `ak_${string}`, options: { format?: AE_AMOUNT_FORMATS } & { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }) => Promise<string>)
      • (address: `ct_${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}` | `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<<internal>.ByteCode>>)
  • getContractInstance: ((options: { aci?: <internal>.Aci; bytecode?: `cb_${string}`; contractAddress?: `ct_${string}` | `${string}.chain`; fileSystem?: Record<string, string>; onAccount?: AccountBase; onCompiler: Compiler; onNode: Node; source?: string; validateBytecode?: boolean; [key: string]: any }) => Promise<ContractInstance>)
      • (options: { aci?: <internal>.Aci; bytecode?: `cb_${string}`; contractAddress?: `ct_${string}` | `${string}.chain`; fileSystem?: Record<string, string>; onAccount?: AccountBase; onCompiler: Compiler; onNode: Node; source?: string; validateBytecode?: boolean; [key: string]: any }): Promise<ContractInstance>
      • Generate contract ACI object with predefined js methods for contract usage - can be used for creating a reference to already deployed contracts

        Returns

        JS Contract API

        Example

        const contractIns = await aeSdk.getContractInstance({ source })
        await contractIns.deploy([321]) or await contractIns.methods.init(321)
        const callResult = await contractIns.call('setState', [123]) or
        await contractIns.methods.setState.send(123, options)
        const staticCallResult = await contractIns.call('setState', [123], { callStatic: true }) or
        await contractIns.methods.setState.get(123, options)

        Also you can call contract like: await contractIns.methods.setState(123, options) Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is stateful or not

        Parameters

        • options: { aci?: <internal>.Aci; bytecode?: `cb_${string}`; contractAddress?: `ct_${string}` | `${string}.chain`; fileSystem?: Record<string, string>; onAccount?: AccountBase; onCompiler: Compiler; onNode: Node; source?: string; validateBytecode?: boolean; [key: string]: any }

          Options object

          • [key: string]: any
          • Optional aci?: <internal>.Aci
          • Optional bytecode?: `cb_${string}`
          • Optional contractAddress?: `ct_${string}` | `${string}.chain`
          • Optional fileSystem?: Record<string, string>
          • Optional onAccount?: AccountBase
          • onCompiler: Compiler
          • onNode: Node
          • Optional source?: string
          • Optional validateBytecode?: boolean

        Returns Promise<ContractInstance>

  • 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[]>>)
  • 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>

  • getVmVersion: { (txType: ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }): Promise<CtVersion>; (txType: Tag, ctVersion: Partial<Pick<CtVersion, "abiVersion">> & { onNode: Node }): Promise<Pick<CtVersion, "abiVersion">> }
      • (txType: ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }): Promise<CtVersion>
      • Validated vm/abi version or get default based on transaction type and NODE version

        Returns

        Object with vm/abi version

        Parameters

        Returns Promise<CtVersion>

      • (txType: Tag, ctVersion: Partial<Pick<CtVersion, "abiVersion">> & { onNode: Node }): Promise<Pick<CtVersion, "abiVersion">>
      • Parameters

        • txType: Tag
        • ctVersion: Partial<Pick<CtVersion, "abiVersion">> & { onNode: Node }

        Returns Promise<Pick<CtVersion, "abiVersion">>

  • height: ((__namedParameters: { onNode: Node }) => Promise<number>)
      • (__namedParameters: { onNode: Node }): Promise<number>
      • Deprecated

        Use getHeight instead

        Hidden

        Parameters

        • __namedParameters: { onNode: Node }

        Returns Promise<number>

  • isGA: ((address: `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }) => Promise<boolean>)
      • (address: `ak_${string}`, options: { hash?: `kh_${string}` | `mh_${string}`; height?: number; onNode: Node }): Promise<boolean>
      • Check if account is GA

        Returns

        if account is GA

        Parameters

        • address: `ak_${string}`

          Account address

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

          Options

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

        Returns Promise<boolean>

  • payForTransaction: ((transaction: `tx_${string}`, options: PayForTransactionOptions) => ReturnType<typeof send>)
      • (transaction: `tx_${string}`, options: PayForTransactionOptions): ReturnType<typeof send>
      • Submit transaction of another account paying for it (fee and gas)

        Returns

        Object Transaction

        Parameters

        Returns ReturnType<typeof send>

  • 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: ((queries: { 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: ((queries: { 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: ((queries: { fee: bigint; id: string; oracleId: string; query: string; response: string; responseTtl: { type: TTLType; value: string; }; senderId: string; senderNonce: string; ttl: number }[]) => void)

          OnQuery callback

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

              • queries: { fee: bigint; id: string; oracleId: string; query: string; response: string; responseTtl: { type: TTLType; value: string; }; senderId: string; 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 send>> & Awaited<ReturnType<typeof getQueryObject>>>)
      • (oracleId: `ok_${string}`, query: string, options: PostQueryToOracleOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>>
      • Post query to oracle

        Returns

        Query object

        Parameters

        • oracleId: `ok_${string}`

          Oracle public key

        • query: string

          Oracle query object

        • options: PostQueryToOracleOptions

          Options object

        Returns Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>>

  • prepareTxParams: ((txType: Tag, params: PrepareTxParamsOptions) => Promise<{ nonce: number; ttl: number }>)
      • (txType: Tag, params: PrepareTxParamsOptions): Promise<{ nonce: number; ttl: number }>
      • Calculate fee, get absolute ttl (ttl + height), get account nonce

        Returns

        Object with account nonce, absolute ttl and transaction fee

        Parameters

        Returns Promise<{ nonce: number; ttl: number }>

  • registerOracle: ((queryFormat: string, responseFormat: string, options: RegisterOracleOptions) => Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>)
      • (queryFormat: string, responseFormat: string, options: RegisterOracleOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>
      • Register oracle

        Returns

        Oracle object

        Parameters

        • queryFormat: string

          Format of query

        • responseFormat: string

          Format of query response

        • options: RegisterOracleOptions

          Options

        Returns Promise<Awaited<ReturnType<typeof send>> & 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: ((oracleId: `ok_${string}`, queryId: `oq_${string}`, response: string, options: RespondToQueryOptions) => Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>)
      • (oracleId: `ok_${string}`, queryId: `oq_${string}`, response: string, options: RespondToQueryOptions): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>
      • Extend oracle ttl

        Returns

        Oracle object

        Parameters

        • oracleId: `ok_${string}`

          Oracle public key

        • queryId: `oq_${string}`

          Oracle query id

        • response: string

          Oracle query response

        • options: RespondToQueryOptions

          Options object

        Returns Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>>

  • send: ((tx: `tx_${string}`, options: SendOptions) => Promise<SendReturnType>)
  • sendTransaction: ((tx: `tx_${string}`, options: SendTransactionOptions) => Promise<SendTransactionReturnType>)
  • signUsingGA: ((tx: `tx_${string}`, __namedParameters: { authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }; authFun: string } & { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object) => Promise<Transaction>)
      • (tx: `tx_${string}`, __namedParameters: { authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }; authFun: string } & { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object): Promise<Transaction>
      • Deprecated

        Use createMetaTx instead

        Hidden

        Parameters

        • tx: `tx_${string}`
        • __namedParameters: { authData: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }; authFun: string } & { onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object

        Returns Promise<Transaction>

  • spend: ((amount: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: SpendOptions) => ReturnType<typeof send>)
      • (amount: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: SpendOptions): ReturnType<typeof send>
      • Send coins to another account

        Returns

        Transaction

        Parameters

        • amount: string | number

          Amount to spend

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

          Address or name of recipient account

        • options: SpendOptions

          Options

        Returns ReturnType<typeof send>

  • transferFunds: ((fraction: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: TransferFundsOptions) => ReturnType<typeof send>)
      • (fraction: string | number, recipientIdOrName: `ak_${string}` | `${string}.chain`, options: TransferFundsOptions): ReturnType<typeof send>
      • Send a fraction of coin balance to another account

        Returns

        Transaction

        Parameters

        • fraction: string | number

          Fraction of balance to spend (between 0 and 1)

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

          Address or name of recipient account

        • options: TransferFundsOptions

          Options

        Returns ReturnType<typeof send>

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

            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