Aptos LocalSDK implementation for Node.js environments Extends the core APTOS class with local-specific functionality

Hierarchy (view full)

Implements

Constructors

Properties

account: Account = null
aptos: Aptos
connected: boolean = false
name: string = ""
network: Network
provider: Aptos
rpc_url: string = ""
signer: any = null
wallet: any = null

Methods

  • Estimate gas for a transaction

    Parameters

    • transaction: any

      The transaction to estimate

    Returns Promise<any>

    Gas estimation

  • Fund account using faucet (only available on devnet/testnet)

    Parameters

    • Optionaladdress: string

      The address to fund

    • amount: number = 100_000_000

      The amount to fund (in Octas)

    Returns Promise<string>

    The transaction hash

  • Get account transactions

    Parameters

    • address: string

      The account address

    • Optionalstart: number

      The start sequence number (optional)

    • Optionallimit: number

      The maximum number of transactions to return (optional)

    Returns Promise<any[]>

    Array of transactions

  • Gets the APT balance from the Aptos network given an address

    Parameters

    • address: string

      The wallet address

    Returns Promise<any>

    XM operation object for Demos Network relay

  • Gets the APT balance directly from Aptos RPC given an address

    The other get balance methods use this method to get the balance

    Parameters

    • address: string

      The wallet address

    Returns Promise<string>

    The balance as a string (in Octas)

  • Gets a coin balance from the Aptos network given a coin type and address

    Parameters

    • coinType: string

      The coin type (e.g., "0x1::aptos_coin::AptosCoin")

    • address: string

      The wallet address

    Returns Promise<any>

    XM operation object for Demos Network relay

  • Gets the balance of a specific coin type directly from Aptos RPC given a coin type and address

    The other get balance methods use this method to get the balance

    Parameters

    • coinType: string

      The coin type (e.g., "0x1::aptos_coin::AptosCoin")

    • address: string

      The wallet address

    Returns Promise<string>

    The balance as a string

  • Get transaction details by hash

    Parameters

    • transactionHash: string

      The transaction hash

    Returns Promise<any>

    The transaction details

  • Check if an address is valid

    Parameters

    • address: string

      The address to validate

    Returns boolean

    Boolean indicating if the address is valid

  • Read from a smart contract via Demos Network XM operation (default behavior)

    Parameters

    • moduleAddress: string

      The module address

    • moduleName: string

      The module name

    • functionName: string

      The function name

    • args: any[]

      Function arguments

    • typeArguments: string[] = []

      Type arguments for generic functions (optional)

    Returns Promise<XMScript>

    The XMScript object ready to be used in a Demos transaction

  • Read from a smart contract directly (bypasses Demos Network) Use only when explicit direct access is needed

    Parameters

    • moduleAddress: string

      The module address

    • moduleName: string

      The module name

    • functionName: string

      The function name

    • args: any[]

      Function arguments

    • typeArguments: string[] = []

      Type arguments for generic functions (optional)

    Returns Promise<any>

    The function result

  • Verifies a message signature

    Parameters

    • message: string

      The original message

    • signature: string

      The signature to verify

    • publicKey: string

      The public key to verify against

    Returns Promise<boolean>

    Boolean indicating if the signature is valid

  • Wait for transaction confirmation

    Parameters

    • transactionHash: string

      The transaction hash

    Returns Promise<UserTransactionResponse>

    The transaction response

  • Prepare a smart contract write transaction for Demos Network relay Builds transaction for XM operations - does NOT execute directly All contract writes must go through Demos Network XM system

    Parameters

    • moduleAddress: string

      The module address

    • moduleName: string

      The module name

    • functionName: string

      The function name

    • args: any[]

      Function arguments

    • typeArguments: string[] = []

      Type arguments (optional)

    Returns Promise<XMScript>

    The XMScript object ready to be used in a Demos transaction

  • Creates a new instance of this sdk

    Type Parameters

    Parameters

    • this: (new (rpc_url: string) => T)
        • new (rpc_url): T
        • Parameters

          • rpc_url: string

          Returns T

    • rpc_url: string = ""

      The RPC URL

    Returns Promise<T>

    The sdk instance connected to the RPC provider