Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AleoClient

Hierarchy

  • AleoClient

Index

Constructors

constructor

  • new AleoClient(uri: string, options?: RequestInit): AleoClient
  • Creates an instance of AleoClient.

    memberof

    AleoClient

    Parameters

    • uri: string

      Aleo Public RPC Endpoints

    • Optional options: RequestInit

    Returns AleoClient

Properties

Private rpc

rpc: RPC

Methods

decode_raw_transaction

  • decode_raw_transaction(transaction_bytes: string): Promise<Transaction>
  • Returns information about a transaction from serialized transaction bytes.

    memberof

    AleoClient

    Parameters

    • transaction_bytes: string

      The raw transaction hex to decode

    Returns Promise<Transaction>

    {Promise}

get_best_block_hash

  • get_best_block_hash(): Promise<string>
  • Returns the block hash of the head of the best valid chain.

    memberof

    AleoClient

    Returns Promise<string>

    {Promise} - The block height of the requested block hash

get_block

  • get_block(block_hash: string): Promise<Block>
  • Returns information about a block from a block hash.

    memberof

    AleoClient

    Parameters

    • block_hash: string

      The block hash of the requested block

    Returns Promise<Block>

    {Promise}

get_block_count

  • get_block_count(): Promise<number>
  • Returns the number of blocks in the best valid chain.

    memberof

    AleoClient

    Returns Promise<number>

    {Promise} - The number of blocks in the best valid chain

get_block_hash

  • get_block_hash(block_height: number): Promise<string>
  • Returns the block hash of a block at the given block height in the best valid chain.

    memberof

    AleoClient

    Parameters

    • block_height: number

      The block height of the requested block hash

    Returns Promise<string>

    {Promise} - The block hash of the block at the given block height

get_block_template

  • Returns the current mempool and consensus information known by this node.

    memberof

    AleoClient

    Returns Promise<BlockTemplate>

    {Promise}

get_connection_count

  • get_connection_count(): Promise<number>
  • Returns the number of connected peers this node has.

    memberof

    AleoClient

    Returns Promise<number>

    {Promise} - The number of connected nodes

get_network_graph

  • Returns the network graph crawled by this node (if it is a bootnode).

    memberof

    AleoClient

    Returns Promise<NetworkGraph>

    {Promise}

get_node_info

  • Returns information about the node.

    memberof

    AleoClient

    Returns Promise<NodeInfo>

    {Promise}

get_node_status

  • Returns statistics related to the node.

    memberof

    AleoClient

    Returns Promise<NodeStatus>

    {Promise}

get_peer_info

  • Returns the node's connected peers.

    memberof

    AleoClient

    Returns Promise<PeerInfo>

    {Promise}

get_raw_transaction

  • get_raw_transaction(transaction_id: string): Promise<string>
  • memberof

    AleoClient

    Parameters

    • transaction_id: string

      The transaction id of the requested transaction hex

    Returns Promise<string>

    {Promise} - The hex-encoded transaction bytes

get_transaction_info

  • get_transaction_info(transaction_id: string): Promise<Transaction>
  • Returns information about a transaction from a transaction id.

    memberof

    AleoClient

    Parameters

    • transaction_id: string

      -The transaction id of the requested transaction info

    Returns Promise<Transaction>

    {Promise}

send_transaction

  • send_transaction(transaction_bytes: string): Promise<string>
  • Send raw transaction bytes to this node to be added into the mempool. If valid, the transaction will be stored and propagated to all peers.

    memberof

    AleoClient

    Parameters

    • transaction_bytes: string

      The raw transaction hex to broadcast

    Returns Promise<string>

    {Promise} - The transaction id of the sent transaction

validate_raw_transaction

  • validate_raw_transaction(transaction_bytes: string): Promise<boolean>
  • Validate and return if the transaction is valid.

    memberof

    AleoClient

    Parameters

    • transaction_bytes: string

      The raw transaction hex to validate

    Returns Promise<boolean>

    {Promise} - Check that the transaction is valid

Generated using TypeDoc