Basic AeSdk class

AeSdkBase objects are the composition of:

  • chain methods
  • tx methods
  • aens methods
  • spend methods
  • oracle methods
  • contract methods
  • contract ga methods Only by providing the joint functionality of them, most more advanced operations, i.e. the ones with actual use value on the chain, become available.

Hierarchy

  • AeSdkBase

Constructors

  • Parameters

    • options: { compilerUrl?: string; ignoreVersion?: boolean; nodes?: { instance: Node; name: string }[]; [key: string]: any } = {}

      Options

      • [key: string]: any
      • Optional compilerUrl?: string

        Url for compiler API

      • Optional ignoreVersion?: boolean

        Don't check node or compiler version

      • Optional nodes?: { instance: Node; name: string }[]

        Array of nodes

    Returns <internal>.AeSdkBase

Properties

_options: { amount: number; denomination: AE_AMOUNT_FORMATS; [key: string]: any } = ...

Type declaration

compilerApi: Compiler
getNetworkId: ((__namedParameters?: { networkId?: string }) => Promise<string>) = getNetworkId

Type declaration

    • (__namedParameters?: { networkId?: string }): Promise<string>
    • Obtain networkId from account or node

      Parameters

      • __namedParameters: { networkId?: string } = {}
        • Optional networkId?: string

      Returns Promise<string>

pool: Map<string, Node> = ...
selectedNodeName?: string

Accessors

Methods

  • Resolves an account

    Parameters

    • Optional account: any

      ak-address, instance of AccountBase, or keypair

    Returns AccountBase

  • Add Node

    Example

    // add and select new node with name 'testNode'
    aeSdkBase.addNode('testNode', new Node({ url }), true)

    Parameters

    • name: string

      Node name

    • node: Node

      Node instance

    • select: boolean = false

      Select this node as current

    Returns void

  • Parameters

    • __namedParameters: { onAccount?: any } = {}
      • Optional onAccount?: any

    Returns Promise<`ak_${string}`>

  • Returns `ak_${string}`[]

  • Select Node

    Example

    nodePool.selectNode('testNode')
    

    Parameters

    • name: string

      Node name

    Returns void

  • Parameters

    • compilerUrl: string
    • __namedParameters: { ignoreVersion?: boolean } = {}
      • Optional ignoreVersion?: boolean

    Returns void

  • Parameters

    • data: string | Uint8Array
    • __namedParameters: { onAccount?: any } = {}
      • Optional onAccount?: any

    Returns Promise<Uint8Array>

  • Parameters

    • message: string
    • __namedParameters: { onAccount?: any } & { returnHex?: boolean } = {}

    Returns Promise<string | Uint8Array>

  • Parameters

    • tx: `tx_${string}`
    • __namedParameters: { onAccount?: any } & { authData?: { args?: any[]; callData?: `cb_${string}`; gasLimit?: number; source?: string }; authFun?: string; innerTx?: boolean; networkId?: string } & Omit<Partial<{ onAccount: AccountBase; onCompiler: Compiler; onNode: Node } & object>, "onAccount"> = {}

    Returns Promise<`tx_${string}`>

  • Parameters

    • message: string
    • signature: string | Uint8Array
    • __namedParameters: { onAccount?: any } & object = {}

    Returns Promise<boolean>

Generated using TypeDoc