Options
All
  • Public
  • Public/Protected
  • All
Menu

@algo-builder/algob

Index

Variables

ERRORS: { [ category in keyof typeof ERROR_RANGES]: {} }
globalZeroAddress: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ" = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"

Functions

  • balanceOf(deployer: Deployer, accountAddress: string, assetID: number): Promise<number | bigint>
  • Returns account balance of assetID. Returns 0 if the account has not opt-in to the given asset id.

    Parameters

    • deployer: Deployer

      algob deployer

    • accountAddress: string

      account to return assetholding info

    • assetID: number

      asset index

    Returns Promise<number | bigint>

  • createMsigAddress(version: number, threshold: number, accountList: string[]): [MultisigMetadata, string]
  • returns multisignature account address

    Parameters

    • version: number

      version of msig

    • threshold: number

      represents min no. of signatures for a tx to be approved

    • accountList: string[]

      account address of multisig (note: order is important)

    Returns [MultisigMetadata, string]

    multisig metadata ({v: .., thr: .., addr: ..}) and the multisig addresses

  • Decode signed txn from file and send to network. probably won't work, because transaction contains fields like firstValid and lastValid which might not be equal to the current network's blockchain block height.

    Parameters

    • deployer: Deployer

      Deployer

    • fileName: string

      raw(encoded) signed txn file

    Returns Promise<ConfirmedTxInfo>

  • Loads accounts from filename. The file should be a YAML file with list of objects which is either HDAccount, MnemonicAccount or an Account.

    Parameters

    • filename: string

      file to load accounts from

    Returns Promise<runtime.rtypes.Account[]>

  • printAssets(deployer: Deployer, account: string): Promise<void>
  • Prints account asset holdings and ALGO balance (in microalgos)

    Parameters

    • deployer: Deployer

      algob deployer object

    • account: string

      account whose asset holding to print

    Returns Promise<void>

  • printGlobalStateSSC(deployer: Deployer, creatorAddr: string, appID: number): Promise<void>
  • print global state of a stateful smart contract

    Parameters

    • deployer: Deployer

      algob deployer

    • creatorAddr: string

      creator address of stateful smart contract

    • appID: number

      application index of smart contract

    Returns Promise<void>

  • printLocalStateSSC(deployer: Deployer, accountAddr: string, appID: number): Promise<void>
  • print account's local state of a stateful smart contract

    Parameters

    • deployer: Deployer

      algob deployer

    • accountAddr: string

      account address to print local state

    • appID: number

      application index of smart contract

    Returns Promise<void>

  • readAppGlobalState(deployer: Deployer, creator: string, appID: number): Promise<Map<Key, StateValue> | undefined>
  • fetches and returns the global state of application.

    Parameters

    • deployer: Deployer

      Deployer

    • creator: string

      Account from which call needs to be made

    • appID: number

      ID of the application being configured or empty if creating

    Returns Promise<Map<Key, StateValue> | undefined>

  • readAppLocalState(deployer: Deployer, account: string, appID: number): Promise<Map<Key, StateValue> | undefined>
  • Read and return the local state of application from an account.

    Parameters

    • deployer: Deployer

      Deployer

    • account: string

      account from the which the local state has to be read

    • appID: number

      ID of the application being configured or empty if creating

    Returns Promise<Map<Key, StateValue> | undefined>

  • signLogicSigMultiSig(lsigAccount: LogicSigAccount, signer: runtime.rtypes.Account, mparams?: MultisigMetadata): LogicSigAccount
  • Appends signature (using signer's sk) to multi-signed logic signature. If multisig is not found then new multisig is created eg. appending own signature to a signed lsig (received from multisignature account address network)

    Parameters

    Returns LogicSigAccount

    multi signed logic signature (with appended signature using signer's sk)

  • signMultiSig(signerAccount: default, rawTxn: Uint8Array, mparams?: MultisigMetadata): { blob: Uint8Array; txID: string }
  • Signs a raw multi-sig transaction object

    Parameters

    • signerAccount: default

      account(addr, sk) to sign the transaction

    • rawTxn: Uint8Array

      encoded transaction fetched from file in /assets

    • Optional mparams: MultisigMetadata

      multisig metadata. Required if creating a new signed multisig transaction.

    Returns { blob: Uint8Array; txID: string }

    signed transaction object

    • blob: Uint8Array
    • txID: string
  • Signs transaction object(s) and returns raw signed transaction Note: signTransaction is used to sign single transaction and signTransactions takes array of SDK transaction object with signers, signs it.

    Parameters

    Returns Uint8Array[]

Generated using TypeDoc