Class AeSdkWallet

Contain functionality for aepp interaction and managing multiple aepps

Hierarchy

References

Re-exports _getPollInterval
Re-exports aensBid
Re-exports aensClaim
Re-exports aensPreclaim
Re-exports aensQuery
Re-exports aensRevoke
Re-exports aensTransfer
Re-exports aensUpdate
Re-exports awaitHeight
Re-exports buildAuthTxHash
Re-exports buildAuthTxHashByGaMetaTx
Re-exports createGeneralizedAccount
Re-exports extendOracleTtl
Re-exports getAccount
Re-exports getBalance
Re-exports getContract
Re-exports getContractByteCode
Re-exports getCurrentGeneration
Re-exports getGeneration
Re-exports getHeight
Re-exports getKeyBlock
Re-exports getMicroBlockHeader
Re-exports getMicroBlockTransactions
Re-exports getName
Re-exports getOracleObject
Re-exports getQueryObject
Re-exports payForTransaction
Re-exports poll
Re-exports pollForQueries
Re-exports pollForQueryResponse
Re-exports postQueryToOracle
Re-exports registerOracle
Re-exports resolveName
Re-exports respondToQuery
Re-exports sendTransaction
Re-exports spend
Re-exports transferFunds
Re-exports txDryRun
Re-exports waitForTxConfirm

Constructors

Properties

_clients: Map<string, RpcClientsInfo> = ...
_options: AeSdkMethodsOptions = {}
accounts: {
    [key: AccountAddress]: AccountBase;
} = {}

Type declaration

createDelegationSignature: ((...args) => Promise<Uint8Array>)

Type declaration

    • (...args): Promise<Uint8Array>
    • Parameters

      • Rest ...args: [`ct_${string}`, (`${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}`)[]] | [`ct_${string}`, (`${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}`)[], Omit<{
            omitAddress?: boolean;
            onAccount: AccountBase;
            onNode: Node;
        }, "onNode" | "onAccount" | "onCompiler"> & Partial<Omit<{
            omitAddress?: boolean;
            onAccount: AccountBase;
            onNode: Node;
        }, "onAccount"> & {
            onAccount: OnAccount;
        }>]

      Returns Promise<Uint8Array>

id: string
name: string
onAskAccounts: OnAskAccounts
onConnection: OnConnection
onDisconnect: OnDisconnect
onSubscription: OnSubscription
pool: Map<string, Node> = ...
selectedAddress?: `ak_${string}`
selectedNodeName?: string

Accessors

  • get address(): `ak_${string}`
  • Returns `ak_${string}`

Methods

  • Parameters

    • clientId: string

    Returns void

  • Parameters

    • clientId: string

    Returns boolean

  • Add specific account

    Parameters

    • account: AccountBase

      Account instance

    • Optional options: {
          select?: boolean;
      }

      Options

      • Optional select?: boolean

    Returns void

    Example

    addAccount(account)
    
  • Add Node

    Parameters

    • name: string

      Node name

    • node: Node

      Node instance

    • select: boolean = false

      Select this node as current

    Returns void

    Example

    // add and select new node with name 'testNode'
    aeSdkBase.addNode('testNode', new Node({ url }), true)
  • Add new client by AEPP connection

    Parameters

    • clientConnection: default

      AEPP connection object

    Returns string

    Client ID

  • Get accounts addresses

    Returns `ak_${string}`[]

    Example

    addresses()
    
  • Type Parameters

    Parameters

    • Optional options: Omit<Omit<{
          aci: Aci;
          address?: `ct_${string}`;
          bytecode?: `cb_${string}`;
          fileSystem?: Record<string, string>;
          onCompiler?: CompilerBase;
          onNode: Node;
          sourceCode?: string;
          sourceCodePath?: string;
      } & Partial<BuildTxOptions<ContractCallTx, "callData" | "callerId" | "contractId">> & {
          omitUnknown?: boolean;
      } & GetContractNameByEventOptions & Omit<SendTransactionOptions, "onNode" | "onAccount"> & Omit<{
          combine?: boolean;
          onNode: Node;
          top?: number | `kh_${string}` | `mh_${string}`;
          txEvents?: boolean;
      }, "onNode"> & {
          callStatic?: boolean;
          onAccount?: AccountBase;
          onNode?: Node;
      } & Partial<BuildTxOptions<ContractCreateTx, "code" | "ownerId" | "callData">>, "address" | "aci"> & {
          aci?: Aci;
          address?: `${string}.chain` | `ct_${string}`;
          validateBytecode?: boolean;
      }, "onNode"> & {
          onNode?: Node;
      }

    Returns Promise<Contract<Methods>>

  • Check if you have selected node

    Returns this is AeSdkBase & {
        selectedNodeName: string;
    }

    Example

    nodePool.isNodeConnected()
    
  • Remove specific account

    Parameters

    • address: `ak_${string}`

      Address of account to remove

    Returns void

    Example

    removeAccount(address)
    
  • Remove specific RpcClient by ID

    Parameters

    • id: string

      Client ID

    Returns void

  • Select specific account

    Parameters

    • address: `ak_${string}`

      Address of account to select

    Returns void

    Example

    selectAccount('ak_xxxxxxxx')
    
  • Select Node

    Parameters

    • name: string

      Node name

    Returns Promise<void>

    Example

    nodePool.selectNode('testNode')
    
  • Send shareWalletInfo message to notify AEPP about wallet

    Parameters

    • clientId: string

      ID of RPC client send message to

    Returns Promise<void>

  • Parameters

    • data: string | Uint8Array
    • __namedParameters: {
          onAccount?: OnAccount;
      } = {}

    Returns Promise<Uint8Array>

  • Parameters

    • contractAddress: `ct_${string}`
    • __namedParameters: {
          onAccount?: OnAccount;
      } & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
          networkId?: string;
      } = {}

    Returns Promise<`sg_${string}`>

  • Parameters

    • message: string
    • __namedParameters: {
          onAccount?: OnAccount;
      } & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
      } = {}

    Returns Promise<Uint8Array>

  • Parameters

    • contractAddress: `ct_${string}`
    • name: `${string}.chain`
    • __namedParameters: {
          onAccount?: OnAccount;
      } & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
          networkId?: string;
      } = {}

    Returns Promise<`sg_${string}`>

  • Parameters

    • contractAddress: `ct_${string}`
    • oracleQueryId: `oq_${string}`
    • __namedParameters: {
          onAccount?: OnAccount;
      } & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
          networkId?: string;
      } = {}

    Returns Promise<`sg_${string}`>

  • Parameters

    • tx: `tx_${string}`
    • __namedParameters: {
          onAccount?: OnAccount;
      } & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
          authData?: AuthData | ((tx) => Promise<AuthData>);
          innerTx?: boolean;
          networkId?: string;
          onCompiler?: CompilerBase;
          onNode?: Node;
      } = {}

    Returns Promise<`tx_${string}`>

  • Parameters

    • data: `cb_${string}`
    • aci: AciValue
    • __namedParameters: {
          onAccount?: OnAccount;
      } & Domain & {
          aeppOrigin?: string;
          aeppRpcClientId?: string;
      } = {}

    Returns Promise<`sg_${string}`>

Generated using TypeDoc