Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Deployer

Index

Properties

accounts: runtime.rtypes.Account[]
accountsByName: AccountMap
algodClient: default
asa: Map<string, ASAInfo>

Mapping of ASA name to deployment log

isDeployMode: boolean

Allows user to know whether a script is running in a deploy or run mode.

Methods

  • addCheckpointKV(key: string, value: string): void
  • Sets metadata key value for a current network in the chckpoint file based on the current deployment script. If run in a non deployment mode (eg algob run script_name.js) it will throw an exception.

    Parameters

    • key: string
    • value: string

    Returns void

  • Checks if checkpoint is deleted for a particular transaction if checkpoint exists and is marked as deleted, throw error(except for opt-out transactions), else pass

    Parameters

    Returns void

  • assertNoApp(appName: string): void
  • assertNoAsset(name: string): void
  • assertNoLsig(lsigName: string): void
  • deployASA(name: string, flags: ASADeploymentFlags, asaParams?: Partial<{ clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }>): Promise<ASAInfo>
  • Creates and deploys ASA defined in asa.yaml.

    name

    ASA name - deployer will search for the ASA in the /assets/asa.yaml file

    flags

    deployment flags

    Parameters

    • name: string
    • flags: ASADeploymentFlags
    • Optional asaParams: Partial<{ clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }>

    Returns Promise<ASAInfo>

  • deployASADef(name: string, asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }, flags: ASADeploymentFlags): Promise<ASAInfo>
  • Creates and deploys ASA without using asa.yaml.

    name

    ASA name

    asadef

    ASA definitions

    flags

    deployment flags

    Parameters

    • name: string
    • asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }
      • Optional clawback?: string
      • decimals: number | bigint
      • Optional defaultFrozen?: boolean
      • Optional freeze?: string
      • Optional manager?: string
      • Optional metadataHash?: string | Uint8Array | Buffer
      • Optional name?: string
      • Optional note?: string
      • Optional noteb64?: string
      • Optional optInAccNames?: string[]
      • Optional reserve?: string
      • total: string | number | bigint
      • Optional unitName?: string
      • Optional url?: string
    • flags: ASADeploymentFlags

    Returns Promise<ASAInfo>

  • Deploys stateful smart contract.

    approvalprogram

    approval program filename (must be present in assets folder)

    clearprogram

    clear program filename (must be present in assets folder)

    flags

    AppDeploymentFlags

    payflags

    Transaction Parameters

    sctmplparams

    Smart contract template parameters (used only when compiling PyTEAL to TEAL)

    appname

    name of the app to deploy. This name (if passed) will be used as the checkpoint "key", and app information will be stored agaisnt this name

    Parameters

    Returns Promise<AppInfo>

  • Execute single transaction or group of transactions (atomic transaction) executes ExecParams or Transaction Object, SDK Transaction object passed to this function will be signed and sent to network. User can use SDK functions to create transactions. Note: If passing transaction object a signer/s must be provided.

    Parameters

    Returns Promise<ConfirmedTxInfo[]>

  • This function will send Algos to ASC account in "Contract Mode".

    Parameters

    • lsigName: string

      name of the smart signature (passed by user during mkContractLsig/mkDelegatedLsig)

    • flags: FundASCFlags

      Deployments flags (as per SPEC)

    • payFlags: TxParams

      as per SPEC

    Returns void

  • Funds logic signature account (Contract Account).

    filename:

    filename with a Smart Signature code (must be present in the assets folder)

    payflags

    Transaction Parameters

    sctmplparams

    Smart contract template parameters (used only when compiling PyTEAL to TEAL)

    Parameters

    Returns void

  • getASADef(name: string, asaParams?: Partial<{ clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }>): { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }
  • Parameters

    • name: string
    • Optional asaParams: Partial<{ clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }>

    Returns { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }

    • Optional clawback?: string
    • decimals: number | bigint
    • Optional defaultFrozen?: boolean
    • Optional freeze?: string
    • Optional manager?: string
    • Optional metadataHash?: string | Uint8Array | Buffer
    • Optional name?: string
    • Optional note?: string
    • Optional noteb64?: string
    • Optional optInAccNames?: string[]
    • Optional reserve?: string
    • total: string | number | bigint
    • Optional unitName?: string
    • Optional url?: string
  • getAssetByID(assetIndex: number | bigint): Promise<Asset>
  • Queries blockchain using algodv2 for asset information by index

    Parameters

    • assetIndex: number | bigint

    Returns Promise<Asset>

  • getCheckpointKV(key: string): undefined | string
  • Queries metadata key in all checkpoint files of current network. If the key is not defined in any checkpoint then undefined is returned. Can be run in both run and deploy mode.

    Parameters

    • key: string

    Returns undefined | string

  • getLsig(lsigName: string): LogicSigAccount
  • Loads logic signature info(contract or delegated) from checkpoint (by lsig name)

    Parameters

    • lsigName: string

      name of the smart signture (defined by user during mkContractLsig/mkDelegatedLsig)

    Returns LogicSigAccount

  • isDefined(name: string): boolean
  • Returns true if ASA or DelegatedLsig or SSC were deployed in any script. Checks even for checkpoints which are out of scope from the execution session and are not obtainable using get methods.

    Parameters

    • name: string

    Returns boolean

  • loadASADef(asaName: string): undefined | { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }
  • Loads deployed asset definition from checkpoint. NOTE: This function returns "deployed" ASADef, as immutable properties of asaDef could be updated during tx execution (eg. update asset clawback)

    name

    ASA name - name of ASA in the /assets/asa.yaml file

    Parameters

    • asaName: string

    Returns undefined | { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }

  • loadLogicByFile(name: string, scTmplParams?: types.SCParams): Promise<LogicSigAccount>
  • Loads contract mode logic signature (TEAL or PyTEAL)

    name

    Smart Contract filename (must be present in assets folder)

    sctmplparams

    Smart contract template parameters (used only when compiling PyTEAL to TEAL)

    Parameters

    Returns Promise<LogicSigAccount>

  • loadMultiSig(name: string): Promise<LogicSig>
  • log(msg: string, obj: any): void
  • Create an entry in a script log (stored in artifacts/scripts/.log) file.

    Parameters

    • msg: string
    • obj: any

    Returns void

  • Stores logic signature info in checkpoint for contract mode

    lsigname

    name of lsig (checkpoint info will be stored against this name)

    filename

    ASC file name

    sctmplparams

    : Smart contract template parameters (used only when compiling PyTEAL to TEAL)

    Parameters

    • lsigName: string
    • fileName: string
    • Optional scTmplParams: types.SCParams

    Returns Promise<LsigInfo>

  • Makes delegated logic signature signed by the signer.

    lsigname

    name of smart signature (checkpoint info will be stored against this name)

    filename

    Smart Signature filename (must be present in assets folder)

    signer

    Signer Account which will sign the smart contract

    sctmplparams

    Smart contract template parameters (used only when compiling PyTEAL to TEAL)

    Parameters

    Returns Promise<LsigInfo>

  • optInAccountToASA(asa: string, accountName: string, flags: TxParams): Promise<void>
  • Creates an opt-in transaction for given ASA name, which must be defined in /assets/asa.yaml file. The opt-in transaction is signed by the account secret key

    Parameters

    • asa: string
    • accountName: string
    • flags: TxParams

    Returns Promise<void>

  • optInLsigToASA(asa: string, lsig: LogicSigAccount, flags: TxParams): Promise<void>
  • Creates an opt-in transaction for given ASA name, which must be defined in /assets/asa.yaml file. The opt-in transaction is signed by the logic signature

    Parameters

    • asa: string
    • lsig: LogicSigAccount
    • flags: TxParams

    Returns Promise<void>

  • Opt-In to stateful smart contract (SSC) for a contract account The opt-in transaction is signed by the logic signature

    Parameters

    Returns Promise<void>

  • persistCP(): void
  • registerASAInfo(name: string, asaInfo: ASAInfo): void
  • registerSSCInfo(name: string, sscInfo: AppInfo): void
  • Update programs(approval, clear) for a stateful smart contract.

    Parameters

    • appName: string

      name of the app to deploy. This name (if passed) will be used as the checkpoint "key", and app information will be stored agaisnt this name

    • sender: default

      Account from which call needs to be made

    • payFlags: TxParams

      Transaction Flags

    • appID: number

      ID of the application being configured or empty if creating

    • newAppCode: SmartContract
    • flags: runtime.rtypes.AppOptionalFlags

      Optional parameters to SSC (accounts, args..)

    • Optional scTmplParams: types.SCParams

    Returns Promise<AppInfo>

Generated using TypeDoc