@algorandfoundation/algokit-utils 6.2.1 → 7.0.0-alpha.1
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/LICENSE +21 -0
- package/README.md +22 -26
- package/account/account.d.ts +21 -11
- package/account/get-account-config-from-environment.d.ts +0 -1
- package/account/get-account.d.ts +6 -7
- package/account/get-dispenser-account.d.ts +2 -3
- package/account/index.d.ts +0 -1
- package/account/mnemonic-account.d.ts +1 -2
- package/amount.d.ts +41 -9
- package/app-client.d.ts +19 -5
- package/app-deploy.d.ts +18 -2
- package/app.d.ts +39 -3
- package/asset.d.ts +10 -1
- package/config.d.ts +0 -1
- package/debugging/debugging.d.ts +3 -5
- package/debugging/index.d.ts +0 -2
- package/dispenser-client.d.ts +1 -2
- package/index.d.ts +8 -6
- package/index.js +61 -48
- package/index.js.map +1 -1
- package/index.mjs +27 -24
- package/index.mjs.map +1 -1
- package/indexer-lookup.d.ts +10 -9
- package/localnet/get-kmd-wallet-account.d.ts +1 -2
- package/localnet/get-localnet-dispenser-account.d.ts +1 -2
- package/localnet/get-or-create-kmd-wallet-account.d.ts +2 -3
- package/localnet/index.d.ts +0 -1
- package/localnet/is-localnet.d.ts +1 -2
- package/network-client.d.ts +3 -10
- package/package.json +5 -5
- package/{account → src/account}/account.js +38 -15
- package/src/account/account.js.map +1 -0
- package/{account → src/account}/account.mjs +39 -16
- package/src/account/account.mjs.map +1 -0
- package/src/account/get-account-config-from-environment.js.map +1 -0
- package/src/account/get-account-config-from-environment.mjs.map +1 -0
- package/{account → src/account}/get-account.js +5 -5
- package/src/account/get-account.js.map +1 -0
- package/{account → src/account}/get-account.mjs +5 -5
- package/src/account/get-account.mjs.map +1 -0
- package/{account → src/account}/get-dispenser-account.js +3 -3
- package/src/account/get-dispenser-account.js.map +1 -0
- package/{account → src/account}/get-dispenser-account.mjs +3 -3
- package/src/account/get-dispenser-account.mjs.map +1 -0
- package/{account → src/account}/mnemonic-account.js +1 -1
- package/src/account/mnemonic-account.js.map +1 -0
- package/{account → src/account}/mnemonic-account.mjs +1 -1
- package/src/account/mnemonic-account.mjs.map +1 -0
- package/src/amount.js +61 -0
- package/src/amount.js.map +1 -0
- package/src/amount.mjs +54 -0
- package/src/amount.mjs.map +1 -0
- package/{app-client.js → src/app-client.js} +20 -5
- package/src/app-client.js.map +1 -0
- package/{app-client.mjs → src/app-client.mjs} +20 -5
- package/src/app-client.mjs.map +1 -0
- package/src/app-deploy.js +285 -0
- package/src/app-deploy.js.map +1 -0
- package/src/app-deploy.mjs +276 -0
- package/src/app-deploy.mjs.map +1 -0
- package/src/app.js +349 -0
- package/src/app.js.map +1 -0
- package/src/app.mjs +329 -0
- package/src/app.mjs.map +1 -0
- package/src/asset.js +142 -0
- package/src/asset.js.map +1 -0
- package/src/asset.mjs +136 -0
- package/src/asset.mjs.map +1 -0
- package/{config.js → src/config.js} +1 -1
- package/src/config.js.map +1 -0
- package/{config.mjs → src/config.mjs} +1 -1
- package/src/config.mjs.map +1 -0
- package/src/debugging/debugging.js +15 -0
- package/src/debugging/debugging.js.map +1 -0
- package/src/debugging/debugging.mjs +13 -0
- package/src/debugging/debugging.mjs.map +1 -0
- package/{dispenser-client.js → src/dispenser-client.js} +3 -3
- package/src/dispenser-client.js.map +1 -0
- package/{dispenser-client.mjs → src/dispenser-client.mjs} +3 -3
- package/src/dispenser-client.mjs.map +1 -0
- package/{indexer-lookup.js → src/indexer-lookup.js} +14 -10
- package/src/indexer-lookup.js.map +1 -0
- package/{indexer-lookup.mjs → src/indexer-lookup.mjs} +14 -10
- package/src/indexer-lookup.mjs.map +1 -0
- package/{localnet → src/localnet}/get-kmd-wallet-account.js +3 -3
- package/src/localnet/get-kmd-wallet-account.js.map +1 -0
- package/{localnet → src/localnet}/get-kmd-wallet-account.mjs +3 -3
- package/src/localnet/get-kmd-wallet-account.mjs.map +1 -0
- package/{localnet → src/localnet}/get-localnet-dispenser-account.js +3 -3
- package/src/localnet/get-localnet-dispenser-account.js.map +1 -0
- package/{localnet → src/localnet}/get-localnet-dispenser-account.mjs +3 -3
- package/src/localnet/get-localnet-dispenser-account.mjs.map +1 -0
- package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.js +4 -4
- package/src/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
- package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.mjs +4 -4
- package/src/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -0
- package/{localnet → src/localnet}/is-localnet.js +2 -2
- package/src/localnet/is-localnet.js.map +1 -0
- package/{localnet → src/localnet}/is-localnet.mjs +2 -2
- package/src/localnet/is-localnet.mjs.map +1 -0
- package/{network-client.js → src/network-client.js} +5 -12
- package/src/network-client.js.map +1 -0
- package/{network-client.mjs → src/network-client.mjs} +5 -12
- package/src/network-client.mjs.map +1 -0
- package/{testing → src/testing}/account.js +16 -4
- package/src/testing/account.js.map +1 -0
- package/{testing → src/testing}/account.mjs +17 -5
- package/src/testing/account.mjs.map +1 -0
- package/src/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/src/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -0
- package/{testing → src/testing}/fixtures/algorand-fixture.js +18 -14
- package/src/testing/fixtures/algorand-fixture.js.map +1 -0
- package/{testing → src/testing}/fixtures/algorand-fixture.mjs +18 -14
- package/src/testing/fixtures/algorand-fixture.mjs.map +1 -0
- package/src/testing/indexer.js.map +1 -0
- package/src/testing/indexer.mjs.map +1 -0
- package/{testing → src/testing}/test-logger.js +7 -3
- package/src/testing/test-logger.js.map +1 -0
- package/{testing → src/testing}/test-logger.mjs +7 -3
- package/src/testing/test-logger.mjs.map +1 -0
- package/src/testing/transaction-logger.js.map +1 -0
- package/src/testing/transaction-logger.mjs.map +1 -0
- package/src/transaction/legacy-bridge.js +129 -0
- package/src/transaction/legacy-bridge.js.map +1 -0
- package/src/transaction/legacy-bridge.mjs +124 -0
- package/src/transaction/legacy-bridge.mjs.map +1 -0
- package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.js +14 -9
- package/src/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -0
- package/{transaction → src/transaction}/perform-atomic-transaction-composer-simulate.mjs +15 -10
- package/src/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -0
- package/{transaction → src/transaction}/transaction.js +221 -141
- package/src/transaction/transaction.js.map +1 -0
- package/{transaction → src/transaction}/transaction.mjs +222 -142
- package/src/transaction/transaction.mjs.map +1 -0
- package/src/transfer/transfer-algos.js +31 -0
- package/src/transfer/transfer-algos.js.map +1 -0
- package/src/transfer/transfer-algos.mjs +29 -0
- package/src/transfer/transfer-algos.mjs.map +1 -0
- package/src/transfer/transfer.js +112 -0
- package/src/transfer/transfer.js.map +1 -0
- package/src/transfer/transfer.mjs +108 -0
- package/src/transfer/transfer.mjs.map +1 -0
- package/{util.js → src/util.js} +33 -7
- package/src/util.js.map +1 -0
- package/{util.mjs → src/util.mjs} +31 -7
- package/src/util.mjs.map +1 -0
- package/testing/_asset.d.ts +3 -5
- package/testing/account.d.ts +4 -4
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
- package/testing/fixtures/algorand-fixture.d.ts +1 -2
- package/testing/fixtures/index.d.ts +0 -1
- package/testing/index.d.ts +0 -1
- package/testing/index.js +6 -6
- package/testing/index.mjs +6 -6
- package/testing/indexer.d.ts +0 -1
- package/testing/test-logger.d.ts +0 -1
- package/testing/transaction-logger.d.ts +0 -1
- package/transaction/index.d.ts +0 -1
- package/transaction/legacy-bridge.d.ts +35 -0
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
- package/transaction/transaction.d.ts +39 -20
- package/transfer/index.d.ts +0 -1
- package/transfer/transfer-algos.d.ts +4 -3
- package/transfer/transfer.d.ts +8 -2
- package/types/account-manager.d.ts +165 -40
- package/types/account-manager.js +255 -59
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +255 -59
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +137 -14
- package/types/account.js +2 -2
- package/types/account.js.map +1 -1
- package/types/account.mjs +3 -3
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +1 -3
- package/types/algo-http-client-with-retry.js +34 -4
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +33 -3
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-interface.d.ts +28 -0
- package/types/algorand-client-interface.js +3 -0
- package/types/algorand-client-interface.js.map +1 -0
- package/types/algorand-client-interface.mjs +2 -0
- package/types/algorand-client-interface.mjs.map +1 -0
- package/types/algorand-client-transaction-creator.d.ts +718 -0
- package/types/algorand-client-transaction-creator.js +683 -0
- package/types/algorand-client-transaction-creator.js.map +1 -0
- package/types/algorand-client-transaction-creator.mjs +681 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -0
- package/types/algorand-client-transaction-sender.d.ts +1158 -0
- package/types/algorand-client-transaction-sender.js +852 -0
- package/types/algorand-client-transaction-sender.js.map +1 -0
- package/types/algorand-client-transaction-sender.mjs +850 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -0
- package/types/algorand-client.d.ts +48 -91
- package/types/algorand-client.js +53 -132
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +55 -131
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +23 -12
- package/types/amount.js +33 -10
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +33 -10
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +359 -0
- package/types/app-arc56.js +184 -0
- package/types/app-arc56.js.map +1 -0
- package/types/app-arc56.mjs +175 -0
- package/types/app-arc56.mjs.map +1 -0
- package/types/app-client.d.ts +1511 -15
- package/types/app-client.js +1029 -43
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1030 -45
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +126 -0
- package/types/app-deployer.js +353 -0
- package/types/app-deployer.js.map +1 -0
- package/types/app-deployer.mjs +351 -0
- package/types/app-deployer.mjs.map +1 -0
- package/types/app-factory.d.ts +846 -0
- package/types/app-factory.js +410 -0
- package/types/app-factory.js.map +1 -0
- package/types/app-factory.mjs +408 -0
- package/types/app-factory.mjs.map +1 -0
- package/types/app-manager.d.ts +244 -0
- package/types/app-manager.js +423 -0
- package/types/app-manager.js.map +1 -0
- package/types/app-manager.mjs +421 -0
- package/types/app-manager.mjs.map +1 -0
- package/types/app-spec.d.ts +2 -1
- package/types/app-spec.js +127 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +126 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +57 -18
- package/types/app.js +1 -1
- package/types/app.js.map +1 -1
- package/types/app.mjs +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +205 -0
- package/types/asset-manager.js +176 -0
- package/types/asset-manager.js.map +1 -0
- package/types/asset-manager.mjs +174 -0
- package/types/asset-manager.mjs.map +1 -0
- package/types/asset.d.ts +4 -5
- package/types/async-event-emitter.d.ts +14 -0
- package/types/async-event-emitter.js +50 -0
- package/types/async-event-emitter.js.map +1 -0
- package/types/async-event-emitter.mjs +48 -0
- package/types/async-event-emitter.mjs.map +1 -0
- package/types/client-manager.d.ts +171 -58
- package/types/client-manager.js +198 -43
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +199 -44
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +474 -132
- package/types/composer.js +461 -167
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +461 -168
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +3 -6
- package/types/config.js +5 -44
- package/types/config.js.map +1 -1
- package/types/config.mjs +5 -27
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +29 -101
- package/types/debugging.js +16 -109
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -107
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +14 -6
- package/types/dispenser-client.js +19 -14
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +19 -14
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +7 -0
- package/types/expand.js +3 -0
- package/types/expand.js.map +1 -0
- package/types/expand.mjs +2 -0
- package/types/expand.mjs.map +1 -0
- package/types/indexer.d.ts +74 -756
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +5 -6
- package/types/kmd-account-manager.js +9 -9
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +10 -10
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +10 -0
- package/types/lifecycle-events.js +8 -0
- package/types/lifecycle-events.js.map +1 -0
- package/types/lifecycle-events.mjs +8 -0
- package/types/lifecycle-events.mjs.map +1 -0
- package/types/logging.d.ts +0 -1
- package/types/logging.js.map +1 -1
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +2 -4
- package/types/logic-error.js +3 -3
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +3 -3
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +21 -3
- package/types/network-client.js +10 -0
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -0
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +9 -11
- package/types/transaction.d.ts +17 -4
- package/types/transfer.d.ts +8 -8
- package/util.d.ts +15 -2
- package/account/account.d.ts.map +0 -1
- package/account/account.js.map +0 -1
- package/account/account.mjs.map +0 -1
- package/account/get-account-config-from-environment.d.ts.map +0 -1
- package/account/get-account-config-from-environment.js.map +0 -1
- package/account/get-account-config-from-environment.mjs.map +0 -1
- package/account/get-account.d.ts.map +0 -1
- package/account/get-account.js.map +0 -1
- package/account/get-account.mjs.map +0 -1
- package/account/get-dispenser-account.d.ts.map +0 -1
- package/account/get-dispenser-account.js.map +0 -1
- package/account/get-dispenser-account.mjs.map +0 -1
- package/account/index.d.ts.map +0 -1
- package/account/mnemonic-account.d.ts.map +0 -1
- package/account/mnemonic-account.js.map +0 -1
- package/account/mnemonic-account.mjs.map +0 -1
- package/amount.d.ts.map +0 -1
- package/amount.js +0 -34
- package/amount.js.map +0 -1
- package/amount.mjs +0 -30
- package/amount.mjs.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-client.js.map +0 -1
- package/app-client.mjs.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app-deploy.js +0 -468
- package/app-deploy.js.map +0 -1
- package/app-deploy.mjs +0 -459
- package/app-deploy.mjs.map +0 -1
- package/app.d.ts.map +0 -1
- package/app.js +0 -599
- package/app.js.map +0 -1
- package/app.mjs +0 -579
- package/app.mjs.map +0 -1
- package/asset.d.ts.map +0 -1
- package/asset.js +0 -272
- package/asset.js.map +0 -1
- package/asset.mjs +0 -266
- package/asset.mjs.map +0 -1
- package/config.d.ts.map +0 -1
- package/config.js.map +0 -1
- package/config.mjs.map +0 -1
- package/debugging/debugging.d.ts.map +0 -1
- package/debugging/debugging.js +0 -139
- package/debugging/debugging.js.map +0 -1
- package/debugging/debugging.mjs +0 -118
- package/debugging/debugging.mjs.map +0 -1
- package/debugging/index.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.d.ts +0 -20
- package/debugging/simulate-and-persist-response.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.js +0 -108
- package/debugging/simulate-and-persist-response.js.map +0 -1
- package/debugging/simulate-and-persist-response.mjs +0 -89
- package/debugging/simulate-and-persist-response.mjs.map +0 -1
- package/dispenser-client.d.ts.map +0 -1
- package/dispenser-client.js.map +0 -1
- package/dispenser-client.mjs.map +0 -1
- package/index.d.ts.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/indexer-lookup.js.map +0 -1
- package/indexer-lookup.mjs.map +0 -1
- package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/get-kmd-wallet-account.js.map +0 -1
- package/localnet/get-kmd-wallet-account.mjs.map +0 -1
- package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
- package/localnet/get-localnet-dispenser-account.js.map +0 -1
- package/localnet/get-localnet-dispenser-account.mjs.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
- package/localnet/index.d.ts.map +0 -1
- package/localnet/is-localnet.d.ts.map +0 -1
- package/localnet/is-localnet.js.map +0 -1
- package/localnet/is-localnet.mjs.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/network-client.js.map +0 -1
- package/network-client.mjs.map +0 -1
- package/testing/_asset.d.ts.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/account.js.map +0 -1
- package/testing/account.mjs.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.js.map +0 -1
- package/testing/fixtures/algorand-fixture.mjs.map +0 -1
- package/testing/fixtures/index.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/indexer.d.ts.map +0 -1
- package/testing/indexer.js.map +0 -1
- package/testing/indexer.mjs.map +0 -1
- package/testing/test-logger.d.ts.map +0 -1
- package/testing/test-logger.js.map +0 -1
- package/testing/test-logger.mjs.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/testing/transaction-logger.js.map +0 -1
- package/testing/transaction-logger.mjs.map +0 -1
- package/transaction/index.d.ts.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
- package/transaction/transaction.d.ts.map +0 -1
- package/transaction/transaction.js.map +0 -1
- package/transaction/transaction.mjs.map +0 -1
- package/transfer/index.d.ts.map +0 -1
- package/transfer/transfer-algos.d.ts.map +0 -1
- package/transfer/transfer-algos.js +0 -40
- package/transfer/transfer-algos.js.map +0 -1
- package/transfer/transfer-algos.mjs +0 -38
- package/transfer/transfer-algos.mjs.map +0 -1
- package/transfer/transfer.d.ts.map +0 -1
- package/transfer/transfer.js +0 -147
- package/transfer/transfer.js.map +0 -1
- package/transfer/transfer.mjs +0 -143
- package/transfer/transfer.mjs.map +0 -1
- package/types/account-manager.d.ts.map +0 -1
- package/types/account.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algorand-client.d.ts.map +0 -1
- package/types/amount.d.ts.map +0 -1
- package/types/app-client.d.ts.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.d.ts.map +0 -1
- package/types/asset.d.ts.map +0 -1
- package/types/client-manager.d.ts.map +0 -1
- package/types/composer.d.ts.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/debugging.d.ts.map +0 -1
- package/types/dispenser-client.d.ts.map +0 -1
- package/types/indexer.d.ts.map +0 -1
- package/types/kmd-account-manager.d.ts.map +0 -1
- package/types/logging.d.ts.map +0 -1
- package/types/logic-error.d.ts.map +0 -1
- package/types/network-client.d.ts.map +0 -1
- package/types/testing.d.ts.map +0 -1
- package/types/transaction.d.ts.map +0 -1
- package/types/transfer.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts +0 -41
- package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.js +0 -153
- package/types/urlTokenBaseHTTPClient.js.map +0 -1
- package/types/urlTokenBaseHTTPClient.mjs +0 -151
- package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
- package/util.d.ts.map +0 -1
- package/util.js.map +0 -1
- package/util.mjs.map +0 -1
- /package/{account → src/account}/get-account-config-from-environment.js +0 -0
- /package/{account → src/account}/get-account-config-from-environment.mjs +0 -0
- /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
- /package/{testing → src/testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
- /package/{testing → src/testing}/indexer.js +0 -0
- /package/{testing → src/testing}/indexer.mjs +0 -0
- /package/{testing → src/testing}/transaction-logger.js +0 -0
- /package/{testing → src/testing}/transaction-logger.mjs +0 -0
package/types/composer.d.ts
CHANGED
|
@@ -1,117 +1,277 @@
|
|
|
1
|
-
import algosdk from 'algosdk';
|
|
1
|
+
import algosdk, { Address } from 'algosdk';
|
|
2
2
|
import { TransactionSignerAccount } from './account';
|
|
3
3
|
import { AlgoAmount } from './amount';
|
|
4
|
-
import {
|
|
4
|
+
import { AppManager, BoxIdentifier, BoxReference } from './app-manager';
|
|
5
|
+
import { Expand } from './expand';
|
|
6
|
+
import { Arc2TransactionNote, SendAtomicTransactionComposerResults, SendParams } from './transaction';
|
|
5
7
|
import Transaction = algosdk.Transaction;
|
|
8
|
+
import TransactionSigner = algosdk.TransactionSigner;
|
|
6
9
|
import TransactionWithSigner = algosdk.TransactionWithSigner;
|
|
10
|
+
import SimulateResponse = algosdk.modelsv2.SimulateResponse;
|
|
11
|
+
import modelsv2 = algosdk.modelsv2;
|
|
12
|
+
export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
|
|
13
|
+
/** Options to control a simulate request */
|
|
14
|
+
export type SimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>> & {
|
|
15
|
+
/** Whether or not to skip signatures for all built transactions and use an empty signer instead. */
|
|
16
|
+
skipSignatures?: boolean;
|
|
17
|
+
};
|
|
7
18
|
/** Common parameters for defining a transaction. */
|
|
8
19
|
export type CommonTransactionParams = {
|
|
9
|
-
/** The address sending the transaction */
|
|
10
|
-
sender: string;
|
|
11
|
-
/** The function used to sign
|
|
20
|
+
/** The address of the account sending the transaction. */
|
|
21
|
+
sender: string | Address;
|
|
22
|
+
/** The function used to sign transaction(s); if not specified then
|
|
23
|
+
* an attempt will be made to find a registered signer for the
|
|
24
|
+
* given `sender` or use a default signer (if configured).
|
|
25
|
+
*/
|
|
12
26
|
signer?: algosdk.TransactionSigner | TransactionSignerAccount;
|
|
13
|
-
/** Change the signing key of the sender to the given address
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
/** Change the signing key of the sender to the given address.
|
|
28
|
+
*
|
|
29
|
+
* **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).
|
|
30
|
+
*/
|
|
31
|
+
rekeyTo?: string | Address;
|
|
32
|
+
/** Note to attach to the transaction. Max of 1000 bytes. */
|
|
16
33
|
note?: Uint8Array | string;
|
|
17
|
-
/** Prevent multiple transactions with the same lease being included within the validity window
|
|
34
|
+
/** Prevent multiple transactions with the same lease being included within the validity window.
|
|
35
|
+
*
|
|
36
|
+
* A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/)
|
|
37
|
+
* enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
|
|
38
|
+
*/
|
|
18
39
|
lease?: Uint8Array | string;
|
|
19
|
-
/** The transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction */
|
|
40
|
+
/** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */
|
|
20
41
|
staticFee?: AlgoAmount;
|
|
21
|
-
/** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees */
|
|
42
|
+
/** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. */
|
|
22
43
|
extraFee?: AlgoAmount;
|
|
23
|
-
/** Throw an error if the fee for the transaction is more than this amount */
|
|
44
|
+
/** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
|
|
24
45
|
maxFee?: AlgoAmount;
|
|
25
|
-
/** How many rounds the transaction should be valid for */
|
|
26
|
-
validityWindow?: number;
|
|
46
|
+
/** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
|
|
47
|
+
validityWindow?: number | bigint;
|
|
27
48
|
/**
|
|
28
49
|
* Set the first round this transaction is valid.
|
|
29
50
|
* If left undefined, the value from algod will be used.
|
|
30
|
-
*
|
|
51
|
+
*
|
|
52
|
+
* We recommend you only set this when you intentionally want this to be some time in the future.
|
|
31
53
|
*/
|
|
32
54
|
firstValidRound?: bigint;
|
|
33
|
-
/** The last round this transaction is valid. It is recommended to use validityWindow instead */
|
|
55
|
+
/** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */
|
|
34
56
|
lastValidRound?: bigint;
|
|
35
57
|
};
|
|
36
58
|
/** Parameters to define a payment transaction. */
|
|
37
59
|
export type PaymentParams = CommonTransactionParams & {
|
|
38
|
-
/**
|
|
39
|
-
receiver: string;
|
|
60
|
+
/** The address of the account that will receive the Algo */
|
|
61
|
+
receiver: string | Address;
|
|
40
62
|
/** Amount to send */
|
|
41
63
|
amount: AlgoAmount;
|
|
42
|
-
/** If given, close the sender account and send the remaining balance to this address
|
|
43
|
-
|
|
64
|
+
/** If given, close the sender account and send the remaining balance to this address
|
|
65
|
+
*
|
|
66
|
+
* *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
67
|
+
*/
|
|
68
|
+
closeRemainderTo?: string | Address;
|
|
44
69
|
};
|
|
45
|
-
/** Parameters to define an asset create transaction.
|
|
70
|
+
/** Parameters to define an asset create transaction.
|
|
71
|
+
*
|
|
72
|
+
* The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.
|
|
73
|
+
*/
|
|
46
74
|
export type AssetCreateParams = CommonTransactionParams & {
|
|
47
|
-
/** The total amount of the smallest divisible unit to create
|
|
75
|
+
/** The total amount of the smallest divisible (decimal) unit to create.
|
|
76
|
+
*
|
|
77
|
+
* For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.
|
|
78
|
+
*
|
|
79
|
+
* This field can only be specified upon asset creation.
|
|
80
|
+
*/
|
|
48
81
|
total: bigint;
|
|
49
|
-
/** The amount of decimal places the asset should have
|
|
82
|
+
/** The amount of decimal places the asset should have.
|
|
83
|
+
*
|
|
84
|
+
* If unspecified then the asset will be in whole units (i.e. `0`).
|
|
85
|
+
*
|
|
86
|
+
* * If 0, the asset is not divisible;
|
|
87
|
+
* * If 1, the base unit of the asset is in tenths;
|
|
88
|
+
* * If 2, the base unit of the asset is in hundredths;
|
|
89
|
+
* * If 3, the base unit of the asset is in thousandths;
|
|
90
|
+
* * and so on up to 19 decimal places.
|
|
91
|
+
*
|
|
92
|
+
* This field can only be specified upon asset creation.
|
|
93
|
+
*/
|
|
50
94
|
decimals?: number;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/** The address that can freeze the asset in any account. Freezing will be permanently disabled if undefined or an empty string. */
|
|
58
|
-
freeze?: string;
|
|
59
|
-
/** The address that can clawback the asset from any account. Clawback will be permanently disabled if undefined or an empty string. */
|
|
60
|
-
clawback?: string;
|
|
61
|
-
/** The short ticker name for the asset */
|
|
62
|
-
unitName?: string;
|
|
63
|
-
/** The full name of the asset */
|
|
95
|
+
/** The optional name of the asset.
|
|
96
|
+
*
|
|
97
|
+
* Max size is 32 bytes.
|
|
98
|
+
*
|
|
99
|
+
* This field can only be specified upon asset creation.
|
|
100
|
+
*/
|
|
64
101
|
assetName?: string;
|
|
65
|
-
/** The
|
|
102
|
+
/** The optional name of the unit of this asset (e.g. ticker name).
|
|
103
|
+
*
|
|
104
|
+
* Max size is 8 bytes.
|
|
105
|
+
*
|
|
106
|
+
* This field can only be specified upon asset creation.
|
|
107
|
+
*/
|
|
108
|
+
unitName?: string;
|
|
109
|
+
/** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
|
|
110
|
+
*
|
|
111
|
+
* Max size is 96 bytes.
|
|
112
|
+
*
|
|
113
|
+
* This field can only be specified upon asset creation.
|
|
114
|
+
*/
|
|
66
115
|
url?: string;
|
|
67
|
-
/**
|
|
68
|
-
|
|
116
|
+
/** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
|
|
117
|
+
*
|
|
118
|
+
* The format of this metadata is up to the application.
|
|
119
|
+
*
|
|
120
|
+
* This field can only be specified upon asset creation.
|
|
121
|
+
*/
|
|
122
|
+
metadataHash?: string | Uint8Array;
|
|
123
|
+
/** Whether the asset is frozen by default for all accounts.
|
|
124
|
+
* Defaults to `false`.
|
|
125
|
+
*
|
|
126
|
+
* If `true` then for anyone apart from the creator to hold the
|
|
127
|
+
* asset it needs to be unfrozen per account using an asset freeze
|
|
128
|
+
* transaction from the `freeze` account, which must be set on creation.
|
|
129
|
+
*
|
|
130
|
+
* This field can only be specified upon asset creation.
|
|
131
|
+
*/
|
|
132
|
+
defaultFrozen?: boolean;
|
|
133
|
+
/** The address of the optional account that can manage the configuration of the asset and destroy it.
|
|
134
|
+
*
|
|
135
|
+
* The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
|
|
136
|
+
*
|
|
137
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
|
|
138
|
+
*/
|
|
139
|
+
manager?: string | Address;
|
|
140
|
+
/**
|
|
141
|
+
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
142
|
+
*
|
|
143
|
+
* This address has no specific authority in the protocol itself and is informational only.
|
|
144
|
+
*
|
|
145
|
+
* Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
|
|
146
|
+
* rely on this field to hold meaningful data.
|
|
147
|
+
*
|
|
148
|
+
* It can be used in the case where you want to signal to holders of your asset that the uncirculated units
|
|
149
|
+
* of the asset reside in an account that is different from the default creator account.
|
|
150
|
+
*
|
|
151
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
152
|
+
*/
|
|
153
|
+
reserve?: string | Address;
|
|
154
|
+
/**
|
|
155
|
+
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
156
|
+
*
|
|
157
|
+
* If empty, freezing is not permitted.
|
|
158
|
+
*
|
|
159
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
160
|
+
*/
|
|
161
|
+
freeze?: string | Address;
|
|
162
|
+
/**
|
|
163
|
+
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
164
|
+
*
|
|
165
|
+
* **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
|
|
166
|
+
*
|
|
167
|
+
* If empty, clawback is not permitted.
|
|
168
|
+
*
|
|
169
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
170
|
+
*/
|
|
171
|
+
clawback?: string | Address;
|
|
69
172
|
};
|
|
70
|
-
/** Parameters to define an asset
|
|
173
|
+
/** Parameters to define an asset reconfiguration transaction.
|
|
174
|
+
*
|
|
175
|
+
* **Note:** The manager, reserve, freeze, and clawback addresses
|
|
176
|
+
* are immutably empty if they are not set. If manager is not set then
|
|
177
|
+
* all fields are immutable from that point forward.
|
|
178
|
+
*/
|
|
71
179
|
export type AssetConfigParams = CommonTransactionParams & {
|
|
72
|
-
/** ID of the asset */
|
|
180
|
+
/** ID of the asset to reconfigure */
|
|
73
181
|
assetId: bigint;
|
|
74
|
-
/** The address
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
182
|
+
/** The address of the optional account that can manage the configuration of the asset and destroy it.
|
|
183
|
+
*
|
|
184
|
+
* The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
|
|
185
|
+
*
|
|
186
|
+
* If not set (`undefined` or `""`) the asset will become permanently immutable.
|
|
187
|
+
*/
|
|
188
|
+
manager: string | Address | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
191
|
+
*
|
|
192
|
+
* This address has no specific authority in the protocol itself and is informational only.
|
|
193
|
+
*
|
|
194
|
+
* Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
|
|
195
|
+
* rely on this field to hold meaningful data.
|
|
196
|
+
*
|
|
197
|
+
* It can be used in the case where you want to signal to holders of your asset that the uncirculated units
|
|
198
|
+
* of the asset reside in an account that is different from the default creator account.
|
|
199
|
+
*
|
|
200
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
201
|
+
*/
|
|
202
|
+
reserve?: string | Address;
|
|
203
|
+
/**
|
|
204
|
+
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
205
|
+
*
|
|
206
|
+
* If empty, freezing is not permitted.
|
|
207
|
+
*
|
|
208
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
209
|
+
*/
|
|
210
|
+
freeze?: string | Address;
|
|
211
|
+
/**
|
|
212
|
+
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
213
|
+
*
|
|
214
|
+
* **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
|
|
215
|
+
*
|
|
216
|
+
* If empty, clawback is not permitted.
|
|
217
|
+
*
|
|
218
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
219
|
+
*/
|
|
220
|
+
clawback?: string | Address;
|
|
82
221
|
};
|
|
83
222
|
/** Parameters to define an asset freeze transaction. */
|
|
84
223
|
export type AssetFreezeParams = CommonTransactionParams & {
|
|
85
|
-
/** The ID of the asset */
|
|
224
|
+
/** The ID of the asset to freeze/unfreeze */
|
|
86
225
|
assetId: bigint;
|
|
87
|
-
/** The account to freeze or unfreeze */
|
|
88
|
-
account: string;
|
|
226
|
+
/** The address of the account to freeze or unfreeze */
|
|
227
|
+
account: string | Address;
|
|
89
228
|
/** Whether the assets in the account should be frozen */
|
|
90
229
|
frozen: boolean;
|
|
91
230
|
};
|
|
92
|
-
/** Parameters to define an asset destroy transaction.
|
|
231
|
+
/** Parameters to define an asset destroy transaction.
|
|
232
|
+
*
|
|
233
|
+
* 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.
|
|
234
|
+
*/
|
|
93
235
|
export type AssetDestroyParams = CommonTransactionParams & {
|
|
94
|
-
/** ID of the asset */
|
|
236
|
+
/** ID of the asset to destroy */
|
|
95
237
|
assetId: bigint;
|
|
96
238
|
};
|
|
97
239
|
/** Parameters to define an asset transfer transaction. */
|
|
98
240
|
export type AssetTransferParams = CommonTransactionParams & {
|
|
99
|
-
/** ID of the asset */
|
|
241
|
+
/** ID of the asset to transfer. */
|
|
100
242
|
assetId: bigint;
|
|
101
|
-
/** Amount of the asset to transfer (smallest divisible
|
|
243
|
+
/** Amount of the asset to transfer (in smallest divisible (decimal) units). */
|
|
102
244
|
amount: bigint;
|
|
103
|
-
/** The account
|
|
104
|
-
receiver: string;
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
245
|
+
/** The address of the account that will receive the asset unit(s). */
|
|
246
|
+
receiver: string | Address;
|
|
247
|
+
/** Optional address of an account to clawback the asset from.
|
|
248
|
+
*
|
|
249
|
+
* Requires the sender to be the clawback account.
|
|
250
|
+
*
|
|
251
|
+
* **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
|
|
252
|
+
*/
|
|
253
|
+
clawbackTarget?: string | Address;
|
|
254
|
+
/** Optional address of an account to close the asset position to.
|
|
255
|
+
*
|
|
256
|
+
* **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
257
|
+
*/
|
|
258
|
+
closeAssetTo?: string | Address;
|
|
109
259
|
};
|
|
110
260
|
/** Parameters to define an asset opt-in transaction. */
|
|
111
261
|
export type AssetOptInParams = CommonTransactionParams & {
|
|
112
|
-
/** ID of the asset */
|
|
262
|
+
/** ID of the asset that will be opted-in to. */
|
|
113
263
|
assetId: bigint;
|
|
114
264
|
};
|
|
265
|
+
/** Parameters to define an asset opt-out transaction. */
|
|
266
|
+
export type AssetOptOutParams = CommonTransactionParams & {
|
|
267
|
+
/** ID of the asset that will be opted-out of. */
|
|
268
|
+
assetId: bigint;
|
|
269
|
+
/**
|
|
270
|
+
* The address of the asset creator account to close the asset
|
|
271
|
+
* position to (any remaining asset units will be sent to this account).
|
|
272
|
+
*/
|
|
273
|
+
creator: string | Address;
|
|
274
|
+
};
|
|
115
275
|
/** Parameters to define an online key registration transaction. */
|
|
116
276
|
export type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
117
277
|
/** The root participation public key */
|
|
@@ -127,82 +287,153 @@ export type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
|
127
287
|
/** The 64 byte state proof public key commitment */
|
|
128
288
|
stateProofKey?: Uint8Array;
|
|
129
289
|
};
|
|
130
|
-
/**
|
|
131
|
-
export type
|
|
132
|
-
/**
|
|
290
|
+
/** Common parameters for defining an application call transaction. */
|
|
291
|
+
export type CommonAppCallParams = CommonTransactionParams & {
|
|
292
|
+
/** ID of the application; 0 if the application is being created. */
|
|
293
|
+
appId: bigint;
|
|
294
|
+
/** The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. */
|
|
133
295
|
onComplete?: algosdk.OnApplicationComplete;
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
/** The
|
|
139
|
-
|
|
140
|
-
/** The
|
|
296
|
+
/** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */
|
|
297
|
+
args?: Uint8Array[];
|
|
298
|
+
/** Any account addresses to add to the [accounts array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
299
|
+
accountReferences?: (string | Address)[];
|
|
300
|
+
/** The ID of any apps to load to the [foreign apps array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
301
|
+
appReferences?: bigint[];
|
|
302
|
+
/** The ID of any assets to load to the [foreign assets array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
303
|
+
assetReferences?: bigint[];
|
|
304
|
+
/** Any boxes to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays).
|
|
305
|
+
*
|
|
306
|
+
* Either the name identifier (which will be set against app ID of `0` i.e.
|
|
307
|
+
* the current app), or a box identifier with the name identifier and app ID.
|
|
308
|
+
*/
|
|
309
|
+
boxReferences?: (BoxReference | BoxIdentifier)[];
|
|
310
|
+
};
|
|
311
|
+
/** Parameters to define an app create transaction */
|
|
312
|
+
export type AppCreateParams = Expand<Omit<CommonAppCallParams, 'appId'> & {
|
|
313
|
+
onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.ClearStateOC>;
|
|
314
|
+
/** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
|
|
315
|
+
approvalProgram: string | Uint8Array;
|
|
316
|
+
/** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */
|
|
317
|
+
clearStateProgram: string | Uint8Array;
|
|
318
|
+
/** The state schema for the app. This is immutable once the app is created. */
|
|
141
319
|
schema?: {
|
|
142
|
-
/** The number of integers saved in global state */
|
|
143
|
-
|
|
144
|
-
/** The number of byte slices saved in global state */
|
|
320
|
+
/** The number of integers saved in global state. */
|
|
321
|
+
globalInts: number;
|
|
322
|
+
/** The number of byte slices saved in global state. */
|
|
145
323
|
globalByteSlices: number;
|
|
146
|
-
/** The number of integers saved in local state */
|
|
147
|
-
|
|
148
|
-
/** The number of byte slices saved in local state */
|
|
324
|
+
/** The number of integers saved in local state. */
|
|
325
|
+
localInts: number;
|
|
326
|
+
/** The number of byte slices saved in local state. */
|
|
149
327
|
localByteSlices: number;
|
|
150
328
|
};
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
|
|
329
|
+
/** Number of extra pages required for the programs.
|
|
330
|
+
* Defaults to the number needed for the programs in this call if not specified.
|
|
331
|
+
* This is immutable once the app is created. */
|
|
332
|
+
extraProgramPages?: number;
|
|
333
|
+
}>;
|
|
334
|
+
/** Parameters to define an app update transaction */
|
|
335
|
+
export type AppUpdateParams = Expand<CommonAppCallParams & {
|
|
336
|
+
onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC;
|
|
337
|
+
/** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
|
|
338
|
+
approvalProgram: string | Uint8Array;
|
|
339
|
+
/** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */
|
|
340
|
+
clearStateProgram: string | Uint8Array;
|
|
341
|
+
}>;
|
|
342
|
+
/** Parameters to define an application call transaction. */
|
|
343
|
+
export type AppCallParams = CommonAppCallParams & {
|
|
344
|
+
onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC>;
|
|
163
345
|
};
|
|
164
|
-
/**
|
|
165
|
-
export type
|
|
166
|
-
|
|
167
|
-
|
|
346
|
+
/** Common parameters to define an ABI method call transaction. */
|
|
347
|
+
export type AppMethodCallParams = CommonAppCallParams & {
|
|
348
|
+
onComplete?: Exclude<algosdk.OnApplicationComplete, algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC>;
|
|
349
|
+
};
|
|
350
|
+
/** Parameters to define an application delete call transaction. */
|
|
351
|
+
export type AppDeleteParams = CommonAppCallParams & {
|
|
352
|
+
onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC;
|
|
353
|
+
};
|
|
354
|
+
/** Parameters to define an ABI method call create transaction. */
|
|
355
|
+
export type AppCreateMethodCall = AppMethodCall<AppCreateParams>;
|
|
356
|
+
/** Parameters to define an ABI method call update transaction. */
|
|
357
|
+
export type AppUpdateMethodCall = AppMethodCall<AppUpdateParams>;
|
|
358
|
+
/** Parameters to define an ABI method call delete transaction. */
|
|
359
|
+
export type AppDeleteMethodCall = AppMethodCall<AppDeleteParams>;
|
|
360
|
+
/** Parameters to define an ABI method call transaction. */
|
|
361
|
+
export type AppCallMethodCall = AppMethodCall<AppMethodCallParams>;
|
|
362
|
+
/** Types that can be used to define a transaction argument for an ABI call transaction. */
|
|
363
|
+
export type AppMethodCallTransactionArgument = TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>;
|
|
364
|
+
/** Parameters to define an ABI method call. */
|
|
365
|
+
export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
|
|
168
366
|
/** The ABI method to call */
|
|
169
367
|
method: algosdk.ABIMethod;
|
|
170
368
|
/** Arguments to the ABI method, either:
|
|
171
369
|
* * An ABI value
|
|
172
370
|
* * A transaction with explicit signer
|
|
173
371
|
* * A transaction (where the signer will be automatically assigned)
|
|
174
|
-
* * An unawaited transaction (e.g. from algorand.
|
|
372
|
+
* * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
|
|
175
373
|
* * Another method call (via method call params object)
|
|
374
|
+
* * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
|
|
176
375
|
*/
|
|
177
|
-
args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> |
|
|
376
|
+
args?: (algosdk.ABIValue | Address | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[];
|
|
178
377
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
378
|
+
export type Txn = (PaymentParams & {
|
|
379
|
+
type: 'pay';
|
|
380
|
+
}) | (AssetCreateParams & {
|
|
381
|
+
type: 'assetCreate';
|
|
382
|
+
}) | (AssetConfigParams & {
|
|
383
|
+
type: 'assetConfig';
|
|
384
|
+
}) | (AssetFreezeParams & {
|
|
385
|
+
type: 'assetFreeze';
|
|
386
|
+
}) | (AssetDestroyParams & {
|
|
387
|
+
type: 'assetDestroy';
|
|
388
|
+
}) | (AssetTransferParams & {
|
|
389
|
+
type: 'assetTransfer';
|
|
390
|
+
}) | (AssetOptInParams & {
|
|
391
|
+
type: 'assetOptIn';
|
|
392
|
+
}) | (AssetOptOutParams & {
|
|
393
|
+
type: 'assetOptOut';
|
|
394
|
+
}) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
|
|
395
|
+
type: 'appCall';
|
|
396
|
+
}) | (OnlineKeyRegistrationParams & {
|
|
397
|
+
type: 'keyReg';
|
|
398
|
+
}) | (algosdk.TransactionWithSigner & {
|
|
399
|
+
type: 'txnWithSigner';
|
|
400
|
+
}) | {
|
|
401
|
+
atc: algosdk.AtomicTransactionComposer;
|
|
402
|
+
type: 'atc';
|
|
403
|
+
} | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
|
|
404
|
+
type: 'methodCall';
|
|
405
|
+
});
|
|
406
|
+
/** Parameters to create an `TransactionComposer`. */
|
|
407
|
+
export type TransactionComposerParams = {
|
|
188
408
|
/** The algod client to use to get suggestedParams and send the transaction group */
|
|
189
409
|
algod: algosdk.Algodv2;
|
|
190
410
|
/** The function used to get the TransactionSigner for a given address */
|
|
191
|
-
getSigner: (address: string) => algosdk.TransactionSigner;
|
|
411
|
+
getSigner: (address: string | Address) => algosdk.TransactionSigner;
|
|
192
412
|
/** The method used to get SuggestedParams for transactions in the group */
|
|
193
413
|
getSuggestedParams?: () => Promise<algosdk.SuggestedParams>;
|
|
194
414
|
/** How many rounds a transaction should be valid for by default; if not specified
|
|
195
415
|
* then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
|
|
196
416
|
*/
|
|
197
|
-
defaultValidityWindow?:
|
|
417
|
+
defaultValidityWindow?: bigint;
|
|
418
|
+
/** An existing `AppManager` to use to manage app compilation and cache compilation results.
|
|
419
|
+
*
|
|
420
|
+
* If not specified than an ephemeral one will be created.
|
|
421
|
+
*/
|
|
422
|
+
appManager?: AppManager;
|
|
198
423
|
};
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
424
|
+
/** Set of transactions built by `TransactionComposer`. */
|
|
425
|
+
export interface BuiltTransactions {
|
|
426
|
+
/** The built transactions */
|
|
427
|
+
transactions: algosdk.Transaction[];
|
|
428
|
+
/** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
|
|
429
|
+
methodCalls: Map<number, algosdk.ABIMethod>;
|
|
430
|
+
/** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
|
|
431
|
+
signers: Map<number, algosdk.TransactionSigner>;
|
|
432
|
+
}
|
|
433
|
+
/** TransactionComposer helps you compose and execute transactions as a transaction group. */
|
|
434
|
+
export declare class TransactionComposer {
|
|
435
|
+
/** Signer used to represent a lack of signer */
|
|
436
|
+
private static NULL_SIGNER;
|
|
206
437
|
/** The ATC used to compose the group */
|
|
207
438
|
private atc;
|
|
208
439
|
/** Map of txid to ABI method */
|
|
@@ -211,7 +442,7 @@ export default class AlgokitComposer {
|
|
|
211
442
|
private txns;
|
|
212
443
|
/** The algod client used by the composer. */
|
|
213
444
|
private algod;
|
|
214
|
-
/** An async function that will return
|
|
445
|
+
/** An async function that will return suggested params for the transaction. */
|
|
215
446
|
private getSuggestedParams;
|
|
216
447
|
/** A function that takes in an address and return a signer function for that address. */
|
|
217
448
|
private getSigner;
|
|
@@ -219,83 +450,153 @@ export default class AlgokitComposer {
|
|
|
219
450
|
private defaultValidityWindow;
|
|
220
451
|
/** Whether the validity window was explicitly set on construction */
|
|
221
452
|
private defaultValidityWindowIsExplicit;
|
|
453
|
+
private appManager;
|
|
222
454
|
/**
|
|
223
|
-
* Create
|
|
455
|
+
* Create a `TransactionComposer`.
|
|
224
456
|
* @param params The configuration for this composer
|
|
225
457
|
*/
|
|
226
|
-
constructor(params:
|
|
458
|
+
constructor(params: TransactionComposerParams);
|
|
459
|
+
/**
|
|
460
|
+
* Add a pre-built transaction to the transaction group.
|
|
461
|
+
* @param transaction The pre-built transaction
|
|
462
|
+
* @param signer Optional signer override for the transaction
|
|
463
|
+
* @returns The composer so you can chain method calls
|
|
464
|
+
*/
|
|
465
|
+
addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
|
|
227
466
|
/**
|
|
228
467
|
* Add a payment transaction to the transaction group.
|
|
229
468
|
* @param params The payment transaction parameters
|
|
230
469
|
* @returns The composer so you can chain method calls
|
|
231
470
|
*/
|
|
232
|
-
addPayment(params: PaymentParams):
|
|
471
|
+
addPayment(params: PaymentParams): TransactionComposer;
|
|
233
472
|
/**
|
|
234
473
|
* Add an asset create transaction to the transaction group.
|
|
235
474
|
* @param params The asset create transaction parameters
|
|
236
475
|
* @returns The composer so you can chain method calls
|
|
237
476
|
*/
|
|
238
|
-
addAssetCreate(params: AssetCreateParams):
|
|
477
|
+
addAssetCreate(params: AssetCreateParams): TransactionComposer;
|
|
239
478
|
/**
|
|
240
479
|
* Add an asset config transaction to the transaction group.
|
|
241
480
|
* @param params The asset config transaction parameters
|
|
242
481
|
* @returns The composer so you can chain method calls
|
|
243
482
|
*/
|
|
244
|
-
addAssetConfig(params: AssetConfigParams):
|
|
483
|
+
addAssetConfig(params: AssetConfigParams): TransactionComposer;
|
|
245
484
|
/**
|
|
246
485
|
* Add an asset freeze transaction to the transaction group.
|
|
247
486
|
* @param params The asset freeze transaction parameters
|
|
248
487
|
* @returns The composer so you can chain method calls
|
|
249
488
|
*/
|
|
250
|
-
addAssetFreeze(params: AssetFreezeParams):
|
|
489
|
+
addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
|
|
251
490
|
/**
|
|
252
491
|
* Add an asset destroy transaction to the transaction group.
|
|
253
492
|
* @param params The asset destroy transaction parameters
|
|
254
493
|
* @returns The composer so you can chain method calls
|
|
255
494
|
*/
|
|
256
|
-
addAssetDestroy(params: AssetDestroyParams):
|
|
495
|
+
addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
|
|
257
496
|
/**
|
|
258
497
|
* Add an asset transfer transaction to the transaction group.
|
|
259
498
|
* @param params The asset transfer transaction parameters
|
|
260
499
|
* @returns The composer so you can chain method calls
|
|
261
500
|
*/
|
|
262
|
-
addAssetTransfer(params: AssetTransferParams):
|
|
501
|
+
addAssetTransfer(params: AssetTransferParams): TransactionComposer;
|
|
263
502
|
/**
|
|
264
503
|
* Add an asset opt-in transaction to the transaction group.
|
|
265
504
|
* @param params The asset opt-in transaction parameters
|
|
266
505
|
* @returns The composer so you can chain method calls
|
|
267
506
|
*/
|
|
268
|
-
addAssetOptIn(params: AssetOptInParams):
|
|
507
|
+
addAssetOptIn(params: AssetOptInParams): TransactionComposer;
|
|
508
|
+
/**
|
|
509
|
+
* Add an asset opt-out transaction to the transaction group.
|
|
510
|
+
* @param params The asset opt-out transaction parameters
|
|
511
|
+
* @returns The composer so you can chain method calls
|
|
512
|
+
*/
|
|
513
|
+
addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
|
|
514
|
+
/**
|
|
515
|
+
* Add an application create transaction to the transaction group.
|
|
516
|
+
*
|
|
517
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
518
|
+
* @param params The application create transaction parameters
|
|
519
|
+
* @returns The composer so you can chain method calls
|
|
520
|
+
*/
|
|
521
|
+
addAppCreate(params: AppCreateParams): TransactionComposer;
|
|
522
|
+
/**
|
|
523
|
+
* Add an application update transaction to the transaction group.
|
|
524
|
+
*
|
|
525
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
526
|
+
* @param params The application update transaction parameters
|
|
527
|
+
* @returns The composer so you can chain method calls
|
|
528
|
+
*/
|
|
529
|
+
addAppUpdate(params: AppUpdateParams): TransactionComposer;
|
|
530
|
+
/**
|
|
531
|
+
* Add an application delete transaction to the transaction group.
|
|
532
|
+
*
|
|
533
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
534
|
+
* @param params The application delete transaction parameters
|
|
535
|
+
* @returns The composer so you can chain method calls
|
|
536
|
+
*/
|
|
537
|
+
addAppDelete(params: AppDeleteParams): TransactionComposer;
|
|
269
538
|
/**
|
|
270
539
|
* Add an application call transaction to the transaction group.
|
|
271
540
|
*
|
|
541
|
+
* If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
|
|
542
|
+
*
|
|
272
543
|
* Note: we recommend using app clients to make it easier to make app calls.
|
|
273
544
|
* @param params The application call transaction parameters
|
|
274
545
|
* @returns The composer so you can chain method calls
|
|
275
546
|
*/
|
|
276
|
-
addAppCall(params: AppCallParams):
|
|
547
|
+
addAppCall(params: AppCallParams): TransactionComposer;
|
|
548
|
+
/**
|
|
549
|
+
* Add an ABI method create application call transaction to the transaction group.
|
|
550
|
+
*
|
|
551
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
552
|
+
* @param params The ABI create method application call transaction parameters
|
|
553
|
+
* @returns The composer so you can chain method calls
|
|
554
|
+
*/
|
|
555
|
+
addAppCreateMethodCall(params: AppCreateMethodCall): this;
|
|
556
|
+
/**
|
|
557
|
+
* Add an ABI method update application call transaction to the transaction group.
|
|
558
|
+
*
|
|
559
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
560
|
+
* @param params The ABI update method application call transaction parameters
|
|
561
|
+
* @returns The composer so you can chain method calls
|
|
562
|
+
*/
|
|
563
|
+
addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
|
|
564
|
+
/**
|
|
565
|
+
* Add an ABI method delete application call transaction to the transaction group.
|
|
566
|
+
*
|
|
567
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
568
|
+
* @param params The ABI delete method application call transaction parameters
|
|
569
|
+
* @returns The composer so you can chain method calls
|
|
570
|
+
*/
|
|
571
|
+
addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
|
|
277
572
|
/**
|
|
278
|
-
* Add
|
|
573
|
+
* Add a non-create/non-update ABI method application call transaction to the transaction group.
|
|
279
574
|
*
|
|
280
575
|
* Note: we recommend using app clients to make it easier to make app calls.
|
|
281
576
|
* @param params The ABI method application call transaction parameters
|
|
282
577
|
* @returns The composer so you can chain method calls
|
|
283
578
|
*/
|
|
284
|
-
|
|
579
|
+
addAppCallMethodCall(params: AppCallMethodCall): this;
|
|
285
580
|
/**
|
|
286
581
|
* Add an online key registration transaction to the transaction group.
|
|
287
582
|
* @param params The online key registration transaction parameters
|
|
288
583
|
* @returns The composer so you can chain method calls
|
|
289
584
|
*/
|
|
290
|
-
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams):
|
|
585
|
+
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
|
|
291
586
|
/**
|
|
292
587
|
* Add the transactions within an `AtomicTransactionComposer` to the transaction group.
|
|
293
588
|
* @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
|
|
294
589
|
* @returns The composer so you can chain method calls
|
|
295
590
|
*/
|
|
296
|
-
addAtc(atc: algosdk.AtomicTransactionComposer):
|
|
591
|
+
addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
|
|
592
|
+
/** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
|
|
297
593
|
private buildAtc;
|
|
298
594
|
private commonTxnBuildStep;
|
|
595
|
+
/**
|
|
596
|
+
* Builds an ABI method call transaction and any other associated transactions represented in the ABI args.
|
|
597
|
+
* @param includeSigner Whether to include the actual signer for the transactions.
|
|
598
|
+
* If you are just building transactions without signers yet then set this to `false`.
|
|
599
|
+
*/
|
|
299
600
|
private buildMethodCall;
|
|
300
601
|
private buildPayment;
|
|
301
602
|
private buildAssetCreate;
|
|
@@ -305,16 +606,32 @@ export default class AlgokitComposer {
|
|
|
305
606
|
private buildAssetTransfer;
|
|
306
607
|
private buildAppCall;
|
|
307
608
|
private buildKeyReg;
|
|
609
|
+
/** Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` since those ones can have custom signers that need to be retrieved. */
|
|
308
610
|
private buildTxn;
|
|
611
|
+
private buildTxnWithSigner;
|
|
612
|
+
/**
|
|
613
|
+
* Compose all of the transactions without signers and return the transaction objects directly along with any ABI method calls.
|
|
614
|
+
*
|
|
615
|
+
* @returns The array of built transactions and any corresponding method calls
|
|
616
|
+
*/
|
|
617
|
+
buildTransactions(): Promise<BuiltTransactions>;
|
|
618
|
+
/**
|
|
619
|
+
* Get the number of transactions currently added to this composer.
|
|
620
|
+
*/
|
|
621
|
+
count(): Promise<number>;
|
|
309
622
|
/**
|
|
310
623
|
* Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
|
|
311
624
|
*
|
|
312
625
|
* You can then use the transactions standalone, or use the composer to execute or simulate the transactions.
|
|
626
|
+
*
|
|
627
|
+
* Once this method is called, no further transactions will be able to be added.
|
|
628
|
+
* You can safely call this method multiple times to get the same result.
|
|
313
629
|
* @returns The built atomic transaction composer and the transactions
|
|
314
630
|
*/
|
|
315
631
|
build(): Promise<{
|
|
316
632
|
atc: algosdk.AtomicTransactionComposer;
|
|
317
633
|
transactions: algosdk.TransactionWithSigner[];
|
|
634
|
+
methodCalls: any;
|
|
318
635
|
}>;
|
|
319
636
|
/**
|
|
320
637
|
* Rebuild the group, discarding any previously built transactions.
|
|
@@ -324,12 +641,37 @@ export default class AlgokitComposer {
|
|
|
324
641
|
rebuild(): Promise<{
|
|
325
642
|
atc: algosdk.AtomicTransactionComposer;
|
|
326
643
|
transactions: algosdk.TransactionWithSigner[];
|
|
644
|
+
methodCalls: any;
|
|
327
645
|
}>;
|
|
328
646
|
/**
|
|
647
|
+
* Compose the atomic transaction group and send it to the network.
|
|
648
|
+
* @param params The parameters to control execution with
|
|
649
|
+
* @returns The execution result
|
|
650
|
+
*/
|
|
651
|
+
send(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
|
|
652
|
+
/**
|
|
653
|
+
* @deprecated Use `send` instead.
|
|
654
|
+
*
|
|
329
655
|
* Compose the atomic transaction group and send it to the network
|
|
656
|
+
*
|
|
657
|
+
* An alias for `composer.send(params)`.
|
|
330
658
|
* @param params The parameters to control execution with
|
|
331
659
|
* @returns The execution result
|
|
332
660
|
*/
|
|
333
|
-
execute(params?:
|
|
661
|
+
execute(params?: SendParams): Promise<SendAtomicTransactionComposerResults>;
|
|
662
|
+
/**
|
|
663
|
+
* Compose the atomic transaction group and simulate sending it to the network
|
|
664
|
+
* @returns The simulation result
|
|
665
|
+
*/
|
|
666
|
+
simulate(options?: SimulateOptions): Promise<SendAtomicTransactionComposerResults & {
|
|
667
|
+
simulateResponse: SimulateResponse;
|
|
668
|
+
}>;
|
|
669
|
+
/**
|
|
670
|
+
* Create an encoded transaction note that follows the ARC-2 spec.
|
|
671
|
+
*
|
|
672
|
+
* https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
|
|
673
|
+
* @param note The ARC-2 transaction note data
|
|
674
|
+
* @returns The binary encoded transaction note
|
|
675
|
+
*/
|
|
676
|
+
static arc2Note(note: Arc2TransactionNote): Uint8Array;
|
|
334
677
|
}
|
|
335
|
-
//# sourceMappingURL=composer.d.ts.map
|