@algorandfoundation/algokit-utils 10.0.0-alpha.3 → 10.0.0-alpha.32
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/abi/index.d.ts +2 -1
- package/abi/index.js +3 -0
- package/abi/index.mjs +2 -1
- package/account-manager.d.ts +448 -0
- package/account-manager.js +623 -0
- package/account-manager.js.map +1 -0
- package/account-manager.mjs +620 -0
- package/account-manager.mjs.map +1 -0
- package/account.d.ts +156 -0
- package/account.js +10 -0
- package/account.js.map +1 -0
- package/account.mjs +9 -0
- package/account.mjs.map +1 -0
- package/algod-client/index.d.ts +3 -7
- package/algod-client/index.js +2 -5
- package/algod-client/index.mjs +2 -2
- package/algorand-client-transaction-creator.d.ts +1103 -0
- package/algorand-client-transaction-creator.js +735 -0
- package/algorand-client-transaction-creator.js.map +1 -0
- package/algorand-client-transaction-creator.mjs +734 -0
- package/algorand-client-transaction-creator.mjs.map +1 -0
- package/algorand-client-transaction-sender.d.ts +1317 -0
- package/algorand-client-transaction-sender.js +933 -0
- package/algorand-client-transaction-sender.js.map +1 -0
- package/algorand-client-transaction-sender.mjs +932 -0
- package/algorand-client-transaction-sender.mjs.map +1 -0
- package/algorand-client.d.ts +246 -0
- package/algorand-client.js +325 -0
- package/algorand-client.js.map +1 -0
- package/algorand-client.mjs +325 -0
- package/algorand-client.mjs.map +1 -0
- package/amount.d.ts +46 -3
- package/amount.js +92 -13
- package/amount.js.map +1 -1
- package/amount.mjs +80 -3
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +2130 -0
- package/app-client.js +909 -0
- package/app-client.js.map +1 -0
- package/app-client.mjs +908 -0
- package/app-client.mjs.map +1 -0
- package/app-deployer.d.ts +166 -0
- package/app-deployer.js +353 -0
- package/app-deployer.js.map +1 -0
- package/app-deployer.mjs +353 -0
- package/app-deployer.mjs.map +1 -0
- package/app-factory.d.ts +965 -0
- package/app-factory.js +448 -0
- package/app-factory.js.map +1 -0
- package/app-factory.mjs +448 -0
- package/app-factory.mjs.map +1 -0
- package/app-manager.d.ts +323 -0
- package/app-manager.js +468 -0
- package/app-manager.js.map +1 -0
- package/app-manager.mjs +468 -0
- package/app-manager.mjs.map +1 -0
- package/app-spec.d.ts +203 -0
- package/app-spec.js +137 -0
- package/app-spec.js.map +1 -0
- package/app-spec.mjs +137 -0
- package/app-spec.mjs.map +1 -0
- package/app.d.ts +257 -0
- package/app.js +49 -0
- package/app.js.map +1 -0
- package/app.mjs +42 -0
- package/app.mjs.map +1 -0
- package/asset-manager.d.ts +212 -0
- package/asset-manager.js +166 -0
- package/asset-manager.js.map +1 -0
- package/asset-manager.mjs +166 -0
- package/asset-manager.mjs.map +1 -0
- package/async-event-emitter.d.ts +16 -0
- package/async-event-emitter.js +38 -0
- package/async-event-emitter.js.map +1 -0
- package/async-event-emitter.mjs +37 -0
- package/async-event-emitter.mjs.map +1 -0
- package/client-manager.d.ts +475 -0
- package/client-manager.js +616 -0
- package/client-manager.js.map +1 -0
- package/client-manager.mjs +616 -0
- package/client-manager.mjs.map +1 -0
- package/composer.d.ts +947 -0
- package/composer.js +1584 -0
- package/composer.js.map +1 -0
- package/composer.mjs +1583 -0
- package/composer.mjs.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +2 -2
- package/config.js.map +1 -1
- package/config.mjs +1 -1
- package/config.mjs.map +1 -1
- package/debugging.d.ts +47 -0
- package/debugging.js +20 -0
- package/debugging.js.map +1 -0
- package/debugging.mjs +15 -0
- package/debugging.mjs.map +1 -0
- package/dispenser-client.d.ts +90 -0
- package/dispenser-client.js +127 -0
- package/dispenser-client.js.map +1 -0
- package/dispenser-client.mjs +127 -0
- package/dispenser-client.mjs.map +1 -0
- package/expand.d.ts +2 -0
- package/expand.js +0 -0
- package/expand.mjs +0 -0
- package/index.d.ts +6 -6
- package/index.js +4 -10
- package/index.mjs +5 -6
- 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/indexer.d.ts +40 -0
- package/indexer.js +38 -0
- package/indexer.js.map +1 -0
- package/indexer.mjs +35 -0
- package/indexer.mjs.map +1 -0
- package/instance-of.d.ts +8 -0
- package/kmd-account-manager.d.ts +74 -0
- package/kmd-account-manager.js +167 -0
- package/kmd-account-manager.js.map +1 -0
- package/kmd-account-manager.mjs +165 -0
- package/kmd-account-manager.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/lifecycle-events.d.ts +14 -0
- package/lifecycle-events.js +11 -0
- package/lifecycle-events.js.map +1 -0
- package/lifecycle-events.mjs +10 -0
- package/lifecycle-events.mjs.map +1 -0
- package/logging.d.ts +13 -0
- package/logging.js +47 -0
- package/logging.js.map +1 -0
- package/logging.mjs +42 -0
- package/logging.mjs.map +1 -0
- package/logic-error.d.ts +39 -0
- package/logic-error.js +54 -0
- package/logic-error.js.map +1 -0
- package/logic-error.mjs +53 -0
- package/logic-error.mjs.map +1 -0
- package/network-client.d.ts +43 -0
- package/network-client.js +14 -0
- package/network-client.js.map +1 -0
- package/network-client.mjs +13 -0
- package/network-client.mjs.map +1 -0
- package/package.json +14 -5
- 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 -3
- package/packages/abi/src/abi-type.js +7 -36
- package/packages/abi/src/abi-type.js.map +1 -1
- package/packages/abi/src/abi-type.mjs +7 -36
- 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/abi/src/utils.d.ts +22 -0
- package/packages/abi/src/utils.js +57 -0
- package/packages/abi/src/utils.js.map +1 -0
- package/packages/abi/src/utils.mjs +55 -0
- package/packages/abi/src/utils.mjs.map +1 -0
- package/packages/algo25/src/index.js +1 -1
- package/packages/algo25/src/index.mjs +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/eval-delta-key-value.js +2 -2
- package/packages/algod_client/src/models/eval-delta-key-value.js.map +1 -1
- package/packages/algod_client/src/models/eval-delta-key-value.mjs +2 -2
- package/packages/algod_client/src/models/eval-delta-key-value.mjs.map +1 -1
- package/packages/algod_client/src/models/eval-delta.js +2 -2
- package/packages/algod_client/src/models/eval-delta.js.map +1 -1
- package/packages/algod_client/src/models/eval-delta.mjs +2 -2
- package/packages/algod_client/src/models/eval-delta.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.d.ts +0 -1
- package/packages/common/src/address.js +4 -17
- package/packages/common/src/address.js.map +1 -1
- package/packages/common/src/address.mjs +5 -17
- 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-base64.js +26 -0
- package/packages/common/src/codecs/primitives/bytes-base64.js.map +1 -0
- package/packages/common/src/codecs/primitives/bytes-base64.mjs +25 -0
- package/packages/common/src/codecs/primitives/bytes-base64.mjs.map +1 -0
- 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-state-proof.d.ts +1 -1
- package/packages/indexer_client/src/models/transaction-state-proof.js +2 -2
- package/packages/indexer_client/src/models/transaction-state-proof.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-state-proof.mjs +2 -2
- package/packages/indexer_client/src/models/transaction-state-proof.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 +35 -33
- package/packages/transact/src/logicsig.js +74 -76
- package/packages/transact/src/logicsig.js.map +1 -1
- package/packages/transact/src/logicsig.mjs +77 -78
- package/packages/transact/src/logicsig.mjs.map +1 -1
- package/packages/transact/src/multisig.d.ts +11 -116
- package/packages/transact/src/multisig.js +106 -136
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +108 -118
- package/packages/transact/src/multisig.mjs.map +1 -1
- package/packages/transact/src/signer.js +9 -2
- package/packages/transact/src/signer.js.map +1 -1
- package/packages/transact/src/signer.mjs +10 -3
- package/packages/transact/src/signer.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 +8 -9
- package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction-meta.mjs +8 -8
- package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.d.ts +10 -6
- 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/state-proof.d.ts +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 -2
- package/packages/transact/src/transactions/transaction.js +5 -4
- package/packages/transact/src/transactions/transaction.js.map +1 -1
- package/packages/transact/src/transactions/transaction.mjs +5 -4
- package/packages/transact/src/transactions/transaction.mjs.map +1 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +2 -3
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +2 -3
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +5 -5
- package/testing/fixtures/algorand-fixture.js +2 -2
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +2 -2
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +2 -1
- package/testing/test-logger.d.ts +1 -1
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.js +1 -1
- package/testing/transaction-logger.mjs +1 -1
- package/testing/types.d.ts +156 -0
- package/transact/index.d.ts +11 -10
- package/transact/index.js +7 -31
- package/transact/index.mjs +7 -10
- package/transaction/index.d.ts +4 -0
- package/transaction/index.js +9 -0
- package/transaction/index.mjs +4 -0
- package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
- package/transaction/perform-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +2 -2
- 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/transaction/types.d.ts +133 -0
- package/transactions/app-call.d.ts +6 -5
- package/transactions/app-call.js +17 -17
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +17 -17
- 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/common.d.ts +1 -1
- package/transactions/common.js.map +1 -1
- package/transactions/common.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 +2 -2
- package/transactions/method-call.js +78 -85
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs +78 -85
- package/transactions/method-call.mjs.map +1 -1
- package/transactions/payment.d.ts +1 -1
- package/transactions/payment.js.map +1 -1
- package/transactions/payment.mjs.map +1 -1
- package/types/account-manager.d.ts +11 -444
- package/types/account-manager.js +5 -606
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +5 -604
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +8 -150
- package/types/account.js +3 -4
- package/types/account.js.map +1 -1
- package/types/account.mjs +4 -4
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +5 -1084
- package/types/algorand-client-transaction-creator.js +3 -721
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +4 -721
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +5 -1298
- package/types/algorand-client-transaction-sender.js +3 -920
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +3 -918
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +5 -241
- package/types/algorand-client.js +3 -319
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +3 -319
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +6 -45
- package/types/amount.js +3 -60
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +3 -60
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +75 -2120
- package/types/app-client.js +3 -904
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +3 -902
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +21 -161
- package/types/app-deployer.js +3 -347
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +3 -347
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +21 -957
- package/types/app-factory.js +3 -442
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +3 -442
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +15 -316
- package/types/app-manager.js +3 -456
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +3 -456
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +39 -198
- package/types/app-spec.js +3 -124
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +3 -124
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +62 -247
- package/types/app.js +15 -37
- package/types/app.js.map +1 -1
- package/types/app.mjs +16 -37
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +9 -207
- package/types/asset-manager.js +3 -160
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +3 -160
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +7 -14
- package/types/async-event-emitter.js +3 -32
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +4 -32
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +27 -470
- package/types/client-manager.js +3 -610
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +3 -610
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +79 -935
- package/types/composer.js +3 -1569
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +3 -1567
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +7 -52
- package/types/config.js +3 -74
- package/types/config.js.map +1 -1
- package/types/config.mjs +3 -74
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +12 -33
- package/types/debugging.js +11 -10
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -10
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +11 -85
- package/types/dispenser-client.js +3 -121
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +3 -121
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +4 -5
- package/types/indexer.d.ts +16 -36
- package/types/indexer.js +7 -30
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +8 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +4 -4
- package/types/kmd-account-manager.d.ts +5 -68
- package/types/kmd-account-manager.js +3 -150
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +3 -148
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +7 -10
- package/types/lifecycle-events.js +3 -5
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +4 -5
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +14 -9
- package/types/logging.js +11 -37
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +12 -37
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +8 -35
- package/types/logic-error.js +3 -48
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +4 -48
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +10 -39
- package/types/network-client.js +3 -8
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +4 -8
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +13 -151
- package/types/transaction.d.ts +33 -128
- package/updatable-config.d.ts +57 -0
- package/updatable-config.js +80 -0
- package/updatable-config.js.map +1 -0
- package/updatable-config.mjs +80 -0
- package/updatable-config.mjs.map +1 -0
- package/util.js +1 -1
- package/util.js.map +1 -1
- package/util.mjs +1 -1
- package/util.mjs.map +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
|
@@ -0,0 +1,933 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_address = require('./packages/common/src/address.js');
|
|
3
|
+
const require_config = require('./config.js');
|
|
4
|
+
const require_util = require('./util.js');
|
|
5
|
+
const require_app_manager = require('./app-manager.js');
|
|
6
|
+
let buffer = require("buffer");
|
|
7
|
+
|
|
8
|
+
//#region src/algorand-client-transaction-sender.ts
|
|
9
|
+
const getMethodCallForLog = ({ method, args }) => {
|
|
10
|
+
return `${method.name}(${(args ?? []).map((a) => typeof a === "object" ? require_util.asJson(a, (k, v) => {
|
|
11
|
+
const newV = require_util.defaultJsonValueReplacer(k, v);
|
|
12
|
+
return newV instanceof Uint8Array ? buffer.Buffer.from(newV).toString("base64") : newV;
|
|
13
|
+
}) : a)})`;
|
|
14
|
+
};
|
|
15
|
+
/** Orchestrates sending transactions for `AlgorandClient`. */
|
|
16
|
+
var AlgorandClientTransactionSender = class {
|
|
17
|
+
_newGroup;
|
|
18
|
+
_assetManager;
|
|
19
|
+
_appManager;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new `AlgorandClientSender`
|
|
22
|
+
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
23
|
+
* @param assetManager An `AssetManager` instance
|
|
24
|
+
* @param appManager An `AppManager` instance
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const transactionSender = new AlgorandClientTransactionSender(() => new TransactionComposer(), assetManager, appManager)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
constructor(newGroup, assetManager, appManager) {
|
|
31
|
+
this._newGroup = newGroup;
|
|
32
|
+
this._assetManager = assetManager;
|
|
33
|
+
this._appManager = appManager;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Start a new `TransactionComposer` transaction group
|
|
37
|
+
* @returns A new instance of `TransactionComposer`.
|
|
38
|
+
* @example
|
|
39
|
+
* const composer = AlgorandClient.mainNet().send.newGroup();
|
|
40
|
+
* const result = await composer.addTransaction(payment).send()
|
|
41
|
+
*/
|
|
42
|
+
newGroup() {
|
|
43
|
+
return this._newGroup();
|
|
44
|
+
}
|
|
45
|
+
_send(c, log) {
|
|
46
|
+
return async (params) => {
|
|
47
|
+
const composer = this._newGroup();
|
|
48
|
+
c(composer).apply(composer, [params]);
|
|
49
|
+
if (log?.preLog) {
|
|
50
|
+
const transaction = (await composer.build()).transactions.at(-1).txn;
|
|
51
|
+
require_config.Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction));
|
|
52
|
+
}
|
|
53
|
+
const rawResult = await composer.send(params);
|
|
54
|
+
const result = {
|
|
55
|
+
transaction: rawResult.transactions.at(-1),
|
|
56
|
+
confirmation: rawResult.confirmations.at(-1),
|
|
57
|
+
txId: rawResult.txIds.at(-1),
|
|
58
|
+
...rawResult
|
|
59
|
+
};
|
|
60
|
+
if (log?.postLog) require_config.Config.getLogger(params?.suppressLog).debug(log.postLog(params, result));
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
_sendAppCall(c, log) {
|
|
65
|
+
return async (params) => {
|
|
66
|
+
const result = await this._send(c, log)(params);
|
|
67
|
+
return {
|
|
68
|
+
...result,
|
|
69
|
+
return: require_app_manager.AppManager.getABIReturn(result.confirmation, "method" in params ? params.method : void 0)
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
_sendAppUpdateCall(c, log) {
|
|
74
|
+
return async (params) => {
|
|
75
|
+
const result = await this._sendAppCall(c, log)(params);
|
|
76
|
+
const compiledApproval = typeof params.approvalProgram === "string" ? this._appManager.getCompilationResult(params.approvalProgram) : void 0;
|
|
77
|
+
const compiledClear = typeof params.clearStateProgram === "string" ? this._appManager.getCompilationResult(params.clearStateProgram) : void 0;
|
|
78
|
+
return {
|
|
79
|
+
...result,
|
|
80
|
+
compiledApproval,
|
|
81
|
+
compiledClear
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
_sendAppCreateCall(c, log) {
|
|
86
|
+
return async (params) => {
|
|
87
|
+
const result = await this._sendAppUpdateCall(c, log)(params);
|
|
88
|
+
return {
|
|
89
|
+
...result,
|
|
90
|
+
appId: BigInt(result.confirmation.appId),
|
|
91
|
+
appAddress: require_address.getApplicationAddress(result.confirmation.appId)
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Send a payment transaction to transfer Algo between accounts.
|
|
97
|
+
* @param params The parameters for the payment transaction
|
|
98
|
+
* @example Basic example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const result = await algorand.send.payment({
|
|
101
|
+
* sender: 'SENDERADDRESS',
|
|
102
|
+
* receiver: 'RECEIVERADDRESS',
|
|
103
|
+
* amount: (4).algo(),
|
|
104
|
+
* })
|
|
105
|
+
* ```
|
|
106
|
+
* @example Advanced example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const result = await algorand.send.payment({
|
|
109
|
+
* amount: (4).algo(),
|
|
110
|
+
* receiver: 'RECEIVERADDRESS',
|
|
111
|
+
* sender: 'SENDERADDRESS',
|
|
112
|
+
* closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
|
|
113
|
+
* lease: 'lease',
|
|
114
|
+
* note: 'note',
|
|
115
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
116
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
117
|
+
* // You wouldn't normally set this field
|
|
118
|
+
* firstValidRound: 1000n,
|
|
119
|
+
* validityWindow: 10,
|
|
120
|
+
* extraFee: (1000).microAlgo(),
|
|
121
|
+
* staticFee: (1000).microAlgo(),
|
|
122
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
123
|
+
* // already specified, but here for completeness
|
|
124
|
+
* maxFee: (3000).microAlgo(),
|
|
125
|
+
* // Signer only needed if you want to provide one,
|
|
126
|
+
* // generally you'd register it with AlgorandClient
|
|
127
|
+
* // against the sender and not need to pass it in
|
|
128
|
+
* signer: transactionSigner,
|
|
129
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
130
|
+
* suppressLog: true,
|
|
131
|
+
* })
|
|
132
|
+
* ```
|
|
133
|
+
* @returns The result of the payment transaction and the transaction that was sent
|
|
134
|
+
*/
|
|
135
|
+
payment = this._send((c) => c.addPayment, { preLog: (params, transaction) => `Sending ${params.amount.microAlgo} µALGO from ${params.sender} to ${params.receiver} via transaction ${transaction.txId()}` });
|
|
136
|
+
/**
|
|
137
|
+
* Create a new Algorand Standard Asset.
|
|
138
|
+
*
|
|
139
|
+
* The account that sends this transaction will automatically be
|
|
140
|
+
* opted in to the asset and will hold all units after creation.
|
|
141
|
+
*
|
|
142
|
+
* @param params The parameters for the asset creation transaction
|
|
143
|
+
*
|
|
144
|
+
* @example Basic example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* await algorand.send.assetCreate({ sender: "CREATORADDRESS", total: 100n})
|
|
147
|
+
* ```
|
|
148
|
+
* @example Advanced example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* await algorand.send.assetCreate({
|
|
151
|
+
* sender: 'CREATORADDRESS',
|
|
152
|
+
* total: 100n,
|
|
153
|
+
* decimals: 2,
|
|
154
|
+
* assetName: 'asset',
|
|
155
|
+
* unitName: 'unit',
|
|
156
|
+
* url: 'url',
|
|
157
|
+
* metadataHash: 'metadataHash',
|
|
158
|
+
* defaultFrozen: false,
|
|
159
|
+
* manager: 'MANAGERADDRESS',
|
|
160
|
+
* reserve: 'RESERVEADDRESS',
|
|
161
|
+
* freeze: 'FREEZEADDRESS',
|
|
162
|
+
* clawback: 'CLAWBACKADDRESS',
|
|
163
|
+
* lease: 'lease',
|
|
164
|
+
* note: 'note',
|
|
165
|
+
* // You wouldn't normally set this field
|
|
166
|
+
* firstValidRound: 1000n,
|
|
167
|
+
* validityWindow: 10,
|
|
168
|
+
* extraFee: (1000).microAlgo(),
|
|
169
|
+
* staticFee: (1000).microAlgo(),
|
|
170
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
171
|
+
* // already specified, but here for completeness
|
|
172
|
+
* maxFee: (3000).microAlgo(),
|
|
173
|
+
* // Signer only needed if you want to provide one,
|
|
174
|
+
* // generally you'd register it with AlgorandClient
|
|
175
|
+
* // against the sender and not need to pass it in
|
|
176
|
+
* signer: transactionSigner,
|
|
177
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
178
|
+
* suppressLog: true,
|
|
179
|
+
* })
|
|
180
|
+
* ```
|
|
181
|
+
* @returns The result of the asset create transaction and the transaction that was sent
|
|
182
|
+
*/
|
|
183
|
+
assetCreate = async (params) => {
|
|
184
|
+
const result = await this._send((c) => c.addAssetCreate, { postLog: (params$1, result$1) => `Created asset${params$1.assetName ? ` ${params$1.assetName}` : ""}${params$1.unitName ? ` (${params$1.unitName})` : ""} with ${params$1.total} units and ${params$1.decimals ?? 0} decimals created by ${params$1.sender} with ID ${result$1.confirmation.assetId} via transaction ${result$1.txIds.at(-1)}` })(params);
|
|
185
|
+
return {
|
|
186
|
+
...result,
|
|
187
|
+
assetId: BigInt(result.confirmation.assetId ?? 0)
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Configure an existing Algorand Standard Asset.
|
|
192
|
+
*
|
|
193
|
+
* **Note:** The manager, reserve, freeze, and clawback addresses
|
|
194
|
+
* are immutably empty if they are not set. If manager is not set then
|
|
195
|
+
* all fields are immutable from that point forward.
|
|
196
|
+
*
|
|
197
|
+
* @param params The parameters for the asset config transaction
|
|
198
|
+
*
|
|
199
|
+
* @example Basic example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* await algorand.send.assetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
202
|
+
* ```
|
|
203
|
+
* @example Advanced example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* await algorand.send.assetConfig({
|
|
206
|
+
* sender: 'MANAGERADDRESS',
|
|
207
|
+
* assetId: 123456n,
|
|
208
|
+
* manager: 'MANAGERADDRESS',
|
|
209
|
+
* reserve: 'RESERVEADDRESS',
|
|
210
|
+
* freeze: 'FREEZEADDRESS',
|
|
211
|
+
* clawback: 'CLAWBACKADDRESS',
|
|
212
|
+
* lease: 'lease',
|
|
213
|
+
* note: 'note',
|
|
214
|
+
* // You wouldn't normally set this field
|
|
215
|
+
* firstValidRound: 1000n,
|
|
216
|
+
* validityWindow: 10,
|
|
217
|
+
* extraFee: (1000).microAlgo(),
|
|
218
|
+
* staticFee: (1000).microAlgo(),
|
|
219
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
220
|
+
* // already specified, but here for completeness
|
|
221
|
+
* maxFee: (3000).microAlgo(),
|
|
222
|
+
* // Signer only needed if you want to provide one,
|
|
223
|
+
* // generally you'd register it with AlgorandClient
|
|
224
|
+
* // against the sender and not need to pass it in
|
|
225
|
+
* signer: transactionSigner,
|
|
226
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
227
|
+
* suppressLog: true,
|
|
228
|
+
* })
|
|
229
|
+
* ```
|
|
230
|
+
* @returns The result of the asset config transaction and the transaction that was sent
|
|
231
|
+
*/
|
|
232
|
+
assetConfig = this._send((c) => c.addAssetConfig, { preLog: (params, transaction) => `Configuring asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
|
|
233
|
+
/**
|
|
234
|
+
* Freeze or unfreeze an Algorand Standard Asset for an account.
|
|
235
|
+
*
|
|
236
|
+
* @param params The parameters for the asset freeze transaction
|
|
237
|
+
*
|
|
238
|
+
* @example Basic example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* await algorand.send.assetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
241
|
+
* ```
|
|
242
|
+
* @example Advanced example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* await algorand.send.assetFreeze({
|
|
245
|
+
* sender: 'MANAGERADDRESS',
|
|
246
|
+
* assetId: 123456n,
|
|
247
|
+
* account: 'ACCOUNTADDRESS',
|
|
248
|
+
* frozen: true,
|
|
249
|
+
* lease: 'lease',
|
|
250
|
+
* note: 'note',
|
|
251
|
+
* // You wouldn't normally set this field
|
|
252
|
+
* firstValidRound: 1000n,
|
|
253
|
+
* validityWindow: 10,
|
|
254
|
+
* extraFee: (1000).microAlgo(),
|
|
255
|
+
* staticFee: (1000).microAlgo(),
|
|
256
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
257
|
+
* // already specified, but here for completeness
|
|
258
|
+
* maxFee: (3000).microAlgo(),
|
|
259
|
+
* // Signer only needed if you want to provide one,
|
|
260
|
+
* // generally you'd register it with AlgorandClient
|
|
261
|
+
* // against the sender and not need to pass it in
|
|
262
|
+
* signer: transactionSigner,
|
|
263
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
264
|
+
* suppressLog: true,
|
|
265
|
+
* })
|
|
266
|
+
* ```
|
|
267
|
+
* @returns The result of the asset freeze transaction and the transaction that was sent
|
|
268
|
+
*/
|
|
269
|
+
assetFreeze = this._send((c) => c.addAssetFreeze, { preLog: (params, transaction) => `Freezing asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
|
|
270
|
+
/**
|
|
271
|
+
* Destroys an Algorand Standard Asset.
|
|
272
|
+
*
|
|
273
|
+
* Created assets can be destroyed only by the asset manager account.
|
|
274
|
+
* All of the assets must be owned by the creator of the asset before
|
|
275
|
+
* the asset can be deleted.
|
|
276
|
+
*
|
|
277
|
+
* @param params The parameters for the asset destroy transaction
|
|
278
|
+
*
|
|
279
|
+
* @example Basic example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* await algorand.send.assetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
|
|
282
|
+
* ```
|
|
283
|
+
* @example Advanced example
|
|
284
|
+
* ```typescript
|
|
285
|
+
* await algorand.send.assetDestroy({
|
|
286
|
+
* sender: 'MANAGERADDRESS',
|
|
287
|
+
* assetId: 123456n,
|
|
288
|
+
* lease: 'lease',
|
|
289
|
+
* note: 'note',
|
|
290
|
+
* // You wouldn't normally set this field
|
|
291
|
+
* firstValidRound: 1000n,
|
|
292
|
+
* validityWindow: 10,
|
|
293
|
+
* extraFee: (1000).microAlgo(),
|
|
294
|
+
* staticFee: (1000).microAlgo(),
|
|
295
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
296
|
+
* // already specified, but here for completeness
|
|
297
|
+
* maxFee: (3000).microAlgo(),
|
|
298
|
+
* // Signer only needed if you want to provide one,
|
|
299
|
+
* // generally you'd register it with AlgorandClient
|
|
300
|
+
* // against the sender and not need to pass it in
|
|
301
|
+
* signer: transactionSigner,
|
|
302
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
303
|
+
* suppressLog: true,
|
|
304
|
+
* })
|
|
305
|
+
* ```
|
|
306
|
+
* @returns The result of the asset destroy transaction and the transaction that was sent
|
|
307
|
+
*/
|
|
308
|
+
assetDestroy = this._send((c) => c.addAssetDestroy, { preLog: (params, transaction) => `Destroying asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
|
|
309
|
+
/**
|
|
310
|
+
* Transfer an Algorand Standard Asset.
|
|
311
|
+
*
|
|
312
|
+
* @param params The parameters for the asset transfer transaction
|
|
313
|
+
*
|
|
314
|
+
* @example Basic example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* await algorand.send.assetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
317
|
+
* ```
|
|
318
|
+
* @example Advanced example (with clawback)
|
|
319
|
+
* ```typescript
|
|
320
|
+
* await algorand.send.assetTransfer({
|
|
321
|
+
* sender: 'CLAWBACKADDRESS',
|
|
322
|
+
* assetId: 123456n,
|
|
323
|
+
* amount: 1n,
|
|
324
|
+
* receiver: 'RECEIVERADDRESS',
|
|
325
|
+
* clawbackTarget: 'HOLDERADDRESS',
|
|
326
|
+
* // This field needs to be used with caution
|
|
327
|
+
* closeAssetTo: 'ADDRESSTOCLOSETO'
|
|
328
|
+
* lease: 'lease',
|
|
329
|
+
* note: 'note',
|
|
330
|
+
* // You wouldn't normally set this field
|
|
331
|
+
* firstValidRound: 1000n,
|
|
332
|
+
* validityWindow: 10,
|
|
333
|
+
* extraFee: (1000).microAlgo(),
|
|
334
|
+
* staticFee: (1000).microAlgo(),
|
|
335
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
336
|
+
* // already specified, but here for completeness
|
|
337
|
+
* maxFee: (3000).microAlgo(),
|
|
338
|
+
* // Signer only needed if you want to provide one,
|
|
339
|
+
* // generally you'd register it with AlgorandClient
|
|
340
|
+
* // against the sender and not need to pass it in
|
|
341
|
+
* signer: transactionSigner,
|
|
342
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
343
|
+
* suppressLog: true,
|
|
344
|
+
* })
|
|
345
|
+
* ```
|
|
346
|
+
* @returns The result of the asset transfer transaction and the transaction that was sent
|
|
347
|
+
*/
|
|
348
|
+
assetTransfer = this._send((c) => c.addAssetTransfer, { preLog: (params, transaction) => `Transferring ${params.amount} units of asset with ID ${params.assetId} from ${params.sender} to ${params.receiver} via transaction ${transaction.txId()}` });
|
|
349
|
+
/**
|
|
350
|
+
* Opt an account into an Algorand Standard Asset.
|
|
351
|
+
*
|
|
352
|
+
* @param params The parameters for the asset opt-in transaction
|
|
353
|
+
*
|
|
354
|
+
* @example Basic example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* await algorand.send.assetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
|
|
357
|
+
* ```
|
|
358
|
+
* @example Advanced example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* await algorand.send.assetOptIn({
|
|
361
|
+
* sender: 'SENDERADDRESS',
|
|
362
|
+
* assetId: 123456n,
|
|
363
|
+
* lease: 'lease',
|
|
364
|
+
* note: 'note',
|
|
365
|
+
* // You wouldn't normally set this field
|
|
366
|
+
* firstValidRound: 1000n,
|
|
367
|
+
* validityWindow: 10,
|
|
368
|
+
* extraFee: (1000).microAlgo(),
|
|
369
|
+
* staticFee: (1000).microAlgo(),
|
|
370
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
371
|
+
* // already specified, but here for completeness
|
|
372
|
+
* maxFee: (3000).microAlgo(),
|
|
373
|
+
* // Signer only needed if you want to provide one,
|
|
374
|
+
* // generally you'd register it with AlgorandClient
|
|
375
|
+
* // against the sender and not need to pass it in
|
|
376
|
+
* signer: transactionSigner,
|
|
377
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
378
|
+
* suppressLog: true,
|
|
379
|
+
* })
|
|
380
|
+
* ```
|
|
381
|
+
* @returns The result of the asset opt-in transaction and the transaction that was sent
|
|
382
|
+
*/
|
|
383
|
+
assetOptIn = this._send((c) => c.addAssetOptIn, { preLog: (params, transaction) => `Opting in ${params.sender} to asset with ID ${params.assetId} via transaction ${transaction.txId()}` });
|
|
384
|
+
/**
|
|
385
|
+
* Opt an account out of an Algorand Standard Asset.
|
|
386
|
+
*
|
|
387
|
+
* *Note:* If the account has a balance of the asset,
|
|
388
|
+
* it will not be able to opt-out unless `ensureZeroBalance`
|
|
389
|
+
* is set to `false` (but then the account will lose the assets).
|
|
390
|
+
*
|
|
391
|
+
* @param params The parameters for the asset opt-out transaction
|
|
392
|
+
*
|
|
393
|
+
* @example Basic example (without creator, will be retrieved from algod)
|
|
394
|
+
* ```typescript
|
|
395
|
+
* await algorand.send.assetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
396
|
+
* ```
|
|
397
|
+
* @example Basic example (with creator)
|
|
398
|
+
* ```typescript
|
|
399
|
+
* await algorand.send.assetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
400
|
+
* ```
|
|
401
|
+
* @example Advanced example
|
|
402
|
+
* ```typescript
|
|
403
|
+
* await algorand.send.assetOptOut({
|
|
404
|
+
* sender: 'SENDERADDRESS',
|
|
405
|
+
* assetId: 123456n,
|
|
406
|
+
* creator: 'CREATORADDRESS',
|
|
407
|
+
* ensureZeroBalance: true,
|
|
408
|
+
* lease: 'lease',
|
|
409
|
+
* note: 'note',
|
|
410
|
+
* // You wouldn't normally set this field
|
|
411
|
+
* firstValidRound: 1000n,
|
|
412
|
+
* validityWindow: 10,
|
|
413
|
+
* extraFee: (1000).microAlgo(),
|
|
414
|
+
* staticFee: (1000).microAlgo(),
|
|
415
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
416
|
+
* // already specified, but here for completeness
|
|
417
|
+
* maxFee: (3000).microAlgo(),
|
|
418
|
+
* // Signer only needed if you want to provide one,
|
|
419
|
+
* // generally you'd register it with AlgorandClient
|
|
420
|
+
* // against the sender and not need to pass it in
|
|
421
|
+
* signer: transactionSigner,
|
|
422
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
423
|
+
* suppressLog: true,
|
|
424
|
+
* })
|
|
425
|
+
* ```
|
|
426
|
+
* @returns The result of the asset opt-out transaction and the transaction that was sent
|
|
427
|
+
*/
|
|
428
|
+
assetOptOut = async (params) => {
|
|
429
|
+
if (params.ensureZeroBalance) {
|
|
430
|
+
let balance = 0n;
|
|
431
|
+
try {
|
|
432
|
+
balance = (await this._assetManager.getAccountInformation(require_address.getAddress(params.sender), params.assetId)).balance;
|
|
433
|
+
} catch {
|
|
434
|
+
throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`);
|
|
435
|
+
}
|
|
436
|
+
if (balance !== 0n) throw new Error(`Account ${params.sender} does not have a zero balance for Asset ${params.assetId}; can't opt-out.`);
|
|
437
|
+
}
|
|
438
|
+
params.creator = params.creator ?? (await this._assetManager.getById(params.assetId)).creator;
|
|
439
|
+
return await this._send((c) => c.addAssetOptOut, { preLog: (params$1, transaction) => `Opting ${params$1.sender} out of asset with ID ${params$1.assetId} to creator ${params$1.creator} via transaction ${transaction.txId()}` })(params);
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Create a smart contract.
|
|
443
|
+
*
|
|
444
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
445
|
+
*
|
|
446
|
+
* @param params The parameters for the app creation transaction
|
|
447
|
+
* @example Basic example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
450
|
+
* const createdAppId = result.appId
|
|
451
|
+
* ```
|
|
452
|
+
* @example Advanced example
|
|
453
|
+
* ```typescript
|
|
454
|
+
* await algorand.send.appCreate({
|
|
455
|
+
* sender: 'CREATORADDRESS',
|
|
456
|
+
* approvalProgram: "TEALCODE",
|
|
457
|
+
* clearStateProgram: "TEALCODE",
|
|
458
|
+
* schema: {
|
|
459
|
+
* globalInts: 1,
|
|
460
|
+
* globalByteSlices: 2,
|
|
461
|
+
* localInts: 3,
|
|
462
|
+
* localByteSlices: 4
|
|
463
|
+
* },
|
|
464
|
+
* extraProgramPages: 1,
|
|
465
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
466
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
467
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
468
|
+
* appReferences: [123n, 1234n]
|
|
469
|
+
* assetReferences: [12345n]
|
|
470
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
471
|
+
* accessReferences: [{ appId: 1234n }]
|
|
472
|
+
* lease: 'lease',
|
|
473
|
+
* note: 'note',
|
|
474
|
+
* // You wouldn't normally set this field
|
|
475
|
+
* firstValidRound: 1000n,
|
|
476
|
+
* validityWindow: 10,
|
|
477
|
+
* extraFee: (1000).microAlgo(),
|
|
478
|
+
* staticFee: (1000).microAlgo(),
|
|
479
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
480
|
+
* // already specified, but here for completeness
|
|
481
|
+
* maxFee: (3000).microAlgo(),
|
|
482
|
+
* rejectVersion: 1,
|
|
483
|
+
* // Signer only needed if you want to provide one,
|
|
484
|
+
* // generally you'd register it with AlgorandClient
|
|
485
|
+
* // against the sender and not need to pass it in
|
|
486
|
+
* signer: transactionSigner,
|
|
487
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
488
|
+
* suppressLog: true,
|
|
489
|
+
*})
|
|
490
|
+
* ```
|
|
491
|
+
* @returns The result of the app create transaction and the transaction that was sent
|
|
492
|
+
*/
|
|
493
|
+
appCreate = this._sendAppCreateCall((c) => c.addAppCreate, { postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.appId} via transaction ${result.txIds.at(-1)}` });
|
|
494
|
+
/**
|
|
495
|
+
* Update a smart contract.
|
|
496
|
+
*
|
|
497
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
498
|
+
*
|
|
499
|
+
* @param params The parameters for the app update transaction
|
|
500
|
+
* @example Basic example
|
|
501
|
+
* ```typescript
|
|
502
|
+
* await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
503
|
+
* ```
|
|
504
|
+
* @example Advanced example
|
|
505
|
+
* ```typescript
|
|
506
|
+
* await algorand.send.appUpdate({
|
|
507
|
+
* sender: 'CREATORADDRESS',
|
|
508
|
+
* approvalProgram: "TEALCODE",
|
|
509
|
+
* clearStateProgram: "TEALCODE",
|
|
510
|
+
* onComplete: OnApplicationComplete.UpdateApplication,
|
|
511
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
512
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
513
|
+
* appReferences: [123n, 1234n]
|
|
514
|
+
* assetReferences: [12345n]
|
|
515
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
516
|
+
* accessReferences: [{ appId: 1234n }]
|
|
517
|
+
* lease: 'lease',
|
|
518
|
+
* note: 'note',
|
|
519
|
+
* // You wouldn't normally set this field
|
|
520
|
+
* firstValidRound: 1000n,
|
|
521
|
+
* validityWindow: 10,
|
|
522
|
+
* extraFee: (1000).microAlgo(),
|
|
523
|
+
* staticFee: (1000).microAlgo(),
|
|
524
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
525
|
+
* // already specified, but here for completeness
|
|
526
|
+
* maxFee: (3000).microAlgo(),
|
|
527
|
+
* rejectVersion: 1,
|
|
528
|
+
* // Signer only needed if you want to provide one,
|
|
529
|
+
* // generally you'd register it with AlgorandClient
|
|
530
|
+
* // against the sender and not need to pass it in
|
|
531
|
+
* signer: transactionSigner,
|
|
532
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
533
|
+
* suppressLog: true,
|
|
534
|
+
*})
|
|
535
|
+
* ```
|
|
536
|
+
* @returns The result of the app update transaction and the transaction that was sent
|
|
537
|
+
*/
|
|
538
|
+
appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, { postLog: (params, result) => `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
539
|
+
/**
|
|
540
|
+
* Delete a smart contract.
|
|
541
|
+
*
|
|
542
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
543
|
+
*
|
|
544
|
+
* @param params The parameters for the app deletion transaction
|
|
545
|
+
* @example Basic example
|
|
546
|
+
* ```typescript
|
|
547
|
+
* await algorand.send.appDelete({ sender: 'CREATORADDRESS' })
|
|
548
|
+
* ```
|
|
549
|
+
* @example Advanced example
|
|
550
|
+
* ```typescript
|
|
551
|
+
* await algorand.send.appDelete({
|
|
552
|
+
* sender: 'CREATORADDRESS',
|
|
553
|
+
* onComplete: OnApplicationComplete.DeleteApplication,
|
|
554
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
555
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
556
|
+
* appReferences: [123n, 1234n]
|
|
557
|
+
* assetReferences: [12345n]
|
|
558
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
559
|
+
* accessReferences: [{ appId: 1234n }]
|
|
560
|
+
* lease: 'lease',
|
|
561
|
+
* note: 'note',
|
|
562
|
+
* // You wouldn't normally set this field
|
|
563
|
+
* firstValidRound: 1000n,
|
|
564
|
+
* validityWindow: 10,
|
|
565
|
+
* extraFee: (1000).microAlgo(),
|
|
566
|
+
* staticFee: (1000).microAlgo(),
|
|
567
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
568
|
+
* // already specified, but here for completeness
|
|
569
|
+
* maxFee: (3000).microAlgo(),
|
|
570
|
+
* rejectVersion: 1,
|
|
571
|
+
* // Signer only needed if you want to provide one,
|
|
572
|
+
* // generally you'd register it with AlgorandClient
|
|
573
|
+
* // against the sender and not need to pass it in
|
|
574
|
+
* signer: transactionSigner,
|
|
575
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
576
|
+
* suppressLog: true,
|
|
577
|
+
*})
|
|
578
|
+
* ```
|
|
579
|
+
* @returns The result of the app delete transaction and the transaction that was sent
|
|
580
|
+
*/
|
|
581
|
+
appDelete = this._sendAppCall((c) => c.addAppDelete, { postLog: (params, result) => `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
582
|
+
/**
|
|
583
|
+
* Call a smart contract.
|
|
584
|
+
*
|
|
585
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
586
|
+
*
|
|
587
|
+
* @param params The parameters for the app call transaction
|
|
588
|
+
* @example Basic example
|
|
589
|
+
* ```typescript
|
|
590
|
+
* await algorand.send.appCall({ sender: 'CREATORADDRESS' })
|
|
591
|
+
* ```
|
|
592
|
+
* @example Advanced example
|
|
593
|
+
* ```typescript
|
|
594
|
+
* await algorand.send.appCall({
|
|
595
|
+
* sender: 'CREATORADDRESS',
|
|
596
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
597
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
598
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
599
|
+
* appReferences: [123n, 1234n]
|
|
600
|
+
* assetReferences: [12345n]
|
|
601
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
602
|
+
* accessReferences: [{ appId: 1234n }]
|
|
603
|
+
* lease: 'lease',
|
|
604
|
+
* note: 'note',
|
|
605
|
+
* // You wouldn't normally set this field
|
|
606
|
+
* firstValidRound: 1000n,
|
|
607
|
+
* validityWindow: 10,
|
|
608
|
+
* extraFee: (1000).microAlgo(),
|
|
609
|
+
* staticFee: (1000).microAlgo(),
|
|
610
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
611
|
+
* // already specified, but here for completeness
|
|
612
|
+
* maxFee: (3000).microAlgo(),
|
|
613
|
+
* rejectVersion: 1,
|
|
614
|
+
* // Signer only needed if you want to provide one,
|
|
615
|
+
* // generally you'd register it with AlgorandClient
|
|
616
|
+
* // against the sender and not need to pass it in
|
|
617
|
+
* signer: transactionSigner,
|
|
618
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
619
|
+
* suppressLog: true,
|
|
620
|
+
*})
|
|
621
|
+
* ```
|
|
622
|
+
* @returns The result of the app call transaction and the transaction that was sent
|
|
623
|
+
*/
|
|
624
|
+
appCall = this._sendAppCall((c) => c.addAppCall, { postLog: (params, result) => `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString("base64"))}` : ""} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
625
|
+
/**
|
|
626
|
+
* Create a smart contract via an ABI method.
|
|
627
|
+
*
|
|
628
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
629
|
+
*
|
|
630
|
+
* @param params The parameters for the app creation transaction
|
|
631
|
+
* @example Basic example
|
|
632
|
+
* ```typescript
|
|
633
|
+
* const method = new ABIMethod({
|
|
634
|
+
* name: 'method',
|
|
635
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
636
|
+
* returns: { type: 'string' },
|
|
637
|
+
* })
|
|
638
|
+
* const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
639
|
+
* const createdAppId = result.appId
|
|
640
|
+
* ```
|
|
641
|
+
* @example Advanced example
|
|
642
|
+
* ```typescript
|
|
643
|
+
* const method = new ABIMethod({
|
|
644
|
+
* name: 'method',
|
|
645
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
646
|
+
* returns: { type: 'string' },
|
|
647
|
+
* })
|
|
648
|
+
* await algorand.send.appCreateMethodCall({
|
|
649
|
+
* sender: 'CREATORADDRESS',
|
|
650
|
+
* method: method,
|
|
651
|
+
* args: ["arg1_value"],
|
|
652
|
+
* approvalProgram: "TEALCODE",
|
|
653
|
+
* clearStateProgram: "TEALCODE",
|
|
654
|
+
* schema: {
|
|
655
|
+
* globalInts: 1,
|
|
656
|
+
* globalByteSlices: 2,
|
|
657
|
+
* localInts: 3,
|
|
658
|
+
* localByteSlices: 4
|
|
659
|
+
* },
|
|
660
|
+
* extraProgramPages: 1,
|
|
661
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
662
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
663
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
664
|
+
* appReferences: [123n, 1234n]
|
|
665
|
+
* assetReferences: [12345n]
|
|
666
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
667
|
+
* accessReferences: [{ appId: 1234n }]
|
|
668
|
+
* lease: 'lease',
|
|
669
|
+
* note: 'note',
|
|
670
|
+
* // You wouldn't normally set this field
|
|
671
|
+
* firstValidRound: 1000n,
|
|
672
|
+
* validityWindow: 10,
|
|
673
|
+
* extraFee: (1000).microAlgo(),
|
|
674
|
+
* staticFee: (1000).microAlgo(),
|
|
675
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
676
|
+
* // already specified, but here for completeness
|
|
677
|
+
* maxFee: (3000).microAlgo(),
|
|
678
|
+
* rejectVersion: 1,
|
|
679
|
+
* // Signer only needed if you want to provide one,
|
|
680
|
+
* // generally you'd register it with AlgorandClient
|
|
681
|
+
* // against the sender and not need to pass it in
|
|
682
|
+
* signer: transactionSigner,
|
|
683
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
684
|
+
* suppressLog: true,
|
|
685
|
+
*})
|
|
686
|
+
* ```
|
|
687
|
+
* @returns The result of the application ABI method create transaction and the transaction that was sent
|
|
688
|
+
*/
|
|
689
|
+
appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, { postLog: (params, result) => `App created by ${params.sender} with ID ${result.confirmation.appId} via transaction ${result.txIds.at(-1)}` });
|
|
690
|
+
/**
|
|
691
|
+
* Update a smart contract via an ABI method.
|
|
692
|
+
*
|
|
693
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
694
|
+
*
|
|
695
|
+
* @param params The parameters for the app update transaction
|
|
696
|
+
* @example Basic example
|
|
697
|
+
* ```typescript
|
|
698
|
+
* const method = new ABIMethod({
|
|
699
|
+
* name: 'method',
|
|
700
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
701
|
+
* returns: { type: 'string' },
|
|
702
|
+
* })
|
|
703
|
+
* await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
704
|
+
* ```
|
|
705
|
+
* @example Advanced example
|
|
706
|
+
* ```typescript
|
|
707
|
+
* const method = new ABIMethod({
|
|
708
|
+
* name: 'method',
|
|
709
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
710
|
+
* returns: { type: 'string' },
|
|
711
|
+
* })
|
|
712
|
+
* await algorand.send.appUpdateMethodCall({
|
|
713
|
+
* sender: 'CREATORADDRESS',
|
|
714
|
+
* method: method,
|
|
715
|
+
* args: ["arg1_value"],
|
|
716
|
+
* approvalProgram: "TEALCODE",
|
|
717
|
+
* clearStateProgram: "TEALCODE",
|
|
718
|
+
* onComplete: OnApplicationComplete.UpdateApplication,
|
|
719
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
720
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
721
|
+
* appReferences: [123n, 1234n]
|
|
722
|
+
* assetReferences: [12345n]
|
|
723
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
724
|
+
* accessReferences: [{ appId: 1234n }]
|
|
725
|
+
* lease: 'lease',
|
|
726
|
+
* note: 'note',
|
|
727
|
+
* // You wouldn't normally set this field
|
|
728
|
+
* firstValidRound: 1000n,
|
|
729
|
+
* validityWindow: 10,
|
|
730
|
+
* extraFee: (1000).microAlgo(),
|
|
731
|
+
* staticFee: (1000).microAlgo(),
|
|
732
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
733
|
+
* // already specified, but here for completeness
|
|
734
|
+
* maxFee: (3000).microAlgo(),
|
|
735
|
+
* rejectVersion: 1,
|
|
736
|
+
* // Signer only needed if you want to provide one,
|
|
737
|
+
* // generally you'd register it with AlgorandClient
|
|
738
|
+
* // against the sender and not need to pass it in
|
|
739
|
+
* signer: transactionSigner,
|
|
740
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
741
|
+
* suppressLog: true,
|
|
742
|
+
*})
|
|
743
|
+
* ```
|
|
744
|
+
* @returns The result of the application ABI method update transaction and the transaction that was sent
|
|
745
|
+
*/
|
|
746
|
+
appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, { postLog: (params, result) => `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
747
|
+
/**
|
|
748
|
+
* Delete a smart contract via an ABI method.
|
|
749
|
+
*
|
|
750
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
751
|
+
*
|
|
752
|
+
* @param params The parameters for the app deletion transaction
|
|
753
|
+
* @example Basic example
|
|
754
|
+
* ```typescript
|
|
755
|
+
* const method = new ABIMethod({
|
|
756
|
+
* name: 'method',
|
|
757
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
758
|
+
* returns: { type: 'string' },
|
|
759
|
+
* })
|
|
760
|
+
* await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
761
|
+
* ```
|
|
762
|
+
* @example Advanced example
|
|
763
|
+
* ```typescript
|
|
764
|
+
* const method = new ABIMethod({
|
|
765
|
+
* name: 'method',
|
|
766
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
767
|
+
* returns: { type: 'string' },
|
|
768
|
+
* })
|
|
769
|
+
* await algorand.send.appDeleteMethodCall({
|
|
770
|
+
* sender: 'CREATORADDRESS',
|
|
771
|
+
* method: method,
|
|
772
|
+
* args: ["arg1_value"],
|
|
773
|
+
* onComplete: OnApplicationComplete.DeleteApplication,
|
|
774
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
775
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
776
|
+
* appReferences: [123n, 1234n]
|
|
777
|
+
* assetReferences: [12345n]
|
|
778
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
779
|
+
* accessReferences: [{ appId: 1234n }]
|
|
780
|
+
* lease: 'lease',
|
|
781
|
+
* note: 'note',
|
|
782
|
+
* // You wouldn't normally set this field
|
|
783
|
+
* firstValidRound: 1000n,
|
|
784
|
+
* validityWindow: 10,
|
|
785
|
+
* extraFee: (1000).microAlgo(),
|
|
786
|
+
* staticFee: (1000).microAlgo(),
|
|
787
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
788
|
+
* // already specified, but here for completeness
|
|
789
|
+
* maxFee: (3000).microAlgo(),
|
|
790
|
+
* rejectVersion: 1,
|
|
791
|
+
* // Signer only needed if you want to provide one,
|
|
792
|
+
* // generally you'd register it with AlgorandClient
|
|
793
|
+
* // against the sender and not need to pass it in
|
|
794
|
+
* signer: transactionSigner,
|
|
795
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
796
|
+
* suppressLog: true,
|
|
797
|
+
*})
|
|
798
|
+
* ```
|
|
799
|
+
* @returns The result of the application ABI method delete transaction and the transaction that was sent
|
|
800
|
+
*/
|
|
801
|
+
appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, { postLog: (params, result) => `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
802
|
+
/**
|
|
803
|
+
* Call a smart contract via an ABI method.
|
|
804
|
+
*
|
|
805
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
806
|
+
*
|
|
807
|
+
* @param params The parameters for the app call transaction
|
|
808
|
+
* @example Basic example
|
|
809
|
+
* ```typescript
|
|
810
|
+
* const method = new ABIMethod({
|
|
811
|
+
* name: 'method',
|
|
812
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
813
|
+
* returns: { type: 'string' },
|
|
814
|
+
* })
|
|
815
|
+
* await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
816
|
+
* ```
|
|
817
|
+
* @example Advanced example
|
|
818
|
+
* ```typescript
|
|
819
|
+
* const method = new ABIMethod({
|
|
820
|
+
* name: 'method',
|
|
821
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
822
|
+
* returns: { type: 'string' },
|
|
823
|
+
* })
|
|
824
|
+
* await algorand.send.appCallMethodCall({
|
|
825
|
+
* sender: 'CREATORADDRESS',
|
|
826
|
+
* method: method,
|
|
827
|
+
* args: ["arg1_value"],
|
|
828
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
829
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
830
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
831
|
+
* appReferences: [123n, 1234n]
|
|
832
|
+
* assetReferences: [12345n]
|
|
833
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
834
|
+
* accessReferences: [{ appId: 1234n }]
|
|
835
|
+
* lease: 'lease',
|
|
836
|
+
* note: 'note',
|
|
837
|
+
* // You wouldn't normally set this field
|
|
838
|
+
* firstValidRound: 1000n,
|
|
839
|
+
* validityWindow: 10,
|
|
840
|
+
* extraFee: (1000).microAlgo(),
|
|
841
|
+
* staticFee: (1000).microAlgo(),
|
|
842
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
843
|
+
* // already specified, but here for completeness
|
|
844
|
+
* maxFee: (3000).microAlgo(),
|
|
845
|
+
* rejectVersion: 1,
|
|
846
|
+
* // Signer only needed if you want to provide one,
|
|
847
|
+
* // generally you'd register it with AlgorandClient
|
|
848
|
+
* // against the sender and not need to pass it in
|
|
849
|
+
* signer: transactionSigner,
|
|
850
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
851
|
+
* suppressLog: true,
|
|
852
|
+
*})
|
|
853
|
+
* ```
|
|
854
|
+
* @returns The result of the application ABI method call transaction and the transaction that was sent
|
|
855
|
+
*/
|
|
856
|
+
appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, { postLog: (params, result) => `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}` });
|
|
857
|
+
/**
|
|
858
|
+
* Register an online key.
|
|
859
|
+
* @param params The parameters for the key registration transaction
|
|
860
|
+
* @example Basic example
|
|
861
|
+
* ```typescript
|
|
862
|
+
* const result = await algorand.send.onlineKeyRegistration({
|
|
863
|
+
* sender: 'SENDERADDRESS',
|
|
864
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
865
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
866
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
867
|
+
* voteFirst: 1n,
|
|
868
|
+
* voteLast: 1000n,
|
|
869
|
+
* voteKeyDilution: 1n,
|
|
870
|
+
* })
|
|
871
|
+
* ```
|
|
872
|
+
* @example Advanced example
|
|
873
|
+
* ```typescript
|
|
874
|
+
* const result = await algorand.send.onlineKeyRegistration({
|
|
875
|
+
* sender: 'SENDERADDRESS',
|
|
876
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
877
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
878
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
879
|
+
* voteFirst: 1n,
|
|
880
|
+
* voteLast: 1000n,
|
|
881
|
+
* voteKeyDilution: 1n,
|
|
882
|
+
* lease: 'lease',
|
|
883
|
+
* note: 'note',
|
|
884
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
885
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
886
|
+
* // You wouldn't normally set this field
|
|
887
|
+
* firstValidRound: 1000n,
|
|
888
|
+
* validityWindow: 10,
|
|
889
|
+
* extraFee: (1000).microAlgo(),
|
|
890
|
+
* staticFee: (1000).microAlgo(),
|
|
891
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
892
|
+
* // already specified, but here for completeness
|
|
893
|
+
* maxFee: (3000).microAlgo(),
|
|
894
|
+
* })
|
|
895
|
+
* ```
|
|
896
|
+
* @returns The result of the online key registration transaction and the transaction that was sent
|
|
897
|
+
*/
|
|
898
|
+
onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, { preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txId()}` });
|
|
899
|
+
/**
|
|
900
|
+
* Register an offline key.
|
|
901
|
+
* @param params The parameters for the key registration transaction
|
|
902
|
+
* @example Basic example
|
|
903
|
+
* ```typescript
|
|
904
|
+
* const result = await algorand.send.offlineKeyRegistration({
|
|
905
|
+
* sender: 'SENDERADDRESS',
|
|
906
|
+
* })
|
|
907
|
+
* ```
|
|
908
|
+
* @example Advanced example
|
|
909
|
+
* ```typescript
|
|
910
|
+
* const result = await algorand.send.offlineKeyRegistration({
|
|
911
|
+
* sender: 'SENDERADDRESS',
|
|
912
|
+
* lease: 'lease',
|
|
913
|
+
* note: 'note',
|
|
914
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
915
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
916
|
+
* // You wouldn't normally set this field
|
|
917
|
+
* firstValidRound: 1000n,
|
|
918
|
+
* validityWindow: 10,
|
|
919
|
+
* extraFee: (1000).microAlgo(),
|
|
920
|
+
* staticFee: (1000).microAlgo(),
|
|
921
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
922
|
+
* // already specified, but here for completeness
|
|
923
|
+
* maxFee: (3000).microAlgo(),
|
|
924
|
+
* })
|
|
925
|
+
* ```
|
|
926
|
+
* @returns The result of the offline key registration transaction and the transaction that was sent
|
|
927
|
+
*/
|
|
928
|
+
offlineKeyRegistration = this._send((c) => c.addOfflineKeyRegistration, { preLog: (params, transaction) => `Registering offline key for ${params.sender} via transaction ${transaction.txId()}` });
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
//#endregion
|
|
932
|
+
exports.AlgorandClientTransactionSender = AlgorandClientTransactionSender;
|
|
933
|
+
//# sourceMappingURL=algorand-client-transaction-sender.js.map
|