@algorandfoundation/algokit-utils 6.3.0-beta.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 +12 -10
- package/account/get-account-config-from-environment.d.ts +0 -1
- package/account/get-account.d.ts +2 -3
- 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 +15 -5
- package/app-client.d.ts +19 -5
- package/app-deploy.d.ts +18 -2
- package/app.d.ts +39 -3
- package/asset.d.ts +5 -6
- 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 +0 -1
- package/index.d.ts +5 -4
- package/index.js +56 -46
- package/index.js.map +1 -1
- package/index.mjs +26 -25
- 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 +1 -2
- 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 +3 -4
- package/{account → src/account}/account.js +21 -18
- package/src/account/account.js.map +1 -0
- package/{account → src/account}/account.mjs +22 -19
- 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 +3 -3
- package/src/account/get-account.js.map +1 -0
- package/{account → src/account}/get-account.mjs +3 -3
- 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/{amount.js → src/amount.js} +10 -3
- package/src/amount.js.map +1 -0
- package/{amount.mjs → src/amount.mjs} +10 -4
- 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/{asset.js → src/asset.js} +6 -9
- package/src/asset.js.map +1 -0
- package/{asset.mjs → src/asset.mjs} +6 -9
- 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} +1 -1
- package/src/dispenser-client.js.map +1 -0
- package/{dispenser-client.mjs → src/dispenser-client.mjs} +1 -1
- 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 +3 -3
- package/src/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
- package/{localnet → src/localnet}/get-or-create-kmd-wallet-account.mjs +3 -3
- 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 +9 -3
- package/src/testing/account.js.map +1 -0
- package/{testing → src/testing}/account.mjs +10 -4
- 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 +15 -16
- package/src/testing/fixtures/algorand-fixture.js.map +1 -0
- package/{testing → src/testing}/fixtures/algorand-fixture.mjs +15 -16
- 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 +217 -137
- package/src/transaction/transaction.js.map +1 -0
- package/{transaction → src/transaction}/transaction.mjs +218 -138
- package/src/transaction/transaction.mjs.map +1 -0
- package/{transfer → src/transfer}/transfer-algos.js +1 -1
- package/src/transfer/transfer-algos.js.map +1 -0
- package/{transfer → src/transfer}/transfer-algos.mjs +1 -1
- package/src/transfer/transfer-algos.mjs.map +1 -0
- package/{transfer → src/transfer}/transfer.js +8 -6
- package/src/transfer/transfer.js.map +1 -0
- package/{transfer → src/transfer}/transfer.mjs +8 -6
- package/src/transfer/transfer.mjs.map +1 -0
- package/{util.js → src/util.js} +11 -10
- package/src/util.js.map +1 -0
- package/{util.mjs → src/util.mjs} +11 -10
- package/src/util.mjs.map +1 -0
- package/testing/_asset.d.ts +2 -2
- 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 +0 -1
- 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 +31 -6
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -2
- package/transaction/transaction.d.ts +38 -19
- package/transfer/index.d.ts +0 -1
- package/transfer/transfer-algos.d.ts +1 -2
- package/transfer/transfer.d.ts +1 -2
- package/types/account-manager.d.ts +33 -25
- package/types/account-manager.js +56 -33
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +58 -35
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +17 -9
- 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 +452 -23
- package/types/algorand-client-transaction-creator.js +407 -23
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +407 -23
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +772 -47
- package/types/algorand-client-transaction-sender.js +446 -16
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +446 -16
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +24 -17
- package/types/algorand-client.js +26 -16
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +28 -15
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +10 -11
- package/types/amount.js +7 -7
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +7 -7
- 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 +1508 -12
- package/types/app-client.js +1023 -34
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1024 -36
- 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 +10 -10
- package/types/asset-manager.js +15 -19
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +15 -19
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +0 -1
- 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 +135 -60
- package/types/client-manager.js +158 -44
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +159 -45
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +271 -87
- package/types/composer.js +406 -126
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +407 -125
- 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 +2 -2
- package/types/dispenser-client.js +10 -5
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +10 -5
- 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 +2 -3
- package/types/kmd-account-manager.js +4 -4
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +5 -5
- 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 +14 -2
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +8 -10
- package/types/transaction.d.ts +17 -4
- package/types/transfer.d.ts +0 -1
- package/util.d.ts +2 -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.map +0 -1
- 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.map +0 -1
- 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/legacy-bridge.d.ts.map +0 -1
- package/transaction/legacy-bridge.js +0 -35
- package/transaction/legacy-bridge.js.map +0 -1
- package/transaction/legacy-bridge.mjs +0 -33
- package/transaction/legacy-bridge.mjs.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.map +0 -1
- package/transfer/transfer-algos.mjs.map +0 -1
- package/transfer/transfer.d.ts.map +0 -1
- package/transfer/transfer.js.map +0 -1
- 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-transaction-creator.d.ts.map +0 -1
- package/types/algorand-client-transaction-sender.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-manager.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
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
2
|
import Algodv2 = algosdk.Algodv2;
|
|
3
3
|
import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
|
|
4
|
+
import modelsv2 = algosdk.modelsv2;
|
|
4
5
|
/**
|
|
5
6
|
* Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.
|
|
7
|
+
* Uses empty transaction signers for all transactions.
|
|
8
|
+
*
|
|
6
9
|
* @param atc The AtomicTransactionComposer with transaction(s) loaded.
|
|
7
10
|
* @param algod An Algod client to perform the simulation.
|
|
8
11
|
* @returns The simulation result, which includes various details about how the transactions would be processed.
|
|
9
12
|
*/
|
|
10
|
-
export declare function performAtomicTransactionComposerSimulate(atc: AtomicTransactionComposer, algod: Algodv2): Promise<algosdk.modelsv2.SimulateResponse>;
|
|
11
|
-
//# sourceMappingURL=perform-atomic-transaction-composer-simulate.d.ts.map
|
|
13
|
+
export declare function performAtomicTransactionComposerSimulate(atc: AtomicTransactionComposer, algod: Algodv2, options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>): Promise<algosdk.modelsv2.SimulateResponse>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
2
|
import { AlgoAmount } from '../types/amount';
|
|
3
|
+
import { ABIReturn } from '../types/app';
|
|
3
4
|
import { AtomicTransactionComposerToSend, SendAtomicTransactionComposerResults, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionGroupToSend, TransactionNote, TransactionToSign } from '../types/transaction';
|
|
4
5
|
import Algodv2 = algosdk.Algodv2;
|
|
5
6
|
import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
|
|
@@ -10,7 +11,10 @@ import TransactionWithSigner = algosdk.TransactionWithSigner;
|
|
|
10
11
|
export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
|
|
11
12
|
export declare const MAX_APP_CALL_FOREIGN_REFERENCES = 8;
|
|
12
13
|
export declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 4;
|
|
13
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `TransactionComposer.arc2Note`.
|
|
16
|
+
*
|
|
17
|
+
* Encodes a transaction note into a byte array ready to be included in an Algorand transaction.
|
|
14
18
|
*
|
|
15
19
|
* @param note The transaction note
|
|
16
20
|
* @returns the transaction note ready for inclusion in a transaction
|
|
@@ -33,12 +37,18 @@ export declare function encodeTransactionNote(note?: TransactionNote): Uint8Arra
|
|
|
33
37
|
*/
|
|
34
38
|
export declare function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined;
|
|
35
39
|
/**
|
|
40
|
+
* @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address
|
|
41
|
+
* and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead.
|
|
42
|
+
*
|
|
36
43
|
* Returns the public address of the given transaction sender.
|
|
37
44
|
* @param sender A transaction sender
|
|
38
45
|
* @returns The public address
|
|
39
46
|
*/
|
|
40
47
|
export declare const getSenderAddress: (sender: string | SendTransactionFrom) => string;
|
|
41
48
|
/**
|
|
49
|
+
* @deprecated Use `AlgorandClient` / `TransactionComposer` to construct transactions instead or
|
|
50
|
+
* construct an `algosdk.TransactionWithSigner` manually instead.
|
|
51
|
+
*
|
|
42
52
|
* Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an
|
|
43
53
|
* AtomicTransactionComposer's addTransaction method.
|
|
44
54
|
* @param transaction One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the
|
|
@@ -50,6 +60,9 @@ export declare const getSenderAddress: (sender: string | SendTransactionFrom) =>
|
|
|
50
60
|
*/
|
|
51
61
|
export declare const getTransactionWithSigner: (transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>, defaultSender?: SendTransactionFrom) => Promise<TransactionWithSigner>;
|
|
52
62
|
/**
|
|
63
|
+
* @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use
|
|
64
|
+
* `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`.
|
|
65
|
+
*
|
|
53
66
|
* Returns a `TransactionSigner` for the given transaction sender.
|
|
54
67
|
* This function has memoization, so will return the same transaction signer for a given sender.
|
|
55
68
|
* @param sender A transaction sender
|
|
@@ -57,13 +70,20 @@ export declare const getTransactionWithSigner: (transaction: TransactionWithSign
|
|
|
57
70
|
*/
|
|
58
71
|
export declare const getSenderTransactionSigner: (val: SendTransactionFrom) => algosdk.TransactionSigner;
|
|
59
72
|
/**
|
|
73
|
+
* @deprecated Use `AlgorandClient` / `TransactionComposer` to sign transactions
|
|
74
|
+
* or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject`
|
|
75
|
+
* / `multiSigAccount.sign` / `TransactionSigner` methods directly.
|
|
76
|
+
*
|
|
60
77
|
* Signs a single transaction by the given signer.
|
|
61
78
|
* @param transaction The transaction to sign
|
|
62
79
|
* @param signer The signer to sign
|
|
63
80
|
* @returns The signed transaction as a `Uint8Array`
|
|
64
81
|
*/
|
|
65
82
|
export declare const signTransaction: (transaction: Transaction, signer: SendTransactionFrom) => Promise<Uint8Array>;
|
|
66
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated Use `AlgorandClient` / `TransactionComposer` to send transactions.
|
|
85
|
+
*
|
|
86
|
+
* Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain.
|
|
67
87
|
*
|
|
68
88
|
* @param send The details for the transaction to prepare/send, including:
|
|
69
89
|
* * `transaction`: The unsigned transaction
|
|
@@ -98,21 +118,20 @@ export declare const sendTransaction: (send: {
|
|
|
98
118
|
export declare function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2): Promise<algosdk.AtomicTransactionComposer>;
|
|
99
119
|
/**
|
|
100
120
|
* Signs and sends transactions that have been collected by an `AtomicTransactionComposer`.
|
|
101
|
-
* @param atcSend The parameters controlling the send, including
|
|
102
|
-
* * `atc` The `AtomicTransactionComposer`
|
|
103
|
-
* * `sendParams` The parameters to control the send behaviour
|
|
121
|
+
* @param atcSend The parameters controlling the send, including `atc` The `AtomicTransactionComposer` and params to control send behaviour
|
|
104
122
|
* @param algod An algod client
|
|
105
123
|
* @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)
|
|
106
124
|
*/
|
|
107
125
|
export declare const sendAtomicTransactionComposer: (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) => Promise<SendAtomicTransactionComposerResults>;
|
|
108
126
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @param
|
|
112
|
-
* @returns The dryrun result
|
|
127
|
+
* Takes an algosdk `ABIResult` and converts it to an `ABIReturn`.
|
|
128
|
+
* Converts `bigint`'s for Uint's < 64 to `number` for easier use.
|
|
129
|
+
* @param result The `ABIReturn`
|
|
113
130
|
*/
|
|
114
|
-
export declare function
|
|
131
|
+
export declare function getABIReturnValue(result: algosdk.ABIResult): ABIReturn;
|
|
115
132
|
/**
|
|
133
|
+
* @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.
|
|
134
|
+
*
|
|
116
135
|
* Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain
|
|
117
136
|
*
|
|
118
137
|
* @param groupSend The group details to send, with:
|
|
@@ -135,6 +154,8 @@ export declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend
|
|
|
135
154
|
*/
|
|
136
155
|
export declare const waitForConfirmation: (transactionId: string, maxRoundsToWait: number | bigint, algod: Algodv2) => Promise<modelsv2.PendingTransactionResponse>;
|
|
137
156
|
/**
|
|
157
|
+
* @deprecated Use `TransactionComposer` and the `maxFee` field in the transaction params instead.
|
|
158
|
+
*
|
|
138
159
|
* Limit the acceptable fee to a defined amount of µAlgo.
|
|
139
160
|
* This also sets the transaction to be flatFee to ensure the transaction only succeeds at
|
|
140
161
|
* the estimated rate.
|
|
@@ -143,6 +164,8 @@ export declare const waitForConfirmation: (transactionId: string, maxRoundsToWai
|
|
|
143
164
|
*/
|
|
144
165
|
export declare function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount): void;
|
|
145
166
|
/**
|
|
167
|
+
* @deprecated Use `TransactionComposer` and the `maxFee` and `staticFee` fields in the transaction params instead.
|
|
168
|
+
*
|
|
146
169
|
* Allows for control of fees on a `Transaction` or `SuggestedParams` object
|
|
147
170
|
* @param transaction The transaction or suggested params
|
|
148
171
|
* @param feeControl The fee control parameters
|
|
@@ -152,23 +175,19 @@ export declare function controlFees<T extends SuggestedParams | Transaction>(tra
|
|
|
152
175
|
maxFee?: AlgoAmount;
|
|
153
176
|
}): T;
|
|
154
177
|
/**
|
|
178
|
+
* @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead
|
|
179
|
+
*
|
|
155
180
|
* Returns suggested transaction parameters from algod unless some are already provided.
|
|
156
181
|
* @param params Optionally provide parameters to use
|
|
157
182
|
* @param algod Algod algod
|
|
158
183
|
* @returns The suggested transaction parameters
|
|
159
184
|
*/
|
|
160
|
-
export declare function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<
|
|
161
|
-
flatFee?: boolean | undefined;
|
|
162
|
-
fee: number;
|
|
163
|
-
firstRound: number;
|
|
164
|
-
lastRound: number;
|
|
165
|
-
genesisID: string;
|
|
166
|
-
genesisHash: string;
|
|
167
|
-
}>;
|
|
185
|
+
export declare function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams>;
|
|
168
186
|
/**
|
|
187
|
+
* @deprecated Use `atc.clone().buildGroup()` instead.
|
|
188
|
+
*
|
|
169
189
|
* Returns the array of transactions currently present in the given `AtomicTransactionComposer`
|
|
170
190
|
* @param atc The atomic transaction composer
|
|
171
191
|
* @returns The array of transactions with signers
|
|
172
192
|
*/
|
|
173
193
|
export declare function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer): algosdk.TransactionWithSigner[];
|
|
174
|
-
//# sourceMappingURL=transaction.d.ts.map
|
package/transfer/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { SendTransactionResult } from '../types/transaction';
|
|
|
3
3
|
import { AlgoTransferParams } from '../types/transfer';
|
|
4
4
|
import Algodv2 = algosdk.Algodv2;
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated Use `algorand.send.payment()` / `algorand.
|
|
6
|
+
* @deprecated Use `algorand.send.payment()` / `algorand.createTransaction.payment()` instead
|
|
7
7
|
*
|
|
8
8
|
* Transfer Algo between two accounts.
|
|
9
9
|
* @param transfer The transfer definition
|
|
@@ -16,4 +16,3 @@ import Algodv2 = algosdk.Algodv2;
|
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
export declare function transferAlgos(transfer: AlgoTransferParams, algod: Algodv2): Promise<SendTransactionResult>;
|
|
19
|
-
//# sourceMappingURL=transfer-algos.d.ts.map
|
package/transfer/transfer.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import Kmd = algosdk.Kmd;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function ensureFunded<T extends EnsureFundedParams>(funding: T, algod: Algodv2, kmd?: Kmd): Promise<EnsureFundedReturnType | undefined>;
|
|
22
22
|
/**
|
|
23
|
-
* @deprecated Use `algorand.send.assetTransfer()` / `algorand.
|
|
23
|
+
* @deprecated Use `algorand.send.assetTransfer()` / `algorand.createTransaction.assetTransfer()` instead
|
|
24
24
|
*
|
|
25
25
|
* Transfer asset between two accounts.
|
|
26
26
|
* @param transfer The transfer definition
|
|
@@ -50,4 +50,3 @@ export declare function transferAsset(transfer: TransferAssetParams, algod: Algo
|
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
52
|
export declare function rekeyAccount(rekey: AlgoRekeyParams, algod: Algodv2): Promise<SendTransactionResult>;
|
|
53
|
-
//# sourceMappingURL=transfer.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import algosdk from 'algosdk';
|
|
1
|
+
import algosdk, { Address } from 'algosdk';
|
|
2
2
|
import { AccountInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from './account';
|
|
3
|
-
import { SendSingleTransactionResult } from './algorand-client-transaction-sender';
|
|
4
3
|
import { AlgoAmount } from './amount';
|
|
5
4
|
import { ClientManager } from './client-manager';
|
|
6
|
-
import { CommonTransactionParams
|
|
5
|
+
import { CommonTransactionParams } from './composer';
|
|
7
6
|
import { TestNetDispenserApiClient } from './dispenser-client';
|
|
8
7
|
import { KmdAccountManager } from './kmd-account-manager';
|
|
8
|
+
import { SendParams, SendSingleTransactionResult } from './transaction';
|
|
9
9
|
import LogicSigAccount = algosdk.LogicSigAccount;
|
|
10
10
|
import Account = algosdk.Account;
|
|
11
11
|
/** Result from performing an ensureFunded call. */
|
|
@@ -92,7 +92,16 @@ export declare class AccountManager {
|
|
|
92
92
|
* ```
|
|
93
93
|
* @returns The `AccountManager` instance for method chaining
|
|
94
94
|
*/
|
|
95
|
-
setSigner(sender: string, signer: algosdk.TransactionSigner): this;
|
|
95
|
+
setSigner(sender: string | Address, signer: algosdk.TransactionSigner): this;
|
|
96
|
+
/**
|
|
97
|
+
* Takes all registered signers from the given `AccountManager` and adds them to this `AccountManager`.
|
|
98
|
+
*
|
|
99
|
+
* This is useful for situations where you have multiple contexts you are building accounts in such as unit tests.
|
|
100
|
+
* @param anotherAccountManager Another account manager with signers registered
|
|
101
|
+
* @param overwriteExisting Whether or not to overwrite any signers that have the same sender address with the ones in the other account manager or not (default: true)
|
|
102
|
+
* @returns The `AccountManager` instance for method chaining
|
|
103
|
+
*/
|
|
104
|
+
setSigners(anotherAccountManager: AccountManager, overwriteExisting?: boolean): void;
|
|
96
105
|
/**
|
|
97
106
|
* Returns the `TransactionSigner` for the given sender address, ready to sign a transaction for that sender.
|
|
98
107
|
*
|
|
@@ -106,7 +115,7 @@ export declare class AccountManager {
|
|
|
106
115
|
* ```
|
|
107
116
|
* @returns The `TransactionSigner` or throws an error if not found and no default signer is set
|
|
108
117
|
*/
|
|
109
|
-
getSigner(sender: string): algosdk.TransactionSigner;
|
|
118
|
+
getSigner(sender: string | Address): algosdk.TransactionSigner;
|
|
110
119
|
/**
|
|
111
120
|
* Returns the `TransactionSignerAccount` for the given sender address.
|
|
112
121
|
*
|
|
@@ -114,14 +123,14 @@ export declare class AccountManager {
|
|
|
114
123
|
* @param sender The sender address
|
|
115
124
|
* @example
|
|
116
125
|
* ```typescript
|
|
117
|
-
* const sender = accountManager.random()
|
|
126
|
+
* const sender = accountManager.random()
|
|
118
127
|
* // ...
|
|
119
128
|
* // Returns the `TransactionSignerAccount` for `sender` that has previously been registered
|
|
120
129
|
* const account = accountManager.getAccount(sender)
|
|
121
130
|
* ```
|
|
122
131
|
* @returns The `TransactionSignerAccount` or throws an error if not found
|
|
123
132
|
*/
|
|
124
|
-
getAccount(sender: string): TransactionSignerAccount;
|
|
133
|
+
getAccount(sender: string | Address): TransactionSignerAccount;
|
|
125
134
|
/**
|
|
126
135
|
* Returns the given sender account's current status, balance and spendable amounts.
|
|
127
136
|
*
|
|
@@ -135,7 +144,7 @@ export declare class AccountManager {
|
|
|
135
144
|
* @param sender The account / address to look up
|
|
136
145
|
* @returns The account information
|
|
137
146
|
*/
|
|
138
|
-
getInformation(sender: string |
|
|
147
|
+
getInformation(sender: string | Address): Promise<AccountInformation>;
|
|
139
148
|
/**
|
|
140
149
|
* Tracks and returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.
|
|
141
150
|
*
|
|
@@ -149,7 +158,7 @@ export declare class AccountManager {
|
|
|
149
158
|
* @param sender The optional sender address to use this signer for (aka a rekeyed account)
|
|
150
159
|
* @returns The account
|
|
151
160
|
*/
|
|
152
|
-
fromMnemonic(mnemonicSecret: string, sender?: string): TransactionSignerAccount & {
|
|
161
|
+
fromMnemonic(mnemonicSecret: string, sender?: string | Address): algosdk.Address & TransactionSignerAccount & {
|
|
153
162
|
account: SigningAccount;
|
|
154
163
|
};
|
|
155
164
|
/**
|
|
@@ -164,9 +173,9 @@ export declare class AccountManager {
|
|
|
164
173
|
* @param sender The sender address to use as the new sender
|
|
165
174
|
* @returns The account
|
|
166
175
|
*/
|
|
167
|
-
rekeyed(sender: string, account: TransactionSignerAccount): TransactionSignerAccount & {
|
|
176
|
+
rekeyed(sender: string | Address, account: TransactionSignerAccount): algosdk.Address & TransactionSignerAccount & {
|
|
168
177
|
account: {
|
|
169
|
-
addr:
|
|
178
|
+
addr: algosdk.Address;
|
|
170
179
|
signer: algosdk.TransactionSigner;
|
|
171
180
|
};
|
|
172
181
|
};
|
|
@@ -197,7 +206,7 @@ export declare class AccountManager {
|
|
|
197
206
|
* @param fundWith The optional amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
|
|
198
207
|
* @returns The account
|
|
199
208
|
*/
|
|
200
|
-
fromEnvironment(name: string, fundWith?: AlgoAmount): Promise<TransactionSignerAccount & {
|
|
209
|
+
fromEnvironment(name: string, fundWith?: AlgoAmount): Promise<algosdk.Address & TransactionSignerAccount & {
|
|
201
210
|
account: SigningAccount;
|
|
202
211
|
}>;
|
|
203
212
|
/**
|
|
@@ -215,7 +224,7 @@ export declare class AccountManager {
|
|
|
215
224
|
* ```
|
|
216
225
|
* @returns The account
|
|
217
226
|
*/
|
|
218
|
-
fromKmd(name: string, predicate?: (account: Record<string, any>) => boolean, sender?: string): Promise<TransactionSignerAccount & {
|
|
227
|
+
fromKmd(name: string, predicate?: (account: Record<string, any>) => boolean, sender?: string | Address): Promise<algosdk.Address & TransactionSignerAccount & {
|
|
219
228
|
account: SigningAccount;
|
|
220
229
|
}>;
|
|
221
230
|
/**
|
|
@@ -230,7 +239,7 @@ export declare class AccountManager {
|
|
|
230
239
|
* @param signingAccounts The signers that are currently present
|
|
231
240
|
* @returns A multisig account wrapper
|
|
232
241
|
*/
|
|
233
|
-
multisig(multisigParams: algosdk.MultisigMetadata, signingAccounts: (algosdk.Account | SigningAccount)[]): TransactionSignerAccount & {
|
|
242
|
+
multisig(multisigParams: algosdk.MultisigMetadata, signingAccounts: (algosdk.Account | SigningAccount)[]): algosdk.Address & TransactionSignerAccount & {
|
|
234
243
|
account: MultisigAccount;
|
|
235
244
|
};
|
|
236
245
|
/**
|
|
@@ -244,7 +253,7 @@ export declare class AccountManager {
|
|
|
244
253
|
* @param args The (binary) arguments to pass into the logic signature
|
|
245
254
|
* @returns A logic signature account wrapper
|
|
246
255
|
*/
|
|
247
|
-
logicsig(program: Uint8Array, args?: Array<Uint8Array>): TransactionSignerAccount & {
|
|
256
|
+
logicsig(program: Uint8Array, args?: Array<Uint8Array>): algosdk.Address & TransactionSignerAccount & {
|
|
248
257
|
account: algosdk.LogicSigAccount;
|
|
249
258
|
};
|
|
250
259
|
/**
|
|
@@ -256,7 +265,7 @@ export declare class AccountManager {
|
|
|
256
265
|
* ```
|
|
257
266
|
* @returns The account
|
|
258
267
|
*/
|
|
259
|
-
random(): TransactionSignerAccount & {
|
|
268
|
+
random(): algosdk.Address & TransactionSignerAccount & {
|
|
260
269
|
account: algosdk.Account;
|
|
261
270
|
};
|
|
262
271
|
/**
|
|
@@ -275,7 +284,7 @@ export declare class AccountManager {
|
|
|
275
284
|
*
|
|
276
285
|
* @returns The account
|
|
277
286
|
*/
|
|
278
|
-
dispenserFromEnvironment(): Promise<TransactionSignerAccount & {
|
|
287
|
+
dispenserFromEnvironment(): Promise<algosdk.Address & TransactionSignerAccount & {
|
|
279
288
|
account: SigningAccount;
|
|
280
289
|
}>;
|
|
281
290
|
/**
|
|
@@ -287,7 +296,7 @@ export declare class AccountManager {
|
|
|
287
296
|
* ```
|
|
288
297
|
* @returns The account
|
|
289
298
|
*/
|
|
290
|
-
localNetDispenser(): Promise<TransactionSignerAccount & {
|
|
299
|
+
localNetDispenser(): Promise<algosdk.Address & TransactionSignerAccount & {
|
|
291
300
|
account: SigningAccount;
|
|
292
301
|
}>;
|
|
293
302
|
/**
|
|
@@ -328,7 +337,7 @@ export declare class AccountManager {
|
|
|
328
337
|
* ```
|
|
329
338
|
* @returns The result of the transaction and the transaction that was sent
|
|
330
339
|
*/
|
|
331
|
-
rekeyAccount(account: string |
|
|
340
|
+
rekeyAccount(account: string | Address, rekeyTo: string | Address | TransactionSignerAccount, options?: Omit<CommonTransactionParams, 'sender'> & SendParams): Promise<SendSingleTransactionResult>;
|
|
332
341
|
private _getEnsureFundedAmount;
|
|
333
342
|
/**
|
|
334
343
|
* Funds a given account using a dispenser account as a funding source such that
|
|
@@ -354,9 +363,9 @@ export declare class AccountManager {
|
|
|
354
363
|
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
355
364
|
* - `undefined` if no funds were needed.
|
|
356
365
|
*/
|
|
357
|
-
ensureFunded(accountToFund: string |
|
|
366
|
+
ensureFunded(accountToFund: string | Address, dispenserAccount: string | Address, minSpendingBalance: AlgoAmount, options?: {
|
|
358
367
|
minFundingIncrement?: AlgoAmount;
|
|
359
|
-
} &
|
|
368
|
+
} & SendParams & Omit<CommonTransactionParams, 'sender'>): Promise<(SendSingleTransactionResult & EnsureFundedResult) | undefined>;
|
|
360
369
|
/**
|
|
361
370
|
* Funds a given account using a dispenser account retrieved from the environment,
|
|
362
371
|
* per the `dispenserFromEnvironment` method, as a funding source such that
|
|
@@ -387,9 +396,9 @@ export declare class AccountManager {
|
|
|
387
396
|
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
388
397
|
* - `undefined` if no funds were needed.
|
|
389
398
|
*/
|
|
390
|
-
ensureFundedFromEnvironment(accountToFund: string |
|
|
399
|
+
ensureFundedFromEnvironment(accountToFund: string | Address, minSpendingBalance: AlgoAmount, options?: {
|
|
391
400
|
minFundingIncrement?: AlgoAmount;
|
|
392
|
-
} &
|
|
401
|
+
} & SendParams & Omit<CommonTransactionParams, 'sender'>): Promise<(SendSingleTransactionResult & EnsureFundedResult) | undefined>;
|
|
393
402
|
/**
|
|
394
403
|
* Funds a given account using the TestNet Dispenser API as a funding source such that
|
|
395
404
|
* the account has a certain amount of Algo free to spend (accounting for Algo locked
|
|
@@ -414,8 +423,7 @@ export declare class AccountManager {
|
|
|
414
423
|
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
415
424
|
* - `undefined` if no funds were needed.
|
|
416
425
|
*/
|
|
417
|
-
ensureFundedFromTestNetDispenserApi(accountToFund: string |
|
|
426
|
+
ensureFundedFromTestNetDispenserApi(accountToFund: string | Address, dispenserClient: TestNetDispenserApiClient, minSpendingBalance: AlgoAmount, options?: {
|
|
418
427
|
minFundingIncrement?: AlgoAmount;
|
|
419
428
|
}): Promise<EnsureFundedResult | undefined>;
|
|
420
429
|
}
|
|
421
|
-
//# sourceMappingURL=account-manager.d.ts.map
|
package/types/account-manager.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
|
-
var config = require('../config.js');
|
|
5
|
-
var util = require('../util.js');
|
|
4
|
+
var config = require('../src/config.js');
|
|
5
|
+
var util = require('../src/util.js');
|
|
6
6
|
var types_account = require('./account.js');
|
|
7
7
|
var types_amount = require('./amount.js');
|
|
8
8
|
var types_composer = require('./composer.js');
|
|
9
9
|
var types_kmdAccountManager = require('./kmd-account-manager.js');
|
|
10
10
|
|
|
11
11
|
var LogicSigAccount = algosdk.LogicSigAccount;
|
|
12
|
-
|
|
12
|
+
const address = (address) => (typeof address === 'string' ? algosdk.Address.fromString(address) : address);
|
|
13
13
|
/**
|
|
14
14
|
* Returns a `TransactionSigner` for the given account that can sign a transaction.
|
|
15
15
|
* This function has memoization, so will return the same transaction signer for a given account.
|
|
@@ -39,7 +39,7 @@ class AccountManager {
|
|
|
39
39
|
this._kmdAccountManager = new types_kmdAccountManager.KmdAccountManager(clientManager);
|
|
40
40
|
}
|
|
41
41
|
_getComposer(getSuggestedParams) {
|
|
42
|
-
return new types_composer.
|
|
42
|
+
return new types_composer.TransactionComposer({
|
|
43
43
|
algod: this._clientManager.algod,
|
|
44
44
|
getSigner: this.getSigner.bind(this),
|
|
45
45
|
getSuggestedParams: getSuggestedParams ?? (() => this._clientManager.algod.getTransactionParams().do()),
|
|
@@ -74,12 +74,18 @@ class AccountManager {
|
|
|
74
74
|
* retrieval and returns a `TransactionSignerAccount` along with the original account in an `account` property.
|
|
75
75
|
*/
|
|
76
76
|
signerAccount(account) {
|
|
77
|
+
const signer = getAccountTransactionSigner(account);
|
|
77
78
|
const acc = {
|
|
78
79
|
addr: 'addr' in account ? account.addr : account.address(),
|
|
79
|
-
signer:
|
|
80
|
+
signer: signer,
|
|
80
81
|
};
|
|
81
|
-
this._accounts[acc.addr] = acc;
|
|
82
|
-
|
|
82
|
+
this._accounts[acc.addr.toString()] = acc;
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
const addressWithAccount = algosdk.Address.fromString(acc.addr.toString());
|
|
85
|
+
addressWithAccount.account = account;
|
|
86
|
+
addressWithAccount.addr = acc.addr.toString();
|
|
87
|
+
addressWithAccount.signer = signer;
|
|
88
|
+
return addressWithAccount;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* Tracks the given account for later signing.
|
|
@@ -115,9 +121,23 @@ class AccountManager {
|
|
|
115
121
|
* @returns The `AccountManager` instance for method chaining
|
|
116
122
|
*/
|
|
117
123
|
setSigner(sender, signer) {
|
|
118
|
-
this._accounts[sender] = { addr: sender, signer };
|
|
124
|
+
this._accounts[address(sender).toString()] = { addr: address(sender), signer };
|
|
119
125
|
return this;
|
|
120
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Takes all registered signers from the given `AccountManager` and adds them to this `AccountManager`.
|
|
129
|
+
*
|
|
130
|
+
* This is useful for situations where you have multiple contexts you are building accounts in such as unit tests.
|
|
131
|
+
* @param anotherAccountManager Another account manager with signers registered
|
|
132
|
+
* @param overwriteExisting Whether or not to overwrite any signers that have the same sender address with the ones in the other account manager or not (default: true)
|
|
133
|
+
* @returns The `AccountManager` instance for method chaining
|
|
134
|
+
*/
|
|
135
|
+
setSigners(anotherAccountManager, overwriteExisting = true) {
|
|
136
|
+
this._accounts = overwriteExisting
|
|
137
|
+
? { ...this._accounts, ...anotherAccountManager._accounts }
|
|
138
|
+
: { ...anotherAccountManager._accounts, ...this._accounts };
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
121
141
|
/**
|
|
122
142
|
* Returns the `TransactionSigner` for the given sender address, ready to sign a transaction for that sender.
|
|
123
143
|
*
|
|
@@ -132,7 +152,7 @@ class AccountManager {
|
|
|
132
152
|
* @returns The `TransactionSigner` or throws an error if not found and no default signer is set
|
|
133
153
|
*/
|
|
134
154
|
getSigner(sender) {
|
|
135
|
-
const signer = this._accounts[sender]?.signer ?? this._defaultSigner;
|
|
155
|
+
const signer = this._accounts[address(sender).toString()]?.signer ?? this._defaultSigner;
|
|
136
156
|
if (!signer)
|
|
137
157
|
throw new Error(`No signer found for address ${sender}`);
|
|
138
158
|
return signer;
|
|
@@ -144,7 +164,7 @@ class AccountManager {
|
|
|
144
164
|
* @param sender The sender address
|
|
145
165
|
* @example
|
|
146
166
|
* ```typescript
|
|
147
|
-
* const sender = accountManager.random()
|
|
167
|
+
* const sender = accountManager.random()
|
|
148
168
|
* // ...
|
|
149
169
|
* // Returns the `TransactionSignerAccount` for `sender` that has previously been registered
|
|
150
170
|
* const account = accountManager.getAccount(sender)
|
|
@@ -152,7 +172,7 @@ class AccountManager {
|
|
|
152
172
|
* @returns The `TransactionSignerAccount` or throws an error if not found
|
|
153
173
|
*/
|
|
154
174
|
getAccount(sender) {
|
|
155
|
-
const account = this._accounts[sender];
|
|
175
|
+
const account = this._accounts[address(sender).toString()];
|
|
156
176
|
if (!account)
|
|
157
177
|
throw new Error(`No signer found for address ${sender}`);
|
|
158
178
|
return account;
|
|
@@ -171,24 +191,27 @@ class AccountManager {
|
|
|
171
191
|
* @returns The account information
|
|
172
192
|
*/
|
|
173
193
|
async getInformation(sender) {
|
|
174
|
-
const account =
|
|
194
|
+
const { round, lastHeartbeat = undefined, lastProposed = undefined, address, ...account } = await this._clientManager.algod.accountInformation(sender).do();
|
|
175
195
|
return {
|
|
176
196
|
...account,
|
|
177
|
-
// None of
|
|
197
|
+
// None of the Number types can practically overflow 2^53
|
|
198
|
+
address: algosdk.Address.fromString(address),
|
|
178
199
|
balance: types_amount.AlgoAmount.MicroAlgo(Number(account.amount)),
|
|
179
200
|
amountWithoutPendingRewards: types_amount.AlgoAmount.MicroAlgo(Number(account.amountWithoutPendingRewards)),
|
|
180
201
|
minBalance: types_amount.AlgoAmount.MicroAlgo(Number(account.minBalance)),
|
|
181
202
|
pendingRewards: types_amount.AlgoAmount.MicroAlgo(Number(account.pendingRewards)),
|
|
182
203
|
rewards: types_amount.AlgoAmount.MicroAlgo(Number(account.rewards)),
|
|
183
|
-
validAsOfRound: BigInt(
|
|
204
|
+
validAsOfRound: BigInt(round),
|
|
184
205
|
totalAppsOptedIn: Number(account.totalAppsOptedIn),
|
|
185
206
|
totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
|
|
186
207
|
totalCreatedApps: Number(account.totalCreatedApps),
|
|
187
208
|
totalCreatedAssets: Number(account.totalCreatedAssets),
|
|
188
|
-
appsTotalExtraPages: account.appsTotalExtraPages ? Number(account.appsTotalExtraPages) : undefined,
|
|
189
|
-
rewardBase: account.rewardBase ? Number(account.rewardBase) : undefined,
|
|
190
|
-
totalBoxBytes: account.totalBoxBytes ? Number(account.totalBoxBytes) : undefined,
|
|
191
|
-
totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
|
|
209
|
+
appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
|
|
210
|
+
rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
|
|
211
|
+
totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
|
|
212
|
+
totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
|
|
213
|
+
lastHeartbeatRound: lastHeartbeat !== undefined ? BigInt(lastHeartbeat) : undefined,
|
|
214
|
+
lastProposedRound: lastProposed !== undefined ? BigInt(lastProposed) : undefined,
|
|
192
215
|
};
|
|
193
216
|
}
|
|
194
217
|
/**
|
|
@@ -221,7 +244,7 @@ class AccountManager {
|
|
|
221
244
|
* @returns The account
|
|
222
245
|
*/
|
|
223
246
|
rekeyed(sender, account) {
|
|
224
|
-
return this.signerAccount({ addr: sender, signer: account.signer });
|
|
247
|
+
return this.signerAccount({ addr: address(sender), signer: account.signer });
|
|
225
248
|
}
|
|
226
249
|
/**
|
|
227
250
|
* Tracks and returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.
|
|
@@ -409,15 +432,15 @@ class AccountManager {
|
|
|
409
432
|
const result = await this._getComposer()
|
|
410
433
|
.addPayment({
|
|
411
434
|
...options,
|
|
412
|
-
sender:
|
|
413
|
-
receiver:
|
|
435
|
+
sender: address(account),
|
|
436
|
+
receiver: address(account),
|
|
414
437
|
amount: types_amount.AlgoAmount.MicroAlgo(0),
|
|
415
|
-
rekeyTo: typeof rekeyTo === '
|
|
438
|
+
rekeyTo: address(typeof rekeyTo === 'object' && 'addr' in rekeyTo ? rekeyTo.addr : rekeyTo),
|
|
416
439
|
})
|
|
417
|
-
.
|
|
440
|
+
.send(options);
|
|
418
441
|
// If the rekey is a signing account set it as the signer for this account
|
|
419
|
-
if (typeof rekeyTo
|
|
420
|
-
this.rekeyed(
|
|
442
|
+
if (typeof rekeyTo === 'object' && 'addr' in rekeyTo) {
|
|
443
|
+
this.rekeyed(account, rekeyTo);
|
|
421
444
|
}
|
|
422
445
|
config.Config.getLogger(options?.suppressLog).info(`Rekeyed ${account} to ${rekeyTo} via transaction ${result.txIds.at(-1)}`);
|
|
423
446
|
return { ...result, transaction: result.transactions.at(-1), confirmation: result.confirmations.at(-1) };
|
|
@@ -425,7 +448,7 @@ class AccountManager {
|
|
|
425
448
|
async _getEnsureFundedAmount(sender, minSpendingBalance, minFundingIncrement) {
|
|
426
449
|
const accountInfo = await this.getInformation(sender);
|
|
427
450
|
const currentSpendingBalance = accountInfo.balance.microAlgo - accountInfo.minBalance.microAlgo;
|
|
428
|
-
const amountFunded = util.calculateFundAmount(minSpendingBalance.microAlgo, currentSpendingBalance, minFundingIncrement?.microAlgo ??
|
|
451
|
+
const amountFunded = util.calculateFundAmount(minSpendingBalance.microAlgo, currentSpendingBalance, minFundingIncrement?.microAlgo ?? 0n);
|
|
429
452
|
return amountFunded === null ? undefined : types_amount.AlgoAmount.MicroAlgo(amountFunded);
|
|
430
453
|
}
|
|
431
454
|
/**
|
|
@@ -453,18 +476,18 @@ class AccountManager {
|
|
|
453
476
|
* - `undefined` if no funds were needed.
|
|
454
477
|
*/
|
|
455
478
|
async ensureFunded(accountToFund, dispenserAccount, minSpendingBalance, options) {
|
|
456
|
-
const addressToFund =
|
|
479
|
+
const addressToFund = address(accountToFund);
|
|
457
480
|
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
458
481
|
if (!amountFunded)
|
|
459
482
|
return undefined;
|
|
460
483
|
const result = await this._getComposer()
|
|
461
484
|
.addPayment({
|
|
462
485
|
...options,
|
|
463
|
-
sender:
|
|
486
|
+
sender: address(dispenserAccount),
|
|
464
487
|
receiver: addressToFund,
|
|
465
488
|
amount: amountFunded,
|
|
466
489
|
})
|
|
467
|
-
.
|
|
490
|
+
.send(options);
|
|
468
491
|
return {
|
|
469
492
|
...result,
|
|
470
493
|
transaction: result.transactions[0],
|
|
@@ -504,7 +527,7 @@ class AccountManager {
|
|
|
504
527
|
* - `undefined` if no funds were needed.
|
|
505
528
|
*/
|
|
506
529
|
async ensureFundedFromEnvironment(accountToFund, minSpendingBalance, options) {
|
|
507
|
-
const addressToFund =
|
|
530
|
+
const addressToFund = address(accountToFund);
|
|
508
531
|
const dispenserAccount = await this.dispenserFromEnvironment();
|
|
509
532
|
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
510
533
|
if (!amountFunded)
|
|
@@ -512,11 +535,11 @@ class AccountManager {
|
|
|
512
535
|
const result = await this._getComposer()
|
|
513
536
|
.addPayment({
|
|
514
537
|
...options,
|
|
515
|
-
sender: dispenserAccount
|
|
538
|
+
sender: dispenserAccount,
|
|
516
539
|
receiver: addressToFund,
|
|
517
540
|
amount: amountFunded,
|
|
518
541
|
})
|
|
519
|
-
.
|
|
542
|
+
.send(options);
|
|
520
543
|
return {
|
|
521
544
|
...result,
|
|
522
545
|
transaction: result.transactions[0],
|
|
@@ -553,7 +576,7 @@ class AccountManager {
|
|
|
553
576
|
if (!(await this._clientManager.isTestNet())) {
|
|
554
577
|
throw new Error('Attempt to fund using TestNet dispenser API on non TestNet network.');
|
|
555
578
|
}
|
|
556
|
-
const addressToFund =
|
|
579
|
+
const addressToFund = address(accountToFund);
|
|
557
580
|
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
558
581
|
if (!amountFunded)
|
|
559
582
|
return undefined;
|