Options
All
  • Public
  • Public/Protected
  • All
Menu

@algo-builder/runtime

Index

Functions

checkIfAssetDeletionTx

  • checkIfAssetDeletionTx(txn: Transaction): boolean

getPathFromDirRecursive

  • getPathFromDirRecursive(dir: string, fileName: string, warnMsg?: string): string | undefined
  • Searches recursively and returns path of file in a given directory. Throws error if multiple files with same name are found (in directory or sub-directory)

    Parameters

    • dir: string

      directory name

    • fileName: string

      name of file to search in directory

    • Optional warnMsg: string

      if file does not exist & warning message is passed, then console log warning, and return. throws error otherwise

    Returns string | undefined

loadASAFile

  • Loads, validates and returns asset definitions from the assets/asa.yaml file

    Parameters

    • accounts: AccountMap | RuntimeAccountMap

      map of string => account. AccountMap is the SDK account type, used in builder. RuntimeAccountMap is for AccountStore used in runtime (where we use maps instead of arrays in sdk structures).

    Returns types.ASADefs

loadFromYamlFileSilent

  • loadFromYamlFileSilent(filePath: string, options?: YAML.Options): any

loadFromYamlFileSilentWithMessage

  • loadFromYamlFileSilentWithMessage(filePath: string, messageIfNotPresent: string, options?: YAML.Options): any

lsTreeWalk

  • lsTreeWalk(directoryName: string): string[]

overrideASADef

  • overrideASADef(accounts: AccountMap, origDef: types.ASADef, newDef?: Partial<types.ASADef>): types.ASADef
  • Override & validate ASA definition in asa.yaml using custom params passed via deployASA

    Parameters

    • accounts: AccountMap

      accounts by name

    • origDef: types.ASADef

      source asset definition (in asa.yaml)

    • Optional newDef: Partial<types.ASADef>

      custom asset def params (passed during ASA deployment)

    Returns types.ASADef

    overriden asset definition. If custom params are empty, return source asa def

parseASADef

  • parseASADef(asaDef: types.ASADef, source?: string): types.ASADef
  • Validate and parse each field of asset definition. metadataHash, if provided as a Buffer will be transformed into Uint8Array.

    Parameters

    • asaDef: types.ASADef

      asset definition

    • Optional source: string

      source of assetDef: asa.yaml file OR function deployASA

    Returns types.ASADef

    parsed asa definition

parseZodError

  • parseZodError(ze: z.ZodError): string

parser

validateASADefs

  • Parses, overrides and validates asset defs map. Filaname parameter is used to indicate an ASA definition source when reporting errors.

    Parameters

    • asaDefs: types.ASADefs

      asset definitions to validate

    • accounts: AccountMap | RuntimeAccountMap

      map of string => account. AccountMap is the SDK account type, used in builder. RuntimeAccountMap is for AccountStore used in runtime (where we use maps instead of arrays in sdk structures).

    • filename: string

      asa filename

    Returns types.ASADefs

validateOptInAccNames

  • Validates asset definitions and checks if opt-in acc names are present in network

    Parameters

    • accounts: AccountMap | RuntimeAccountMap

      AccountMap is the SDK account type, used in builder. RuntimeAccountMap is for AccountStore used in runtime (where we use maps instead of arrays in sdk structures).

    • asaDef: types.ASADef

      asset definition

    • Optional source: string

    Returns void

Generated using TypeDoc