Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Deployer

Hierarchy

  • Deployer

Index

Properties

accounts

accounts: Account[]

accountsByName

accountsByName: AccountMap

addCheckpointKV

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.

Type declaration

    • (key: string, value: string): void
    • Parameters

      • key: string
      • value: string

      Returns void

algodClient

algodClient: Algodv2

asa

asa: Map<string, ASAInfo>

Mapping of ASA name to deployment log

assertNoAsset

assertNoAsset: (name: string) => void

Type declaration

    • (name: string): void
    • Parameters

      • name: string

      Returns void

deployASA

deployASA: (name: string, flags: ASADeploymentFlags, asaParams?: Partial<{ clawback?: string; decimals: number; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName: string; url?: string }>) => Promise<ASAInfo>

Creates and deploys ASA.

name

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

flags

deployment flags

Type declaration

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

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

      Returns Promise<ASAInfo>

deploySSC

deploySSC: (approvalProgram: string, clearProgram: string, flags: SSCDeploymentFlags, payFlags: TxParams, scTmplParams?: SCParams) => Promise<SSCInfo>

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

SSCDeploymentFlags

payflags

Transaction Parameters

sctmplparams

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

Type declaration

ensureCompiled

ensureCompiled: (name: string, force?: boolean, scTmplParams?: SCParams) => Promise<ASCCache>

Returns ASCCache (with compiled code)

name

Smart Contract filename (must be present in assets folder)

force

if force is true file will be compiled for sure, even if it's checkpoint exist

sctmplparams

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

Type declaration

    • Parameters

      • name: string
      • Optional force: boolean
      • Optional scTmplParams: SCParams

      Returns Promise<ASCCache>

fundLsig

fundLsig: (name: string, flags: FundASCFlags, payFlags: TxParams, scTmplParams?: SCParams) => void

Funds logic signature account (Contract Account).

name

Stateless Smart Contract filename (must be present in assets folder)

payflags

Transaction Parameters

sctmplparams

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

Type declaration

getASADef

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

Type declaration

    • (name: string, asaParams?: Partial<{ clawback?: string; decimals: number; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName: string; url?: string }>): { clawback?: string; decimals: number; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: 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; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName: string; url?: string }>

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

      • Optional clawback?: string
      • decimals: number
      • Optional defaultFrozen?: boolean
      • Optional freeze?: string
      • Optional manager?: string
      • Optional metadataHash?: string
      • Optional note?: string
      • Optional noteb64?: string
      • Optional optInAccNames?: string[]
      • Optional reserve?: string
      • total: string | number | bigint
      • unitName: string
      • Optional url?: string

getASAInfo

getASAInfo: (name: string) => ASAInfo

Type declaration

getAssetByID

getAssetByID: (assetIndex: number | bigint) => Promise<AssetInfo>

Queries blockchain using algodv2 for asset information by index

Type declaration

    • (assetIndex: number | bigint): Promise<AssetInfo>
    • Parameters

      • assetIndex: number | bigint

      Returns Promise<AssetInfo>

getCheckpointKV

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.

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getDelegatedLsig

getDelegatedLsig: (lsigName: string) => undefined | Object

Queries a delegated logic signature from checkpoint.

Type declaration

    • (lsigName: string): undefined | Object
    • Parameters

      • lsigName: string

      Returns undefined | Object

getSSC

getSSC: (nameApproval: string, nameClear: string) => undefined | SSCInfo

Queries a stateful smart contract info from checkpoint.

Type declaration

    • (nameApproval: string, nameClear: string): undefined | SSCInfo
    • Parameters

      • nameApproval: string
      • nameClear: string

      Returns undefined | SSCInfo

getSSCfromCPKey

getSSCfromCPKey: (key: string) => undefined | SSCInfo

Queries a stateful smart contract info from checkpoint using key.

Type declaration

    • (key: string): undefined | SSCInfo
    • Parameters

      • key: string

      Returns undefined | SSCInfo

isDefined

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.

Type declaration

    • (name: string): boolean
    • Parameters

      • name: string

      Returns boolean

isDeployMode

isDeployMode: boolean

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

loadASADef

loadASADef: (asaName: string) => undefined | { clawback?: string; decimals: number; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: 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

Type declaration

    • (asaName: string): undefined | { clawback?: string; decimals: number; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName: string; url?: string }
    • Parameters

      • asaName: string

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

loadLogic

loadLogic: (name: string, scTmplParams?: SCParams) => Promise<LogicSig>

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)

