@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_rolldown/runtime.js +33 -0
- package/_virtual/_rolldown/runtime.mjs +13 -0
- package/account/account.d.ts +25 -30
- package/account/account.js +151 -146
- package/account/account.js.map +1 -1
- package/account/account.mjs +149 -144
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +7 -2
- package/account/get-account-config-from-environment.js +19 -21
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs +19 -19
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +14 -12
- package/account/get-account.js +56 -59
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +56 -57
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +9 -5
- package/account/get-dispenser-account.js +20 -18
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +20 -16
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.d.ts +7 -3
- package/account/mnemonic-account.js +17 -17
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +15 -15
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +40 -35
- package/amount.js +33 -34
- package/amount.js.map +1 -1
- package/amount.mjs +33 -32
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +10 -6
- package/app-client.js +91 -86
- package/app-client.js.map +1 -1
- package/app-client.mjs +91 -84
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +26 -24
- package/app-deploy.js +235 -253
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +233 -251
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +45 -46
- package/app.js +253 -271
- package/app.js.map +1 -1
- package/app.mjs +249 -267
- package/app.mjs.map +1 -1
- package/asset.d.ts +16 -12
- package/asset.js +116 -122
- package/asset.js.map +1 -1
- package/asset.mjs +116 -120
- package/asset.mjs.map +1 -1
- package/config.d.ts +7 -2
- package/config.js +5 -7
- package/config.js.map +1 -1
- package/config.mjs +5 -4
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +5 -1
- package/debugging/debugging.js +11 -11
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +11 -9
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.d.ts +7 -2
- package/dispenser-client.js +23 -24
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +23 -22
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +27 -18
- package/index.js +140 -143
- package/index.mjs +27 -29
- package/indexer-lookup.d.ts +18 -11
- package/indexer-lookup.js +112 -120
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +105 -118
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +9 -7
- package/localnet/get-kmd-wallet-account.js +28 -26
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +28 -24
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +7 -5
- package/localnet/get-localnet-dispenser-account.js +17 -15
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +17 -13
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
- package/localnet/get-or-create-kmd-wallet-account.js +28 -26
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.d.ts +7 -3
- package/localnet/is-localnet.js +9 -10
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +9 -8
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +17 -15
- package/network-client.js +115 -116
- package/network-client.js.map +1 -1
- package/network-client.mjs +115 -114
- package/network-client.mjs.map +1 -1
- package/package.json +12 -3
- package/testing/account.d.ts +11 -9
- package/testing/account.js +31 -33
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +29 -31
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
- package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +9 -4
- package/testing/fixtures/algorand-fixture.js +67 -62
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +66 -59
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +7 -5
- package/testing/index.js +13 -18
- package/testing/index.mjs +7 -7
- package/testing/indexer.d.ts +5 -1
- package/testing/indexer.js +28 -37
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs +28 -35
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +41 -36
- package/testing/test-logger.js +71 -76
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +71 -74
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +30 -27
- package/testing/transaction-logger.js +77 -93
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs +74 -90
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +100 -111
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +97 -108
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
- package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +34 -35
- package/transaction/transaction.js +716 -914
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +713 -911
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +9 -5
- package/transfer/transfer-algos.js +26 -27
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +26 -25
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +11 -8
- package/transfer/transfer.js +94 -100
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +94 -98
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +432 -429
- package/types/account-manager.js +591 -602
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +587 -599
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +192 -202
- package/types/account.js +91 -88
- package/types/account.js.map +1 -1
- package/types/account.mjs +88 -86
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +15 -10
- package/types/algo-http-client-with-retry.js +70 -92
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +69 -90
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +778 -771
- package/types/algorand-client-transaction-creator.js +733 -732
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +732 -730
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +1090 -1360
- package/types/algorand-client-transaction-sender.js +930 -961
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +927 -959
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +239 -236
- package/types/algorand-client.js +322 -320
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +321 -318
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +47 -43
- package/types/amount.js +66 -70
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +63 -68
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +235 -272
- package/types/app-arc56.js +124 -170
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs +121 -168
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +1128 -2009
- package/types/app-client.js +1633 -1791
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1624 -1783
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +139 -141
- package/types/app-deployer.js +344 -384
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +341 -382
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +762 -932
- package/types/app-factory.js +496 -488
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +491 -484
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +304 -310
- package/types/app-manager.js +422 -475
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +419 -473
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +118 -117
- package/types/app-spec.js +125 -135
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +121 -132
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +229 -241
- package/types/app.js +36 -28
- package/types/app.js.map +1 -1
- package/types/app.mjs +33 -26
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +204 -199
- package/types/asset-manager.js +165 -174
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +164 -172
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +95 -91
- package/types/asset.js +0 -3
- package/types/asset.mjs +0 -2
- package/types/async-event-emitter.d.ts +18 -13
- package/types/async-event-emitter.js +37 -49
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +36 -47
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +453 -451
- package/types/client-manager.js +602 -598
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +597 -594
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1211 -1258
- package/types/composer.js +1436 -1498
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +1430 -1493
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +53 -48
- package/types/config.js +78 -77
- package/types/config.js.map +1 -1
- package/types/config.mjs +77 -75
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +25 -23
- package/types/debugging.js +9 -11
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +8 -9
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +57 -52
- package/types/dispenser-client.js +120 -141
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +119 -139
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +5 -3
- package/types/expand.js +0 -3
- package/types/expand.mjs +0 -2
- package/types/indexer.d.ts +104 -100
- package/types/indexer.js +36 -31
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +32 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +5 -3
- package/types/instance-of.js +0 -3
- package/types/instance-of.mjs +0 -2
- package/types/kmd-account-manager.d.ts +75 -70
- package/types/kmd-account-manager.js +150 -184
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +147 -182
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +13 -8
- package/types/lifecycle-events.js +10 -7
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +9 -7
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +15 -11
- package/types/logging.js +30 -31
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +29 -29
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +33 -29
- package/types/logic-error.js +50 -49
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +49 -47
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +32 -27
- package/types/network-client.js +10 -9
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -7
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +131 -132
- package/types/testing.js +0 -3
- package/types/testing.mjs +0 -2
- package/types/transaction.d.ts +110 -110
- package/types/transaction.js +0 -3
- package/types/transaction.mjs +0 -2
- package/types/transfer.d.ts +70 -66
- package/types/transfer.js +0 -3
- package/types/transfer.mjs +0 -2
- package/util.js +73 -118
- package/util.js.map +1 -1
- package/util.mjs +73 -116
- package/util.mjs.map +1 -1
- package/account/index.d.ts +0 -5
- package/debugging/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/localnet/index.d.ts +0 -4
- package/testing/_asset.d.ts +0 -3
- package/testing/fixtures/index.d.ts +0 -2
- package/testing/index.js.map +0 -1
- package/testing/index.mjs.map +0 -1
- package/transaction/index.d.ts +0 -2
- package/transaction/legacy-bridge.d.ts +0 -35
- package/transfer/index.d.ts +0 -2
- package/types/asset.js.map +0 -1
- package/types/asset.mjs.map +0 -1
- package/types/expand.js.map +0 -1
- package/types/expand.mjs.map +0 -1
- package/types/instance-of.js.map +0 -1
- package/types/instance-of.mjs.map +0 -1
- package/types/testing.js.map +0 -1
- package/types/testing.mjs.map +0 -1
- package/types/transaction.js.map +0 -1
- package/types/transaction.mjs.map +0 -1
- package/types/transfer.js.map +0 -1
- package/types/transfer.mjs.map +0 -1
- package/util.d.ts +0 -48
package/app-deploy.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-deploy.mjs","sources":["../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB,EAAA;AAejB,IAAA,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC;AACxC,IAAA,MAAM,QAAQ,GAAG,MACf,IAAI,mBAAmB,CAAC;QACtB,KAAK;QACL,SAAS,EAAE,MAAM,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;QAC5D,kBAAkB,EAAE,YAClB,UAAU,CAAC,iBAAiB,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,EAAE,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;QAC9G,UAAU;AACX,KAAA,CAAC;IACJ,MAAM,QAAQ,GAAG,IAAI,WAAW,CAC9B,UAAU,EACV,IAAI,+BAA+B,CAAC,QAAQ,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC,EAC5F,OAAO,CACR;AAED,IAAA,MAAM,YAAY,GAAG;QACnB,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;AAC/C,QAAA,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC;AACzC,QAAA,iBAAiB,EAAE,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAChI,QAAA,aAAa,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC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AA,QAAQ,EAAE,oBAAoB;AAC9B,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,MAAM,EAAE,GAAG;KACZ;AACH;AAEA;;;;;;;;;;;;;;AAcG;AACa,SAAA,8BAA8B,CAAC,QAAgB,EAAE,MAAoD,EAAA;IACnH,OAAO,UAAU,CAAC,0CAA0C,CAAC,QAAQ,EAAE,MAAM,CAAC;AAChF;AAEA;;;;;;;;;;AAUG;AACa,SAAA,2BAA2B,CAAC,QAAgB,EAAE,cAAmC,EAAA;IAC/F,OAAO,UAAU,CAAC,yBAAyB,CAAC,QAAQ,EAAE,cAAc,CAAC;AACvE;AAEA;;;;;;;;;;;;AAYG;AACI,eAAe,qCAAqC,CACzD,QAAgB,EAChB,KAAc,EACd,cAAmC,EACnC,kBAAsC,EAAA;AAEtC,IAAA,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC;AAEtC,IAAA,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,cAAc,CAAC;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC;;AAGzE,IAAA,OAAO,MAAM,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAO,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC;AAC/C;;;;"}
|
|
1
|
+
{"version":3,"file":"app-deploy.mjs","names":[],"sources":["../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/src/content/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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,gBACA,oBACuB;CACvB,WAAW,kBAAkB,QAAQ;CAErC,WAAW,4BAA4B,UAAU,cAAc;CAE/D,IAAI,oBACF,WAAW,+BAA+B,UAAU,kBAAkB;CAGxE,OAAO,MAAM,YAAY,UAAU,KAAK;AAC1C;;;;;;;;;AAUA,SAAgB,kBAAkB,UAAkB;CAClD,OAAO,WAAW,kBAAkB,QAAQ;AAC9C"}
|
package/app.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import ABIValue = algosdk.ABIValue;
|
|
7
|
-
import Algodv2 = algosdk.Algodv2;
|
|
8
|
-
import modelsv2 = algosdk.modelsv2;
|
|
9
|
-
import OnApplicationComplete = algosdk.OnApplicationComplete;
|
|
1
|
+
import { ABIAppCallArgs, ABIReturn, AppCallArgs, AppCallParams, AppCallTransactionResult, AppCallType, AppCompilationResult, AppReference, AppState, BoxIdentifier, BoxName, BoxReference, BoxValueRequestParams, BoxValuesRequestParams, CompiledTeal, CreateAppParams, RawAppCallArgs, UpdateAppParams } from "./types/app.js";
|
|
2
|
+
import { SendTransactionFrom } from "./types/transaction.js";
|
|
3
|
+
import algosdk from "algosdk";
|
|
4
|
+
|
|
5
|
+
//#region src/app.d.ts
|
|
10
6
|
/**
|
|
11
7
|
* @deprecated Use `algorand.send.appCreate()` / `algorand.createTransaction.appCreate()` / `algorand.send.appCreateMethodCall()`
|
|
12
8
|
* / `algorand.createTransaction.appCreateMethodCall()` instead
|
|
@@ -16,7 +12,7 @@ import OnApplicationComplete = algosdk.OnApplicationComplete;
|
|
|
16
12
|
* @param algod An algod client
|
|
17
13
|
* @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
|
|
18
14
|
*/
|
|
19
|
-
|
|
15
|
+
declare function createApp(create: CreateAppParams, algod: Algodv2): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference>;
|
|
20
16
|
/**
|
|
21
17
|
* @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`
|
|
22
18
|
* / `algorand.createTransaction.appUpdateMethodCall()` instead
|
|
@@ -26,7 +22,7 @@ export declare function createApp(create: CreateAppParams, algod: Algodv2): Prom
|
|
|
26
22
|
* @param algod An algod client
|
|
27
23
|
* @returns The transaction send result and the compilation result
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
declare function updateApp(update: UpdateAppParams, algod: Algodv2): Promise<Partial<AppCompilationResult> & AppCallTransactionResult>;
|
|
30
26
|
/**
|
|
31
27
|
* @deprecated Use `algosdk.OnApplicationComplete` directly instead.
|
|
32
28
|
*
|
|
@@ -39,7 +35,7 @@ export declare function updateApp(update: UpdateAppParams, algod: Algodv2): Prom
|
|
|
39
35
|
* @param onCompletionAction The on completion action
|
|
40
36
|
* @returns The `algosdk.OnApplicationComplete`
|
|
41
37
|
*/
|
|
42
|
-
|
|
38
|
+
declare function getAppOnCompleteAction(onCompletionAction?: AppCallType | OnApplicationComplete): algosdk.OnApplicationComplete;
|
|
43
39
|
/**
|
|
44
40
|
* @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`
|
|
45
41
|
* / `algorand.createTransaction.appUpdateMethodCall()` instead
|
|
@@ -49,7 +45,7 @@ export declare function getAppOnCompleteAction(onCompletionAction?: AppCallType
|
|
|
49
45
|
* @param algod An algod client
|
|
50
46
|
* @returns The result of the call
|
|
51
47
|
*/
|
|
52
|
-
|
|
48
|
+
declare function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult>;
|
|
53
49
|
/**
|
|
54
50
|
* @deprecated Use `AppManager.getABIReturn` instead.
|
|
55
51
|
*
|
|
@@ -58,7 +54,7 @@ export declare function callApp(call: AppCallParams, algod: Algodv2): Promise<Ap
|
|
|
58
54
|
* @param confirmation The transaction confirmation from algod
|
|
59
55
|
* @returns The return value for the method call
|
|
60
56
|
*/
|
|
61
|
-
|
|
57
|
+
declare function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.PendingTransactionResponse): ABIReturn | undefined;
|
|
62
58
|
/**
|
|
63
59
|
* @deprecated Use `algorand.app.getGlobalState` instead.
|
|
64
60
|
*
|
|
@@ -67,7 +63,7 @@ export declare function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2
|
|
|
67
63
|
* @param algod An algod client instance
|
|
68
64
|
* @returns The current global state
|
|
69
65
|
*/
|
|
70
|
-
|
|
66
|
+
declare function getAppGlobalState(appId: number | bigint, algod: Algodv2): Promise<AppState>;
|
|
71
67
|
/**
|
|
72
68
|
* @deprecated Use `algorand.app.getLocalState` instead.
|
|
73
69
|
*
|
|
@@ -77,7 +73,7 @@ export declare function getAppGlobalState(appId: number | bigint, algod: Algodv2
|
|
|
77
73
|
* @param algod An algod client instance
|
|
78
74
|
* @returns The current local state for the given (app, account) combination
|
|
79
75
|
*/
|
|
80
|
-
|
|
76
|
+
declare function getAppLocalState(appId: number | bigint, account: string | SendTransactionFrom, algod: Algodv2): Promise<AppState>;
|
|
81
77
|
/**
|
|
82
78
|
* @deprecated Use `algorand.app.getBoxNames` instead.
|
|
83
79
|
* Returns the names of the boxes for the given app.
|
|
@@ -85,7 +81,7 @@ export declare function getAppLocalState(appId: number | bigint, account: string
|
|
|
85
81
|
* @param algod An algod client instance
|
|
86
82
|
* @returns The current box names
|
|
87
83
|
*/
|
|
88
|
-
|
|
84
|
+
declare function getAppBoxNames(appId: number | bigint, algod: Algodv2): Promise<BoxName[]>;
|
|
89
85
|
/**
|
|
90
86
|
* @deprecated Use `algorand.app.getBoxValue` instead.
|
|
91
87
|
* Returns the value of the given box name for the given app.
|
|
@@ -94,7 +90,7 @@ export declare function getAppBoxNames(appId: number | bigint, algod: Algodv2):
|
|
|
94
90
|
* @param algod An algod client instance
|
|
95
91
|
* @returns The current box value as a byte array
|
|
96
92
|
*/
|
|
97
|
-
|
|
93
|
+
declare function getAppBoxValue(appId: number | bigint, boxName: string | Uint8Array | BoxName, algod: Algodv2): Promise<Uint8Array>;
|
|
98
94
|
/**
|
|
99
95
|
* @deprecated Use `algorand.app.getBoxValues` instead.
|
|
100
96
|
* Returns the value of the given box names for the given app.
|
|
@@ -103,7 +99,7 @@ export declare function getAppBoxValue(appId: number | bigint, boxName: string |
|
|
|
103
99
|
* @param algod An algod client instance
|
|
104
100
|
* @returns The current box values as a byte array in the same order as the passed in box names
|
|
105
101
|
*/
|
|
106
|
-
|
|
102
|
+
declare function getAppBoxValues(appId: number, boxNames: (string | Uint8Array | BoxName)[], algod: Algodv2): Promise<Uint8Array[]>;
|
|
107
103
|
/**
|
|
108
104
|
* @deprecated Use `algorand.app.getBoxValueFromABIType` instead.
|
|
109
105
|
* Returns the value of the given box name for the given app decoded based on the given ABI type.
|
|
@@ -111,7 +107,7 @@ export declare function getAppBoxValues(appId: number, boxNames: (string | Uint8
|
|
|
111
107
|
* @param algod An algod client instance
|
|
112
108
|
* @returns The current box value as an ABI value
|
|
113
109
|
*/
|
|
114
|
-
|
|
110
|
+
declare function getAppBoxValueFromABIType(request: BoxValueRequestParams, algod: Algodv2): Promise<ABIValue>;
|
|
115
111
|
/**
|
|
116
112
|
* @deprecated Use `algorand.app.getBoxValuesFromABIType` instead.
|
|
117
113
|
* Returns the value of the given box names for the given app decoded based on the given ABI type.
|
|
@@ -119,7 +115,7 @@ export declare function getAppBoxValueFromABIType(request: BoxValueRequestParams
|
|
|
119
115
|
* @param algod An algod client instance
|
|
120
116
|
* @returns The current box values as an ABI value in the same order as the passed in box names
|
|
121
117
|
*/
|
|
122
|
-
|
|
118
|
+
declare function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]>;
|
|
123
119
|
/**
|
|
124
120
|
* @deprecated Use `AppManager.decodeAppState` instead.
|
|
125
121
|
*
|
|
@@ -128,9 +124,9 @@ export declare function getAppBoxValuesFromABIType(request: BoxValuesRequestPara
|
|
|
128
124
|
* @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`
|
|
129
125
|
* @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values
|
|
130
126
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
declare function decodeAppState(state: {
|
|
128
|
+
key: string;
|
|
129
|
+
value: modelsv2.TealValue | modelsv2.EvalDelta;
|
|
134
130
|
}[]): AppState;
|
|
135
131
|
/**
|
|
136
132
|
* @deprecated Use `TransactionComposer` methods to construct transactions instead.
|
|
@@ -139,13 +135,13 @@ export declare function decodeAppState(state: {
|
|
|
139
135
|
* @param args The app call args
|
|
140
136
|
* @returns The args ready to load into a `Transaction`
|
|
141
137
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
declare function getAppArgsForTransaction(args?: RawAppCallArgs): {
|
|
139
|
+
accounts: string[] | undefined;
|
|
140
|
+
appArgs: Uint8Array<ArrayBufferLike>[] | undefined;
|
|
141
|
+
boxes: algosdk.BoxReference[] | undefined;
|
|
142
|
+
foreignApps: number[] | undefined;
|
|
143
|
+
foreignAssets: number[] | undefined;
|
|
144
|
+
lease: Uint8Array<ArrayBufferLike> | undefined;
|
|
149
145
|
} | undefined;
|
|
150
146
|
/**
|
|
151
147
|
* @deprecated Use `TransactionComposer` methods to construct transactions instead.
|
|
@@ -155,17 +151,17 @@ export declare function getAppArgsForTransaction(args?: RawAppCallArgs): {
|
|
|
155
151
|
* @param from The transaction signer
|
|
156
152
|
* @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer
|
|
157
153
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
154
|
+
declare function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom): Promise<{
|
|
155
|
+
method: algosdk.ABIMethod;
|
|
156
|
+
sender: string;
|
|
157
|
+
signer: algosdk.TransactionSigner;
|
|
158
|
+
boxes: algosdk.BoxReference[] | undefined;
|
|
159
|
+
lease: Uint8Array<ArrayBufferLike> | undefined;
|
|
160
|
+
appForeignApps: number[] | undefined;
|
|
161
|
+
appForeignAssets: number[] | undefined;
|
|
162
|
+
appAccounts: string[] | undefined;
|
|
163
|
+
methodArgs: (string | number | bigint | boolean | algosdk.TransactionWithSigner | Uint8Array<ArrayBufferLike> | algosdk.ABIValue[] | algosdk.Address)[];
|
|
164
|
+
rekeyTo: string | undefined;
|
|
169
165
|
}>;
|
|
170
166
|
/**
|
|
171
167
|
* @deprecated Use `AppManager.getBoxReference()` instead.
|
|
@@ -174,7 +170,7 @@ export declare function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTra
|
|
|
174
170
|
* @param box The box to return a reference for
|
|
175
171
|
* @returns The box reference ready to pass into a `Transaction`
|
|
176
172
|
*/
|
|
177
|
-
|
|
173
|
+
declare function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference;
|
|
178
174
|
/**
|
|
179
175
|
* @deprecated Use `algorand.app.getById` instead.
|
|
180
176
|
*
|
|
@@ -184,7 +180,7 @@ export declare function getBoxReference(box: BoxIdentifier | BoxReference | algo
|
|
|
184
180
|
* @param algod An algod client
|
|
185
181
|
* @returns The data about the app
|
|
186
182
|
*/
|
|
187
|
-
|
|
183
|
+
declare function getAppById(appId: number | bigint, algod: Algodv2): Promise<algosdk.modelsv2.Application>;
|
|
188
184
|
/**
|
|
189
185
|
* @deprecated Use `algorand.app.compileTeal` instead.
|
|
190
186
|
*
|
|
@@ -194,7 +190,7 @@ export declare function getAppById(appId: number | bigint, algod: Algodv2): Prom
|
|
|
194
190
|
* @param tealCode The TEAL code
|
|
195
191
|
* @returns The information about the compiled file
|
|
196
192
|
*/
|
|
197
|
-
|
|
193
|
+
declare function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal>;
|
|
198
194
|
/**
|
|
199
195
|
* @deprecated Use `abiMethod.getSignature()` or `new ABIMethod(abiMethodParams).getSignature()` instead.
|
|
200
196
|
*
|
|
@@ -202,4 +198,7 @@ export declare function compileTeal(tealCode: string, algod: Algodv2): Promise<C
|
|
|
202
198
|
* @param method The method to return a signature for
|
|
203
199
|
* @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`
|
|
204
200
|
*/
|
|
205
|
-
|
|
201
|
+
declare const getABIMethodSignature: (method: ABIMethodParams | ABIMethod) => string;
|
|
202
|
+
//#endregion
|
|
203
|
+
export { callApp, compileTeal, createApp, decodeAppState, getABIMethodSignature, getABIReturn, getAppArgsForABICall, getAppArgsForTransaction, getAppBoxNames, getAppBoxValue, getAppBoxValueFromABIType, getAppBoxValues, getAppBoxValuesFromABIType, getAppById, getAppGlobalState, getAppLocalState, getAppOnCompleteAction, getBoxReference, updateApp };
|
|
204
|
+
//# sourceMappingURL=app.d.ts.map
|