Interface Deployer

Hierarchy

  • Deployer

Properties

accounts: runtime.rtypes.Account[]
accountsByName: AccountMap
addCheckpointKV: ((key: string, value: string) => void)

Type declaration

    • (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

algodClient: default
asa: Map<string, ASAInfo>

Mapping of ASA name to deployment log

assertCPNotDeleted: ((execParams: ExecParams | ExecParams[]) => void)

Type declaration

    • (execParams: ExecParams | ExecParams[]): 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)

Type declaration

    • (appName: string): void
    • Parameters

      • appName: string

      Returns void

assertNoAsset: ((name: string) => void)

Type declaration

    • (name: string): void
    • Parameters

      • name: string

      Returns void

assertNoLsig: ((lsigName: string) => void)

Type declaration

    • (lsigName: string): void
    • Parameters

      • lsigName: string

      Returns void

assetPath: string
compileASC: ((name: string, scTmplParams?: types.SCParams, force?: boolean) => Promise<ASCCache>)

Type declaration

    • (name: string, scTmplParams?: types.SCParams, force?: boolean): Promise<ASCCache>
    • Returns ASCCache (with compiled code)

      Parameters

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

      Returns Promise<ASCCache>

compileApplication: ((appName: string, source: SmartContract, scTmplParams?: types.SCParams) => Promise<SourceCompiled>)

Type declaration

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>)

Type declaration

    • (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. Required. flags.creator must be defined - it's an account which will sign the constructed transaction. NOTE: support for rekeyed accounts is limited (creator must have updated sk to properly sign transaction)

      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>)

Type declaration

    • (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

      Asa Def

      ASA definitions

      Flags

      deployment flags flags.creator must be defined - it's an account which will sign the constructed transaction. NOTE: support for rekeyed accounts is limited (creator must have updated sk to properly sign transaction)

      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>

deployApp: ((creator: default, appDefinition: AppDefinitionFromFile, payFlags: TxParams, scTmplParams?: types.SCParams, appName?: string) => Promise<AppInfo>)

Type declaration

    • (creator: default, appDefinition: AppDefinitionFromFile, payFlags: TxParams, scTmplParams?: types.SCParams, appName?: string): Promise<AppInfo>
    • Deploys stateful smart contract.

      Creator

      is the signer of the transaction.

      App Definition

      is an object providing details about approval and clear program.

      Clear Program

      clear program filename (must be present in assets folder)

      Flags

      AppDeploymentFlags

      Pay Flags

      Transaction Parameters

      Sc Tmpl Params

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

      App Name

      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>

executeTx: ((transactions: ExecParams[] | TransactionAndSign[]) => Promise<types.TxnReceipt[]>)

Type declaration

fundLsig: ((lsigName: string, flags: FundASCFlags, payFlags: TxParams) => void)

Type declaration

    • (lsigName: string, flags: FundASCFlags, payFlags: TxParams): void
    • 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

fundLsigByFile: ((fileName: string, flags: FundASCFlags, payFlags: TxParams, scTmplParams?: types.SCParams) => void)

Type declaration

    • (fileName: string, flags: FundASCFlags, payFlags: TxParams, scTmplParams?: types.SCParams): void
    • Funds logic signature account (Contract Account). @fileName: filename with a Smart Signature code (must be present in the assets folder)

      Pay Flags

      Transaction Parameters

      Sc Tmpl Params

      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;
})

