Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace convert

Index

Functions

addressToPk

  • addressToPk(addr: string): Uint8Array
  • Takes an Algorand address in string form and decodes it into a Uint8Array (as public key)

    Parameters

    • addr: string

      : algorand address

    Returns Uint8Array

parseAppArgs

  • parseAppArgs(appArgs?: (Uint8Array | string)[]): Uint8Array[] | undefined
  • Parses appArgs to bytes if arguments passed to App are similar to goal ('int:1', 'str:hello'..) https://developer.algorand.org/docs/features/asc1/stateful/#passing-arguments-to-stateful-smart-contracts eg. "int:1" => new Uint8Aarray([0, 0, 0, 0, 0, 0, 0, 1]) NOTE: parseAppArgs returns undefined to handle the case when application args passed to stateful smart contract is undefined

    Parameters

    • Optional appArgs: (Uint8Array | string)[]

      : arguments to stateful smart contract

    Returns Uint8Array[] | undefined

stringToBytes

  • stringToBytes(s: string): Uint8Array
  • Parameters

    • s: string

    Returns Uint8Array

uint64ToBigEndian

  • uint64ToBigEndian(x: number | bigint): Uint8Array
  • Converts 64 bit unsigned integer to bytes in big endian.

    Parameters

    • x: number | bigint

    Returns Uint8Array

Generated using TypeDoc