@algorandfoundation/algokit-utils 10.0.0-alpha.2 → 10.0.0-alpha.21
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 +10 -15
- package/algo25/index.d.ts +2 -0
- package/algo25/index.js +9 -0
- package/algo25/index.mjs +3 -0
- package/algod-client/index.d.ts +3 -7
- package/algod-client/index.js +2 -5
- package/algod-client/index.mjs +2 -2
- package/index.d.ts +1 -2
- package/index.js +0 -7
- package/index.mjs +1 -2
- package/indexer-client/index.d.ts +2 -2
- package/indexer-client/index.js +6 -6
- package/indexer-client/index.mjs +2 -2
- package/{indexer-lookup.d.ts → indexer-client/indexer-lookup.d.ts} +8 -11
- package/{indexer-lookup.mjs → indexer-client/indexer-lookup.js} +6 -10
- package/indexer-client/indexer-lookup.js.map +1 -0
- package/{indexer-lookup.js → indexer-client/indexer-lookup.mjs} +3 -18
- package/indexer-client/indexer-lookup.mjs.map +1 -0
- package/kmd-client/index.d.ts +1 -2
- package/kmd-client/index.js +0 -5
- package/kmd-client/index.mjs +1 -2
- package/package.json +1 -6
- package/packages/abi/src/abi-method.d.ts +1 -1
- package/packages/abi/src/abi-method.js +1 -1
- package/packages/abi/src/abi-method.js.map +1 -1
- package/packages/abi/src/abi-method.mjs +1 -1
- package/packages/abi/src/abi-method.mjs.map +1 -1
- package/packages/abi/src/abi-type.d.ts +1 -1
- package/packages/abi/src/abi-type.js +4 -2
- package/packages/abi/src/abi-type.js.map +1 -1
- package/packages/abi/src/abi-type.mjs +4 -2
- package/packages/abi/src/abi-type.mjs.map +1 -1
- package/packages/abi/src/arc56-contract.js +1 -0
- package/packages/abi/src/arc56-contract.js.map +1 -1
- package/packages/abi/src/arc56-contract.mjs +1 -0
- package/packages/abi/src/arc56-contract.mjs.map +1 -1
- package/packages/algo25/src/index.d.ts +40 -0
- package/packages/algo25/src/index.js +45 -1
- package/packages/algo25/src/index.js.map +1 -1
- package/packages/algo25/src/index.mjs +40 -2
- package/packages/algo25/src/index.mjs.map +1 -1
- package/packages/algod_client/src/apis/api-service.d.ts +44 -44
- package/packages/algod_client/src/apis/api-service.js +155 -155
- package/packages/algod_client/src/apis/api-service.js.map +1 -1
- package/packages/algod_client/src/apis/api-service.mjs +155 -155
- package/packages/algod_client/src/apis/api-service.mjs.map +1 -1
- package/packages/algod_client/src/core/api-error.js +3 -1
- package/packages/algod_client/src/core/api-error.js.map +1 -1
- package/packages/algod_client/src/core/api-error.mjs +3 -1
- package/packages/algod_client/src/core/api-error.mjs.map +1 -1
- package/packages/algod_client/src/core/model-runtime.js +6 -6
- package/packages/algod_client/src/core/model-runtime.js.map +1 -1
- package/packages/algod_client/src/core/model-runtime.mjs +8 -8
- package/packages/algod_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/algod_client/src/models/account-participation.js +4 -4
- package/packages/algod_client/src/models/account-participation.js.map +1 -1
- package/packages/algod_client/src/models/account-participation.mjs +4 -4
- package/packages/algod_client/src/models/account-participation.mjs.map +1 -1
- package/packages/algod_client/src/models/application-state-schema.d.ts +2 -2
- package/packages/algod_client/src/models/application-state-schema.js +2 -2
- package/packages/algod_client/src/models/application-state-schema.js.map +1 -1
- package/packages/algod_client/src/models/application-state-schema.mjs +2 -2
- package/packages/algod_client/src/models/application-state-schema.mjs.map +1 -1
- package/packages/algod_client/src/models/asset-params.js +2 -1
- package/packages/algod_client/src/models/asset-params.js.map +1 -1
- package/packages/algod_client/src/models/asset-params.mjs +2 -1
- package/packages/algod_client/src/models/asset-params.mjs.map +1 -1
- package/packages/algod_client/src/models/block-response.js +1 -2
- package/packages/algod_client/src/models/block-response.js.map +1 -1
- package/packages/algod_client/src/models/block-response.mjs +2 -3
- package/packages/algod_client/src/models/block-response.mjs.map +1 -1
- package/packages/algod_client/src/models/block.d.ts +60 -40
- package/packages/algod_client/src/models/block.js +184 -108
- package/packages/algod_client/src/models/block.js.map +1 -1
- package/packages/algod_client/src/models/block.mjs +184 -108
- package/packages/algod_client/src/models/block.mjs.map +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.js +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.js.map +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.mjs +2 -2
- package/packages/algod_client/src/models/ledger-state-delta.mjs.map +1 -1
- package/packages/algod_client/src/models/simulate-request.js +1 -1
- package/packages/algod_client/src/models/simulate-request.mjs +1 -1
- package/packages/algod_client/src/models/simulate-response.d.ts +2 -1
- package/packages/algod_client/src/models/simulate-response.js +6 -1
- package/packages/algod_client/src/models/simulate-response.js.map +1 -1
- package/packages/algod_client/src/models/simulate-response.mjs +6 -2
- package/packages/algod_client/src/models/simulate-response.mjs.map +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js +4 -6
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js.map +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs.map +1 -1
- package/packages/algod_client/src/models/transaction-parameters-response.js +2 -2
- package/packages/algod_client/src/models/transaction-parameters-response.js.map +1 -1
- package/packages/algod_client/src/models/transaction-parameters-response.mjs +2 -2
- package/packages/algod_client/src/models/transaction-parameters-response.mjs.map +1 -1
- package/packages/common/src/address.js +0 -14
- package/packages/common/src/address.js.map +1 -1
- package/packages/common/src/address.mjs +1 -14
- package/packages/common/src/address.mjs.map +1 -1
- package/packages/common/src/codecs/composite/map.js +7 -4
- package/packages/common/src/codecs/composite/map.js.map +1 -1
- package/packages/common/src/codecs/composite/map.mjs +7 -4
- package/packages/common/src/codecs/composite/map.mjs.map +1 -1
- package/packages/common/src/codecs/composite/record.js +0 -1
- package/packages/common/src/codecs/composite/record.js.map +1 -1
- package/packages/common/src/codecs/primitives/address.js +0 -1
- package/packages/common/src/codecs/primitives/address.js.map +1 -1
- package/packages/common/src/codecs/primitives/bytes.js +0 -1
- package/packages/common/src/codecs/primitives/bytes.js.map +1 -1
- package/packages/common/src/codecs/primitives/fixed-bytes.js +0 -1
- package/packages/common/src/codecs/primitives/fixed-bytes.js.map +1 -1
- package/packages/common/src/codecs/wire.js +0 -1
- package/packages/common/src/codecs/wire.js.map +1 -1
- package/packages/common/src/json.mjs +2 -2
- package/packages/common/src/json.mjs.map +1 -1
- package/packages/common/src/msgpack.js +0 -1
- package/packages/common/src/msgpack.js.map +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.d.ts +2 -2
- package/packages/{sdk/src/logic → common/src}/sourcemap.js +2 -2
- package/packages/{sdk/src/logic → common/src}/sourcemap.js.map +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.mjs +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.mjs.map +1 -1
- package/packages/indexer_client/src/apis/api-service.d.ts +1 -1
- package/packages/indexer_client/src/apis/api-service.js +12 -12
- package/packages/indexer_client/src/apis/api-service.js.map +1 -1
- package/packages/indexer_client/src/apis/api-service.mjs +12 -12
- package/packages/indexer_client/src/apis/api-service.mjs.map +1 -1
- package/packages/indexer_client/src/core/api-error.js +3 -1
- package/packages/indexer_client/src/core/api-error.js.map +1 -1
- package/packages/indexer_client/src/core/api-error.mjs +3 -1
- package/packages/indexer_client/src/core/api-error.mjs.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.js +0 -15
- package/packages/indexer_client/src/core/model-runtime.js.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.mjs +1 -13
- package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/indexer_client/src/models/account-participation.js +4 -4
- package/packages/indexer_client/src/models/account-participation.js.map +1 -1
- package/packages/indexer_client/src/models/account-participation.mjs +4 -4
- package/packages/indexer_client/src/models/account-participation.mjs.map +1 -1
- package/packages/indexer_client/src/models/application-state-schema.d.ts +2 -2
- package/packages/indexer_client/src/models/application-state-schema.js +2 -2
- package/packages/indexer_client/src/models/application-state-schema.js.map +1 -1
- package/packages/indexer_client/src/models/application-state-schema.mjs +2 -2
- package/packages/indexer_client/src/models/application-state-schema.mjs.map +1 -1
- package/packages/indexer_client/src/models/asset-params.js +2 -1
- package/packages/indexer_client/src/models/asset-params.js.map +1 -1
- package/packages/indexer_client/src/models/asset-params.mjs +2 -1
- package/packages/indexer_client/src/models/asset-params.mjs.map +1 -1
- package/packages/indexer_client/src/models/block.d.ts +5 -5
- package/packages/indexer_client/src/models/block.js +13 -13
- package/packages/indexer_client/src/models/block.js.map +1 -1
- package/packages/indexer_client/src/models/block.mjs +13 -13
- package/packages/indexer_client/src/models/block.mjs.map +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.d.ts +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.js +2 -2
- package/packages/indexer_client/src/models/eval-delta-key-value.js.map +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.mjs +2 -2
- package/packages/indexer_client/src/models/eval-delta-key-value.mjs.map +1 -1
- package/packages/indexer_client/src/models/eval-delta.d.ts +1 -1
- package/packages/indexer_client/src/models/eval-delta.js +2 -2
- package/packages/indexer_client/src/models/eval-delta.js.map +1 -1
- package/packages/indexer_client/src/models/eval-delta.mjs +2 -2
- package/packages/indexer_client/src/models/eval-delta.mjs.map +1 -1
- package/packages/indexer_client/src/models/hb-proof-fields.js +6 -6
- package/packages/indexer_client/src/models/hb-proof-fields.js.map +1 -1
- package/packages/indexer_client/src/models/hb-proof-fields.mjs +6 -6
- package/packages/indexer_client/src/models/hb-proof-fields.mjs.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.d.ts +2 -2
- package/packages/indexer_client/src/models/participation-updates.js +2 -2
- package/packages/indexer_client/src/models/participation-updates.js.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.mjs +2 -2
- package/packages/indexer_client/src/models/participation-updates.mjs.map +1 -1
- package/packages/indexer_client/src/models/state-proof-verifier.js +2 -2
- package/packages/indexer_client/src/models/state-proof-verifier.js.map +1 -1
- package/packages/indexer_client/src/models/state-proof-verifier.mjs +2 -2
- package/packages/indexer_client/src/models/state-proof-verifier.mjs.map +1 -1
- package/packages/indexer_client/src/models/state-schema.d.ts +2 -2
- package/packages/indexer_client/src/models/state-schema.js +2 -2
- package/packages/indexer_client/src/models/state-schema.js.map +1 -1
- package/packages/indexer_client/src/models/state-schema.mjs +2 -2
- package/packages/indexer_client/src/models/state-schema.mjs.map +1 -1
- package/packages/indexer_client/src/models/teal-key-value.d.ts +1 -1
- package/packages/indexer_client/src/models/teal-key-value.js +2 -2
- package/packages/indexer_client/src/models/teal-key-value.js.map +1 -1
- package/packages/indexer_client/src/models/teal-key-value.mjs +2 -2
- package/packages/indexer_client/src/models/teal-key-value.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.js +2 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.mjs +2 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-keyreg.js +4 -4
- package/packages/indexer_client/src/models/transaction-keyreg.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-keyreg.mjs +4 -4
- package/packages/indexer_client/src/models/transaction-keyreg.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.js +2 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs +2 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js +3 -3
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs +3 -3
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction.d.ts +2 -2
- package/packages/indexer_client/src/models/transaction.js +6 -5
- package/packages/indexer_client/src/models/transaction.js.map +1 -1
- package/packages/indexer_client/src/models/transaction.mjs +6 -5
- package/packages/indexer_client/src/models/transaction.mjs.map +1 -1
- package/packages/kmd_client/src/apis/api-service.d.ts +5 -5
- package/packages/kmd_client/src/apis/api-service.js +32 -32
- package/packages/kmd_client/src/apis/api-service.js.map +1 -1
- package/packages/kmd_client/src/apis/api-service.mjs +32 -32
- package/packages/kmd_client/src/apis/api-service.mjs.map +1 -1
- package/packages/kmd_client/src/core/api-error.js +3 -1
- package/packages/kmd_client/src/core/api-error.js.map +1 -1
- package/packages/kmd_client/src/core/api-error.mjs +3 -1
- package/packages/kmd_client/src/core/api-error.mjs.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.js +2 -12
- package/packages/kmd_client/src/core/model-runtime.js.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.mjs +3 -11
- package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/transact/src/logicsig.d.ts +3 -15
- package/packages/transact/src/logicsig.js +16 -36
- package/packages/transact/src/logicsig.js.map +1 -1
- package/packages/transact/src/logicsig.mjs +18 -36
- package/packages/transact/src/logicsig.mjs.map +1 -1
- package/packages/transact/src/multisig.d.ts +7 -115
- package/packages/transact/src/multisig.js +86 -136
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +87 -117
- package/packages/transact/src/multisig.mjs.map +1 -1
- package/packages/transact/src/transactions/app-call.d.ts +10 -15
- package/packages/transact/src/transactions/app-call.js.map +1 -1
- package/packages/transact/src/transactions/app-call.mjs.map +1 -1
- package/packages/transact/src/transactions/asset-config.d.ts +1 -6
- package/packages/transact/src/transactions/asset-config.js.map +1 -1
- package/packages/transact/src/transactions/asset-config.mjs.map +1 -1
- package/packages/transact/src/transactions/asset-freeze.d.ts +1 -6
- package/packages/transact/src/transactions/asset-transfer.d.ts +1 -6
- package/packages/transact/src/transactions/key-registration.d.ts +1 -8
- package/packages/transact/src/transactions/reference-types-meta.d.ts +26 -0
- package/packages/transact/src/transactions/reference-types-meta.js +71 -0
- package/packages/transact/src/transactions/reference-types-meta.js.map +1 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs +69 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs.map +1 -0
- package/packages/transact/src/transactions/signed-transaction-meta.js +2 -3
- package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction-meta.mjs +3 -3
- package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.d.ts +7 -3
- package/packages/transact/src/transactions/signed-transaction.js +1 -1
- package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.mjs +1 -2
- package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
- package/packages/transact/src/transactions/transaction-meta.js +29 -23
- package/packages/transact/src/transactions/transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/transaction-meta.mjs +29 -23
- package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/transaction.d.ts +5 -1
- package/packages/transact/src/transactions/transaction.js +1 -1
- package/packages/transact/src/transactions/transaction.js.map +1 -1
- package/packages/transact/src/transactions/transaction.mjs +1 -1
- package/packages/transact/src/transactions/transaction.mjs.map +1 -1
- package/testing/account.js +2 -5
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +2 -5
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +3 -3
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/transaction-logger.js +1 -1
- package/testing/transaction-logger.mjs +1 -1
- package/transact/index.d.ts +11 -10
- package/transact/index.js +7 -32
- package/transact/index.mjs +7 -10
- package/transaction/transaction.js +2 -2
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +2 -2
- package/transaction/transaction.mjs.map +1 -1
- package/transactions/app-call.d.ts +5 -4
- package/transactions/app-call.js +16 -16
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +16 -16
- package/transactions/app-call.mjs.map +1 -1
- package/transactions/asset-config.d.ts +1 -1
- package/transactions/asset-config.js +1 -1
- package/transactions/asset-config.js.map +1 -1
- package/transactions/asset-config.mjs +1 -1
- package/transactions/asset-config.mjs.map +1 -1
- package/transactions/key-registration.d.ts +1 -1
- package/transactions/key-registration.js.map +1 -1
- package/transactions/key-registration.mjs.map +1 -1
- package/transactions/method-call.d.ts +1 -1
- package/transactions/method-call.js +70 -78
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs +70 -78
- package/transactions/method-call.mjs.map +1 -1
- package/types/account-manager.d.ts +1 -1
- package/types/account-manager.js +5 -5
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +5 -5
- package/types/account-manager.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +74 -60
- package/types/algorand-client-transaction-creator.js +8 -0
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +8 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +79 -65
- package/types/algorand-client-transaction-sender.js +8 -1
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +8 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/amount.js +23 -4
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +20 -2
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +174 -169
- package/types/app-client.js +2 -3
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +2 -2
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +1 -1
- package/types/app-deployer.js +3 -3
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +3 -3
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +70 -67
- package/types/app-factory.js +2 -2
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +2 -2
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +3 -1
- package/types/app-manager.js +17 -11
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +17 -11
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.js +12 -5
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +12 -5
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +2 -2
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.js +1 -1
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +1 -1
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +3 -6
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +1 -1
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +9 -1
- package/types/composer.js +49 -37
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +40 -27
- package/types/composer.mjs.map +1 -1
- package/types/debugging.d.ts +13 -9
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs.map +1 -1
- package/types/expand.d.ts +2 -9
- package/types/kmd-account-manager.d.ts +1 -0
- package/types/kmd-account-manager.js +22 -11
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +23 -12
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +0 -1
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/testing.d.ts +2 -2
- package/types/transaction.d.ts +1 -1
- package/_virtual/rolldown_runtime.mjs +0 -13
- package/indexer-lookup.js.map +0 -1
- package/indexer-lookup.mjs.map +0 -1
- package/packages/algod_client/src/core/model-runtime.d.ts +0 -10
- package/packages/algod_client/src/models/application-local-reference.d.ts +0 -20
- package/packages/algod_client/src/models/application-local-reference.js +0 -23
- package/packages/algod_client/src/models/application-local-reference.js.map +0 -1
- package/packages/algod_client/src/models/application-local-reference.mjs +0 -23
- package/packages/algod_client/src/models/application-local-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.d.ts +0 -20
- package/packages/algod_client/src/models/asset-holding-reference.js +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.js.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.mjs +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/box-reference.d.ts +0 -17
- package/packages/algod_client/src/models/box-reference.js +0 -23
- package/packages/algod_client/src/models/box-reference.js.map +0 -1
- package/packages/algod_client/src/models/box-reference.mjs +0 -23
- package/packages/algod_client/src/models/box-reference.mjs.map +0 -1
- package/packages/indexer_client/src/core/model-runtime.d.ts +0 -10
- package/packages/kmd_client/src/core/model-runtime.d.ts +0 -10
- package/packages/sdk/src/convert.d.ts +0 -17
- package/packages/sdk/src/convert.js +0 -28
- package/packages/sdk/src/convert.js.map +0 -1
- package/packages/sdk/src/convert.mjs +0 -25
- package/packages/sdk/src/convert.mjs.map +0 -1
- package/packages/sdk/src/encoding/binarydata.d.ts +0 -34
- package/packages/sdk/src/encoding/binarydata.js +0 -65
- package/packages/sdk/src/encoding/binarydata.js.map +0 -1
- package/packages/sdk/src/encoding/binarydata.mjs +0 -60
- package/packages/sdk/src/encoding/binarydata.mjs.map +0 -1
- package/packages/sdk/src/encoding/encoding.d.ts +0 -237
- package/packages/sdk/src/encoding/encoding.js +0 -302
- package/packages/sdk/src/encoding/encoding.js.map +0 -1
- package/packages/sdk/src/encoding/encoding.mjs +0 -287
- package/packages/sdk/src/encoding/encoding.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/array.js +0 -35
- package/packages/sdk/src/encoding/schema/array.js.map +0 -1
- package/packages/sdk/src/encoding/schema/array.mjs +0 -35
- package/packages/sdk/src/encoding/schema/array.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/bytearray.js +0 -49
- package/packages/sdk/src/encoding/schema/bytearray.js.map +0 -1
- package/packages/sdk/src/encoding/schema/bytearray.mjs +0 -49
- package/packages/sdk/src/encoding/schema/bytearray.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/map.d.ts +0 -58
- package/packages/sdk/src/encoding/schema/map.js +0 -110
- package/packages/sdk/src/encoding/schema/map.js.map +0 -1
- package/packages/sdk/src/encoding/schema/map.mjs +0 -107
- package/packages/sdk/src/encoding/schema/map.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/optional.js +0 -46
- package/packages/sdk/src/encoding/schema/optional.js.map +0 -1
- package/packages/sdk/src/encoding/schema/optional.mjs +0 -46
- package/packages/sdk/src/encoding/schema/optional.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/uint64.js +0 -30
- package/packages/sdk/src/encoding/schema/uint64.js.map +0 -1
- package/packages/sdk/src/encoding/schema/uint64.mjs +0 -30
- package/packages/sdk/src/encoding/schema/uint64.mjs.map +0 -1
- package/packages/sdk/src/encoding/uint64.d.ts +0 -34
- package/packages/sdk/src/encoding/uint64.js +0 -34
- package/packages/sdk/src/encoding/uint64.js.map +0 -1
- package/packages/sdk/src/encoding/uint64.mjs +0 -33
- package/packages/sdk/src/encoding/uint64.mjs.map +0 -1
- package/packages/sdk/src/index.d.ts +0 -44
- package/packages/sdk/src/index.js +0 -62
- package/packages/sdk/src/index.js.map +0 -1
- package/packages/sdk/src/index.mjs +0 -58
- package/packages/sdk/src/index.mjs.map +0 -1
- package/packages/sdk/src/nacl/naclWrappers.js +0 -14
- package/packages/sdk/src/nacl/naclWrappers.js.map +0 -1
- package/packages/sdk/src/nacl/naclWrappers.mjs +0 -11
- package/packages/sdk/src/nacl/naclWrappers.mjs.map +0 -1
- package/packages/sdk/src/types/intDecoding.d.ts +0 -28
- package/packages/sdk/src/types/intDecoding.js +0 -32
- package/packages/sdk/src/types/intDecoding.js.map +0 -1
- package/packages/sdk/src/types/intDecoding.mjs +0 -31
- package/packages/sdk/src/types/intDecoding.mjs.map +0 -1
- package/packages/sdk/src/types/transactions/encoded.d.ts +0 -40
- package/packages/sdk/src/types/transactions/encoded.js +0 -64
- package/packages/sdk/src/types/transactions/encoded.js.map +0 -1
- package/packages/sdk/src/types/transactions/encoded.mjs +0 -59
- package/packages/sdk/src/types/transactions/encoded.mjs.map +0 -1
- package/packages/sdk/src/utils/utils.d.ts +0 -64
- package/packages/sdk/src/utils/utils.js +0 -140
- package/packages/sdk/src/utils/utils.js.map +0 -1
- package/packages/sdk/src/utils/utils.mjs +0 -128
- package/packages/sdk/src/utils/utils.mjs.map +0 -1
- package/packages/transact/src/transactions/common.d.ts +0 -37
- package/sdk/index.d.ts +0 -10
- package/sdk/index.js +0 -59
- package/sdk/index.mjs +0 -11
package/types/app-factory.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Address, ReadableAddress } from "../packages/common/src/address.js";
|
|
2
|
+
import { Expand } from "../packages/common/src/expand.js";
|
|
2
3
|
import { ABIValue } from "../packages/abi/src/abi-value.js";
|
|
3
4
|
import { Arc56Contract } from "../packages/abi/src/arc56-contract.js";
|
|
4
5
|
import { ABIMethod, ABIReturn } from "../packages/abi/src/abi-method.js";
|
|
5
|
-
import {
|
|
6
|
+
import { OnApplicationComplete, ResourceReference } from "../packages/transact/src/transactions/app-call.js";
|
|
6
7
|
import { Transaction } from "../packages/transact/src/transactions/transaction.js";
|
|
7
8
|
import { AddressWithTransactionSigner, SendingAddress, TransactionSigner } from "../packages/transact/src/signer.js";
|
|
8
9
|
import { PendingTransactionResponse } from "../packages/algod_client/src/models/pending-transaction-response.js";
|
|
9
10
|
import { AlgoAmount } from "./amount.js";
|
|
10
11
|
import { BoxIdentifier, BoxReference } from "./app-manager.js";
|
|
11
|
-
import { Expand } from "./expand.js";
|
|
12
12
|
import { AppMethodCallParams } from "../transactions/app-call.js";
|
|
13
13
|
import { AppMethodCall, AppMethodCallTransactionArgument } from "../transactions/method-call.js";
|
|
14
14
|
import { ConfirmedTransactionResult, SendParams } from "./transaction.js";
|
|
@@ -171,7 +171,7 @@ declare class AppFactory {
|
|
|
171
171
|
get params(): {
|
|
172
172
|
/** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */
|
|
173
173
|
create: (params: {
|
|
174
|
-
signer?:
|
|
174
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
175
175
|
rekeyTo?: ReadableAddress | undefined;
|
|
176
176
|
note?: string | Uint8Array | undefined;
|
|
177
177
|
lease?: string | Uint8Array | undefined;
|
|
@@ -185,8 +185,8 @@ declare class AppFactory {
|
|
|
185
185
|
accountReferences?: ReadableAddress[] | undefined;
|
|
186
186
|
appReferences?: bigint[] | undefined;
|
|
187
187
|
assetReferences?: bigint[] | undefined;
|
|
188
|
-
boxReferences?: (
|
|
189
|
-
accessReferences?:
|
|
188
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
189
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
190
190
|
rejectVersion?: number | undefined;
|
|
191
191
|
sender?: ReadableAddress | undefined;
|
|
192
192
|
method: string;
|
|
@@ -219,7 +219,7 @@ declare class AppFactory {
|
|
|
219
219
|
};
|
|
220
220
|
approvalProgram: Uint8Array;
|
|
221
221
|
clearStateProgram: Uint8Array;
|
|
222
|
-
signer?:
|
|
222
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
223
223
|
rekeyTo?: ReadableAddress | undefined;
|
|
224
224
|
note?: string | Uint8Array | undefined;
|
|
225
225
|
lease?: string | Uint8Array | undefined;
|
|
@@ -233,8 +233,8 @@ declare class AppFactory {
|
|
|
233
233
|
accountReferences?: ReadableAddress[] | undefined;
|
|
234
234
|
appReferences?: bigint[] | undefined;
|
|
235
235
|
assetReferences?: bigint[] | undefined;
|
|
236
|
-
boxReferences?: (
|
|
237
|
-
accessReferences?:
|
|
236
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
237
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
238
238
|
rejectVersion?: number | undefined;
|
|
239
239
|
sender?: ReadableAddress | undefined;
|
|
240
240
|
method: string;
|
|
@@ -244,11 +244,11 @@ declare class AppFactory {
|
|
|
244
244
|
extraProgramPages?: number | undefined;
|
|
245
245
|
} & {
|
|
246
246
|
sender: Address;
|
|
247
|
-
signer:
|
|
247
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
248
248
|
method: ABIMethod;
|
|
249
|
-
args: (Transaction |
|
|
250
|
-
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
249
|
+
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
251
250
|
sender: SendingAddress;
|
|
251
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
252
252
|
rekeyTo?: ReadableAddress | undefined;
|
|
253
253
|
note?: string | Uint8Array | undefined;
|
|
254
254
|
lease?: string | Uint8Array | undefined;
|
|
@@ -263,9 +263,10 @@ declare class AppFactory {
|
|
|
263
263
|
accountReferences?: ReadableAddress[] | undefined;
|
|
264
264
|
appReferences?: bigint[] | undefined;
|
|
265
265
|
assetReferences?: bigint[] | undefined;
|
|
266
|
-
boxReferences?: (
|
|
267
|
-
accessReferences?:
|
|
266
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
267
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
268
268
|
rejectVersion?: number | undefined;
|
|
269
|
+
appId?: 0 | undefined;
|
|
269
270
|
approvalProgram: string | Uint8Array;
|
|
270
271
|
clearStateProgram: string | Uint8Array;
|
|
271
272
|
schema?: {
|
|
@@ -277,7 +278,7 @@ declare class AppFactory {
|
|
|
277
278
|
extraProgramPages?: number | undefined;
|
|
278
279
|
}> | AppMethodCall<{
|
|
279
280
|
sender: SendingAddress;
|
|
280
|
-
signer?:
|
|
281
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
281
282
|
rekeyTo?: ReadableAddress | undefined;
|
|
282
283
|
note?: string | Uint8Array | undefined;
|
|
283
284
|
lease?: string | Uint8Array | undefined;
|
|
@@ -293,8 +294,8 @@ declare class AppFactory {
|
|
|
293
294
|
accountReferences?: ReadableAddress[] | undefined;
|
|
294
295
|
appReferences?: bigint[] | undefined;
|
|
295
296
|
assetReferences?: bigint[] | undefined;
|
|
296
|
-
boxReferences?: (
|
|
297
|
-
accessReferences?:
|
|
297
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
298
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
298
299
|
rejectVersion?: number | undefined;
|
|
299
300
|
approvalProgram: string | Uint8Array;
|
|
300
301
|
clearStateProgram: string | Uint8Array;
|
|
@@ -303,7 +304,7 @@ declare class AppFactory {
|
|
|
303
304
|
}>;
|
|
304
305
|
/** Return params for a deployment update ABI call */
|
|
305
306
|
deployUpdate: (params: {
|
|
306
|
-
signer?:
|
|
307
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
307
308
|
rekeyTo?: ReadableAddress | undefined;
|
|
308
309
|
note?: string | Uint8Array | undefined;
|
|
309
310
|
lease?: string | Uint8Array | undefined;
|
|
@@ -317,14 +318,14 @@ declare class AppFactory {
|
|
|
317
318
|
accountReferences?: ReadableAddress[] | undefined;
|
|
318
319
|
appReferences?: bigint[] | undefined;
|
|
319
320
|
assetReferences?: bigint[] | undefined;
|
|
320
|
-
boxReferences?: (
|
|
321
|
-
accessReferences?:
|
|
321
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
322
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
322
323
|
rejectVersion?: number | undefined;
|
|
323
324
|
sender?: ReadableAddress | undefined;
|
|
324
325
|
method: string;
|
|
325
326
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
326
327
|
}) => {
|
|
327
|
-
signer?:
|
|
328
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
328
329
|
rekeyTo?: ReadableAddress | undefined;
|
|
329
330
|
note?: string | Uint8Array | undefined;
|
|
330
331
|
lease?: string | Uint8Array | undefined;
|
|
@@ -338,19 +339,19 @@ declare class AppFactory {
|
|
|
338
339
|
accountReferences?: ReadableAddress[] | undefined;
|
|
339
340
|
appReferences?: bigint[] | undefined;
|
|
340
341
|
assetReferences?: bigint[] | undefined;
|
|
341
|
-
boxReferences?: (
|
|
342
|
-
accessReferences?:
|
|
342
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
343
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
343
344
|
rejectVersion?: number | undefined;
|
|
344
345
|
sender?: ReadableAddress | undefined;
|
|
345
346
|
method: string;
|
|
346
347
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
347
348
|
} & {
|
|
348
349
|
sender: Address;
|
|
349
|
-
signer:
|
|
350
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
350
351
|
method: ABIMethod;
|
|
351
|
-
args: (Transaction |
|
|
352
|
-
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
352
|
+
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
353
353
|
sender: SendingAddress;
|
|
354
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
354
355
|
rekeyTo?: ReadableAddress | undefined;
|
|
355
356
|
note?: string | Uint8Array | undefined;
|
|
356
357
|
lease?: string | Uint8Array | undefined;
|
|
@@ -365,9 +366,10 @@ declare class AppFactory {
|
|
|
365
366
|
accountReferences?: ReadableAddress[] | undefined;
|
|
366
367
|
appReferences?: bigint[] | undefined;
|
|
367
368
|
assetReferences?: bigint[] | undefined;
|
|
368
|
-
boxReferences?: (
|
|
369
|
-
accessReferences?:
|
|
369
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
370
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
370
371
|
rejectVersion?: number | undefined;
|
|
372
|
+
appId?: 0 | undefined;
|
|
371
373
|
approvalProgram: string | Uint8Array;
|
|
372
374
|
clearStateProgram: string | Uint8Array;
|
|
373
375
|
schema?: {
|
|
@@ -379,7 +381,7 @@ declare class AppFactory {
|
|
|
379
381
|
extraProgramPages?: number | undefined;
|
|
380
382
|
}> | AppMethodCall<{
|
|
381
383
|
sender: SendingAddress;
|
|
382
|
-
signer?:
|
|
384
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
383
385
|
rekeyTo?: ReadableAddress | undefined;
|
|
384
386
|
note?: string | Uint8Array | undefined;
|
|
385
387
|
lease?: string | Uint8Array | undefined;
|
|
@@ -395,8 +397,8 @@ declare class AppFactory {
|
|
|
395
397
|
accountReferences?: ReadableAddress[] | undefined;
|
|
396
398
|
appReferences?: bigint[] | undefined;
|
|
397
399
|
assetReferences?: bigint[] | undefined;
|
|
398
|
-
boxReferences?: (
|
|
399
|
-
accessReferences?:
|
|
400
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
401
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
400
402
|
rejectVersion?: number | undefined;
|
|
401
403
|
approvalProgram: string | Uint8Array;
|
|
402
404
|
clearStateProgram: string | Uint8Array;
|
|
@@ -405,7 +407,7 @@ declare class AppFactory {
|
|
|
405
407
|
};
|
|
406
408
|
/** Return params for a deployment delete ABI call */
|
|
407
409
|
deployDelete: (params: {
|
|
408
|
-
signer?:
|
|
410
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
409
411
|
rekeyTo?: ReadableAddress | undefined;
|
|
410
412
|
note?: string | Uint8Array | undefined;
|
|
411
413
|
lease?: string | Uint8Array | undefined;
|
|
@@ -419,14 +421,14 @@ declare class AppFactory {
|
|
|
419
421
|
accountReferences?: ReadableAddress[] | undefined;
|
|
420
422
|
appReferences?: bigint[] | undefined;
|
|
421
423
|
assetReferences?: bigint[] | undefined;
|
|
422
|
-
boxReferences?: (
|
|
423
|
-
accessReferences?:
|
|
424
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
425
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
424
426
|
rejectVersion?: number | undefined;
|
|
425
427
|
sender?: ReadableAddress | undefined;
|
|
426
428
|
method: string;
|
|
427
429
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
428
430
|
}) => {
|
|
429
|
-
signer?:
|
|
431
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
430
432
|
rekeyTo?: ReadableAddress | undefined;
|
|
431
433
|
note?: string | Uint8Array | undefined;
|
|
432
434
|
lease?: string | Uint8Array | undefined;
|
|
@@ -440,19 +442,19 @@ declare class AppFactory {
|
|
|
440
442
|
accountReferences?: ReadableAddress[] | undefined;
|
|
441
443
|
appReferences?: bigint[] | undefined;
|
|
442
444
|
assetReferences?: bigint[] | undefined;
|
|
443
|
-
boxReferences?: (
|
|
444
|
-
accessReferences?:
|
|
445
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
446
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
445
447
|
rejectVersion?: number | undefined;
|
|
446
448
|
sender?: ReadableAddress | undefined;
|
|
447
449
|
method: string;
|
|
448
450
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
449
451
|
} & {
|
|
450
452
|
sender: Address;
|
|
451
|
-
signer:
|
|
453
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
452
454
|
method: ABIMethod;
|
|
453
|
-
args: (Transaction |
|
|
454
|
-
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
455
|
+
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
455
456
|
sender: SendingAddress;
|
|
457
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
456
458
|
rekeyTo?: ReadableAddress | undefined;
|
|
457
459
|
note?: string | Uint8Array | undefined;
|
|
458
460
|
lease?: string | Uint8Array | undefined;
|
|
@@ -467,9 +469,10 @@ declare class AppFactory {
|
|
|
467
469
|
accountReferences?: ReadableAddress[] | undefined;
|
|
468
470
|
appReferences?: bigint[] | undefined;
|
|
469
471
|
assetReferences?: bigint[] | undefined;
|
|
470
|
-
boxReferences?: (
|
|
471
|
-
accessReferences?:
|
|
472
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
473
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
472
474
|
rejectVersion?: number | undefined;
|
|
475
|
+
appId?: 0 | undefined;
|
|
473
476
|
approvalProgram: string | Uint8Array;
|
|
474
477
|
clearStateProgram: string | Uint8Array;
|
|
475
478
|
schema?: {
|
|
@@ -481,7 +484,7 @@ declare class AppFactory {
|
|
|
481
484
|
extraProgramPages?: number | undefined;
|
|
482
485
|
}> | AppMethodCall<{
|
|
483
486
|
sender: SendingAddress;
|
|
484
|
-
signer?:
|
|
487
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
485
488
|
rekeyTo?: ReadableAddress | undefined;
|
|
486
489
|
note?: string | Uint8Array | undefined;
|
|
487
490
|
lease?: string | Uint8Array | undefined;
|
|
@@ -497,8 +500,8 @@ declare class AppFactory {
|
|
|
497
500
|
accountReferences?: ReadableAddress[] | undefined;
|
|
498
501
|
appReferences?: bigint[] | undefined;
|
|
499
502
|
assetReferences?: bigint[] | undefined;
|
|
500
|
-
boxReferences?: (
|
|
501
|
-
accessReferences?:
|
|
503
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
504
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
502
505
|
rejectVersion?: number | undefined;
|
|
503
506
|
approvalProgram: string | Uint8Array;
|
|
504
507
|
clearStateProgram: string | Uint8Array;
|
|
@@ -508,7 +511,7 @@ declare class AppFactory {
|
|
|
508
511
|
bare: {
|
|
509
512
|
/** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */
|
|
510
513
|
create: (params?: {
|
|
511
|
-
signer?:
|
|
514
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
512
515
|
rekeyTo?: ReadableAddress | undefined;
|
|
513
516
|
note?: string | Uint8Array | undefined;
|
|
514
517
|
lease?: string | Uint8Array | undefined;
|
|
@@ -522,8 +525,8 @@ declare class AppFactory {
|
|
|
522
525
|
accountReferences?: ReadableAddress[] | undefined;
|
|
523
526
|
appReferences?: bigint[] | undefined;
|
|
524
527
|
assetReferences?: bigint[] | undefined;
|
|
525
|
-
boxReferences?: (
|
|
526
|
-
accessReferences?:
|
|
528
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
529
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
527
530
|
rejectVersion?: number | undefined;
|
|
528
531
|
sender?: ReadableAddress | undefined;
|
|
529
532
|
deployTimeParams?: TealTemplateParams | undefined;
|
|
@@ -557,7 +560,7 @@ declare class AppFactory {
|
|
|
557
560
|
/** The number of byte slices saved in local state. */
|
|
558
561
|
localByteSlices: number;
|
|
559
562
|
};
|
|
560
|
-
signer?:
|
|
563
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
561
564
|
rekeyTo?: ReadableAddress | undefined;
|
|
562
565
|
note?: string | Uint8Array | undefined;
|
|
563
566
|
lease?: string | Uint8Array | undefined;
|
|
@@ -571,8 +574,8 @@ declare class AppFactory {
|
|
|
571
574
|
accountReferences?: ReadableAddress[] | undefined;
|
|
572
575
|
appReferences?: bigint[] | undefined;
|
|
573
576
|
assetReferences?: bigint[] | undefined;
|
|
574
|
-
boxReferences?: (
|
|
575
|
-
accessReferences?:
|
|
577
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
578
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
576
579
|
rejectVersion?: number | undefined;
|
|
577
580
|
sender?: ReadableAddress | undefined;
|
|
578
581
|
updatable?: boolean | undefined;
|
|
@@ -581,12 +584,12 @@ declare class AppFactory {
|
|
|
581
584
|
extraProgramPages?: number | undefined;
|
|
582
585
|
} & {
|
|
583
586
|
sender: Address;
|
|
584
|
-
signer:
|
|
587
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
585
588
|
onComplete: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication;
|
|
586
589
|
}>;
|
|
587
590
|
/** Return params for a deployment update bare call */
|
|
588
591
|
deployUpdate: (params?: {
|
|
589
|
-
signer?:
|
|
592
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
590
593
|
rekeyTo?: ReadableAddress | undefined;
|
|
591
594
|
note?: string | Uint8Array | undefined;
|
|
592
595
|
lease?: string | Uint8Array | undefined;
|
|
@@ -600,12 +603,12 @@ declare class AppFactory {
|
|
|
600
603
|
accountReferences?: ReadableAddress[] | undefined;
|
|
601
604
|
appReferences?: bigint[] | undefined;
|
|
602
605
|
assetReferences?: bigint[] | undefined;
|
|
603
|
-
boxReferences?: (
|
|
604
|
-
accessReferences?:
|
|
606
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
607
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
605
608
|
rejectVersion?: number | undefined;
|
|
606
609
|
sender?: ReadableAddress | undefined;
|
|
607
610
|
} | undefined) => {
|
|
608
|
-
signer?:
|
|
611
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
609
612
|
rekeyTo?: ReadableAddress | undefined;
|
|
610
613
|
note?: string | Uint8Array | undefined;
|
|
611
614
|
lease?: string | Uint8Array | undefined;
|
|
@@ -619,18 +622,18 @@ declare class AppFactory {
|
|
|
619
622
|
accountReferences?: ReadableAddress[] | undefined;
|
|
620
623
|
appReferences?: bigint[] | undefined;
|
|
621
624
|
assetReferences?: bigint[] | undefined;
|
|
622
|
-
boxReferences?: (
|
|
623
|
-
accessReferences?:
|
|
625
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
626
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
624
627
|
rejectVersion?: number | undefined;
|
|
625
628
|
sender?: ReadableAddress | undefined;
|
|
626
629
|
} & {
|
|
627
630
|
sender: Address;
|
|
628
|
-
signer:
|
|
631
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
629
632
|
onComplete: OnApplicationComplete.UpdateApplication;
|
|
630
633
|
};
|
|
631
634
|
/** Return params for a deployment delete bare call */
|
|
632
635
|
deployDelete: (params?: {
|
|
633
|
-
signer?:
|
|
636
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
634
637
|
rekeyTo?: ReadableAddress | undefined;
|
|
635
638
|
note?: string | Uint8Array | undefined;
|
|
636
639
|
lease?: string | Uint8Array | undefined;
|
|
@@ -644,12 +647,12 @@ declare class AppFactory {
|
|
|
644
647
|
accountReferences?: ReadableAddress[] | undefined;
|
|
645
648
|
appReferences?: bigint[] | undefined;
|
|
646
649
|
assetReferences?: bigint[] | undefined;
|
|
647
|
-
boxReferences?: (
|
|
648
|
-
accessReferences?:
|
|
650
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
651
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
649
652
|
rejectVersion?: number | undefined;
|
|
650
653
|
sender?: ReadableAddress | undefined;
|
|
651
654
|
} | undefined) => {
|
|
652
|
-
signer?:
|
|
655
|
+
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
653
656
|
rekeyTo?: ReadableAddress | undefined;
|
|
654
657
|
note?: string | Uint8Array | undefined;
|
|
655
658
|
lease?: string | Uint8Array | undefined;
|
|
@@ -663,13 +666,13 @@ declare class AppFactory {
|
|
|
663
666
|
accountReferences?: ReadableAddress[] | undefined;
|
|
664
667
|
appReferences?: bigint[] | undefined;
|
|
665
668
|
assetReferences?: bigint[] | undefined;
|
|
666
|
-
boxReferences?: (
|
|
667
|
-
accessReferences?:
|
|
669
|
+
boxReferences?: (BoxReference | BoxIdentifier)[] | undefined;
|
|
670
|
+
accessReferences?: ResourceReference[] | undefined;
|
|
668
671
|
rejectVersion?: number | undefined;
|
|
669
672
|
sender?: ReadableAddress | undefined;
|
|
670
673
|
} & {
|
|
671
674
|
sender: Address;
|
|
672
|
-
signer:
|
|
675
|
+
signer: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
673
676
|
onComplete: OnApplicationComplete.DeleteApplication;
|
|
674
677
|
};
|
|
675
678
|
};
|
|
@@ -799,7 +802,6 @@ declare class AppFactory {
|
|
|
799
802
|
compiledApproval?: CompiledTeal | undefined;
|
|
800
803
|
compiledClear?: CompiledTeal | undefined;
|
|
801
804
|
operationPerformed: "create";
|
|
802
|
-
version: string;
|
|
803
805
|
updatable?: boolean | undefined;
|
|
804
806
|
deletable?: boolean | undefined;
|
|
805
807
|
createdRound: bigint;
|
|
@@ -807,6 +809,7 @@ declare class AppFactory {
|
|
|
807
809
|
createdMetadata: AppDeployMetadata;
|
|
808
810
|
deleted: boolean;
|
|
809
811
|
name: string;
|
|
812
|
+
version: string;
|
|
810
813
|
groupId: string | undefined;
|
|
811
814
|
txIds: string[];
|
|
812
815
|
returns?: ABIReturn[] | undefined;
|
|
@@ -845,7 +848,6 @@ declare class AppFactory {
|
|
|
845
848
|
compiledApproval?: CompiledTeal | undefined;
|
|
846
849
|
compiledClear?: CompiledTeal | undefined;
|
|
847
850
|
operationPerformed: "replace";
|
|
848
|
-
version: string;
|
|
849
851
|
updatable?: boolean | undefined;
|
|
850
852
|
deletable?: boolean | undefined;
|
|
851
853
|
createdRound: bigint;
|
|
@@ -853,6 +855,7 @@ declare class AppFactory {
|
|
|
853
855
|
createdMetadata: AppDeployMetadata;
|
|
854
856
|
deleted: boolean;
|
|
855
857
|
name: string;
|
|
858
|
+
version: string;
|
|
856
859
|
groupId: string | undefined;
|
|
857
860
|
txIds: string[];
|
|
858
861
|
returns?: ABIReturn[] | undefined;
|
package/types/app-factory.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_address = require('../packages/common/src/address.js');
|
|
2
|
-
const require_app_call = require('../packages/transact/src/transactions/app-call.js');
|
|
3
|
-
const require_sourcemap = require('../packages/sdk/src/logic/sourcemap.js');
|
|
4
2
|
const require_app = require('./app.js');
|
|
3
|
+
const require_sourcemap = require('../packages/common/src/sourcemap.js');
|
|
4
|
+
const require_app_call = require('../packages/transact/src/transactions/app-call.js');
|
|
5
5
|
const require_abi_method = require('../packages/abi/src/abi-method.js');
|
|
6
6
|
const require_app_client = require('./app-client.js');
|
|
7
7
|
|
package/types/app-factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-factory.js","names":["AppClient","getOptionalAddress","result","ProgramSourceMap","UPDATABLE_TEMPLATE_NAME","DELETABLE_TEMPLATE_NAME","OnApplicationComplete","getABIMethod","argTypeIsTransaction","getABIDecodedValue","getAddress"],"sources":["../../src/types/app-factory.ts"],"sourcesContent":["import { Arc56Contract, argTypeIsTransaction, getABIDecodedValue, getABIMethod } from '@algorandfoundation/algokit-abi'\nimport { Address, ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { AddressWithTransactionSigner, OnApplicationComplete, TransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { ProgramSourceMap } from '@algorandfoundation/sdk'\nimport { type AlgorandClient } from './algorand-client'\nimport { AppCompilationResult, DELETABLE_TEMPLATE_NAME, TealTemplateParams, UPDATABLE_TEMPLATE_NAME } from './app'\nimport {\n AppClient,\n AppClientBareCallParams,\n AppClientCompilationParams,\n AppClientMethodCallParams,\n AppClientParams,\n AppSourceMaps,\n ResolveAppClientByCreatorAndName,\n} from './app-client'\nimport {\n AppDeployParams,\n DeployAppDeleteMethodCall,\n DeployAppDeleteParams,\n DeployAppUpdateMethodCall,\n DeployAppUpdateParams,\n} from './app-deployer'\nimport { AppSpec } from './app-spec'\nimport { AppCreateMethodCall, AppCreateParams, AppMethodCall, CommonAppCallParams } from './composer'\nimport { Expand } from './expand'\nimport { SendParams } from './transaction'\n\n/** Parameters to create an app client */\nexport interface AppFactoryParams {\n /** The ARC-56 or ARC-32 application spec as either:\n * * Parsed JSON ARC-56 `Contract`\n * * Parsed JSON ARC-32 `AppSpec`\n * * Raw JSON string (in either ARC-56 or ARC-32 format)\n */\n appSpec: Arc56Contract | AppSpec | string\n\n /** `AlgorandClient` instance */\n algorand: AlgorandClient\n\n /**\n * Optional override for the app name; used for on-chain metadata and lookups.\n * Defaults to the ARC-32/ARC-56 app spec name.\n */\n appName?: string\n\n /** Optional address to use for the account to use as the default sender for calls. */\n defaultSender?: ReadableAddress\n\n /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */\n defaultSigner?: TransactionSigner\n\n /** The version of app that is / will be deployed; defaults to 1.0 */\n version?: string\n\n /**\n * Whether or not the contract should have deploy-time immutability control set, undefined = ignore.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n updatable?: boolean\n\n /**\n * Whether or not the contract should have deploy-time permanence control set, undefined = ignore.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n deletable?: boolean\n\n /**\n * Optional deploy-time TEAL template replacement parameters.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n deployTimeParams?: TealTemplateParams\n}\n\n/** onComplete parameter for a create app call */\nexport type CreateOnComplete = {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearState>\n}\n\n/** Specifies a schema used for creating an app */\nexport type CreateSchema = {\n /** The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. */\n schema?: {\n /** The number of integers saved in global state. */\n globalInts: number\n /** The number of byte slices saved in global state. */\n globalByteSlices: number\n /** The number of integers saved in local state. */\n localInts: number\n /** The number of byte slices saved in local state. */\n localByteSlices: number\n }\n /** Number of extra pages required for the programs.\n * Defaults to the number needed for the programs in this call if not specified.\n * This is immutable once the app is created. */\n extraProgramPages?: number\n}\n\n/** Params to specify a bare (raw) create call for an app */\nexport type AppFactoryCreateParams = Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>\n\n/** Params to specify a create method call for an app */\nexport type AppFactoryCreateMethodCallParams = Expand<\n AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema\n>\n\n/** Params to get an app client by ID from an app factory. */\nexport type AppFactoryAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>\n\n/** Params to get an app client by creator address and name from an app factory. */\nexport type AppFactoryResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>\n\n/** Parameters to define a deployment for an `AppFactory` */\nexport type AppFactoryDeployParams = Expand<\n Omit<AppDeployParams, 'createParams' | 'updateParams' | 'deleteParams' | 'metadata'> & {\n /** Create transaction parameters to use if a create needs to be issued as part of deployment */\n createParams?:\n | Expand<AppClientMethodCallParams & CreateOnComplete & CreateSchema>\n | Expand<AppClientBareCallParams & CreateOnComplete & CreateSchema>\n /** Update transaction parameters to use if a create needs to be issued as part of deployment */\n updateParams?: AppClientMethodCallParams | AppClientBareCallParams\n /** Delete transaction parameters to use if a create needs to be issued as part of deployment */\n deleteParams?: AppClientMethodCallParams | AppClientBareCallParams\n /**\n * Whether or not the contract should have deploy-time immutability control set.\n * `undefined` = use AppFactory constructor value if set or base it on the app spec.\n */\n updatable?: boolean\n /**\n * Whether or not the contract should have deploy-time permanence control set.\n * `undefined` = use AppFactory constructor value if set or base it on the app spec.\n */\n deletable?: boolean\n /** Override the app name for this deployment */\n appName?: string\n }\n>\n\n/**\n * ARC-56/ARC-32 app factory that, for a given app spec, allows you to create\n * and deploy one or more app instances and to create one or more app clients\n * to interact with those (or other) app instances.\n */\nexport class AppFactory {\n private _appSpec: Arc56Contract\n private _appName: string\n private _algorand: AlgorandClient\n private _version: string\n private _defaultSender?: Address\n private _defaultSigner?: TransactionSigner\n private _deployTimeParams?: TealTemplateParams\n private _updatable?: boolean\n private _deletable?: boolean\n\n private _approvalSourceMap: ProgramSourceMap | undefined\n private _clearSourceMap: ProgramSourceMap | undefined\n\n private _paramsMethods: ReturnType<AppFactory['getParamsMethods']>\n\n /**\n * Create a new app factory.\n * @param params The parameters to create the app factory\n * @returns The `AppFactory` instance\n * @example\n * ```typescript\n * const appFactory = new AppFactory({\n * appSpec: appSpec,\n * algorand: AlgorandClient.mainNet(),\n * })\n */\n constructor(params: AppFactoryParams) {\n this._appSpec = AppClient.normaliseAppSpec(params.appSpec)\n this._appName = params.appName ?? this._appSpec.name\n this._algorand = params.algorand\n this._version = params.version ?? '1.0'\n this._defaultSender = getOptionalAddress(params.defaultSender)\n this._defaultSigner = params.defaultSigner\n this._deployTimeParams = params.deployTimeParams\n this._updatable = params.updatable\n this._deletable = params.deletable\n this._paramsMethods = this.getParamsMethods()\n }\n\n /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n public get appName() {\n return this._appName\n }\n\n /** The ARC-56 app spec being used */\n get appSpec() {\n return this._appSpec\n }\n\n /** Return the algorand client this factory is using. */\n get algorand() {\n return this._algorand\n }\n\n /** Get parameters to create transactions (create and deploy related calls) for the current app.\n *\n * A good mental model for this is that these parameters represent a deferred transaction creation.\n * @example Create a transaction in the future using Algorand Client\n * ```typescript\n * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})\n * // ...\n * await algorand.send.AppCreateMethodCall(createAppParams)\n * ```\n * @example Define a nested transaction as an ABI argument\n * ```typescript\n * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})\n * await appClient.send.call({method: 'my_method', args: [createAppParams]})\n * ```\n */\n get params() {\n return this._paramsMethods\n }\n\n /** Create transactions for the current app */\n readonly createTransaction = {\n /** Create bare (raw) transactions for the current app */\n bare: {\n /**\n * Create a create app call transaction using a bare (raw) create call.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the create call transaction\n * @returns The create call transaction\n */\n create: async (params?: AppFactoryCreateParams) => {\n return this._algorand.createTransaction.appCreate(await this.params.bare.create(params))\n },\n },\n\n /**\n * Create a create app call transaction using an ABI create call.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the create call transaction\n * @returns The create call transaction\n */\n create: async (params: AppFactoryCreateMethodCallParams) => {\n return this._algorand.createTransaction.appCreateMethodCall(await this.params.create(params))\n },\n }\n\n /** Send transactions to the current app */\n readonly send = {\n /** Send bare (raw) transactions for the current app */\n bare: {\n /**\n * Creates an instance of the app using a bare (raw) create call and returns the result\n * of the creation transaction and an app client to interact with that app instance.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the app\n * @returns The app client and the result of the creation transaction\n */\n create: async (params?: AppFactoryCreateParams & SendParams) => {\n const updatable = params?.updatable ?? this._updatable\n const deletable = params?.deletable ?? this._deletable\n const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams\n const compiled = await this.compile({ deployTimeParams, updatable, deletable })\n const result = await this.handleCallErrors(async () => ({\n ...(await this._algorand.send.appCreate(await this.params.bare.create({ ...params, updatable, deletable, deployTimeParams }))),\n return: undefined,\n }))\n return {\n appClient: this.getAppClientById({\n appId: result.appId,\n }),\n result: {\n ...result,\n ...(compiled as Partial<AppCompilationResult>),\n },\n }\n },\n },\n\n /**\n * Creates an instance of the app and returns the result of the creation\n * transaction and an app client to interact with that app instance.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the app\n * @returns The app client and the result of the creation transaction\n */\n create: async (params: AppFactoryCreateMethodCallParams & SendParams) => {\n const updatable = params?.updatable ?? this._updatable\n const deletable = params?.deletable ?? this._deletable\n const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams\n const compiled = await this.compile({ deployTimeParams, updatable, deletable })\n const result = await this.handleCallErrors(async () => {\n const result = await this._algorand.send.appCreateMethodCall(\n await this.params.create({ ...params, updatable, deletable, deployTimeParams }),\n )\n return {\n ...result,\n return: result.return?.returnValue,\n }\n })\n return {\n appClient: this.getAppClientById({\n appId: result.appId,\n }),\n result: {\n ...result,\n ...(compiled as Partial<AppCompilationResult>),\n },\n }\n },\n }\n\n /**\n * Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).\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 params The arguments to control the app deployment\n * @returns The app client and the result of the deployment\n * @example\n * ```ts\n * const { appClient, result } = await factory.deploy({\n * createParams: {\n * sender: 'SENDER_ADDRESS',\n * approvalProgram: 'APPROVAL PROGRAM',\n * clearStateProgram: 'CLEAR PROGRAM',\n * schema: {\n * globalByteSlices: 0,\n * globalInts: 0,\n * localByteSlices: 0,\n * localInts: 0\n * }\n * },\n * updateParams: {\n * sender: 'SENDER_ADDRESS'\n * },\n * deleteParams: {\n * sender: 'SENDER_ADDRESS'\n * },\n * onSchemaBreak: 'append',\n * onUpdate: 'append'\n * })\n * ```\n */\n public async deploy(params: AppFactoryDeployParams) {\n const updatable = params.updatable ?? this._updatable ?? this.getDeployTimeControl('updatable')\n const deletable = params.deletable ?? this._deletable ?? this.getDeployTimeControl('deletable')\n const deployTimeParams = params.deployTimeParams ?? this._deployTimeParams\n\n // Compile using a appID 0 AppClient so we can register the error handler and use the programs\n // to identify the app within the error handler (because we can't use app ID 0)\n const tempAppClient = this.getAppClientById({ appId: 0n })\n const compiled = await tempAppClient.compile({ deployTimeParams, updatable, deletable })\n\n const deployResult = await this._algorand.appDeployer.deploy({\n ...params,\n createParams: await (params.createParams && 'method' in params.createParams\n ? this.params.create({ ...params.createParams, updatable, deletable, deployTimeParams })\n : this.params.bare.create({ ...params.createParams, updatable, deletable, deployTimeParams })),\n updateParams:\n params.updateParams && 'method' in params.updateParams\n ? this.params.deployUpdate(params.updateParams)\n : this.params.bare.deployUpdate(params.updateParams),\n deleteParams:\n params.deleteParams && 'method' in params.deleteParams\n ? this.params.deployDelete(params.deleteParams)\n : this.params.bare.deployDelete(params.deleteParams),\n metadata: {\n name: params.appName ?? this._appName,\n version: this._version,\n updatable,\n deletable,\n },\n })\n const appClient = this.getAppClientById({\n appId: deployResult.appId,\n appName: params.appName,\n })\n const result = {\n ...deployResult,\n ...(compiled as Partial<AppCompilationResult>),\n }\n return {\n appClient,\n result: {\n ...result,\n return:\n 'return' in result\n ? result.operationPerformed === 'update'\n ? params.updateParams && 'method' in params.updateParams\n ? result.return?.returnValue\n : undefined\n : params.createParams && 'method' in params.createParams\n ? result.return?.returnValue\n : undefined\n : undefined,\n deleteReturn:\n 'deleteReturn' in result && params.deleteParams && 'method' in params.deleteParams ? result.deleteReturn?.returnValue : undefined,\n },\n }\n }\n\n /**\n * Returns a new `AppClient` client for an app instance of the given ID.\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient` instance\n * @example\n * ```typescript\n * const appClient = factory.getAppClientById({ appId: 12345n })\n * ```\n */\n public getAppClientById(params: AppFactoryAppClientParams) {\n return new AppClient({\n ...params,\n algorand: this._algorand,\n appSpec: this._appSpec,\n appName: params.appName ?? this._appName,\n defaultSender: params.defaultSender ?? this._defaultSender,\n defaultSigner: params.defaultSigner ?? this._defaultSigner,\n approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap,\n clearSourceMap: params.clearSourceMap ?? this._clearSourceMap,\n })\n }\n\n /**\n * Returns a new `AppClient` client, resolving the app by creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient` instance\n * @example\n * ```typescript\n * const appClient = factory.getAppClientByCreatorAndName({ creatorAddress: 'CREATOR_ADDRESS', appName: 'my_app' })\n * ```\n */\n public getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams) {\n return AppClient.fromCreatorAndName({\n ...params,\n algorand: this._algorand,\n appSpec: this._appSpec,\n appName: params.appName ?? this._appName,\n defaultSender: params.defaultSender ?? this._defaultSender,\n approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap,\n clearSourceMap: params.clearSourceMap ?? this._clearSourceMap,\n })\n }\n\n /**\n * Takes an error that may include a logic error from a call to the current app and re-exposes the\n * error to include source code information via the source map and ARC-56 spec.\n * @param e The error to parse\n * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)\n * @returns The new error, or if there was no logic error or source map then the wrapped error with source details\n */\n exposeLogicError(e: Error, isClearStateProgram?: boolean): Error {\n return AppClient.exposeLogicError(e, this._appSpec, {\n isClearStateProgram,\n approvalSourceMap: this._approvalSourceMap,\n clearSourceMap: this._clearSourceMap,\n })\n }\n\n /**\n * Export the current source maps for the app.\n * @returns The source maps\n */\n exportSourceMaps(): AppSourceMaps {\n if (!this._approvalSourceMap || !this._clearSourceMap) {\n throw new Error(\n \"Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first\",\n )\n }\n\n return {\n approvalSourceMap: this._approvalSourceMap,\n clearSourceMap: this._clearSourceMap,\n }\n }\n\n /**\n * Import source maps for the app.\n * @param sourceMaps The source maps to import\n */\n importSourceMaps(sourceMaps: AppSourceMaps) {\n this._approvalSourceMap = new ProgramSourceMap(sourceMaps.approvalSourceMap)\n this._clearSourceMap = new ProgramSourceMap(sourceMaps.clearSourceMap)\n }\n\n private getDeployTimeControl(control: 'updatable' | 'deletable'): boolean | undefined {\n const approval = this._appSpec.source?.approval ? Buffer.from(this._appSpec.source.approval, 'base64').toString('utf-8') : undefined\n // variable not present, so unknown control value\n if (!approval || !approval.includes(control === 'updatable' ? UPDATABLE_TEMPLATE_NAME : DELETABLE_TEMPLATE_NAME)) return undefined\n\n // A call is present and configured\n return (\n this._appSpec.bareActions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication') ||\n Object.values(this._appSpec.methods).some((c) =>\n c.actions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication'),\n )\n )\n }\n\n private getParamsMethods() {\n return {\n /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */\n create: async (params: AppFactoryCreateMethodCallParams) => {\n const compiled = await this.compile({ ...params, deployTimeParams: params.deployTimeParams ?? this._deployTimeParams })\n return this.getABIParams(\n {\n ...params,\n deployTimeParams: params.deployTimeParams ?? this._deployTimeParams,\n schema: params.schema ?? {\n globalByteSlices: this._appSpec.state.schema.global.bytes,\n globalInts: this._appSpec.state.schema.global.ints,\n localByteSlices: this._appSpec.state.schema.local.bytes,\n localInts: this._appSpec.state.schema.local.ints,\n },\n approvalProgram: compiled.approvalProgram,\n clearStateProgram: compiled.clearStateProgram,\n },\n params.onComplete ?? OnApplicationComplete.NoOp,\n ) satisfies AppCreateMethodCall\n },\n /** Return params for a deployment update ABI call */\n deployUpdate: (params: AppClientMethodCallParams) => {\n return this.getABIParams(params, OnApplicationComplete.UpdateApplication) satisfies DeployAppUpdateMethodCall\n },\n /** Return params for a deployment delete ABI call */\n deployDelete: (params: AppClientMethodCallParams) => {\n return this.getABIParams(params, OnApplicationComplete.DeleteApplication) satisfies DeployAppDeleteMethodCall\n },\n bare: {\n /** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */\n create: async (params?: AppFactoryCreateParams) => {\n return this.getBareParams(\n {\n ...params,\n deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams,\n schema: params?.schema ?? {\n globalByteSlices: this._appSpec.state.schema.global.bytes,\n globalInts: this._appSpec.state.schema.global.ints,\n localByteSlices: this._appSpec.state.schema.local.bytes,\n localInts: this._appSpec.state.schema.local.ints,\n },\n ...(await this.compile({ ...params, deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams })),\n },\n params?.onComplete ?? OnApplicationComplete.NoOp,\n ) satisfies AppCreateParams\n },\n /** Return params for a deployment update bare call */\n deployUpdate: (params?: AppClientBareCallParams) => {\n return this.getBareParams(params, OnApplicationComplete.UpdateApplication) satisfies DeployAppUpdateParams\n },\n /** Return params for a deployment delete bare call */\n deployDelete: (params?: AppClientBareCallParams) => {\n return this.getBareParams(params, OnApplicationComplete.DeleteApplication) satisfies DeployAppDeleteParams\n },\n },\n }\n }\n\n /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */\n private async handleCallErrors<TResult>(call: () => Promise<TResult>) {\n try {\n return await call()\n } catch (e) {\n throw this.exposeLogicError(e as Error)\n }\n }\n\n /**\n * Compiles the approval and clear state programs (if TEAL templates provided),\n * performing any provided deploy-time parameter replacement and stores\n * the source maps.\n *\n * If no TEAL templates provided it will use any byte code provided in the app spec.\n *\n * Will store any generated source maps for later use in debugging.\n * @param compilation Optional compilation parameters to use for the compilation\n * @returns The compilation result\n * @example\n * ```typescript\n * const result = await factory.compile()\n * ```\n */\n public async compile(compilation?: AppClientCompilationParams) {\n const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation)\n\n if (result.compiledApproval) {\n this._approvalSourceMap = result.compiledApproval.sourceMap\n }\n if (result.compiledClear) {\n this._clearSourceMap = result.compiledClear.sourceMap\n }\n\n return result\n }\n\n private getBareParams<\n TParams extends { sender?: ReadableAddress; signer?: TransactionSigner | AddressWithTransactionSigner } | undefined,\n TOnComplete extends OnApplicationComplete,\n >(params: TParams, onComplete: TOnComplete) {\n return {\n ...params,\n sender: this.getSender(params?.sender),\n signer: this.getSigner(params?.sender, params?.signer),\n onComplete,\n }\n }\n\n private getABIParams<\n TParams extends {\n method: string\n sender?: ReadableAddress\n signer?: TransactionSigner | AddressWithTransactionSigner\n args?: AppClientMethodCallParams['args']\n },\n TOnComplete extends OnApplicationComplete,\n >(params: TParams, onComplete: TOnComplete) {\n return {\n ...params,\n sender: this.getSender(params.sender),\n signer: this.getSigner(params.sender, params.signer),\n method: getABIMethod(params.method, this._appSpec),\n args: this.getCreateABIArgsWithDefaultValues(params.method, params.args),\n onComplete,\n }\n }\n\n private getCreateABIArgsWithDefaultValues(\n methodNameOrSignature: string,\n args: AppClientMethodCallParams['args'] | undefined,\n ): AppMethodCall<CommonAppCallParams>['args'] {\n const m = getABIMethod(methodNameOrSignature, this._appSpec)\n return args?.map((arg, i) => {\n const methodArg = m.args[i]\n if (arg !== undefined) {\n return arg\n }\n if (argTypeIsTransaction(methodArg.type)) {\n return arg\n }\n const defaultValue = methodArg.defaultValue\n if (defaultValue) {\n switch (defaultValue.source) {\n case 'literal': {\n const bytes = Buffer.from(defaultValue.data, 'base64')\n const value_type = defaultValue.type ?? methodArg.type\n return getABIDecodedValue(value_type, bytes)\n }\n default:\n throw new Error(`Can't provide default value for ${defaultValue.source} for a contract creation call`)\n }\n }\n throw new Error(`No value provided for required argument ${methodArg.name ?? `arg${i + 1}`} in call to method ${m.name}`)\n })\n }\n\n /** Returns the sender for a call, using the `defaultSender`\n * if none provided and throws an error if neither provided */\n private getSender(sender: ReadableAddress | undefined): Address {\n if (!sender && !this._defaultSender) {\n throw new Error(`No sender provided and no default sender present in app factory for call to app ${this._appName}`)\n }\n return getAddress(sender ?? this._defaultSender!)\n }\n\n /** Returns the signer for a call, using the provided signer or the `defaultSigner`\n * if no signer was provided and the sender resolves to the default sender, the call will use default signer\n * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */\n private getSigner(\n sender: ReadableAddress | undefined,\n signer: TransactionSigner | AddressWithTransactionSigner | undefined,\n ): TransactionSigner | AddressWithTransactionSigner | undefined {\n return signer ?? (!sender || sender === this._defaultSender ? this._defaultSigner : undefined)\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAuJA,IAAa,aAAb,MAAwB;CACtB,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CAER,AAAQ;CACR,AAAQ;CAER,AAAQ;;;;;;;;;;;;CAaR,YAAY,QAA0B;AACpC,OAAK,WAAWA,6BAAU,iBAAiB,OAAO,QAAQ;AAC1D,OAAK,WAAW,OAAO,WAAW,KAAK,SAAS;AAChD,OAAK,YAAY,OAAO;AACxB,OAAK,WAAW,OAAO,WAAW;AAClC,OAAK,iBAAiBC,mCAAmB,OAAO,cAAc;AAC9D,OAAK,iBAAiB,OAAO;AAC7B,OAAK,oBAAoB,OAAO;AAChC,OAAK,aAAa,OAAO;AACzB,OAAK,aAAa,OAAO;AACzB,OAAK,iBAAiB,KAAK,kBAAkB;;;CAI/C,IAAW,UAAU;AACnB,SAAO,KAAK;;;CAId,IAAI,UAAU;AACZ,SAAO,KAAK;;;CAId,IAAI,WAAW;AACb,SAAO,KAAK;;;;;;;;;;;;;;;;;CAkBd,IAAI,SAAS;AACX,SAAO,KAAK;;;CAId,AAAS,oBAAoB;EAE3B,MAAM,EAQJ,QAAQ,OAAO,WAAoC;AACjD,UAAO,KAAK,UAAU,kBAAkB,UAAU,MAAM,KAAK,OAAO,KAAK,OAAO,OAAO,CAAC;KAE3F;EASD,QAAQ,OAAO,WAA6C;AAC1D,UAAO,KAAK,UAAU,kBAAkB,oBAAoB,MAAM,KAAK,OAAO,OAAO,OAAO,CAAC;;EAEhG;;CAGD,AAAS,OAAO;EAEd,MAAM,EASJ,QAAQ,OAAO,WAAiD;GAC9D,MAAM,YAAY,QAAQ,aAAa,KAAK;GAC5C,MAAM,YAAY,QAAQ,aAAa,KAAK;GAC5C,MAAM,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,MAAM,mCAAmC,aAAa,OAAO,+BAA+B;;AAG5G,SAAM,IAAI,MAAM,2CAA2C,UAAU,QAAQ,MAAM,IAAI,IAAI,qBAAqB,EAAE,OAAO;IACzH;;;;CAKJ,AAAQ,UAAU,QAA8C;AAC9D,MAAI,CAAC,UAAU,CAAC,KAAK,eACnB,OAAM,IAAI,MAAM,mFAAmF,KAAK,WAAW;AAErH,SAAOC,2BAAW,UAAU,KAAK,eAAgB;;;;;CAMnD,AAAQ,UACN,QACA,QAC8D;AAC9D,SAAO,WAAW,CAAC,UAAU,WAAW,KAAK,iBAAiB,KAAK,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"app-factory.js","names":["AppClient","getOptionalAddress","result","ProgramSourceMap","UPDATABLE_TEMPLATE_NAME","DELETABLE_TEMPLATE_NAME","OnApplicationComplete","getABIMethod","argTypeIsTransaction","getABIDecodedValue","getAddress"],"sources":["../../src/types/app-factory.ts"],"sourcesContent":["import { Arc56Contract, argTypeIsTransaction, getABIDecodedValue, getABIMethod } from '@algorandfoundation/algokit-abi'\nimport { Address, Expand, ProgramSourceMap, ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { AddressWithTransactionSigner, OnApplicationComplete, TransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { type AlgorandClient } from './algorand-client'\nimport { AppCompilationResult, DELETABLE_TEMPLATE_NAME, TealTemplateParams, UPDATABLE_TEMPLATE_NAME } from './app'\nimport {\n AppClient,\n AppClientBareCallParams,\n AppClientCompilationParams,\n AppClientMethodCallParams,\n AppClientParams,\n AppSourceMaps,\n ResolveAppClientByCreatorAndName,\n} from './app-client'\nimport {\n AppDeployParams,\n DeployAppDeleteMethodCall,\n DeployAppDeleteParams,\n DeployAppUpdateMethodCall,\n DeployAppUpdateParams,\n} from './app-deployer'\nimport { AppSpec } from './app-spec'\nimport { AppCreateMethodCall, AppCreateParams, AppMethodCall, CommonAppCallParams } from './composer'\nimport { SendParams } from './transaction'\n\n/** Parameters to create an app client */\nexport interface AppFactoryParams {\n /** The ARC-56 or ARC-32 application spec as either:\n * * Parsed JSON ARC-56 `Contract`\n * * Parsed JSON ARC-32 `AppSpec`\n * * Raw JSON string (in either ARC-56 or ARC-32 format)\n */\n appSpec: Arc56Contract | AppSpec | string\n\n /** `AlgorandClient` instance */\n algorand: AlgorandClient\n\n /**\n * Optional override for the app name; used for on-chain metadata and lookups.\n * Defaults to the ARC-32/ARC-56 app spec name.\n */\n appName?: string\n\n /** Optional address to use for the account to use as the default sender for calls. */\n defaultSender?: ReadableAddress\n\n /** Optional signer to use as the default signer for default sender calls (if not specified then the signer will be resolved from `AlgorandClient`). */\n defaultSigner?: TransactionSigner\n\n /** The version of app that is / will be deployed; defaults to 1.0 */\n version?: string\n\n /**\n * Whether or not the contract should have deploy-time immutability control set, undefined = ignore.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n updatable?: boolean\n\n /**\n * Whether or not the contract should have deploy-time permanence control set, undefined = ignore.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n deletable?: boolean\n\n /**\n * Optional deploy-time TEAL template replacement parameters.\n * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls.\n *\n * Useful if you want to vend multiple contracts from the same factory without specifying this value\n * for each call.\n */\n deployTimeParams?: TealTemplateParams\n}\n\n/** onComplete parameter for a create app call */\nexport type CreateOnComplete = {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearState>\n}\n\n/** Specifies a schema used for creating an app */\nexport type CreateSchema = {\n /** The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. */\n schema?: {\n /** The number of integers saved in global state. */\n globalInts: number\n /** The number of byte slices saved in global state. */\n globalByteSlices: number\n /** The number of integers saved in local state. */\n localInts: number\n /** The number of byte slices saved in local state. */\n localByteSlices: number\n }\n /** Number of extra pages required for the programs.\n * Defaults to the number needed for the programs in this call if not specified.\n * This is immutable once the app is created. */\n extraProgramPages?: number\n}\n\n/** Params to specify a bare (raw) create call for an app */\nexport type AppFactoryCreateParams = Expand<AppClientBareCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema>\n\n/** Params to specify a create method call for an app */\nexport type AppFactoryCreateMethodCallParams = Expand<\n AppClientMethodCallParams & AppClientCompilationParams & CreateOnComplete & CreateSchema\n>\n\n/** Params to get an app client by ID from an app factory. */\nexport type AppFactoryAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>\n\n/** Params to get an app client by creator address and name from an app factory. */\nexport type AppFactoryResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>\n\n/** Parameters to define a deployment for an `AppFactory` */\nexport type AppFactoryDeployParams = Expand<\n Omit<AppDeployParams, 'createParams' | 'updateParams' | 'deleteParams' | 'metadata'> & {\n /** Create transaction parameters to use if a create needs to be issued as part of deployment */\n createParams?:\n | Expand<AppClientMethodCallParams & CreateOnComplete & CreateSchema>\n | Expand<AppClientBareCallParams & CreateOnComplete & CreateSchema>\n /** Update transaction parameters to use if a create needs to be issued as part of deployment */\n updateParams?: AppClientMethodCallParams | AppClientBareCallParams\n /** Delete transaction parameters to use if a create needs to be issued as part of deployment */\n deleteParams?: AppClientMethodCallParams | AppClientBareCallParams\n /**\n * Whether or not the contract should have deploy-time immutability control set.\n * `undefined` = use AppFactory constructor value if set or base it on the app spec.\n */\n updatable?: boolean\n /**\n * Whether or not the contract should have deploy-time permanence control set.\n * `undefined` = use AppFactory constructor value if set or base it on the app spec.\n */\n deletable?: boolean\n /** Override the app name for this deployment */\n appName?: string\n }\n>\n\n/**\n * ARC-56/ARC-32 app factory that, for a given app spec, allows you to create\n * and deploy one or more app instances and to create one or more app clients\n * to interact with those (or other) app instances.\n */\nexport class AppFactory {\n private _appSpec: Arc56Contract\n private _appName: string\n private _algorand: AlgorandClient\n private _version: string\n private _defaultSender?: Address\n private _defaultSigner?: TransactionSigner\n private _deployTimeParams?: TealTemplateParams\n private _updatable?: boolean\n private _deletable?: boolean\n\n private _approvalSourceMap: ProgramSourceMap | undefined\n private _clearSourceMap: ProgramSourceMap | undefined\n\n private _paramsMethods: ReturnType<AppFactory['getParamsMethods']>\n\n /**\n * Create a new app factory.\n * @param params The parameters to create the app factory\n * @returns The `AppFactory` instance\n * @example\n * ```typescript\n * const appFactory = new AppFactory({\n * appSpec: appSpec,\n * algorand: AlgorandClient.mainNet(),\n * })\n */\n constructor(params: AppFactoryParams) {\n this._appSpec = AppClient.normaliseAppSpec(params.appSpec)\n this._appName = params.appName ?? this._appSpec.name\n this._algorand = params.algorand\n this._version = params.version ?? '1.0'\n this._defaultSender = getOptionalAddress(params.defaultSender)\n this._defaultSigner = params.defaultSigner\n this._deployTimeParams = params.deployTimeParams\n this._updatable = params.updatable\n this._deletable = params.deletable\n this._paramsMethods = this.getParamsMethods()\n }\n\n /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n public get appName() {\n return this._appName\n }\n\n /** The ARC-56 app spec being used */\n get appSpec() {\n return this._appSpec\n }\n\n /** Return the algorand client this factory is using. */\n get algorand() {\n return this._algorand\n }\n\n /** Get parameters to create transactions (create and deploy related calls) for the current app.\n *\n * A good mental model for this is that these parameters represent a deferred transaction creation.\n * @example Create a transaction in the future using Algorand Client\n * ```typescript\n * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})\n * // ...\n * await algorand.send.AppCreateMethodCall(createAppParams)\n * ```\n * @example Define a nested transaction as an ABI argument\n * ```typescript\n * const createAppParams = appFactory.params.create({method: 'create_method', args: [123, 'hello']})\n * await appClient.send.call({method: 'my_method', args: [createAppParams]})\n * ```\n */\n get params() {\n return this._paramsMethods\n }\n\n /** Create transactions for the current app */\n readonly createTransaction = {\n /** Create bare (raw) transactions for the current app */\n bare: {\n /**\n * Create a create app call transaction using a bare (raw) create call.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the create call transaction\n * @returns The create call transaction\n */\n create: async (params?: AppFactoryCreateParams) => {\n return this._algorand.createTransaction.appCreate(await this.params.bare.create(params))\n },\n },\n\n /**\n * Create a create app call transaction using an ABI create call.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the create call transaction\n * @returns The create call transaction\n */\n create: async (params: AppFactoryCreateMethodCallParams) => {\n return this._algorand.createTransaction.appCreateMethodCall(await this.params.create(params))\n },\n }\n\n /** Send transactions to the current app */\n readonly send = {\n /** Send bare (raw) transactions for the current app */\n bare: {\n /**\n * Creates an instance of the app using a bare (raw) create call and returns the result\n * of the creation transaction and an app client to interact with that app instance.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the app\n * @returns The app client and the result of the creation transaction\n */\n create: async (params?: AppFactoryCreateParams & SendParams) => {\n const updatable = params?.updatable ?? this._updatable\n const deletable = params?.deletable ?? this._deletable\n const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams\n const compiled = await this.compile({ deployTimeParams, updatable, deletable })\n const result = await this.handleCallErrors(async () => ({\n ...(await this._algorand.send.appCreate(await this.params.bare.create({ ...params, updatable, deletable, deployTimeParams }))),\n return: undefined,\n }))\n return {\n appClient: this.getAppClientById({\n appId: result.appId,\n }),\n result: {\n ...result,\n ...(compiled as Partial<AppCompilationResult>),\n },\n }\n },\n },\n\n /**\n * Creates an instance of the app and returns the result of the creation\n * transaction and an app client to interact with that app instance.\n *\n * Performs deploy-time TEAL template placeholder substitutions (if specified).\n * @param params The parameters to create the app\n * @returns The app client and the result of the creation transaction\n */\n create: async (params: AppFactoryCreateMethodCallParams & SendParams) => {\n const updatable = params?.updatable ?? this._updatable\n const deletable = params?.deletable ?? this._deletable\n const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams\n const compiled = await this.compile({ deployTimeParams, updatable, deletable })\n const result = await this.handleCallErrors(async () => {\n const result = await this._algorand.send.appCreateMethodCall(\n await this.params.create({ ...params, updatable, deletable, deployTimeParams }),\n )\n return {\n ...result,\n return: result.return?.returnValue,\n }\n })\n return {\n appClient: this.getAppClientById({\n appId: result.appId,\n }),\n result: {\n ...result,\n ...(compiled as Partial<AppCompilationResult>),\n },\n }\n },\n }\n\n /**\n * Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).\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 params The arguments to control the app deployment\n * @returns The app client and the result of the deployment\n * @example\n * ```ts\n * const { appClient, result } = await factory.deploy({\n * createParams: {\n * sender: 'SENDER_ADDRESS',\n * approvalProgram: 'APPROVAL PROGRAM',\n * clearStateProgram: 'CLEAR PROGRAM',\n * schema: {\n * globalByteSlices: 0,\n * globalInts: 0,\n * localByteSlices: 0,\n * localInts: 0\n * }\n * },\n * updateParams: {\n * sender: 'SENDER_ADDRESS'\n * },\n * deleteParams: {\n * sender: 'SENDER_ADDRESS'\n * },\n * onSchemaBreak: 'append',\n * onUpdate: 'append'\n * })\n * ```\n */\n public async deploy(params: AppFactoryDeployParams) {\n const updatable = params.updatable ?? this._updatable ?? this.getDeployTimeControl('updatable')\n const deletable = params.deletable ?? this._deletable ?? this.getDeployTimeControl('deletable')\n const deployTimeParams = params.deployTimeParams ?? this._deployTimeParams\n\n // Compile using a appID 0 AppClient so we can register the error handler and use the programs\n // to identify the app within the error handler (because we can't use app ID 0)\n const tempAppClient = this.getAppClientById({ appId: 0n })\n const compiled = await tempAppClient.compile({ deployTimeParams, updatable, deletable })\n\n const deployResult = await this._algorand.appDeployer.deploy({\n ...params,\n createParams: await (params.createParams && 'method' in params.createParams\n ? this.params.create({ ...params.createParams, updatable, deletable, deployTimeParams })\n : this.params.bare.create({ ...params.createParams, updatable, deletable, deployTimeParams })),\n updateParams:\n params.updateParams && 'method' in params.updateParams\n ? this.params.deployUpdate(params.updateParams)\n : this.params.bare.deployUpdate(params.updateParams),\n deleteParams:\n params.deleteParams && 'method' in params.deleteParams\n ? this.params.deployDelete(params.deleteParams)\n : this.params.bare.deployDelete(params.deleteParams),\n metadata: {\n name: params.appName ?? this._appName,\n version: this._version,\n updatable,\n deletable,\n },\n })\n const appClient = this.getAppClientById({\n appId: deployResult.appId,\n appName: params.appName,\n })\n const result = {\n ...deployResult,\n ...(compiled as Partial<AppCompilationResult>),\n }\n return {\n appClient,\n result: {\n ...result,\n return:\n 'return' in result\n ? result.operationPerformed === 'update'\n ? params.updateParams && 'method' in params.updateParams\n ? result.return?.returnValue\n : undefined\n : params.createParams && 'method' in params.createParams\n ? result.return?.returnValue\n : undefined\n : undefined,\n deleteReturn:\n 'deleteReturn' in result && params.deleteParams && 'method' in params.deleteParams ? result.deleteReturn?.returnValue : undefined,\n },\n }\n }\n\n /**\n * Returns a new `AppClient` client for an app instance of the given ID.\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient` instance\n * @example\n * ```typescript\n * const appClient = factory.getAppClientById({ appId: 12345n })\n * ```\n */\n public getAppClientById(params: AppFactoryAppClientParams) {\n return new AppClient({\n ...params,\n algorand: this._algorand,\n appSpec: this._appSpec,\n appName: params.appName ?? this._appName,\n defaultSender: params.defaultSender ?? this._defaultSender,\n defaultSigner: params.defaultSigner ?? this._defaultSigner,\n approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap,\n clearSourceMap: params.clearSourceMap ?? this._clearSourceMap,\n })\n }\n\n /**\n * Returns a new `AppClient` client, resolving the app by creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient` instance\n * @example\n * ```typescript\n * const appClient = factory.getAppClientByCreatorAndName({ creatorAddress: 'CREATOR_ADDRESS', appName: 'my_app' })\n * ```\n */\n public getAppClientByCreatorAndName(params: AppFactoryResolveAppClientByCreatorAndNameParams) {\n return AppClient.fromCreatorAndName({\n ...params,\n algorand: this._algorand,\n appSpec: this._appSpec,\n appName: params.appName ?? this._appName,\n defaultSender: params.defaultSender ?? this._defaultSender,\n approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap,\n clearSourceMap: params.clearSourceMap ?? this._clearSourceMap,\n })\n }\n\n /**\n * Takes an error that may include a logic error from a call to the current app and re-exposes the\n * error to include source code information via the source map and ARC-56 spec.\n * @param e The error to parse\n * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)\n * @returns The new error, or if there was no logic error or source map then the wrapped error with source details\n */\n exposeLogicError(e: Error, isClearStateProgram?: boolean): Error {\n return AppClient.exposeLogicError(e, this._appSpec, {\n isClearStateProgram,\n approvalSourceMap: this._approvalSourceMap,\n clearSourceMap: this._clearSourceMap,\n })\n }\n\n /**\n * Export the current source maps for the app.\n * @returns The source maps\n */\n exportSourceMaps(): AppSourceMaps {\n if (!this._approvalSourceMap || !this._clearSourceMap) {\n throw new Error(\n \"Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first\",\n )\n }\n\n return {\n approvalSourceMap: this._approvalSourceMap,\n clearSourceMap: this._clearSourceMap,\n }\n }\n\n /**\n * Import source maps for the app.\n * @param sourceMaps The source maps to import\n */\n importSourceMaps(sourceMaps: AppSourceMaps) {\n this._approvalSourceMap = new ProgramSourceMap(sourceMaps.approvalSourceMap)\n this._clearSourceMap = new ProgramSourceMap(sourceMaps.clearSourceMap)\n }\n\n private getDeployTimeControl(control: 'updatable' | 'deletable'): boolean | undefined {\n const approval = this._appSpec.source?.approval ? Buffer.from(this._appSpec.source.approval, 'base64').toString('utf-8') : undefined\n // variable not present, so unknown control value\n if (!approval || !approval.includes(control === 'updatable' ? UPDATABLE_TEMPLATE_NAME : DELETABLE_TEMPLATE_NAME)) return undefined\n\n // A call is present and configured\n return (\n this._appSpec.bareActions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication') ||\n Object.values(this._appSpec.methods).some((c) =>\n c.actions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication'),\n )\n )\n }\n\n private getParamsMethods() {\n return {\n /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */\n create: async (params: AppFactoryCreateMethodCallParams) => {\n const compiled = await this.compile({ ...params, deployTimeParams: params.deployTimeParams ?? this._deployTimeParams })\n return this.getABIParams(\n {\n ...params,\n deployTimeParams: params.deployTimeParams ?? this._deployTimeParams,\n schema: params.schema ?? {\n globalByteSlices: this._appSpec.state.schema.global.bytes,\n globalInts: this._appSpec.state.schema.global.ints,\n localByteSlices: this._appSpec.state.schema.local.bytes,\n localInts: this._appSpec.state.schema.local.ints,\n },\n approvalProgram: compiled.approvalProgram,\n clearStateProgram: compiled.clearStateProgram,\n },\n params.onComplete ?? OnApplicationComplete.NoOp,\n ) satisfies AppCreateMethodCall\n },\n /** Return params for a deployment update ABI call */\n deployUpdate: (params: AppClientMethodCallParams) => {\n return this.getABIParams(params, OnApplicationComplete.UpdateApplication) satisfies DeployAppUpdateMethodCall\n },\n /** Return params for a deployment delete ABI call */\n deployDelete: (params: AppClientMethodCallParams) => {\n return this.getABIParams(params, OnApplicationComplete.DeleteApplication) satisfies DeployAppDeleteMethodCall\n },\n bare: {\n /** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */\n create: async (params?: AppFactoryCreateParams) => {\n return this.getBareParams(\n {\n ...params,\n deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams,\n schema: params?.schema ?? {\n globalByteSlices: this._appSpec.state.schema.global.bytes,\n globalInts: this._appSpec.state.schema.global.ints,\n localByteSlices: this._appSpec.state.schema.local.bytes,\n localInts: this._appSpec.state.schema.local.ints,\n },\n ...(await this.compile({ ...params, deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams })),\n },\n params?.onComplete ?? OnApplicationComplete.NoOp,\n ) satisfies AppCreateParams\n },\n /** Return params for a deployment update bare call */\n deployUpdate: (params?: AppClientBareCallParams) => {\n return this.getBareParams(params, OnApplicationComplete.UpdateApplication) satisfies DeployAppUpdateParams\n },\n /** Return params for a deployment delete bare call */\n deployDelete: (params?: AppClientBareCallParams) => {\n return this.getBareParams(params, OnApplicationComplete.DeleteApplication) satisfies DeployAppDeleteParams\n },\n },\n }\n }\n\n /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */\n private async handleCallErrors<TResult>(call: () => Promise<TResult>) {\n try {\n return await call()\n } catch (e) {\n throw this.exposeLogicError(e as Error)\n }\n }\n\n /**\n * Compiles the approval and clear state programs (if TEAL templates provided),\n * performing any provided deploy-time parameter replacement and stores\n * the source maps.\n *\n * If no TEAL templates provided it will use any byte code provided in the app spec.\n *\n * Will store any generated source maps for later use in debugging.\n * @param compilation Optional compilation parameters to use for the compilation\n * @returns The compilation result\n * @example\n * ```typescript\n * const result = await factory.compile()\n * ```\n */\n public async compile(compilation?: AppClientCompilationParams) {\n const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation)\n\n if (result.compiledApproval) {\n this._approvalSourceMap = result.compiledApproval.sourceMap\n }\n if (result.compiledClear) {\n this._clearSourceMap = result.compiledClear.sourceMap\n }\n\n return result\n }\n\n private getBareParams<\n TParams extends { sender?: ReadableAddress; signer?: TransactionSigner | AddressWithTransactionSigner } | undefined,\n TOnComplete extends OnApplicationComplete,\n >(params: TParams, onComplete: TOnComplete) {\n return {\n ...params,\n sender: this.getSender(params?.sender),\n signer: this.getSigner(params?.sender, params?.signer),\n onComplete,\n }\n }\n\n private getABIParams<\n TParams extends {\n method: string\n sender?: ReadableAddress\n signer?: TransactionSigner | AddressWithTransactionSigner\n args?: AppClientMethodCallParams['args']\n },\n TOnComplete extends OnApplicationComplete,\n >(params: TParams, onComplete: TOnComplete) {\n return {\n ...params,\n sender: this.getSender(params.sender),\n signer: this.getSigner(params.sender, params.signer),\n method: getABIMethod(params.method, this._appSpec),\n args: this.getCreateABIArgsWithDefaultValues(params.method, params.args),\n onComplete,\n }\n }\n\n private getCreateABIArgsWithDefaultValues(\n methodNameOrSignature: string,\n args: AppClientMethodCallParams['args'] | undefined,\n ): AppMethodCall<CommonAppCallParams>['args'] {\n const m = getABIMethod(methodNameOrSignature, this._appSpec)\n return args?.map((arg, i) => {\n const methodArg = m.args[i]\n if (arg !== undefined) {\n return arg\n }\n if (argTypeIsTransaction(methodArg.type)) {\n return arg\n }\n const defaultValue = methodArg.defaultValue\n if (defaultValue) {\n switch (defaultValue.source) {\n case 'literal': {\n const bytes = Buffer.from(defaultValue.data, 'base64')\n const value_type = defaultValue.type ?? methodArg.type\n return getABIDecodedValue(value_type, bytes)\n }\n default:\n throw new Error(`Can't provide default value for ${defaultValue.source} for a contract creation call`)\n }\n }\n throw new Error(`No value provided for required argument ${methodArg.name ?? `arg${i + 1}`} in call to method ${m.name}`)\n })\n }\n\n /** Returns the sender for a call, using the `defaultSender`\n * if none provided and throws an error if neither provided */\n private getSender(sender: ReadableAddress | undefined): Address {\n if (!sender && !this._defaultSender) {\n throw new Error(`No sender provided and no default sender present in app factory for call to app ${this._appName}`)\n }\n return getAddress(sender ?? this._defaultSender!)\n }\n\n /** Returns the signer for a call, using the provided signer or the `defaultSigner`\n * if no signer was provided and the sender resolves to the default sender, the call will use default signer\n * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */\n private getSigner(\n sender: ReadableAddress | undefined,\n signer: TransactionSigner | AddressWithTransactionSigner | undefined,\n ): TransactionSigner | AddressWithTransactionSigner | undefined {\n return signer ?? (!sender || sender === this._defaultSender ? this._defaultSigner : undefined)\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqJA,IAAa,aAAb,MAAwB;CACtB,AAAQ;CACR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,MAAI,CAAC,UAAU,CAAC,KAAK,eACnB,OAAM,IAAI,MAAM,mFAAmF,KAAK,WAAW;AAErH,SAAOC,2BAAW,UAAU,KAAK,eAAgB;;;;;CAMnD,AAAQ,UACN,QACA,QAC8D;AAC9D,SAAO,WAAW,CAAC,UAAU,WAAW,KAAK,iBAAiB,KAAK,iBAAiB"}
|
package/types/app-factory.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAddress, getOptionalAddress } from "../packages/common/src/address.mjs";
|
|
2
|
-
import { OnApplicationComplete } from "../packages/transact/src/transactions/app-call.mjs";
|
|
3
|
-
import { ProgramSourceMap } from "../packages/sdk/src/logic/sourcemap.mjs";
|
|
4
2
|
import { DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME } from "./app.mjs";
|
|
3
|
+
import { ProgramSourceMap } from "../packages/common/src/sourcemap.mjs";
|
|
4
|
+
import { OnApplicationComplete } from "../packages/transact/src/transactions/app-call.mjs";
|
|
5
5
|
import { argTypeIsTransaction, getABIDecodedValue, getABIMethod } from "../packages/abi/src/abi-method.mjs";
|
|
6
6
|
import { AppClient } from "./app-client.mjs";
|
|
7
7
|
|