Type declaration

    • (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
getASAInfo: ((name: string) => ASAInfo)

Type declaration

getApp: ((appName: string) => AppInfo)

Type declaration

    • (appName: string): AppInfo
    • Queries a stateful smart contract info from checkpoint name passed by user during deployment

      Parameters

      • appName: string

      Returns AppInfo

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

Type declaration

    • (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)

Type declaration

    • (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

getDeployedASC: ((name: string) => Promise<undefined | ASCCache | AppCache>)

Type declaration

    • (name: string): Promise<undefined | ASCCache | AppCache>
    • Returns cached program (from artifacts/cache) ASCCache object by app/lsig name.

      Parameters

      • name: string

        App/Lsig name used during deployment

      Returns Promise<undefined | ASCCache | AppCache>

getLsig: ((lsigName: string) => LogicSigAccount)

Type declaration

    • (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

getReceiptTxns: ((txns: Transaction[]) => Promise<types.TxnReceipt[]>)

Type declaration

    • (txns: Transaction[]): Promise<types.TxnReceipt[]>
    • Return receipts for each transaction in group txn

      Returns

      confirmed tx info of group

      Parameters

      • txns: Transaction[]

        list transaction in group

      Returns Promise<types.TxnReceipt[]>

isDefined: ((name: string) => boolean)

Type declaration

    • (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

isDeployMode: boolean

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

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;
})

Type declaration

    • (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>)

Type declaration

    • (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)

      Sc Tmpl Params

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

      Parameters

      Returns Promise<LogicSigAccount>

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

Type declaration

    • (name: string): Promise<LogicSig>
    • Extracts multi signed logic signature file from assets/.

      Parameters

      • name: string

      Returns Promise<LogicSig>

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

Type declaration

    • (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

logTx: ((message: string, txConfirmation: types.TxnReceipt) => void)

Type declaration

mkContractLsig: ((lsigName: string, fileName: string, scTmplParams?: types.SCParams) => Promise<LsigInfo>)

Type declaration

    • (lsigName: string, fileName: string, scTmplParams?: types.SCParams): Promise<LsigInfo>
    • Stores logic signature info in checkpoint for contract mode

      Lsig Name

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

      File Name

      ASC file name

      Sc Tmpl Params

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

      Parameters

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

      Returns Promise<LsigInfo>

mkDelegatedLsig: ((lsigName: string, fileName: string, signer: runtime.rtypes.Account, scTmplParams?: types.SCParams) => Promise<LsigInfo>)

Type declaration

    • (lsigName: string, fileName: string, signer: runtime.rtypes.Account, scTmplParams?: types.SCParams): Promise<LsigInfo>
    • Makes delegated logic signature signed by the signer.

      Lsig Name

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

      File Name

      Smart Signature filename (must be present in assets folder)

      Signer

      Signer Account which will sign the smart contract

      Sc Tmpl Params

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

      Parameters

      Returns Promise<LsigInfo>

optInAccountToASA: ((asa: string, accountName: string, flags: TxParams) => Promise<void>)

Type declaration

    • (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>

optInAccountToApp: ((sender: runtime.rtypes.Account, appID: number, payFlags: TxParams, flags: runtime.rtypes.AppOptionalFlags) => Promise<void>)

Type declaration

optInLsigToASA: ((asa: string, lsig: LogicSigAccount, flags: TxParams) => Promise<void>)

Type declaration

    • (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>

optInLsigToApp: ((appID: number, lsig: LogicSigAccount, payFlags: TxParams, flags: runtime.rtypes.AppOptionalFlags) => Promise<void>)

Type declaration

    • (appID: number, lsig: LogicSigAccount, payFlags: TxParams, flags: runtime.rtypes.AppOptionalFlags): 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)

Type declaration

    • (): void
    • Returns void

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

Type declaration

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

      Returns void

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

Type declaration

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

      Returns void

sendAndWait: ((rawTxns: Uint8Array | Uint8Array[]) => Promise<types.TxnReceipt>)

Type declaration

    • (rawTxns: Uint8Array | Uint8Array[]): Promise<types.TxnReceipt>
    • Send signed transaction to network and wait for confirmation

      Returns

      TxnReceipt which includes confirmed txn response along with txID

      Parameters

      • rawTxns: Uint8Array | Uint8Array[]

        Signed Transaction(s)

      Returns Promise<types.TxnReceipt>

updateApp: ((appName: string, sender: default, payFlags: TxParams, appID: number, newAppCode: SmartContract, flags: runtime.rtypes.AppOptionalFlags, scTmplParams?: types.SCParams) => Promise<AppInfo>)

Type declaration

    • (appName: string, sender: default, payFlags: TxParams, appID: number, newAppCode: SmartContract, flags: runtime.rtypes.AppOptionalFlags, scTmplParams?: types.SCParams): Promise<AppInfo>
    • 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>

waitForConfirmation: ((txId: string) => Promise<types.TxnReceipt>)

Type declaration

    • (txId: string): Promise<types.TxnReceipt>
    • Queries blockchain for a given transaction and waits until it will be processed.

      Parameters

      • txId: string

      Returns Promise<types.TxnReceipt>

Generated using TypeDoc