Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AleoAuthClient

Hierarchy

  • AleoAuthClient

Index

Constructors

constructor

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

    memberof

    AleoAuthClient

    Parameters

    • uri: string

      Aleo Private RPC Endpoints

    • user: string

      RPC Endpoints auth username

    • password: string

      RPC Endpoints auth password

    • Optional options: RequestInit

    Returns AleoAuthClient

Properties

Private rpc

rpc: RPC

Methods

create_account

  • create_account(): Promise<Account>
  • Creates a new account private key and its corresponding account address.

    memberof

    AleoAuthClient

    Returns Promise<Account>

    {Promise}

create_raw_transaction

  • create_raw_transaction(old_records: Array<string>, old_account_private_keys: Array<string>, recipients: Array<TransactionRecipient>, memo: string, network_id: number): Promise<RawTransaction>
  • Creates a new transaction and returns the encoded transaction along with the encoded records.

    memberof

    AleoAuthClient

    Parameters

    • old_records: Array<string>

      An array of hex encoded records to be spent

    • old_account_private_keys: Array<string>

      An array of private keys authorized to spend the records

    • recipients: Array<TransactionRecipient>

      The array of transaction recipient objects

    • memo: string

      The transaction memo

    • network_id: number

      The network id of the transaction

    Returns Promise<RawTransaction>

    {Promise}

create_transaction

  • create_transaction(private_keys: Array<string>, transaction_kernel: string): Promise<RawTransaction>
  • Create a new transaction from a given transaction kernel, returning the encoded transaction and the new records.

    memberof

    AleoAuthClient

    Parameters

    • private_keys: Array<string>

      An array of private key strings

    • transaction_kernel: string

      The hex encoded transaction kernel

    Returns Promise<RawTransaction>

    {Promise}

create_transaction_kernel

  • create_transaction_kernel(old_records: Array<string>, old_account_private_keys: Array<string>, recipients: Array<TransactionRecipient>, memo: string, network_id: number): Promise<string>
  • Create a new transaction kernel.

    memberof

    AleoAuthClient

    Parameters

    • old_records: Array<string>

      An array of hex encoded records to be spent

    • old_account_private_keys: Array<string>

      An array of private keys authorized to spend the records

    • recipients: Array<TransactionRecipient>

      The array of transaction recipient objects

    • memo: string

      -The transaction memo

    • network_id: number

      The network id of the transaction

    Returns Promise<string>

    {Promise} - The hex encoded transaction kernel

decode_record

  • decode_record(record_bytes: string): Promise<Record>
  • Returns information about a record from serialized record hex.

    memberof

    AleoAuthClient

    Parameters

    • record_bytes: string

      The raw record hex to decode

    Returns Promise<Record>

    {Promise}

decrypt_record

  • decrypt_record(encrypted_record: string, account_view_key: string): Promise<string>
  • Decrypts the encrypted record and returns the hex encoded bytes of the record.

    memberof

    AleoAuthClient

    Parameters

    • encrypted_record: string

      The encrypted record

    • account_view_key: string

      The account view key used to decrypt the ciphertext

    Returns Promise<string>

    {Promise} - The hex-encoded record bytes

disconnect

  • disconnect(address: string): Promise<unknown>
  • Disconnects the node from the given address.

    memberof

    AleoAuthClient

    Parameters

    • address: string

      The address to disconnect in an IP:port format

    Returns Promise<unknown>

    {Promise}

get_raw_record

  • get_raw_record(record_commitment: string): Promise<string>
  • Returns the hex encoded bytes of a record from its record commitment.

    memberof

    AleoAuthClient

    Parameters

    • record_commitment: string

      The record commitment

    Returns Promise<string>

    {Promise} - The hex-encoded record bytes

get_record_commitment_count

  • get_record_commitment_count(): Promise<number>
  • Returns the number of record commitments that are stored on the full node.

    memberof

    AleoAuthClient

    Returns Promise<number>

    {Promise} - The number of stored record commitments

get_record_commitments

  • get_record_commitments(): Promise<Array<string>>
  • Returns a list of record commitments that are stored on the full node.

    memberof

    AleoAuthClient

    Returns Promise<Array<string>>

    {Promise<Array>} - The list of stored record commitments

Generated using TypeDoc