Class representing the Algorand connection.

Hierarchy

  • AlgorandConnect

Constructors

Properties

accountsStore: AlgorandAccountsStore

The Algorand accounts store.

assetsRepo: AssetsRepository

The Assets repository.

client: default

The Algorand client instance.

clientIndexer: default

The Algorand Indexer client.

The Algorand configuration object.

Methods

  • Initiates bridge transactions to transfer tokens from the source network to the destination network.

    Returns

    • A promise that resolves with an array of bridge transactions.

    Parameters

    • sourceAddress: string

      The source address on the source network.

    • destinationAddress: string

      The destination address on the destination network.

    • destinationNetwork: BridgeNetworks

      The destination network type.

    • tokenSymbol: string

      The symbol of the token being transferred.

    • amount: bigint

      The amount of tokens to be transferred (as a BigInt).

    Returns Promise<Transaction[]>

  • Retrieves the address corresponding to a specified key from the bridge accounts configuration.

    Returns

    • The address corresponding to the specified key.

    Parameters

    • key: "asaOwner" | "algoOwner" | "bridgeOwner" | "feeReceiver" | "multiSig1" | "multiSig2" | "bridge" | "asaVault" | "algoVault" | "usdcReceiver" | "usdcDeposit" | "tokenBridgeProgramID" | "tokenBridgeV2ProgramID"

      The key for the bridge account address.

    Returns string

  • Retrieves the balance of a specified token for a given address.

    Returns

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

    Parameters

    • address: string

      The address for which to retrieve the token balance.

    • tokenSymbol: string

      The symbol of the token.

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

  • Checks if a specified address is opted-in to a given asset.

    Returns

    • A promise that resolves with a boolean indicating if the address is opted-in to the asset.

    Parameters

    • assetId: number

      The ID of the asset.

    • address: string

      The address to check.

    Returns Promise<boolean>

  • Performs an opt-in operation for a specified token symbol.

    Returns

    • A promise that resolves with the result of the opt-in operation.

    Parameters

    • signerAddress: string

      The address of the account performing the opt-in.

    • tokenSymbol: string

      The symbol of the token to opt-in.

    Returns Promise<string>

  • Generates an opt-in transaction for a specified token symbol.

    Returns

    • A promise that resolves with the opt-in transaction.

    Parameters

    • signerAddress: string

      The address of the account performing the opt-in.

    • tokenSymbol: string

      The symbol of the token to opt-in.

    Returns Promise<Transaction>

  • Waits for the balance of a specified token for a given address to match the expected amount within a timeout period.

    Returns

    • A promise that resolves with the updated balance amount that matches the expected amount.

    Parameters

    • address: string

      The address for which to wait for the balance.

    • expectedAmount: number

      The expected balance amount to wait for.

    • tokenSymbol: string

      The symbol of the token.

    • Optional timeoutSeconds: number = 60

      The timeout duration in seconds.

    • Optional threshold: number = 0.001

      The threshold to consider the balance amount as a match.

    • Optional anybalance: boolean = false

      If true, waits for any balance change (greater or smaller) to match the expected amount.

    • Optional noBalance: boolean = false

      If true, waits for no balance (zero) to match the expected amount.

    Returns Promise<number>

  • Waits for the balance of a specified token for a given address to change from the starting amount.

    Returns

    • A promise that resolves with the updated balance amount after the change.

    Parameters

    • address: string

      The address for which to wait for the balance change.

    • tokenSymbol: string

      The symbol of the token.

    • startingAmount: number

      The starting balance amount to compare against.

    • Optional timeoutSeconds: number = 60

      The timeout duration in seconds.

    Returns Promise<number>

  • Waits for the balance of a specified token for a given address to reach or exceed the minimum amount.

    Returns

    • A promise that resolves with the updated balance amount after reaching or exceeding the minimum.

    Parameters

    • address: string

      The address for which to wait for the minimum balance.

    • minAmount: number

      The minimum balance amount to wait for.

    • tokenSymbol: string

      The symbol of the token.

    • Optional timeoutSeconds: number = 60

      The timeout duration in seconds.

    Returns Promise<number>

Generated using TypeDoc