Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace algorand

Index

Type aliases

LogicSigAccountInfo

LogicSigAccountInfo: { doesExist: boolean; lsa: LogicSigAccount }

Type declaration

  • doesExist: boolean
  • lsa: LogicSigAccount

OptInResult

OptInResult: { addr: string; txs: TransactionSignerPair[] }

Type declaration

ParsedVAA

ParsedVAA: { Amount?: Uint8Array; Body?: Uint8Array; Contract?: string; Decimals?: number; EmitterChainID?: number; Fee?: Uint8Array; FromAddress?: Uint8Array; FromChain?: number; Meta: "Unknown" | "TokenBridge" | "TokenBridge RegisterChain" | "TokenBridge UpgradeContract" | "CoreGovernance" | "TokenBridge Attest" | "TokenBridge Transfer" | "TokenBridge Transfer With Payload"; Name?: Uint8Array; NewGuardianSetIndex?: number; Payload?: Uint8Array; Symbol?: Uint8Array; ToAddress?: Uint8Array; ToChain?: number; TokenId?: Uint8Array; Type?: number; action?: number; chain: number; chainRaw: string; consistency: number; digest: Uint8Array; emitter: string; index: number; module?: Uint8Array; newContract?: Uint8Array; nonce: number; sequence: bigint; siglen: number; signatures: Uint8Array; sigs: Uint8Array[]; targetChain?: number; targetEmitter?: Uint8Array; timestamp: number; uri?: string; version: number }

Parses the VAA into a Map

param

The VAA to be parsed

returns

The ParsedVAA containing the parsed elements of the VAA

Type declaration

  • Optional Amount?: Uint8Array
  • Optional Body?: Uint8Array
  • Optional Contract?: string
  • Optional Decimals?: number
  • Optional EmitterChainID?: number
  • Optional Fee?: Uint8Array
  • Optional FromAddress?: Uint8Array
  • Optional FromChain?: number
  • Meta: "Unknown" | "TokenBridge" | "TokenBridge RegisterChain" | "TokenBridge UpgradeContract" | "CoreGovernance" | "TokenBridge Attest" | "TokenBridge Transfer" | "TokenBridge Transfer With Payload"
  • Optional Name?: Uint8Array
  • Optional NewGuardianSetIndex?: number
  • Optional Payload?: Uint8Array
  • Optional Symbol?: Uint8Array
  • Optional ToAddress?: Uint8Array
  • Optional ToChain?: number
  • Optional TokenId?: Uint8Array
  • Optional Type?: number
  • Optional action?: number
  • chain: number
  • chainRaw: string
  • consistency: number
  • digest: Uint8Array
  • emitter: string
  • index: number
  • Optional module?: Uint8Array
  • Optional newContract?: Uint8Array
  • nonce: number
  • sequence: bigint
  • siglen: number
  • signatures: Uint8Array
  • sigs: Uint8Array[]
  • Optional targetChain?: number
  • Optional targetEmitter?: Uint8Array
  • timestamp: number
  • Optional uri?: string
  • version: number

TransactionSignerPair

TransactionSignerPair: { signer: Signer | null; tx: Transaction }

Type declaration

  • signer: Signer | null
  • tx: Transaction

Variables

Const BITS_PER_KEY

BITS_PER_KEY: number = ...

Const MAX_BITS

MAX_BITS: number = ...

Const METADATA_REPLACE

METADATA_REPLACE: RegExp = ...

Functions

_parseNFTAlgorand

  • _parseNFTAlgorand(vaa: Uint8Array): ParsedVAA

_parseVAAAlgorand

  • _parseVAAAlgorand(vaa: Uint8Array): ParsedVAA

_submitVAAAlgorand

  • _submitVAAAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, vaa: Uint8Array, senderAddr: string): Promise<TransactionSignerPair[]>
  • Submits the VAA to the application

    Parameters

    • client: Algodv2

      AlgodV2 client

    • tokenBridgeId: bigint

      Application ID of the token bridge

    • bridgeId: bigint

      Application ID of the core bridge

    • vaa: Uint8Array

      The VAA to be submitted

    • senderAddr: string

      Sending account address

    Returns Promise<TransactionSignerPair[]>

    Confirmation log

