Class representing an Algorand accounts store.

Hierarchy

  • AlgorandAccountsStore

Constructors

Properties

ALGO_DECIMALS: number = 6
__accounts: Map<string, AlgorandAccount>
__client: default
__multisigs: Map<string, AlgorandMultiSigAccount>

Methods

  • Adds a new Algorand account to the store.

    Returns

    • A promise that resolves with the added Algorand account.

    Parameters

    • Rest ...args: [sk: Uint8Array] | [mnemonic: string]

      Either the secret key (as a Uint8Array) or the mnemonic (as a string) for the account.

    Returns Promise<AlgorandAccount>

  • Adds a new multi-signature Algorand account to the store.

    Returns

    • A promise that resolves with the added multi-signature account.

    Parameters

    • addresses: string[]

      The addresses of the participants in the multi-signature account.

    • threshold: number

      The minimum number of signatures required to authorize a transaction.

    • Optional version: number = 1

      The version of the multi-signature account.

    Returns Promise<AlgorandMultiSigAccount>

  • Creates a new Algorand account with a specified prefix for the address.

    Returns

    • A promise that resolves with the newly created Algorand account.

    Parameters

    • prefix: string

      The prefix for the address.

    • Optional tries: number = 10000

      The maximum number of attempts to find an available address.

    Returns Promise<AlgorandAccount>

  • Retrieves the Algo balance of a specified address.

    Returns

    • A promise that resolves with the Algo balance in both human-readable and BigNumber format.

    Parameters

    • address: string

      The address for which to retrieve the Algo balance.

    Returns Promise<{
        balanceBn: BigNumber;
        balanceHuman: BigNumber;
    }>

  • Retrieves the balance of a specific standard asset for a specified address.

    Returns

    • A promise that resolves with the asset balance in both human-readable and BigNumber format.

    Parameters

    • address: string

      The address for which to retrieve the asset balance.

    • token: AlgorandStandardAssetConfig

      The token configuration object for the standard asset.

    Returns Promise<{
        balanceBn: BigNumber;
        balanceHuman: BigNumber;
    }>

  • Signs and sends an array of multisig transactions using the specified signers and multisig metadata.

    Returns

    • A promise that resolves with the result of sending the multisig transactions.

    Parameters

    • groupedTxns: Transaction[]

      The grouped transactions to sign and send.

    • mParams: MultisigMetadata

      The multisig metadata object.

    • signers: default[]

      The signers for the multisig account.

    Returns Promise<default>

  • Signs and sends an array of transactions using the specified signer address.

    Returns

    • A promise that resolves with an array of transaction IDs.

    Parameters

    • transactions: Transaction[]

      The transactions to sign and send.

    • signerAddress: string

      The address of the signer.

    Returns Promise<string[]>

Generated using TypeDoc