@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-config.js","names":["Transaction","buildTransactionCommonData","TransactionType","ensureString","getOptionalAddress","getAddress"],"sources":["../../src/transactions/asset-config.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData, ensureString } from './common'\n\n/** Parameters to define an asset create transaction.\n *\n * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.\n */\nexport type AssetCreateParams = CommonTransactionParams & {\n /** The total amount of the smallest divisible (decimal) unit to create.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.\n *\n * This field can only be specified upon asset creation.\n */\n total: bigint\n\n /** The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: string | Uint8Array\n\n /** Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.\n */\n manager?: ReadableAddress\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n reserve?: ReadableAddress\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n freeze?: ReadableAddress\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset reconfiguration transaction.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n */\nexport type AssetConfigParams = CommonTransactionParams & {\n /** ID of the asset to reconfigure */\n assetId: bigint\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) the asset will become permanently immutable.\n */\n manager?: ReadableAddress\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n reserve?: ReadableAddress\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n freeze?: ReadableAddress\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset freeze transaction. */\nexport type AssetFreezeParams = CommonTransactionParams & {\n /** The ID of the asset to freeze/unfreeze */\n assetId: bigint\n /** The address of the account to freeze or unfreeze */\n account: ReadableAddress\n /** Whether the assets in the account should be frozen */\n frozen: boolean\n}\n\n/** Parameters to define an asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.\n */\nexport type AssetDestroyParams = CommonTransactionParams & {\n /** ID of the asset to destroy */\n assetId: bigint\n}\n\nexport const buildAssetCreate = (\n params: AssetCreateParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: 0n, // Asset creation always uses ID 0\n total: params.total,\n decimals: params.decimals,\n defaultFrozen: params.defaultFrozen,\n assetName: params.assetName,\n unitName: params.unitName,\n url: params.url,\n metadataHash: ensureString(params.metadataHash),\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetConfig = (\n params: AssetConfigParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetFreeze = (\n params: AssetFreezeParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetFreeze,\n assetFreeze: {\n assetId: params.assetId,\n freezeTarget: getAddress(params.account),\n frozen: params.frozen,\n },\n })\n}\n\nexport const buildAssetDestroy = (\n params: AssetDestroyParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n },\n })\n}\n"],"mappings":";;;;;;AA4LA,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIA,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS;GACT,OAAO,OAAO;GACd,UAAU,OAAO;GACjB,eAAe,OAAO;GACtB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,KAAK,OAAO;GACZ,cAAcC,4BAAa,OAAO,aAAa;GAC/C,SAASC,mCAAmB,OAAO,QAAQ;GAC3C,SAASA,mCAAmB,OAAO,QAAQ;GAC3C,QAAQA,mCAAmB,OAAO,OAAO;GACzC,UAAUA,mCAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIJ,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,SAASE,mCAAmB,OAAO,QAAQ;GAC3C,SAASA,mCAAmB,OAAO,QAAQ;GAC3C,QAAQA,mCAAmB,OAAO,OAAO;GACzC,UAAUA,mCAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIJ,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,cAAcG,2BAAW,OAAO,QAAQ;GACxC,QAAQ,OAAO;GAChB;EACF,CAAC;;AAGJ,MAAa,qBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIL,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa,EACX,SAAS,OAAO,SACjB;EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"asset-config.js","names":["Transaction","buildTransactionCommonData","TransactionType","ensureString","getOptionalAddress","getAddress"],"sources":["../../src/transactions/asset-config.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData, ensureString } from './common'\n\n/** Parameters to define an asset create transaction.\n *\n * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.\n */\nexport type AssetCreateParams = CommonTransactionParams & {\n /** The total amount of the smallest divisible (decimal) unit to create.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.\n *\n * This field can only be specified upon asset creation.\n */\n total: bigint\n\n /** The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: string | Uint8Array\n\n /** Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.\n */\n manager?: ReadableAddress\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n reserve?: ReadableAddress\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n freeze?: ReadableAddress\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset reconfiguration transaction.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n */\nexport type AssetConfigParams = CommonTransactionParams & {\n /** ID of the asset to reconfigure */\n assetId: bigint\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) the asset will become permanently immutable.\n */\n manager?: ReadableAddress\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n reserve?: ReadableAddress\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n freeze?: ReadableAddress\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset freeze transaction. */\nexport type AssetFreezeParams = CommonTransactionParams & {\n /** The ID of the asset to freeze/unfreeze */\n assetId: bigint\n /** The address of the account to freeze or unfreeze */\n freezeTarget: ReadableAddress\n /** Whether the assets in the account should be frozen */\n frozen: boolean\n}\n\n/** Parameters to define an asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.\n */\nexport type AssetDestroyParams = CommonTransactionParams & {\n /** ID of the asset to destroy */\n assetId: bigint\n}\n\nexport const buildAssetCreate = (\n params: AssetCreateParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: 0n, // Asset creation always uses ID 0\n total: params.total,\n decimals: params.decimals,\n defaultFrozen: params.defaultFrozen,\n assetName: params.assetName,\n unitName: params.unitName,\n url: params.url,\n metadataHash: ensureString(params.metadataHash),\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetConfig = (\n params: AssetConfigParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetFreeze = (\n params: AssetFreezeParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetFreeze,\n assetFreeze: {\n assetId: params.assetId,\n freezeTarget: getAddress(params.freezeTarget),\n frozen: params.frozen,\n },\n })\n}\n\nexport const buildAssetDestroy = (\n params: AssetDestroyParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n },\n })\n}\n"],"mappings":";;;;;;AA4LA,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIA,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS;GACT,OAAO,OAAO;GACd,UAAU,OAAO;GACjB,eAAe,OAAO;GACtB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,KAAK,OAAO;GACZ,cAAcC,4BAAa,OAAO,aAAa;GAC/C,SAASC,mCAAmB,OAAO,QAAQ;GAC3C,SAASA,mCAAmB,OAAO,QAAQ;GAC3C,QAAQA,mCAAmB,OAAO,OAAO;GACzC,UAAUA,mCAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIJ,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,SAASE,mCAAmB,OAAO,QAAQ;GAC3C,SAASA,mCAAmB,OAAO,QAAQ;GAC3C,QAAQA,mCAAmB,OAAO,OAAO;GACzC,UAAUA,mCAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIJ,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,cAAcG,2BAAW,OAAO,aAAa;GAC7C,QAAQ,OAAO;GAChB;EACF,CAAC;;AAGJ,MAAa,qBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAIL,gCAAY;EACrB,GAFiBC,0CAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAMC,yCAAgB;EACtB,aAAa,EACX,SAAS,OAAO,SACjB;EACF,CAAC"}
|
|
@@ -43,7 +43,7 @@ const buildAssetFreeze = (params, suggestedParams, defaultValidityWindow) => {
|
|
|
43
43
|
type: TransactionType.AssetFreeze,
|
|
44
44
|
assetFreeze: {
|
|
45
45
|
assetId: params.assetId,
|
|
46
|
-
freezeTarget: getAddress(params.
|
|
46
|
+
freezeTarget: getAddress(params.freezeTarget),
|
|
47
47
|
frozen: params.frozen
|
|
48
48
|
}
|
|
49
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-config.mjs","names":[],"sources":["../../src/transactions/asset-config.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData, ensureString } from './common'\n\n/** Parameters to define an asset create transaction.\n *\n * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.\n */\nexport type AssetCreateParams = CommonTransactionParams & {\n /** The total amount of the smallest divisible (decimal) unit to create.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.\n *\n * This field can only be specified upon asset creation.\n */\n total: bigint\n\n /** The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: string | Uint8Array\n\n /** Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.\n */\n manager?: ReadableAddress\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n reserve?: ReadableAddress\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n freeze?: ReadableAddress\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset reconfiguration transaction.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n */\nexport type AssetConfigParams = CommonTransactionParams & {\n /** ID of the asset to reconfigure */\n assetId: bigint\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) the asset will become permanently immutable.\n */\n manager?: ReadableAddress\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n reserve?: ReadableAddress\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n freeze?: ReadableAddress\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset freeze transaction. */\nexport type AssetFreezeParams = CommonTransactionParams & {\n /** The ID of the asset to freeze/unfreeze */\n assetId: bigint\n /** The address of the account to freeze or unfreeze */\n account: ReadableAddress\n /** Whether the assets in the account should be frozen */\n frozen: boolean\n}\n\n/** Parameters to define an asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.\n */\nexport type AssetDestroyParams = CommonTransactionParams & {\n /** ID of the asset to destroy */\n assetId: bigint\n}\n\nexport const buildAssetCreate = (\n params: AssetCreateParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: 0n, // Asset creation always uses ID 0\n total: params.total,\n decimals: params.decimals,\n defaultFrozen: params.defaultFrozen,\n assetName: params.assetName,\n unitName: params.unitName,\n url: params.url,\n metadataHash: ensureString(params.metadataHash),\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetConfig = (\n params: AssetConfigParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetFreeze = (\n params: AssetFreezeParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetFreeze,\n assetFreeze: {\n assetId: params.assetId,\n freezeTarget: getAddress(params.account),\n frozen: params.frozen,\n },\n })\n}\n\nexport const buildAssetDestroy = (\n params: AssetDestroyParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n },\n })\n}\n"],"mappings":";;;;;;AA4LA,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS;GACT,OAAO,OAAO;GACd,UAAU,OAAO;GACjB,eAAe,OAAO;GACtB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,KAAK,OAAO;GACZ,cAAc,aAAa,OAAO,aAAa;GAC/C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,QAAQ,mBAAmB,OAAO,OAAO;GACzC,UAAU,mBAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,QAAQ,mBAAmB,OAAO,OAAO;GACzC,UAAU,mBAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,cAAc,WAAW,OAAO,QAAQ;GACxC,QAAQ,OAAO;GAChB;EACF,CAAC;;AAGJ,MAAa,qBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa,EACX,SAAS,OAAO,SACjB;EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"asset-config.mjs","names":[],"sources":["../../src/transactions/asset-config.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { ReadableAddress, getAddress, getOptionalAddress } from '@algorandfoundation/algokit-common'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData, ensureString } from './common'\n\n/** Parameters to define an asset create transaction.\n *\n * The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.\n */\nexport type AssetCreateParams = CommonTransactionParams & {\n /** The total amount of the smallest divisible (decimal) unit to create.\n *\n * For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.\n *\n * This field can only be specified upon asset creation.\n */\n total: bigint\n\n /** The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n *\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n * * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /** The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /** The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: string | Uint8Array\n\n /** Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.\n */\n manager?: ReadableAddress\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n reserve?: ReadableAddress\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n freeze?: ReadableAddress\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) at asset creation or subsequently set to empty by the manager the field is permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset reconfiguration transaction.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n */\nexport type AssetConfigParams = CommonTransactionParams & {\n /** ID of the asset to reconfigure */\n assetId: bigint\n /** The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set (`undefined` or `\"\"`) the asset will become permanently immutable.\n */\n manager?: ReadableAddress\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n reserve?: ReadableAddress\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n freeze?: ReadableAddress\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set (`undefined` or `\"\"`) the field will become permanently empty.\n */\n clawback?: ReadableAddress\n}\n\n/** Parameters to define an asset freeze transaction. */\nexport type AssetFreezeParams = CommonTransactionParams & {\n /** The ID of the asset to freeze/unfreeze */\n assetId: bigint\n /** The address of the account to freeze or unfreeze */\n freezeTarget: ReadableAddress\n /** Whether the assets in the account should be frozen */\n frozen: boolean\n}\n\n/** Parameters to define an asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.\n */\nexport type AssetDestroyParams = CommonTransactionParams & {\n /** ID of the asset to destroy */\n assetId: bigint\n}\n\nexport const buildAssetCreate = (\n params: AssetCreateParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: 0n, // Asset creation always uses ID 0\n total: params.total,\n decimals: params.decimals,\n defaultFrozen: params.defaultFrozen,\n assetName: params.assetName,\n unitName: params.unitName,\n url: params.url,\n metadataHash: ensureString(params.metadataHash),\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetConfig = (\n params: AssetConfigParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n manager: getOptionalAddress(params.manager),\n reserve: getOptionalAddress(params.reserve),\n freeze: getOptionalAddress(params.freeze),\n clawback: getOptionalAddress(params.clawback),\n },\n })\n}\n\nexport const buildAssetFreeze = (\n params: AssetFreezeParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetFreeze,\n assetFreeze: {\n assetId: params.assetId,\n freezeTarget: getAddress(params.freezeTarget),\n frozen: params.frozen,\n },\n })\n}\n\nexport const buildAssetDestroy = (\n params: AssetDestroyParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n return new Transaction({\n ...commonData,\n type: TransactionType.AssetConfig,\n assetConfig: {\n assetId: params.assetId,\n },\n })\n}\n"],"mappings":";;;;;;AA4LA,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS;GACT,OAAO,OAAO;GACd,UAAU,OAAO;GACjB,eAAe,OAAO;GACtB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,KAAK,OAAO;GACZ,cAAc,aAAa,OAAO,aAAa;GAC/C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,QAAQ,mBAAmB,OAAO,OAAO;GACzC,UAAU,mBAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,SAAS,mBAAmB,OAAO,QAAQ;GAC3C,QAAQ,mBAAmB,OAAO,OAAO;GACzC,UAAU,mBAAmB,OAAO,SAAS;GAC9C;EACF,CAAC;;AAGJ,MAAa,oBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa;GACX,SAAS,OAAO;GAChB,cAAc,WAAW,OAAO,aAAa;GAC7C,QAAQ,OAAO;GAChB;EACF,CAAC;;AAGJ,MAAa,qBACX,QACA,iBACA,0BACgB;AAEhB,QAAO,IAAI,YAAY;EACrB,GAFiB,2BAA2B,QAAQ,iBAAiB,sBAAsB;EAG3F,MAAM,gBAAgB;EACtB,aAAa,EACX,SAAS,OAAO,SACjB;EACF,CAAC"}
|
|
@@ -15,7 +15,7 @@ type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
|
15
15
|
/** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */
|
|
16
16
|
voteKeyDilution: bigint;
|
|
17
17
|
/** The 64 byte state proof public key commitment */
|
|
18
|
-
stateProofKey
|
|
18
|
+
stateProofKey: Uint8Array;
|
|
19
19
|
};
|
|
20
20
|
/** Parameters to define an offline key registration transaction. */
|
|
21
21
|
type OfflineKeyRegistrationParams = CommonTransactionParams & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-registration.js","names":["buildTransactionCommonData","Transaction","TransactionType"],"sources":["../../src/transactions/key-registration.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Parameters to define an online key registration transaction. */\nexport type OnlineKeyRegistrationParams = CommonTransactionParams & {\n /** The root participation public key */\n voteKey: Uint8Array\n /** The VRF public key */\n selectionKey: Uint8Array\n /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */\n voteFirst: bigint\n /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */\n voteLast: bigint\n /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */\n voteKeyDilution: bigint\n /** The 64 byte state proof public key commitment */\n stateProofKey
|
|
1
|
+
{"version":3,"file":"key-registration.js","names":["buildTransactionCommonData","Transaction","TransactionType"],"sources":["../../src/transactions/key-registration.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Parameters to define an online key registration transaction. */\nexport type OnlineKeyRegistrationParams = CommonTransactionParams & {\n /** The root participation public key */\n voteKey: Uint8Array\n /** The VRF public key */\n selectionKey: Uint8Array\n /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */\n voteFirst: bigint\n /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */\n voteLast: bigint\n /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */\n voteKeyDilution: bigint\n /** The 64 byte state proof public key commitment */\n stateProofKey: Uint8Array\n}\n\n/** Parameters to define an offline key registration transaction. */\nexport type OfflineKeyRegistrationParams = CommonTransactionParams & {\n /** Prevent this account from ever participating again. The account will also no longer earn rewards */\n preventAccountFromEverParticipatingAgain?: boolean\n}\n\nexport const buildKeyReg = (\n params: OnlineKeyRegistrationParams | OfflineKeyRegistrationParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n if ('voteKey' in params) {\n return new Transaction({\n ...commonData,\n type: TransactionType.KeyRegistration,\n keyRegistration: {\n voteKey: params.voteKey,\n selectionKey: params.selectionKey,\n voteFirst: params.voteFirst,\n voteLast: params.voteLast,\n voteKeyDilution: params.voteKeyDilution,\n nonParticipation: false,\n stateProofKey: params.stateProofKey,\n },\n })\n } else {\n return new Transaction({\n ...commonData,\n type: TransactionType.KeyRegistration,\n keyRegistration: {\n nonParticipation: params.preventAccountFromEverParticipatingAgain,\n },\n })\n }\n}\n"],"mappings":";;;;;AA0BA,MAAa,eACX,QACA,iBACA,0BACgB;CAChB,MAAM,aAAaA,0CAA2B,QAAQ,iBAAiB,sBAAsB;AAC7F,KAAI,aAAa,OACf,QAAO,IAAIC,gCAAY;EACrB,GAAG;EACH,MAAMC,yCAAgB;EACtB,iBAAiB;GACf,SAAS,OAAO;GAChB,cAAc,OAAO;GACrB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,iBAAiB,OAAO;GACxB,kBAAkB;GAClB,eAAe,OAAO;GACvB;EACF,CAAC;KAEF,QAAO,IAAID,gCAAY;EACrB,GAAG;EACH,MAAMC,yCAAgB;EACtB,iBAAiB,EACf,kBAAkB,OAAO,0CAC1B;EACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-registration.mjs","names":[],"sources":["../../src/transactions/key-registration.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Parameters to define an online key registration transaction. */\nexport type OnlineKeyRegistrationParams = CommonTransactionParams & {\n /** The root participation public key */\n voteKey: Uint8Array\n /** The VRF public key */\n selectionKey: Uint8Array\n /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */\n voteFirst: bigint\n /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */\n voteLast: bigint\n /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */\n voteKeyDilution: bigint\n /** The 64 byte state proof public key commitment */\n stateProofKey
|
|
1
|
+
{"version":3,"file":"key-registration.mjs","names":[],"sources":["../../src/transactions/key-registration.ts"],"sourcesContent":["import { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Transaction, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Parameters to define an online key registration transaction. */\nexport type OnlineKeyRegistrationParams = CommonTransactionParams & {\n /** The root participation public key */\n voteKey: Uint8Array\n /** The VRF public key */\n selectionKey: Uint8Array\n /** The first round that the participation key is valid. Not to be confused with the `firstValid` round of the keyreg transaction */\n voteFirst: bigint\n /** The last round that the participation key is valid. Not to be confused with the `lastValid` round of the keyreg transaction */\n voteLast: bigint\n /** This is the dilution for the 2-level participation key. It determines the interval (number of rounds) for generating new ephemeral keys */\n voteKeyDilution: bigint\n /** The 64 byte state proof public key commitment */\n stateProofKey: Uint8Array\n}\n\n/** Parameters to define an offline key registration transaction. */\nexport type OfflineKeyRegistrationParams = CommonTransactionParams & {\n /** Prevent this account from ever participating again. The account will also no longer earn rewards */\n preventAccountFromEverParticipatingAgain?: boolean\n}\n\nexport const buildKeyReg = (\n params: OnlineKeyRegistrationParams | OfflineKeyRegistrationParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n if ('voteKey' in params) {\n return new Transaction({\n ...commonData,\n type: TransactionType.KeyRegistration,\n keyRegistration: {\n voteKey: params.voteKey,\n selectionKey: params.selectionKey,\n voteFirst: params.voteFirst,\n voteLast: params.voteLast,\n voteKeyDilution: params.voteKeyDilution,\n nonParticipation: false,\n stateProofKey: params.stateProofKey,\n },\n })\n } else {\n return new Transaction({\n ...commonData,\n type: TransactionType.KeyRegistration,\n keyRegistration: {\n nonParticipation: params.preventAccountFromEverParticipatingAgain,\n },\n })\n }\n}\n"],"mappings":";;;;;AA0BA,MAAa,eACX,QACA,iBACA,0BACgB;CAChB,MAAM,aAAa,2BAA2B,QAAQ,iBAAiB,sBAAsB;AAC7F,KAAI,aAAa,OACf,QAAO,IAAI,YAAY;EACrB,GAAG;EACH,MAAM,gBAAgB;EACtB,iBAAiB;GACf,SAAS,OAAO;GAChB,cAAc,OAAO;GACrB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,iBAAiB,OAAO;GACxB,kBAAkB;GAClB,eAAe,OAAO;GACvB;EACF,CAAC;KAEF,QAAO,IAAI,YAAY;EACrB,GAAG;EACH,MAAM,gBAAgB;EACtB,iBAAiB,EACf,kBAAkB,OAAO,0CAC1B;EACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Expand } from "../packages/common/src/expand.js";
|
|
1
2
|
import { ABIValue } from "../packages/abi/src/abi-value.js";
|
|
2
3
|
import { ABIMethod } from "../packages/abi/src/abi-method.js";
|
|
3
4
|
import { Transaction } from "../packages/transact/src/transactions/transaction.js";
|
|
4
|
-
import { Expand } from "../types/expand.js";
|
|
5
5
|
import { AppCreateParams, AppDeleteParams, AppMethodCallParams, AppUpdateParams } from "./app-call.js";
|
|
6
6
|
import { TransactionWithSigner } from "../transaction/transaction.js";
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_address = require('../packages/common/src/address.js');
|
|
2
|
+
const require_util = require('../util.js');
|
|
2
3
|
const require_app_call = require('../packages/transact/src/transactions/app-call.js');
|
|
3
4
|
const require_transaction_type = require('../packages/transact/src/transactions/transaction-type.js');
|
|
4
5
|
const require_transaction = require('../packages/transact/src/transactions/transaction.js');
|
|
5
|
-
const require_util = require('../util.js');
|
|
6
6
|
const require_app_manager = require('../types/app-manager.js');
|
|
7
7
|
const require_common = require('./common.js');
|
|
8
8
|
const require_abi_type = require('../packages/abi/src/abi-type.js');
|
|
@@ -82,68 +82,58 @@ const isAbiValue = (x) => {
|
|
|
82
82
|
return typeof x === "bigint" || typeof x === "boolean" || typeof x === "number" || typeof x === "string" || x instanceof Uint8Array || x instanceof require_address.Address;
|
|
83
83
|
};
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Prepares method arguments for ABI encoding by building reference arrays and
|
|
86
|
+
* replacing reference-type arguments (account, asset, application) with their indices.
|
|
86
87
|
*/
|
|
87
|
-
function
|
|
88
|
-
const accounts = accountReferences ?? [];
|
|
89
|
-
const assets = assetReferences ?? [];
|
|
90
|
-
const apps = appReferences ?? [];
|
|
91
|
-
methodArgs.forEach((arg, i) => {
|
|
92
|
-
const argType = method.args[i].type;
|
|
93
|
-
if (require_abi_method.argTypeIsReference(argType)) switch (argType) {
|
|
94
|
-
case "account":
|
|
95
|
-
if (typeof arg === "string" && arg !== sender.toString() && !accounts.some((a) => a.toString() === arg)) accounts.push(require_address.getAddress(arg));
|
|
96
|
-
break;
|
|
97
|
-
case "asset":
|
|
98
|
-
if (typeof arg === "bigint" && !assets.includes(arg)) assets.push(arg);
|
|
99
|
-
break;
|
|
100
|
-
case "application":
|
|
101
|
-
if (typeof arg === "bigint" && arg !== appId && !apps.includes(arg)) apps.push(arg);
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
88
|
+
function prepareArgsForEncoding(sender, appId, method, methodArgs, accountReferences, appReferences, assetReferences) {
|
|
89
|
+
const accounts = [...accountReferences ?? []];
|
|
90
|
+
const assets = [...assetReferences ?? []];
|
|
91
|
+
const apps = [...appReferences ?? []];
|
|
105
92
|
return {
|
|
106
93
|
accountReferences: accounts,
|
|
107
94
|
appReferences: apps,
|
|
108
|
-
assetReferences: assets
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
95
|
+
assetReferences: assets,
|
|
96
|
+
updatedArgs: methodArgs.map((arg, i) => {
|
|
97
|
+
const argType = method.args[i].type;
|
|
98
|
+
if (!require_abi_method.argTypeIsReference(argType)) return arg;
|
|
99
|
+
switch (argType) {
|
|
100
|
+
case "account": {
|
|
101
|
+
let addr;
|
|
102
|
+
if (typeof arg === "string") addr = require_address.getAddress(arg);
|
|
103
|
+
else if (arg instanceof Uint8Array) addr = new require_address.Address(arg);
|
|
104
|
+
else throw new Error("Invalid value for account");
|
|
105
|
+
if (sender.equals(addr)) return 0;
|
|
106
|
+
const existing = accounts.findIndex((a) => a.equals(addr)) + 1;
|
|
107
|
+
if (existing) return existing;
|
|
108
|
+
accounts.push(addr);
|
|
109
|
+
return accounts.length;
|
|
110
|
+
}
|
|
111
|
+
case "asset": {
|
|
112
|
+
if (typeof arg !== "bigint") throw new Error("Invalid value for asset");
|
|
113
|
+
const existing = assets.findIndex((a) => a === arg);
|
|
114
|
+
if (existing === -1) {
|
|
115
|
+
assets.push(arg);
|
|
116
|
+
return assets.length - 1;
|
|
117
|
+
}
|
|
118
|
+
return existing;
|
|
119
|
+
}
|
|
120
|
+
case "application": {
|
|
121
|
+
if (typeof arg !== "bigint") throw new Error("Invalid value for application");
|
|
122
|
+
if (arg === appId) return 0;
|
|
123
|
+
const existing = apps.findIndex((a) => a === arg) + 1;
|
|
124
|
+
if (existing) return existing;
|
|
125
|
+
apps.push(arg);
|
|
126
|
+
return apps.length;
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (typeof refValue === "bigint") {
|
|
126
|
-
const index = assetReferences.indexOf(refValue);
|
|
127
|
-
if (index === -1) throw new Error(`Asset ${refValue} not found in reference array`);
|
|
128
|
-
return index;
|
|
129
|
-
}
|
|
130
|
-
throw new Error("Asset reference must be a bigint");
|
|
131
|
-
case "application":
|
|
132
|
-
if (typeof refValue === "bigint") {
|
|
133
|
-
if (refValue === appId) return 0;
|
|
134
|
-
const index = appReferences.indexOf(refValue);
|
|
135
|
-
if (index === -1) throw new Error(`Application ${refValue} not found in reference array`);
|
|
136
|
-
return index + 1;
|
|
137
|
-
}
|
|
138
|
-
throw new Error("Application reference must be a bigint");
|
|
139
|
-
default: throw new Error(`Unknown reference type: ${referenceType}`);
|
|
140
|
-
}
|
|
129
|
+
})
|
|
130
|
+
};
|
|
141
131
|
}
|
|
142
132
|
/**
|
|
143
133
|
* Encode ABI method arguments with tuple packing support
|
|
144
134
|
* Ports the logic from the Rust encode_method_arguments function
|
|
145
135
|
*/
|
|
146
|
-
function encodeMethodArguments(method, args
|
|
136
|
+
function encodeMethodArguments(method, args) {
|
|
147
137
|
const encodedArgs = new Array();
|
|
148
138
|
encodedArgs.push(method.getSelector());
|
|
149
139
|
const abiTypes = new Array();
|
|
@@ -153,10 +143,9 @@ function encodeMethodArguments(method, args, sender, appId, accountReferences, a
|
|
|
153
143
|
const argValue = args[i];
|
|
154
144
|
if (require_abi_method.argTypeIsTransaction(methodArg.type)) {} else if (require_abi_method.argTypeIsReference(methodArg.type)) {
|
|
155
145
|
const referenceType = methodArg.type;
|
|
156
|
-
if (typeof argValue === "
|
|
157
|
-
const foreignIndex = calculateMethodArgReferenceArrayIndex(argValue, referenceType, sender, appId, accountReferences, appReferences, assetReferences);
|
|
146
|
+
if (typeof argValue === "number") {
|
|
158
147
|
abiTypes.push(new require_abi_type.ABIUintType(8));
|
|
159
|
-
abiValues.push(
|
|
148
|
+
abiValues.push(argValue);
|
|
160
149
|
} else throw new Error(`Invalid reference value for ${referenceType}: ${argValue}`);
|
|
161
150
|
} else if (argValue !== void 0) {
|
|
162
151
|
abiTypes.push(methodArg.type);
|
|
@@ -198,12 +187,12 @@ function encodeArgsWithTuplePacking(abiTypes, abiValues) {
|
|
|
198
187
|
return encodedArgs;
|
|
199
188
|
}
|
|
200
189
|
/**
|
|
201
|
-
*
|
|
190
|
+
* Builds encoded ABI method arguments and resolves reference arrays
|
|
202
191
|
*/
|
|
203
|
-
function
|
|
204
|
-
const { accountReferences, appReferences, assetReferences } =
|
|
192
|
+
function buildMethodCallArgsAndReferences(params) {
|
|
193
|
+
const { accountReferences, appReferences, assetReferences, updatedArgs } = prepareArgsForEncoding(params.sender, params.appId, params.method, params.args ?? [], params.accountReferences, params.appReferences, params.assetReferences);
|
|
205
194
|
return {
|
|
206
|
-
args: encodeMethodArguments(params.method,
|
|
195
|
+
args: encodeMethodArguments(params.method, updatedArgs),
|
|
207
196
|
accountReferences,
|
|
208
197
|
appReferences,
|
|
209
198
|
assetReferences
|
|
@@ -223,14 +212,15 @@ const buildAppCreateMethodCall = async (params, appManager, suggestedParams, def
|
|
|
223
212
|
} : void 0;
|
|
224
213
|
const extraProgramPages = params.extraProgramPages !== void 0 ? params.extraProgramPages : require_util.calculateExtraProgramPages(approvalProgram, clearStateProgram);
|
|
225
214
|
const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
|
|
226
|
-
const
|
|
215
|
+
const argsAndReferences = buildMethodCallArgsAndReferences({
|
|
216
|
+
sender: commonData.sender,
|
|
227
217
|
appId: 0n,
|
|
228
218
|
method: params.method,
|
|
229
219
|
args: params.args ?? [],
|
|
230
220
|
accountReferences,
|
|
231
221
|
appReferences: params.appReferences,
|
|
232
222
|
assetReferences: params.assetReferences
|
|
233
|
-
}
|
|
223
|
+
});
|
|
234
224
|
const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
|
|
235
225
|
return new require_transaction.Transaction({
|
|
236
226
|
...commonData,
|
|
@@ -243,11 +233,11 @@ const buildAppCreateMethodCall = async (params, appManager, suggestedParams, def
|
|
|
243
233
|
globalStateSchema,
|
|
244
234
|
localStateSchema,
|
|
245
235
|
extraProgramPages,
|
|
246
|
-
args:
|
|
236
|
+
args: argsAndReferences.args,
|
|
247
237
|
...hasAccessReferences ? { accessReferences: params.accessReferences } : {
|
|
248
|
-
accountReferences:
|
|
249
|
-
appReferences:
|
|
250
|
-
assetReferences:
|
|
238
|
+
accountReferences: argsAndReferences.accountReferences,
|
|
239
|
+
appReferences: argsAndReferences.appReferences,
|
|
240
|
+
assetReferences: argsAndReferences.assetReferences,
|
|
251
241
|
boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
|
|
252
242
|
},
|
|
253
243
|
rejectVersion: params.rejectVersion
|
|
@@ -259,14 +249,15 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
|
|
|
259
249
|
const approvalProgram = typeof params.approvalProgram === "string" ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes : params.approvalProgram;
|
|
260
250
|
const clearStateProgram = typeof params.clearStateProgram === "string" ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes : params.clearStateProgram;
|
|
261
251
|
const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
|
|
262
|
-
const
|
|
252
|
+
const argsAndReferences = buildMethodCallArgsAndReferences({
|
|
253
|
+
sender: commonData.sender,
|
|
263
254
|
appId: params.appId,
|
|
264
255
|
method: params.method,
|
|
265
256
|
args: params.args ?? [],
|
|
266
257
|
accountReferences,
|
|
267
258
|
appReferences: params.appReferences,
|
|
268
259
|
assetReferences: params.assetReferences
|
|
269
|
-
}
|
|
260
|
+
});
|
|
270
261
|
const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
|
|
271
262
|
return new require_transaction.Transaction({
|
|
272
263
|
...commonData,
|
|
@@ -276,11 +267,11 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
|
|
|
276
267
|
onComplete: require_app_call.OnApplicationComplete.UpdateApplication,
|
|
277
268
|
approvalProgram,
|
|
278
269
|
clearStateProgram,
|
|
279
|
-
args:
|
|
270
|
+
args: argsAndReferences.args,
|
|
280
271
|
...hasAccessReferences ? { accessReferences: params.accessReferences } : {
|
|
281
|
-
accountReferences:
|
|
282
|
-
appReferences:
|
|
283
|
-
assetReferences:
|
|
272
|
+
accountReferences: argsAndReferences.accountReferences,
|
|
273
|
+
appReferences: argsAndReferences.appReferences,
|
|
274
|
+
assetReferences: argsAndReferences.assetReferences,
|
|
284
275
|
boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
|
|
285
276
|
},
|
|
286
277
|
rejectVersion: params.rejectVersion
|
|
@@ -290,14 +281,15 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
|
|
|
290
281
|
const buildAppCallMethodCall = async (params, suggestedParams, defaultValidityWindow) => {
|
|
291
282
|
const commonData = require_common.buildTransactionCommonData(params, suggestedParams, defaultValidityWindow);
|
|
292
283
|
const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
|
|
293
|
-
const
|
|
284
|
+
const argsAndReferences = buildMethodCallArgsAndReferences({
|
|
285
|
+
sender: commonData.sender,
|
|
294
286
|
appId: params.appId,
|
|
295
287
|
method: params.method,
|
|
296
288
|
args: params.args ?? [],
|
|
297
289
|
accountReferences,
|
|
298
290
|
appReferences: params.appReferences,
|
|
299
291
|
assetReferences: params.assetReferences
|
|
300
|
-
}
|
|
292
|
+
});
|
|
301
293
|
const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
|
|
302
294
|
return new require_transaction.Transaction({
|
|
303
295
|
...commonData,
|
|
@@ -305,11 +297,11 @@ const buildAppCallMethodCall = async (params, suggestedParams, defaultValidityWi
|
|
|
305
297
|
appCall: {
|
|
306
298
|
appId: params.appId,
|
|
307
299
|
onComplete: params.onComplete ?? require_app_call.OnApplicationComplete.NoOp,
|
|
308
|
-
args:
|
|
300
|
+
args: argsAndReferences.args,
|
|
309
301
|
...hasAccessReferences ? { accessReferences: params.accessReferences } : {
|
|
310
|
-
accountReferences:
|
|
311
|
-
appReferences:
|
|
312
|
-
assetReferences:
|
|
302
|
+
accountReferences: argsAndReferences.accountReferences,
|
|
303
|
+
appReferences: argsAndReferences.appReferences,
|
|
304
|
+
assetReferences: argsAndReferences.assetReferences,
|
|
313
305
|
boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
|
|
314
306
|
},
|
|
315
307
|
rejectVersion: params.rejectVersion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-call.js","names":["Address","argTypeIsReference","getAddress","argTypeIsTransaction","ABIUintType","encodedArgs: Uint8Array[]","ABITupleType","buildTransactionCommonData","calculateExtraProgramPages","Transaction","TransactionType","OnApplicationComplete","AppManager"],"sources":["../../src/transactions/method-call.ts"],"sourcesContent":["import {\n ABIMethod,\n ABIReferenceType,\n ABITupleType,\n ABIType,\n ABIUintType,\n ABIValue,\n argTypeIsReference,\n argTypeIsTransaction,\n} from '@algorandfoundation/algokit-abi'\nimport { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Address, getAddress } from '@algorandfoundation/algokit-common'\nimport { OnApplicationComplete, Transaction, TransactionSigner, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { TransactionWithSigner } from '../transaction'\nimport { AlgoAmount } from '../types/amount'\nimport { AppManager } from '../types/app-manager'\nimport { Expand } from '../types/expand'\nimport { calculateExtraProgramPages } from '../util'\nimport { AppCreateParams, AppDeleteParams, AppMethodCallParams, AppUpdateParams } from './app-call'\nimport { TransactionCommonData, buildTransactionCommonData } from './common'\n\nconst ARGS_TUPLE_PACKING_THRESHOLD = 14 // 14+ args trigger tuple packing, excluding the method selector\n\n/** Parameters to define an ABI method call create transaction. */\nexport type AppCreateMethodCall = Expand<AppMethodCall<AppCreateParams>>\n/** Parameters to define an ABI method call update transaction. */\nexport type AppUpdateMethodCall = Expand<AppMethodCall<AppUpdateParams>>\n/** Parameters to define an ABI method call delete transaction. */\nexport type AppDeleteMethodCall = Expand<AppMethodCall<AppDeleteParams>>\n/** Parameters to define an ABI method call transaction. */\nexport type AppCallMethodCall = Expand<AppMethodCall<AppMethodCallParams>>\n\nexport type ProcessedAppCreateMethodCall = Expand<\n Omit<AppCreateMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\nexport type ProcessedAppUpdateMethodCall = Expand<\n Omit<AppUpdateMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\nexport type ProcessedAppCallMethodCall = Expand<\n Omit<AppCallMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\n/** Types that can be used to define a transaction argument for an ABI call transaction. */\nexport type AppMethodCallTransactionArgument =\n // The following should match the partial `args` types from `AppMethodCall<T>` below\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n\n/** Parameters to define an ABI method call. */\nexport type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {\n /** The ABI method to call */\n method: ABIMethod\n /** Arguments to the ABI method, either:\n * * An ABI value\n * * A transaction with explicit signer\n * * A transaction (where the signer will be automatically assigned)\n * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())\n * * Another method call (via method call params object)\n * * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)\n */\n args?: (\n | ABIValue\n // The following should match the above `AppMethodCallTransactionArgument` type above\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n | undefined\n )[]\n}\n\ntype AppMethodCallArgs = AppMethodCall<unknown>['args']\ntype AppMethodCallArg = NonNullable<AppMethodCallArgs>[number]\n\nexport type AsyncTransactionParams = {\n txn: Promise<Transaction>\n signer?: TransactionSigner\n maxFee?: AlgoAmount\n}\n\nexport type TransactionParams = {\n txn: Transaction\n signer?: TransactionSigner\n maxFee?: AlgoAmount\n}\n\ntype ExtractedMethodCallTransactionArg =\n | { data: TransactionParams; type: 'txn' }\n | {\n data: AsyncTransactionParams\n type: 'asyncTxn'\n }\n | { data: ProcessedAppCallMethodCall | ProcessedAppCreateMethodCall | ProcessedAppUpdateMethodCall; type: 'methodCall' }\n\nexport function extractComposerTransactionsFromAppMethodCallParams(\n params: AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall | AppDeleteMethodCall,\n parentSigner?: TransactionSigner,\n): ExtractedMethodCallTransactionArg[] {\n const composerTransactions = new Array<ExtractedMethodCallTransactionArg>()\n const methodCallArgs = params.args\n if (!methodCallArgs) return []\n\n // Extract signer from params, falling back to parentSigner\n const currentSigner = params.signer ? ('signer' in params.signer ? params.signer.signer : params.signer) : parentSigner\n\n for (let i = 0; i < methodCallArgs.length; i++) {\n const arg = methodCallArgs[i]\n\n if (arg === undefined) {\n // is a transaction or default value placeholder, do nothing\n continue\n }\n if (isAbiValue(arg)) {\n // if is ABI value, also ignore\n continue\n }\n\n if (isTransactionWithSignerArg(arg)) {\n composerTransactions.push({\n data: {\n txn: arg.txn,\n signer: arg.signer,\n },\n type: 'txn',\n })\n\n continue\n }\n if (isAppCallMethodCallArg(arg)) {\n // Recursively extract nested method call transactions, passing the nested call itself and current signer as parent\n const nestedComposerTransactions = extractComposerTransactionsFromAppMethodCallParams(arg, currentSigner)\n composerTransactions.push(...nestedComposerTransactions)\n composerTransactions.push({\n data: {\n ...arg,\n signer: arg.signer ?? currentSigner,\n args: processAppMethodCallArgs(arg.args),\n },\n type: 'methodCall',\n } satisfies ExtractedMethodCallTransactionArg)\n\n continue\n }\n if (arg instanceof Promise) {\n composerTransactions.push({\n data: {\n txn: arg,\n signer: currentSigner,\n },\n type: 'asyncTxn',\n })\n continue\n }\n\n composerTransactions.push({\n data: {\n txn: Promise.resolve(arg),\n signer: currentSigner,\n },\n type: 'asyncTxn',\n })\n }\n\n return composerTransactions\n}\n\nexport function processAppMethodCallArgs(args: AppMethodCallArg[] | undefined): (ABIValue | undefined)[] | undefined {\n if (args === undefined) return undefined\n\n return args.map((arg) => {\n if (arg === undefined) {\n // Handle explicit placeholders (either transaction or default value)\n return undefined\n } else if (!isAbiValue(arg)) {\n // If the arg is not an ABIValue, it's must be a transaction, set to undefined\n // transaction arguments should be flattened out and added into the composer during the add process\n return undefined\n }\n return arg\n })\n}\n\nfunction isTransactionWithSignerArg(arg: AppMethodCallArg): arg is TransactionWithSigner {\n return typeof arg === 'object' && arg !== undefined && 'txn' in arg && 'signer' in arg\n}\n\nfunction isAppCallMethodCallArg(\n arg: AppMethodCallArg,\n): arg is AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> {\n return typeof arg === 'object' && arg !== undefined && 'method' in arg\n}\n\nconst isAbiValue = (x: unknown): x is ABIValue => {\n if (Array.isArray(x)) return x.length == 0 || x.every(isAbiValue)\n\n // If x is a POJO literal\n if (Object.getPrototypeOf(x) === Object.getPrototypeOf({})) {\n return Object.values(x as object).every(isAbiValue)\n }\n\n return (\n typeof x === 'bigint' ||\n typeof x === 'boolean' ||\n typeof x === 'number' ||\n typeof x === 'string' ||\n x instanceof Uint8Array ||\n x instanceof Address\n )\n}\n\n/**\n * Populate reference arrays from processed ABI method call arguments\n */\nfunction populateMethodArgsIntoReferenceArrays(\n sender: Address,\n appId: bigint,\n method: ABIMethod,\n methodArgs: AppMethodCallArg[],\n accountReferences?: Address[],\n appReferences?: bigint[],\n assetReferences?: bigint[],\n): { accountReferences: Address[]; appReferences: bigint[]; assetReferences: bigint[] } {\n const accounts = accountReferences ?? []\n const assets = assetReferences ?? []\n const apps = appReferences ?? []\n\n methodArgs.forEach((arg, i) => {\n const argType = method.args[i].type\n if (argTypeIsReference(argType)) {\n switch (argType) {\n case 'account':\n if (typeof arg === 'string' && arg !== sender.toString() && !accounts.some((a) => a.toString() === arg)) {\n accounts.push(getAddress(arg))\n }\n break\n case 'asset':\n if (typeof arg === 'bigint' && !assets.includes(arg)) {\n assets.push(arg)\n }\n break\n case 'application':\n if (typeof arg === 'bigint' && arg !== appId && !apps.includes(arg)) {\n apps.push(arg)\n }\n break\n }\n }\n })\n\n return { accountReferences: accounts, appReferences: apps, assetReferences: assets }\n}\n\n/**\n * Calculate array index for ABI reference values\n */\nfunction calculateMethodArgReferenceArrayIndex(\n refValue: string | bigint,\n referenceType: ABIReferenceType,\n sender: Address,\n appId: bigint,\n accountReferences: Address[],\n appReferences: bigint[],\n assetReferences: bigint[],\n): number {\n switch (referenceType) {\n case 'account':\n if (typeof refValue === 'string') {\n // If address is the same as sender, use index 0\n if (refValue === sender.toString()) return 0\n const index = accountReferences.findIndex((a) => a.toString() === refValue)\n if (index === -1) throw new Error(`Account ${refValue} not found in reference array`)\n return index + 1\n }\n throw new Error('Account reference must be a string')\n case 'asset':\n if (typeof refValue === 'bigint') {\n const index = assetReferences.indexOf(refValue)\n if (index === -1) throw new Error(`Asset ${refValue} not found in reference array`)\n return index\n }\n throw new Error('Asset reference must be a bigint')\n case 'application':\n if (typeof refValue === 'bigint') {\n // If app ID is the same as the current app, use index 0\n if (refValue === appId) return 0\n const index = appReferences.indexOf(refValue)\n if (index === -1) throw new Error(`Application ${refValue} not found in reference array`)\n return index + 1\n }\n throw new Error('Application reference must be a bigint')\n default:\n throw new Error(`Unknown reference type: ${referenceType}`)\n }\n}\n\n/**\n * Encode ABI method arguments with tuple packing support\n * Ports the logic from the Rust encode_method_arguments function\n */\nfunction encodeMethodArguments(\n method: ABIMethod,\n args: (ABIValue | undefined)[],\n sender: Address,\n appId: bigint,\n accountReferences: Address[],\n appReferences: bigint[],\n assetReferences: bigint[],\n): Uint8Array[] {\n const encodedArgs = new Array<Uint8Array>()\n\n // Insert method selector at the front\n encodedArgs.push(method.getSelector())\n\n // Get ABI types for non-transaction arguments\n const abiTypes = new Array<ABIType>()\n const abiValues = new Array<ABIValue>()\n\n // Process each method argument\n for (let i = 0; i < method.args.length; i++) {\n const methodArg = method.args[i]\n const argValue = args[i]\n\n if (argTypeIsTransaction(methodArg.type)) {\n // Transaction arguments are not ABI encoded - they're handled separately\n } else if (argTypeIsReference(methodArg.type)) {\n // Reference types are encoded as uint8 indexes\n const referenceType = methodArg.type\n if (typeof argValue === 'string' || typeof argValue === 'bigint') {\n const foreignIndex = calculateMethodArgReferenceArrayIndex(\n argValue,\n referenceType,\n sender,\n appId,\n accountReferences,\n appReferences,\n assetReferences,\n )\n\n abiTypes.push(new ABIUintType(8))\n abiValues.push(foreignIndex)\n } else {\n throw new Error(`Invalid reference value for ${referenceType}: ${argValue}`)\n }\n } else if (argValue !== undefined) {\n // Regular ABI value\n abiTypes.push(methodArg.type)\n // it's safe to cast to ABIValue here because the abiType must be ABIValue\n abiValues.push(argValue as ABIValue)\n }\n\n // Skip undefined values (transaction placeholders)\n }\n\n if (abiValues.length !== abiTypes.length) {\n throw new Error('Mismatch in length of non-transaction arguments')\n }\n\n // Apply ARC-4 tuple packing for methods with more than 14 arguments\n // 14 instead of 15 in the ARC-4 because the first argument (method selector) is added separately\n if (abiTypes.length > ARGS_TUPLE_PACKING_THRESHOLD) {\n encodedArgs.push(...encodeArgsWithTuplePacking(abiTypes, abiValues))\n } else {\n encodedArgs.push(...encodeArgsIndividually(abiTypes, abiValues))\n }\n\n return encodedArgs\n}\n\n/**\n * Encode individual ABI values\n */\nfunction encodeArgsIndividually(abiTypes: ABIType[], abiValues: ABIValue[]): Uint8Array[] {\n const encodedArgs: Uint8Array[] = []\n\n for (let i = 0; i < abiTypes.length; i++) {\n const abiType = abiTypes[i]\n const abiValue = abiValues[i]\n const encoded = abiType.encode(abiValue)\n encodedArgs.push(encoded)\n }\n\n return encodedArgs\n}\n\n/**\n * Encode ABI values with tuple packing for methods with many arguments\n */\nfunction encodeArgsWithTuplePacking(abiTypes: ABIType[], abiValues: ABIValue[]): Uint8Array[] {\n const encodedArgs: Uint8Array[] = []\n\n // Encode first 14 arguments individually\n const first14AbiTypes = abiTypes.slice(0, ARGS_TUPLE_PACKING_THRESHOLD)\n const first14AbiValues = abiValues.slice(0, ARGS_TUPLE_PACKING_THRESHOLD)\n encodedArgs.push(...encodeArgsIndividually(first14AbiTypes, first14AbiValues))\n\n // Pack remaining arguments into tuple at position 15\n const remainingAbiTypes = abiTypes.slice(ARGS_TUPLE_PACKING_THRESHOLD)\n const remainingAbiValues = abiValues.slice(ARGS_TUPLE_PACKING_THRESHOLD)\n\n if (remainingAbiTypes.length > 0) {\n const tupleType = new ABITupleType(remainingAbiTypes)\n const tupleValue = remainingAbiValues\n const tupleEncoded = tupleType.encode(tupleValue)\n encodedArgs.push(tupleEncoded)\n }\n\n return encodedArgs\n}\n\n/**\n * Common method call building logic\n */\nfunction buildMethodCallCommon(\n params: {\n appId: bigint\n method: ABIMethod\n args: (ABIValue | undefined)[]\n accountReferences?: Address[]\n appReferences?: bigint[]\n assetReferences?: bigint[]\n },\n commonData: TransactionCommonData,\n): { args: Uint8Array[]; accountReferences: Address[]; appReferences: bigint[]; assetReferences: bigint[] } {\n const { accountReferences, appReferences, assetReferences } = populateMethodArgsIntoReferenceArrays(\n commonData.sender,\n params.appId,\n params.method,\n params.args ?? [],\n params.accountReferences,\n params.appReferences,\n params.assetReferences,\n )\n\n const encodedArgs = encodeMethodArguments(\n params.method,\n params.args,\n commonData.sender,\n params.appId,\n accountReferences,\n appReferences,\n assetReferences,\n )\n\n return {\n args: encodedArgs,\n accountReferences,\n appReferences,\n assetReferences,\n }\n}\n\nexport const buildAppCreateMethodCall = async (\n params: ProcessedAppCreateMethodCall,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const globalStateSchema =\n params.schema?.globalByteSlices !== undefined || params.schema?.globalInts !== undefined\n ? {\n numByteSlices: params.schema?.globalByteSlices ?? 0,\n numUints: params.schema?.globalInts ?? 0,\n }\n : undefined\n const localStateSchema =\n params.schema?.localByteSlices !== undefined || params.schema?.localInts !== undefined\n ? {\n numByteSlices: params.schema?.localByteSlices ?? 0,\n numUints: params.schema?.localInts ?? 0,\n }\n : undefined\n const extraProgramPages =\n params.extraProgramPages !== undefined ? params.extraProgramPages : calculateExtraProgramPages(approvalProgram!, clearStateProgram!)\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const common = buildMethodCallCommon(\n {\n appId: 0n,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n },\n commonData,\n )\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: 0n,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n globalStateSchema: globalStateSchema,\n localStateSchema: localStateSchema,\n extraProgramPages: extraProgramPages,\n args: common.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppUpdateMethodCall = async (\n params: ProcessedAppUpdateMethodCall,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const common = buildMethodCallCommon(\n {\n appId: params.appId,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n },\n commonData,\n )\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: OnApplicationComplete.UpdateApplication,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n args: common.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppCallMethodCall = async (\n params: ProcessedAppCallMethodCall,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const common = buildMethodCallCommon(\n {\n appId: params.appId,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n },\n commonData,\n )\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n args: common.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n"],"mappings":";;;;;;;;;;;AAqBA,MAAM,+BAA+B;AAuFrC,SAAgB,mDACd,QACA,cACqC;CACrC,MAAM,uBAAuB,IAAI,OAA0C;CAC3E,MAAM,iBAAiB,OAAO;AAC9B,KAAI,CAAC,eAAgB,QAAO,EAAE;CAG9B,MAAM,gBAAgB,OAAO,SAAU,YAAY,OAAO,SAAS,OAAO,OAAO,SAAS,OAAO,SAAU;AAE3G,MAAK,IAAI,IAAI,GAAG,IAAI,eAAe,QAAQ,KAAK;EAC9C,MAAM,MAAM,eAAe;AAE3B,MAAI,QAAQ,OAEV;AAEF,MAAI,WAAW,IAAI,CAEjB;AAGF,M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AAgB;EACtB,SAAS;GACP,OAAO,OAAO;GACd,YAAY,OAAO,cAAcC,uCAAsB;GACvD,MAAM,OAAO;GACb,GAAI,sBACA,EAAE,kBAAkB,OAAO,kBAAkB,GAC7C;IACE,mBAAmB,OAAO,mBAAmB,KAAK,MAAMT,2BAAW,EAAE,CAAC;IACtE,eAAe,OAAO;IACtB,iBAAiB,OAAO;IACxB,eAAe,OAAO,eAAe,IAAIU,+BAAW,gBAAgB;IACrE;GACL,eAAe,OAAO;GACvB;EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"method-call.js","names":["Address","argTypeIsReference","addr: Address","getAddress","argTypeIsTransaction","ABIUintType","encodedArgs: Uint8Array[]","ABITupleType","buildTransactionCommonData","calculateExtraProgramPages","Transaction","TransactionType","OnApplicationComplete","AppManager"],"sources":["../../src/transactions/method-call.ts"],"sourcesContent":["import {\n ABIMethod,\n ABITupleType,\n ABIType,\n ABIUintType,\n ABIValue,\n argTypeIsReference,\n argTypeIsTransaction,\n} from '@algorandfoundation/algokit-abi'\nimport { SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport { Address, Expand, getAddress } from '@algorandfoundation/algokit-common'\nimport { OnApplicationComplete, Transaction, TransactionSigner, TransactionType } from '@algorandfoundation/algokit-transact'\nimport { TransactionWithSigner } from '../transaction'\nimport { AlgoAmount } from '../types/amount'\nimport { AppManager } from '../types/app-manager'\nimport { calculateExtraProgramPages } from '../util'\nimport { AppCreateParams, AppDeleteParams, AppMethodCallParams, AppUpdateParams } from './app-call'\nimport { buildTransactionCommonData } from './common'\n\nconst ARGS_TUPLE_PACKING_THRESHOLD = 14 // 14+ args trigger tuple packing, excluding the method selector\n\n/** Parameters to define an ABI method call create transaction. */\nexport type AppCreateMethodCall = Expand<AppMethodCall<AppCreateParams>>\n/** Parameters to define an ABI method call update transaction. */\nexport type AppUpdateMethodCall = Expand<AppMethodCall<AppUpdateParams>>\n/** Parameters to define an ABI method call delete transaction. */\nexport type AppDeleteMethodCall = Expand<AppMethodCall<AppDeleteParams>>\n/** Parameters to define an ABI method call transaction. */\nexport type AppCallMethodCall = Expand<AppMethodCall<AppMethodCallParams>>\n\nexport type ProcessedAppCreateMethodCall = Expand<\n Omit<AppCreateMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\nexport type ProcessedAppUpdateMethodCall = Expand<\n Omit<AppUpdateMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\nexport type ProcessedAppCallMethodCall = Expand<\n Omit<AppCallMethodCall, 'args'> & {\n args?: (ABIValue | undefined)[]\n }\n>\n\n/** Types that can be used to define a transaction argument for an ABI call transaction. */\nexport type AppMethodCallTransactionArgument =\n // The following should match the partial `args` types from `AppMethodCall<T>` below\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n\n/** Parameters to define an ABI method call. */\nexport type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {\n /** The ABI method to call */\n method: ABIMethod\n /** Arguments to the ABI method, either:\n * * An ABI value\n * * A transaction with explicit signer\n * * A transaction (where the signer will be automatically assigned)\n * * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())\n * * Another method call (via method call params object)\n * * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)\n */\n args?: (\n | ABIValue\n // The following should match the above `AppMethodCallTransactionArgument` type above\n | TransactionWithSigner\n | Transaction\n | Promise<Transaction>\n | AppMethodCall<AppCreateParams>\n | AppMethodCall<AppUpdateParams>\n | AppMethodCall<AppMethodCallParams>\n | undefined\n )[]\n}\n\ntype AppMethodCallArgs = AppMethodCall<unknown>['args']\ntype AppMethodCallArg = NonNullable<AppMethodCallArgs>[number]\n\nexport type AsyncTransactionParams = {\n txn: Promise<Transaction>\n signer?: TransactionSigner\n maxFee?: AlgoAmount\n}\n\nexport type TransactionParams = {\n txn: Transaction\n signer?: TransactionSigner\n maxFee?: AlgoAmount\n}\n\ntype ExtractedMethodCallTransactionArg =\n | { data: TransactionParams; type: 'txn' }\n | {\n data: AsyncTransactionParams\n type: 'asyncTxn'\n }\n | { data: ProcessedAppCallMethodCall | ProcessedAppCreateMethodCall | ProcessedAppUpdateMethodCall; type: 'methodCall' }\n\nexport function extractComposerTransactionsFromAppMethodCallParams(\n params: AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall | AppDeleteMethodCall,\n parentSigner?: TransactionSigner,\n): ExtractedMethodCallTransactionArg[] {\n const composerTransactions = new Array<ExtractedMethodCallTransactionArg>()\n const methodCallArgs = params.args\n if (!methodCallArgs) return []\n\n // Extract signer from params, falling back to parentSigner\n const currentSigner = params.signer ? ('signer' in params.signer ? params.signer.signer : params.signer) : parentSigner\n\n for (let i = 0; i < methodCallArgs.length; i++) {\n const arg = methodCallArgs[i]\n\n if (arg === undefined) {\n // is a transaction or default value placeholder, do nothing\n continue\n }\n if (isAbiValue(arg)) {\n // if is ABI value, also ignore\n continue\n }\n\n if (isTransactionWithSignerArg(arg)) {\n composerTransactions.push({\n data: {\n txn: arg.txn,\n signer: arg.signer,\n },\n type: 'txn',\n })\n\n continue\n }\n if (isAppCallMethodCallArg(arg)) {\n // Recursively extract nested method call transactions, passing the nested call itself and current signer as parent\n const nestedComposerTransactions = extractComposerTransactionsFromAppMethodCallParams(arg, currentSigner)\n composerTransactions.push(...nestedComposerTransactions)\n composerTransactions.push({\n data: {\n ...arg,\n signer: arg.signer ?? currentSigner,\n args: processAppMethodCallArgs(arg.args),\n },\n type: 'methodCall',\n } satisfies ExtractedMethodCallTransactionArg)\n\n continue\n }\n if (arg instanceof Promise) {\n composerTransactions.push({\n data: {\n txn: arg,\n signer: currentSigner,\n },\n type: 'asyncTxn',\n })\n continue\n }\n\n composerTransactions.push({\n data: {\n txn: Promise.resolve(arg),\n signer: currentSigner,\n },\n type: 'asyncTxn',\n })\n }\n\n return composerTransactions\n}\n\nexport function processAppMethodCallArgs(args: AppMethodCallArg[] | undefined): (ABIValue | undefined)[] | undefined {\n if (args === undefined) return undefined\n\n return args.map((arg) => {\n if (arg === undefined) {\n // Handle explicit placeholders (either transaction or default value)\n return undefined\n } else if (!isAbiValue(arg)) {\n // If the arg is not an ABIValue, it's must be a transaction, set to undefined\n // transaction arguments should be flattened out and added into the composer during the add process\n return undefined\n }\n return arg\n })\n}\n\nfunction isTransactionWithSignerArg(arg: AppMethodCallArg): arg is TransactionWithSigner {\n return typeof arg === 'object' && arg !== undefined && 'txn' in arg && 'signer' in arg\n}\n\nfunction isAppCallMethodCallArg(\n arg: AppMethodCallArg,\n): arg is AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> {\n return typeof arg === 'object' && arg !== undefined && 'method' in arg\n}\n\nconst isAbiValue = (x: unknown): x is ABIValue => {\n if (Array.isArray(x)) return x.length == 0 || x.every(isAbiValue)\n\n // If x is a POJO literal\n if (Object.getPrototypeOf(x) === Object.getPrototypeOf({})) {\n return Object.values(x as object).every(isAbiValue)\n }\n\n return (\n typeof x === 'bigint' ||\n typeof x === 'boolean' ||\n typeof x === 'number' ||\n typeof x === 'string' ||\n x instanceof Uint8Array ||\n x instanceof Address\n )\n}\n\n/**\n * Prepares method arguments for ABI encoding by building reference arrays and\n * replacing reference-type arguments (account, asset, application) with their indices.\n */\nfunction prepareArgsForEncoding(\n sender: Address,\n appId: bigint,\n method: ABIMethod,\n methodArgs: (ABIValue | undefined)[],\n accountReferences?: Address[],\n appReferences?: bigint[],\n assetReferences?: bigint[],\n): { accountReferences: Address[]; appReferences: bigint[]; assetReferences: bigint[]; updatedArgs: (ABIValue | undefined)[] } {\n const accounts = [...(accountReferences ?? [])]\n const assets = [...(assetReferences ?? [])]\n const apps = [...(appReferences ?? [])]\n\n const updatedArgs = methodArgs.map((arg, i) => {\n const argType = method.args[i].type\n if (!argTypeIsReference(argType)) {\n return arg\n }\n switch (argType) {\n case 'account': {\n let addr: Address\n if (typeof arg === 'string') {\n addr = getAddress(arg)\n } else if (arg instanceof Uint8Array) {\n addr = new Address(arg)\n } else {\n throw new Error('Invalid value for account')\n }\n\n if (sender.equals(addr)) {\n return 0\n }\n\n const existing = accounts.findIndex((a) => a.equals(addr)) + 1\n if (existing) return existing\n\n accounts.push(addr)\n return accounts.length\n }\n case 'asset': {\n if (typeof arg !== 'bigint') {\n throw new Error('Invalid value for asset')\n }\n\n const existing = assets.findIndex((a) => a === arg)\n if (existing === -1) {\n assets.push(arg)\n return assets.length - 1\n }\n\n return existing\n }\n case 'application': {\n if (typeof arg !== 'bigint') {\n throw new Error('Invalid value for application')\n }\n\n if (arg === appId) return 0\n\n const existing = apps.findIndex((a) => a === arg) + 1\n if (existing) return existing\n\n apps.push(arg)\n return apps.length\n }\n }\n })\n\n return { accountReferences: accounts, appReferences: apps, assetReferences: assets, updatedArgs }\n}\n\n/**\n * Encode ABI method arguments with tuple packing support\n * Ports the logic from the Rust encode_method_arguments function\n */\nfunction encodeMethodArguments(method: ABIMethod, args: (ABIValue | undefined)[]): Uint8Array[] {\n const encodedArgs = new Array<Uint8Array>()\n\n // Insert method selector at the front\n encodedArgs.push(method.getSelector())\n\n // Get ABI types for non-transaction arguments\n const abiTypes = new Array<ABIType>()\n const abiValues = new Array<ABIValue>()\n\n // Process each method argument\n for (let i = 0; i < method.args.length; i++) {\n const methodArg = method.args[i]\n const argValue = args[i]\n\n if (argTypeIsTransaction(methodArg.type)) {\n // Transaction arguments are not ABI encoded - they're handled separately\n } else if (argTypeIsReference(methodArg.type)) {\n // Reference types are encoded as uint8 indexes\n const referenceType = methodArg.type\n if (typeof argValue === 'number') {\n abiTypes.push(new ABIUintType(8))\n abiValues.push(argValue)\n } else {\n throw new Error(`Invalid reference value for ${referenceType}: ${argValue}`)\n }\n } else if (argValue !== undefined) {\n // Regular ABI value\n abiTypes.push(methodArg.type)\n // it's safe to cast to ABIValue here because the abiType must be ABIValue\n abiValues.push(argValue as ABIValue)\n }\n\n // Skip undefined values (transaction placeholders)\n }\n\n if (abiValues.length !== abiTypes.length) {\n throw new Error('Mismatch in length of non-transaction arguments')\n }\n\n // Apply ARC-4 tuple packing for methods with more than 14 arguments\n // 14 instead of 15 in the ARC-4 because the first argument (method selector) is added separately\n if (abiTypes.length > ARGS_TUPLE_PACKING_THRESHOLD) {\n encodedArgs.push(...encodeArgsWithTuplePacking(abiTypes, abiValues))\n } else {\n encodedArgs.push(...encodeArgsIndividually(abiTypes, abiValues))\n }\n\n return encodedArgs\n}\n\n/**\n * Encode individual ABI values\n */\nfunction encodeArgsIndividually(abiTypes: ABIType[], abiValues: ABIValue[]): Uint8Array[] {\n const encodedArgs: Uint8Array[] = []\n\n for (let i = 0; i < abiTypes.length; i++) {\n const abiType = abiTypes[i]\n const abiValue = abiValues[i]\n const encoded = abiType.encode(abiValue)\n encodedArgs.push(encoded)\n }\n\n return encodedArgs\n}\n\n/**\n * Encode ABI values with tuple packing for methods with many arguments\n */\nfunction encodeArgsWithTuplePacking(abiTypes: ABIType[], abiValues: ABIValue[]): Uint8Array[] {\n const encodedArgs: Uint8Array[] = []\n\n // Encode first 14 arguments individually\n const first14AbiTypes = abiTypes.slice(0, ARGS_TUPLE_PACKING_THRESHOLD)\n const first14AbiValues = abiValues.slice(0, ARGS_TUPLE_PACKING_THRESHOLD)\n encodedArgs.push(...encodeArgsIndividually(first14AbiTypes, first14AbiValues))\n\n // Pack remaining arguments into tuple at position 15\n const remainingAbiTypes = abiTypes.slice(ARGS_TUPLE_PACKING_THRESHOLD)\n const remainingAbiValues = abiValues.slice(ARGS_TUPLE_PACKING_THRESHOLD)\n\n if (remainingAbiTypes.length > 0) {\n const tupleType = new ABITupleType(remainingAbiTypes)\n const tupleValue = remainingAbiValues\n const tupleEncoded = tupleType.encode(tupleValue)\n encodedArgs.push(tupleEncoded)\n }\n\n return encodedArgs\n}\n\n/**\n * Builds encoded ABI method arguments and resolves reference arrays\n */\nfunction buildMethodCallArgsAndReferences(params: {\n sender: Address\n appId: bigint\n method: ABIMethod\n args: (ABIValue | undefined)[]\n accountReferences?: Address[]\n appReferences?: bigint[]\n assetReferences?: bigint[]\n}): { args: Uint8Array[]; accountReferences: Address[]; appReferences: bigint[]; assetReferences: bigint[] } {\n const { accountReferences, appReferences, assetReferences, updatedArgs } = prepareArgsForEncoding(\n params.sender,\n params.appId,\n params.method,\n params.args ?? [],\n params.accountReferences,\n params.appReferences,\n params.assetReferences,\n )\n\n const encodedArgs = encodeMethodArguments(params.method, updatedArgs)\n\n return {\n args: encodedArgs,\n accountReferences,\n appReferences,\n assetReferences,\n }\n}\n\nexport const buildAppCreateMethodCall = async (\n params: ProcessedAppCreateMethodCall,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const globalStateSchema =\n params.schema?.globalByteSlices !== undefined || params.schema?.globalInts !== undefined\n ? {\n numByteSlices: params.schema?.globalByteSlices ?? 0,\n numUints: params.schema?.globalInts ?? 0,\n }\n : undefined\n const localStateSchema =\n params.schema?.localByteSlices !== undefined || params.schema?.localInts !== undefined\n ? {\n numByteSlices: params.schema?.localByteSlices ?? 0,\n numUints: params.schema?.localInts ?? 0,\n }\n : undefined\n const extraProgramPages =\n params.extraProgramPages !== undefined ? params.extraProgramPages : calculateExtraProgramPages(approvalProgram!, clearStateProgram!)\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const argsAndReferences = buildMethodCallArgsAndReferences({\n sender: commonData.sender,\n appId: 0n,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n })\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: 0n,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n globalStateSchema: globalStateSchema,\n localStateSchema: localStateSchema,\n extraProgramPages: extraProgramPages,\n args: argsAndReferences.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: argsAndReferences.accountReferences,\n appReferences: argsAndReferences.appReferences,\n assetReferences: argsAndReferences.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppUpdateMethodCall = async (\n params: ProcessedAppUpdateMethodCall,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const argsAndReferences = buildMethodCallArgsAndReferences({\n sender: commonData.sender,\n appId: params.appId,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n })\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: OnApplicationComplete.UpdateApplication,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n args: argsAndReferences.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: argsAndReferences.accountReferences,\n appReferences: argsAndReferences.appReferences,\n assetReferences: argsAndReferences.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppCallMethodCall = async (\n params: ProcessedAppCallMethodCall,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const accountReferences = params.accountReferences?.map((a) => getAddress(a))\n const argsAndReferences = buildMethodCallArgsAndReferences({\n sender: commonData.sender,\n appId: params.appId,\n method: params.method,\n args: params.args ?? [],\n accountReferences: accountReferences,\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n })\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n args: argsAndReferences.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: argsAndReferences.accountReferences,\n appReferences: argsAndReferences.appReferences,\n assetReferences: argsAndReferences.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n"],"mappings":";;;;;;;;;;;AAmBA,MAAM,+BAA+B;AAuFrC,SAAgB,mDACd,QACA,cACqC;CACrC,MAAM,uBAAuB,IAAI,OAA0C;CAC3E,MAAM,iBAAiB,OAAO;AAC9B,KAAI,CAAC,eAAgB,QAAO,EAAE;CAG9B,MAAM,gBAAgB,OAAO,SAAU,YAAY,OAAO,SAAS,OAAO,OAAO,SAAS,OAAO,SAAU;AAE3G,MAAK,IAAI,IAAI,GAAG,IAAI,eAAe,QAAQ,KAAK;EAC9C,MAAM,MAAM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