accountExists

  • accountExists(client: Algodv2, appId: bigint, acctAddr: string): Promise<boolean>
  • Checks to see it the account exists for the application

    Parameters

    • client: Algodv2

      An Algodv2 client

    • appId: bigint

      Application ID

    • acctAddr: string

      Account address to check

    Returns Promise<boolean>

    true, if account exists for application. Otherwise, returns false

assetOptinCheck

  • assetOptinCheck(client: Algodv2, asset: bigint, receiver: string): Promise<boolean>
  • Checks if the asset has been opted in by the receiver

    Parameters

    • client: Algodv2

      Algodv2 client

    • asset: bigint

      Algorand asset index

    • receiver: string

      Account address

    Returns Promise<boolean>

    True if the asset was opted in, else false

calcLogicSigAccount

  • calcLogicSigAccount(client: algosdk.Algodv2, appId: bigint, appIndex: bigint, emitterId: string): Promise<LogicSigAccountInfo>
  • Calculates the logic sig account for the application

    Parameters

    • client: algosdk.Algodv2

      An Algodv2 client

    • appId: bigint

      Application ID

    • appIndex: bigint

      Application index

    • emitterId: string

      Emitter address

    Returns Promise<LogicSigAccountInfo>

    LogicSigAccountInfo

decodeLocalState

  • decodeLocalState(client: Algodv2, appId: bigint, address: string): Promise<Uint8Array>
  • Returns the local data for an application ID

    Parameters

    • client: Algodv2

      Algodv2 client

    • appId: bigint

      Application ID of interest

    • address: string

      Address of the account

    Returns Promise<Uint8Array>

    Uint8Array of data squirreled away

getMessageFee

  • getMessageFee(client: Algodv2, bridgeId: bigint): Promise<bigint>
  • Return the message fee for the core bridge

    Parameters

    • client: Algodv2

      An Algodv2 client

    • bridgeId: bigint

      The application ID of the core bridge

    Returns Promise<bigint>

    The message fee for the core bridge

hexToNativeAssetBigIntAlgorand

  • hexToNativeAssetBigIntAlgorand(s: string): bigint

hexToNativeAssetStringAlgorand

  • hexToNativeAssetStringAlgorand(s: string): string

hexToNativeStringAlgorand

  • hexToNativeStringAlgorand(s: string): string

nativeStringToHexAlgorand

  • nativeStringToHexAlgorand(s: string): string

optin

  • optin(client: Algodv2, senderAddr: string, appId: bigint, appIndex: bigint, emitterId: string): Promise<OptInResult>
  • Calculates the logic sig account for the application

    Parameters

    • client: Algodv2

      An Algodv2 client

    • senderAddr: string

      Sender address

    • appId: bigint

      Application ID

    • appIndex: bigint

      Application index

    • emitterId: string

      Emitter address

    Returns Promise<OptInResult>

    Address and array of TransactionSignerPairs

signSendAndConfirmAlgorand

  • signSendAndConfirmAlgorand(algodClient: Algodv2, txs: TransactionSignerPair[], wallet: Account): Promise<Record<string, any>>

submitVAAHeader

  • submitVAAHeader(client: Algodv2, bridgeId: bigint, vaa: Uint8Array, senderAddr: string, appid: bigint): Promise<SubmitVAAState>
  • Submits just the header of the VAA

    Parameters

    • client: Algodv2

      AlgodV2 client

    • bridgeId: bigint

      Application ID of the core bridge

    • vaa: Uint8Array

      The VAA (Just the header is used)

    • senderAddr: string

      Sending account address

    • appid: bigint

      Application ID

    Returns Promise<SubmitVAAState>

    Current VAA state

uint8ArrayToNativeStringAlgorand

  • uint8ArrayToNativeStringAlgorand(a: Uint8Array): string

Generated using TypeDoc