/// import { types as rtypes } from "@algorand-builder/runtime"; import type { LogicSig, LogicSigArgs } from "algosdk"; import * as algosdk from "algosdk"; import { txWriter } from "../internal/tx-log-writer"; import { AlgoOperator } from "../lib/algo-operator"; import type { AlgobDeployer, AlgobRuntimeEnv, ASAInfo, ASCCache, CheckpointRepo, FundASCFlags, LsigInfo, SCParams, SSCInfo } from "../types"; import { DeployerConfig } from "./deployer_cfg"; declare class DeployerBasicMode { protected readonly runtimeEnv: AlgobRuntimeEnv; protected readonly cpData: CheckpointRepo; protected readonly loadedAsaDefs: rtypes.ASADefs; protected readonly algoOp: AlgoOperator; protected readonly txWriter: txWriter; readonly accounts: rtypes.Account[]; readonly accountsByName: rtypes.AccountMap; constructor(deployerCfg: DeployerConfig); protected get networkName(): string; getCheckpointKV(key: string): string | undefined; isDefined(name: string): boolean; get asa(): Map; get algodClient(): algosdk.Algodv2; waitForConfirmation(txId: string): Promise; log(msg: string, obj: any): void; /** * Description: loads stateful smart contract info from checkpoint * @param nameApproval Approval program name * @param nameClear clear program name */ getSSC(nameApproval: string, nameClear: string): SSCInfo | undefined; /** * Description: loads a delegated logic signature from checkpoint */ getDelegatedLsig(lsigName: string): LogicSig | undefined; /** * Description : loads logic signature for contract mode * @param name ASC name * @param scParams: Smart contract parameters used for calling smart contract * @param scTmplParams: Smart contract template parameters (used only when compiling PyTEAL to TEAL) * @returns {LogicSig} loaded logic signature from assets/.teal */ loadLogic(name: string, scParams: LogicSigArgs, scTmplParams?: SCParams): Promise; /** * Description : loads multisigned logic signature from .lsig or .blsig file * @param {string} name filename * @param {LogicSigArgs} scParams parameters * @returns {LogicSig} multi signed logic signature from assets/.(b)lsig */ loadMultiSig(name: string, scParams: LogicSigArgs): Promise; /** * Description: Returns ASCCache (with compiled code) * @param name: Smart Contract filename (must be present in assets folder) * @param force: if force is true file will be compiled for sure, even if it's checkpoint exist * @param scTmplParams: scTmplParams: Smart contract template parameters * (used only when compiling PyTEAL to TEAL) */ ensureCompiled(name: string, force?: boolean, scTmplParams?: SCParams): Promise; } export declare class DeployerDeployMode extends DeployerBasicMode implements AlgobDeployer { get isDeployMode(): boolean; addCheckpointKV(key: string, value: string): void; private assertNoAsset; private _getASAInfo; private _getAccount; deployASA(name: string, flags: rtypes.ASADeploymentFlags): Promise; /** * Description - This function will send Algos to ASC account in "Contract Mode" * @param name - ASC filename * @param flags - Deployments flags (as per SPEC) * @param payFlags - as per SPEC * @param scParams: Smart contract parameters (used while calling smart contract) * @param scTmplParams: Smart contract template parameters (used only when compiling PyTEAL to TEAL) */ fundLsig(name: string, flags: FundASCFlags, payFlags: rtypes.TxParams, scParams: LogicSigArgs, scTmplParams?: SCParams): Promise; /** * Description - This function will create and sign a logic signature for "delegated approval". * https://developer.algorand.org/docs/features/asc1/stateless/sdks/#account-delegation-sdk-usage * @param name: Stateless Smart Contract filename (must be present in assets folder) * @param signer: Signer Account which will sign the smart contract * @param scParams: Smart contract Parameters(Used while calling smart contract) * @param scTmplParams: scTmplParams: Smart contract template parameters * (used only when compiling PyTEAL to TEAL) */ mkDelegatedLsig(name: string, signer: rtypes.Account, scParams: LogicSigArgs, scTmplParams?: SCParams): Promise; /** * Description: function to deploy stateful smart contracts * @param approvalProgram filename which has approval program * @param clearProgram filename which has clear program * @param flags SSCDeploymentFlags * @param payFlags Transaction Params * @param scTmplParams: scTmplParams: Smart contract template parameters * (used only when compiling PyTEAL to TEAL) */ deploySSC(approvalProgram: string, clearProgram: string, flags: rtypes.SSCDeploymentFlags, payFlags: rtypes.TxParams, scTmplParams?: SCParams): Promise; /** * Description: Opt-In to ASA for a single account. The opt-in transaction is * signed by account secret key * @param asaName ASA name * @param accountName * @param flags Transaction flags */ optInAcountToASA(asaName: string, accountName: string, flags: rtypes.TxParams): Promise; /** * Description: Opt-In to ASA for a contract account (represented by logic signture). * The opt-in transaction is signed by the logic signature * @param asaName ASA name * @param lsig logic signature * @param flags Transaction flags */ optInLsigToASA(asaName: string, lsig: LogicSig, flags: rtypes.TxParams): Promise; /** * Description: Opt-In to stateful smart contract (SSC) for a single account * @param sender sender account * @param appID application index * @param payFlags Transaction flags * @param flags Optional parameters to SSC (accounts, args..) */ optInToSSC(sender: rtypes.Account, appId: number, payFlags: rtypes.TxParams, flags: rtypes.SSCOptionalFlags): Promise; } export declare class DeployerRunMode extends DeployerBasicMode implements AlgobDeployer { get isDeployMode(): boolean; addCheckpointKV(_key: string, _value: string): void; deployASA(_name: string, _flags: rtypes.ASADeploymentFlags): Promise; fundLsig(_name: string, _flags: FundASCFlags, _payFlags: rtypes.TxParams, _scParams: LogicSigArgs, _scInitParams?: unknown): Promise; mkDelegatedLsig(_name: string, _signer: rtypes.Account, _scParams: LogicSigArgs, _scInitParams?: unknown): Promise; deploySSC(approvalProgram: string, clearProgram: string, flags: rtypes.SSCDeploymentFlags, payFlags: rtypes.TxParams, scInitParam?: unknown): Promise; optInAcountToASA(_asaName: string, _accountName: string, _flags: rtypes.TxParams): Promise; optInLsigToASA(_asaName: string, _lsig: LogicSig, _flags: rtypes.TxParams): Promise; optInToSSC(sender: rtypes.Account, index: number, payFlags: rtypes.TxParams): Promise; } export {};