RPC handler for AEPP side Contain functionality for wallet interaction and connect it to sdk

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

  • Parameters

    • options: {
          name: string;
          onAddressChange?: ((a) => void);
          onDisconnect?: ((p) => void);
          onNetworkChange?: ((a) => void);
      } & AeSdkMethodsOptions & {
          nodes?: {
              instance: Node;
              name: string;
          }[];
      }

      Options

    Returns AeSdkAepp

Properties

_accounts?: Accounts
_options: AeSdkMethodsOptions = {}
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>

name: string
onAddressChange: ((a) => void)

Type declaration

    • (a): void
    • Parameters

      Returns void

onDisconnect: ((p) => void)

Type declaration

    • (p): void
    • Parameters

      • p: any

      Returns void

onNetworkChange: ((a) => void)

Type declaration

    • (a): void
    • Parameters

      Returns void

pool: Map<string, Node> = ...
rpcClient?: default<WalletApi, AeppApi>
selectedNodeName?: string

Accessors

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

Methods

  • 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)
  • Ask addresses from wallet

    Returns Promise<`ak_${string}`[]>

    Addresses from wallet

  • Connect to wallet

    Parameters

    • connection: default

      Wallet connection object

    • options: {
          connectNode?: boolean;
          name?: string;
      } = {}

      Options

      • Optional connectNode?: boolean

        Request wallet to bind node

      • Optional name?: string

        Node name

    Returns Promise<WalletInfo & {
        node?: Node;
    }>

  • Disconnect from wallet

    Returns void

  • 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>>

  • Select Node

    Parameters

    • name: string

      Node name

    Returns void

    Example

    nodePool.selectNode('testNode')
    
  • 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}`>

  • Subscribe for addresses from wallet

    Parameters

    • type: SUBSCRIPTION_TYPES

      Subscription type

    • value: "connected" | "current"

      Should be one of 'current' (the selected account), 'connected' (all)

    Returns Promise<Promise<{
        address: Accounts;
        subscription: ("connected" | "current")[];
    }>>

    Accounts from wallet

Generated using TypeDoc