Options
All
  • Public
  • Public/Protected
  • All
Menu

An abstraction of an account on the Algorand

Hierarchy

Index

Constructors

  • new Account(params: AccountInterface): Account

Properties

mnemonic?: string
property

An optional string of 25 words seperated by spaces that can be used to recover an algorand account

network?: "LocalHost" | "MainNet" | "TestNet"
property

The desired network to connect to, the default value is LocalHost

networkAccount?: any
property

An optional instance of an account from the reach standard library. Used to reconnect via a frontend

provider?: any
property

An instance of the provider object for the signer specified

providerEnv?: any
property

providerEnv for indexer

reachAccount: any
property

An account created from the reach sdk

reachStdLib: any
property

An instance of the reach standard library

secretKey?: number[]
property

An optional array of numbers that can be used to recover an algorand account

signer?: string
propertyan

optional name of a signer or wallet provider that can be used to sign transactions, should be set along with the provider property. Only required when not using a mnemonic or secretKey

Methods

  • fundFromFaucet(): Promise<boolean>
  • Allows you to fund this account from the faucet when on the Reach devnet

    Returns Promise<boolean>

    A boolean indicating if this account was successfully funded or not

  • getAddress(): Promise<any>
  • Returns Promise<any>

    The formatted adress of this account

  • getBalance(params: { tokenId: number }): Promise<number>
  • Parameters

    • params: { tokenId: number }

      An object with key tokenId that indicates the ASA id whose balance this function must return, this key's value should be set to zero for the native token balance

      • tokenId: number

    Returns Promise<number>

    The balance of the specified tokenId

  • getContractAbi(params: { backend: any; contractId: number }): Promise<AbiInterface>
  • Parameters

    • params: { backend: any; contractId: number }

      contractId which indicates the contract we want to interact with, and the backend to use (see utils.ts for backend options)

      • backend: any
      • contractId: number

    Returns Promise<AbiInterface>

  • getContractAddress(params: { backend: any; contractId: number }): Promise<string>
  • Returns the contract address

    Parameters

    • params: { backend: any; contractId: number }

      An object with key vault that indicates the contract whose address is to be retrieved, and the backend to use (see utils.ts for backend options)

      • backend: any
      • contractId: number

    Returns Promise<string>

    A formatted address of the specified contract as a string

  • getSecret(): Promise<any>
  • Returns Promise<any>

    A UInt8 array which is the secretKey of this Reach account

  • initialiseReachAccount(): Promise<void>
  • Initialises the reachAccount property

    Returns Promise<void>

  • optIntoToken(tokenID: number): Promise<void>
  • Allows an instance of the account class to opt into an Algorand standard Asset

    Parameters

    • tokenID: number

      The asa ID to opt into

    Returns Promise<void>

Generated using TypeDoc