Type declaration

    • (name: string, scTmplParams?: SCParams): Promise<LogicSig>
    • Parameters

      • name: string
      • Optional scTmplParams: SCParams

      Returns Promise<LogicSig>

loadMultiSig

loadMultiSig: (name: string) => Promise<LogicSig>

Extracts multi signed logic signature file from assets/.

Type declaration

    • (name: string): Promise<LogicSig>
    • Parameters

      • name: string

      Returns Promise<LogicSig>

log

log: (msg: string, obj: any) => void

Create an entry in a script log (stored in artifacts/scripts/.log) file.

Type declaration

    • (msg: string, obj: any): void
    • Parameters

      • msg: string
      • obj: any

      Returns void

logTx

logTx: (message: string, txConfirmation: ConfirmedTxInfo) => void

Type declaration

    • (message: string, txConfirmation: ConfirmedTxInfo): void
    • Parameters

      • message: string
      • txConfirmation: ConfirmedTxInfo

      Returns void

mkDelegatedLsig

mkDelegatedLsig: (name: string, signer: Account, scTmplParams?: SCParams) => Promise<LsigInfo>

Makes delegated logic signature signed by the signer.

name

Stateless Smart Contract 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)

Type declaration

optInAccountToSSC

optInAccountToSSC: (sender: Account, appId: number, payFlags: TxParams, flags: SSCOptionalFlags) => Promise<void>

Opt-In to stateful smart contract (SSC) for a single account signed by account secret key

param

sender account

param

application index

param

Transaction flags

param

Optional parameters to SSC (accounts, args..)

Type declaration

optInAcountToASA

optInAcountToASA: (asa: string, accountName: string, flags: TxParams, sign: Sign) => 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

Type declaration

    • (asa: string, accountName: string, flags: TxParams, sign: Sign): Promise<void>
    • Parameters

      • asa: string
      • accountName: string
      • flags: TxParams
      • sign: Sign

      Returns Promise<void>

optInLsigToASA

optInLsigToASA: (asa: string, lsig: LogicSig, 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

Type declaration

    • (asa: string, lsig: LogicSig, flags: TxParams): Promise<void>
    • Parameters

      • asa: string
      • lsig: LogicSig
      • flags: TxParams

      Returns Promise<void>

optInLsigToSSC

optInLsigToSSC: (appId: number, lsig: LogicSig, payFlags: TxParams, flags: SSCOptionalFlags) => Promise<void>

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

param

sender account

param

application index

param

Transaction flags

param

Optional parameters to SSC (accounts, args..)

Type declaration

persistCP

persistCP: () => void

Type declaration

    • (): void
    • Returns void

registerASAInfo

registerASAInfo: (name: string, asaInfo: ASAInfo) => void

Type declaration

    • (name: string, asaInfo: ASAInfo): void
    • Parameters

      Returns void

registerSSCInfo

registerSSCInfo: (name: string, sscInfo: SSCInfo) => void

Type declaration

    • (name: string, sscInfo: SSCInfo): void
    • Parameters

      Returns void

sendAndWait

sendAndWait: (rawTxns: Uint8Array | Uint8Array[]) => Promise<ConfirmedTxInfo>

Send signed transaction to network and wait for confirmation

param

Signed Transaction(s)

Type declaration

    • (rawTxns: Uint8Array | Uint8Array[]): Promise<ConfirmedTxInfo>
    • Parameters

      • rawTxns: Uint8Array | Uint8Array[]

      Returns Promise<ConfirmedTxInfo>

updateSSC

updateSSC: (sender: Account, payFlags: TxParams, appId: number, newApprovalProgram: string, newClearProgram: string, flags: SSCOptionalFlags) => Promise<SSCInfo>

Update programs(approval, clear) for a stateful smart contract.

param

Account from which call needs to be made

param

Transaction Flags

param

ID of the application being configured or empty if creating

param

New Approval Program filename

param

New Clear Program filename

param

Optional parameters to SSC (accounts, args..)

Type declaration

    • Parameters

      • sender: Account
      • payFlags: TxParams
      • appId: number
      • newApprovalProgram: string
      • newClearProgram: string
      • flags: SSCOptionalFlags

      Returns Promise<SSCInfo>

waitForConfirmation

waitForConfirmation: (txId: string) => Promise<ConfirmedTxInfo>

Queries blockchain for a given transaction and waits until it will be processed.

Type declaration

    • (txId: string): Promise<ConfirmedTxInfo>
    • Parameters

      • txId: string

      Returns Promise<ConfirmedTxInfo>

Generated using TypeDoc