@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/asset.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import algosdk from 'algosdk';
|
|
|
2
2
|
import { AlgoAmount } from './amount';
|
|
3
3
|
import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction';
|
|
4
4
|
import SuggestedParams = algosdk.SuggestedParams;
|
|
5
|
-
/** Parameters for `createAsset` call. */
|
|
5
|
+
/** @deprecated Parameters for `createAsset` call. */
|
|
6
6
|
export interface CreateAssetParams extends SendTransactionParams {
|
|
7
7
|
/** The account to create the asset.
|
|
8
8
|
*
|
|
@@ -60,7 +60,7 @@ export interface CreateAssetParams extends SendTransactionParams {
|
|
|
60
60
|
/** An (optional) [transaction lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) to apply */
|
|
61
61
|
lease?: string | Uint8Array;
|
|
62
62
|
}
|
|
63
|
-
/** Parameters for `assetOptIn` call. */
|
|
63
|
+
/** @deprecated Parameters for `assetOptIn` call. */
|
|
64
64
|
export interface AssetOptInParams extends SendTransactionParams {
|
|
65
65
|
/** The account to opt in/out for */
|
|
66
66
|
account: SendTransactionFrom;
|
|
@@ -73,14 +73,14 @@ export interface AssetOptInParams extends SendTransactionParams {
|
|
|
73
73
|
/** An (optional) [transaction lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) to apply */
|
|
74
74
|
lease?: string | Uint8Array;
|
|
75
75
|
}
|
|
76
|
-
/** Parameters for `assetOptOut` call. */
|
|
76
|
+
/** @deprecated Parameters for `assetOptOut` call. */
|
|
77
77
|
export interface AssetOptOutParams extends AssetOptInParams {
|
|
78
78
|
/** The address of the creator account for the asset; if unspecified then it looks it up using algod */
|
|
79
79
|
assetCreatorAddress?: string;
|
|
80
80
|
/** Whether or not to validate the account has a zero-balance before issuing the opt-out; default = true */
|
|
81
81
|
ensureZeroBalance?: boolean;
|
|
82
82
|
}
|
|
83
|
-
/** Parameters for `assetBulkOptIn` / `assetBulkOptOut` call. */
|
|
83
|
+
/** @deprecated Parameters for `assetBulkOptIn` / `assetBulkOptOut` call. */
|
|
84
84
|
export interface AssetBulkOptInOutParams {
|
|
85
85
|
/** The account to opt in/out for */
|
|
86
86
|
account: SendTransactionFrom;
|
|
@@ -97,4 +97,3 @@ export interface AssetBulkOptInOutParams {
|
|
|
97
97
|
/** Whether to suppress log messages from transaction send, default: do not suppress */
|
|
98
98
|
suppressLog?: boolean;
|
|
99
99
|
}
|
|
100
|
-
//# sourceMappingURL=asset.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventDataMap, EventType } from './lifecycle-events';
|
|
2
|
+
export type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void;
|
|
3
|
+
export declare class AsyncEventEmitter {
|
|
4
|
+
private listenerWrapperMap;
|
|
5
|
+
private listenerMap;
|
|
6
|
+
emitAsync<K extends EventType>(eventName: K, event: EventDataMap[K]): Promise<void>;
|
|
7
|
+
emitAsync(eventName: string | symbol, event: unknown): Promise<void>;
|
|
8
|
+
on<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter;
|
|
9
|
+
on<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter;
|
|
10
|
+
once<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter;
|
|
11
|
+
once<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter;
|
|
12
|
+
removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter;
|
|
13
|
+
off: (eventName: string | symbol, listener: AsyncEventListener) => AsyncEventEmitter;
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class AsyncEventEmitter {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.listenerWrapperMap = new WeakMap();
|
|
6
|
+
this.listenerMap = {};
|
|
7
|
+
this.off = this.removeListener;
|
|
8
|
+
}
|
|
9
|
+
async emitAsync(eventName, event) {
|
|
10
|
+
for (const listener of this.listenerMap[eventName] ?? []) {
|
|
11
|
+
await listener(event, eventName);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
on(eventName, listener) {
|
|
15
|
+
if (!this.listenerMap[eventName])
|
|
16
|
+
this.listenerMap[eventName] = [];
|
|
17
|
+
this.listenerMap[eventName].push(listener);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
once(eventName, listener) {
|
|
21
|
+
const wrappedListener = async (event, eventName) => {
|
|
22
|
+
try {
|
|
23
|
+
return await listener(event, eventName);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
this.removeListener(eventName, wrappedListener);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this.listenerWrapperMap.set(listener, wrappedListener);
|
|
30
|
+
return this.on(eventName, wrappedListener);
|
|
31
|
+
}
|
|
32
|
+
removeListener(eventName, listener) {
|
|
33
|
+
const wrappedListener = this.listenerWrapperMap.get(listener);
|
|
34
|
+
if (wrappedListener) {
|
|
35
|
+
this.listenerWrapperMap.delete(listener);
|
|
36
|
+
if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {
|
|
37
|
+
this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {
|
|
42
|
+
this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
exports.AsyncEventEmitter = AsyncEventEmitter;
|
|
50
|
+
//# sourceMappingURL=async-event-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-event-emitter.js","sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["import { EventDataMap, EventType } from './lifecycle-events'\n\nexport type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void\n\nexport class AsyncEventEmitter {\n private listenerWrapperMap = new WeakMap<AsyncEventListener, AsyncEventListener>()\n private listenerMap: Record<string | symbol, AsyncEventListener[]> = {}\n\n async emitAsync<K extends EventType>(eventName: K, event: EventDataMap[K]): Promise<void>\n async emitAsync(eventName: string | symbol, event: unknown): Promise<void>\n async emitAsync(eventName: string | symbol, event: unknown): Promise<void> {\n for (const listener of this.listenerMap[eventName] ?? []) {\n await listener(event, eventName)\n }\n }\n\n on<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter\n on<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter\n on(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n if (!this.listenerMap[eventName]) this.listenerMap[eventName] = []\n this.listenerMap[eventName].push(listener as AsyncEventListener)\n return this\n }\n\n once<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter\n once<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter\n once(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener: AsyncEventListener = async (event, eventName) => {\n try {\n return await listener(event, eventName)\n } finally {\n this.removeListener(eventName, wrappedListener)\n }\n }\n this.listenerWrapperMap.set(listener, wrappedListener)\n return this.on(eventName, wrappedListener)\n }\n\n removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener = this.listenerWrapperMap.get(listener)\n if (wrappedListener) {\n this.listenerWrapperMap.delete(listener)\n if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1)\n }\n } else {\n if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1)\n }\n }\n\n return this\n }\n\n off = this.removeListener\n}\n"],"names":[],"mappings":";;MAIa,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;AACU,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,OAAO,EAA0C,CAAA;QAC1E,IAAW,CAAA,WAAA,GAAkD,EAAE,CAAA;AAgDvE,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;KAC1B;AA7CC,IAAA,MAAM,SAAS,CAAC,SAA0B,EAAE,KAAc,EAAA;AACxD,QAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;AACxD,YAAA,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;SACjC;KACF;IAID,EAAE,CAAC,SAA0B,EAAE,QAA4B,EAAA;AACzD,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;AAAE,YAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;QAClE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAA8B,CAAC,CAAA;AAChE,QAAA,OAAO,IAAI,CAAA;KACZ;IAID,IAAI,CAAC,SAA0B,EAAE,QAA4B,EAAA;QAC3D,MAAM,eAAe,GAAuB,OAAO,KAAK,EAAE,SAAS,KAAI;AACrE,YAAA,IAAI;AACF,gBAAA,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;aACxC;oBAAS;AACR,gBAAA,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;aAChD;AACH,SAAC,CAAA;QACD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;QACtD,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;KAC3C;IAED,cAAc,CAAC,SAA0B,EAAE,QAA4B,EAAA;QACrE,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAC7D,IAAI,eAAe,EAAE;AACnB,YAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACxC,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;gBAChE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAA;aAC5F;SACF;aAAM;AACL,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;gBACzD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;aACrF;SACF;AAED,QAAA,OAAO,IAAI,CAAA;KACZ;AAGF;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
class AsyncEventEmitter {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.listenerWrapperMap = new WeakMap();
|
|
4
|
+
this.listenerMap = {};
|
|
5
|
+
this.off = this.removeListener;
|
|
6
|
+
}
|
|
7
|
+
async emitAsync(eventName, event) {
|
|
8
|
+
for (const listener of this.listenerMap[eventName] ?? []) {
|
|
9
|
+
await listener(event, eventName);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
on(eventName, listener) {
|
|
13
|
+
if (!this.listenerMap[eventName])
|
|
14
|
+
this.listenerMap[eventName] = [];
|
|
15
|
+
this.listenerMap[eventName].push(listener);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
once(eventName, listener) {
|
|
19
|
+
const wrappedListener = async (event, eventName) => {
|
|
20
|
+
try {
|
|
21
|
+
return await listener(event, eventName);
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
this.removeListener(eventName, wrappedListener);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.listenerWrapperMap.set(listener, wrappedListener);
|
|
28
|
+
return this.on(eventName, wrappedListener);
|
|
29
|
+
}
|
|
30
|
+
removeListener(eventName, listener) {
|
|
31
|
+
const wrappedListener = this.listenerWrapperMap.get(listener);
|
|
32
|
+
if (wrappedListener) {
|
|
33
|
+
this.listenerWrapperMap.delete(listener);
|
|
34
|
+
if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {
|
|
35
|
+
this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {
|
|
40
|
+
this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { AsyncEventEmitter };
|
|
48
|
+
//# sourceMappingURL=async-event-emitter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-event-emitter.mjs","sources":["../../src/types/async-event-emitter.ts"],"sourcesContent":["import { EventDataMap, EventType } from './lifecycle-events'\n\nexport type AsyncEventListener<T = unknown> = (event: T, eventName: string | symbol) => Promise<void> | void\n\nexport class AsyncEventEmitter {\n private listenerWrapperMap = new WeakMap<AsyncEventListener, AsyncEventListener>()\n private listenerMap: Record<string | symbol, AsyncEventListener[]> = {}\n\n async emitAsync<K extends EventType>(eventName: K, event: EventDataMap[K]): Promise<void>\n async emitAsync(eventName: string | symbol, event: unknown): Promise<void>\n async emitAsync(eventName: string | symbol, event: unknown): Promise<void> {\n for (const listener of this.listenerMap[eventName] ?? []) {\n await listener(event, eventName)\n }\n }\n\n on<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter\n on<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter\n on(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n if (!this.listenerMap[eventName]) this.listenerMap[eventName] = []\n this.listenerMap[eventName].push(listener as AsyncEventListener)\n return this\n }\n\n once<K extends EventType>(eventName: K, listener: AsyncEventListener<EventDataMap[K]>): AsyncEventEmitter\n once<T = unknown>(eventName: string | symbol, listener: AsyncEventListener<T>): AsyncEventEmitter\n once(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener: AsyncEventListener = async (event, eventName) => {\n try {\n return await listener(event, eventName)\n } finally {\n this.removeListener(eventName, wrappedListener)\n }\n }\n this.listenerWrapperMap.set(listener, wrappedListener)\n return this.on(eventName, wrappedListener)\n }\n\n removeListener(eventName: string | symbol, listener: AsyncEventListener): AsyncEventEmitter {\n const wrappedListener = this.listenerWrapperMap.get(listener)\n if (wrappedListener) {\n this.listenerWrapperMap.delete(listener)\n if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1)\n }\n } else {\n if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {\n this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1)\n }\n }\n\n return this\n }\n\n off = this.removeListener\n}\n"],"names":[],"mappings":"MAIa,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;AACU,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,OAAO,EAA0C,CAAA;QAC1E,IAAW,CAAA,WAAA,GAAkD,EAAE,CAAA;AAgDvE,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;KAC1B;AA7CC,IAAA,MAAM,SAAS,CAAC,SAA0B,EAAE,KAAc,EAAA;AACxD,QAAA,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;AACxD,YAAA,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;SACjC;KACF;IAID,EAAE,CAAC,SAA0B,EAAE,QAA4B,EAAA;AACzD,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;AAAE,YAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAA;QAClE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAA8B,CAAC,CAAA;AAChE,QAAA,OAAO,IAAI,CAAA;KACZ;IAID,IAAI,CAAC,SAA0B,EAAE,QAA4B,EAAA;QAC3D,MAAM,eAAe,GAAuB,OAAO,KAAK,EAAE,SAAS,KAAI;AACrE,YAAA,IAAI;AACF,gBAAA,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;aACxC;oBAAS;AACR,gBAAA,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;aAChD;AACH,SAAC,CAAA;QACD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;QACtD,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;KAC3C;IAED,cAAc,CAAC,SAA0B,EAAE,QAA4B,EAAA;QACrE,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAC7D,IAAI,eAAe,EAAE;AACnB,YAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACxC,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;gBAChE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAA;aAC5F;SACF;aAAM;AACL,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;gBACzD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;aACrF;SACF;AAED,QAAA,OAAO,IAAI,CAAA;KACZ;AAGF;;;;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AlgorandClientInterface } from './algorand-client-interface';
|
|
3
|
+
import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client';
|
|
4
|
+
import { AppFactory, AppFactoryParams } from './app-factory';
|
|
4
5
|
import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client';
|
|
5
|
-
import {
|
|
6
|
+
import { Expand } from './expand';
|
|
7
|
+
import { AlgoClientConfig, AlgoConfig, NetworkDetails } from './network-client';
|
|
6
8
|
import Kmd = algosdk.Kmd;
|
|
7
9
|
import Indexer = algosdk.Indexer;
|
|
8
10
|
import Algodv2 = algosdk.Algodv2;
|
|
9
|
-
import IntDecoding = algosdk.IntDecoding;
|
|
10
11
|
/** Clients from algosdk that interact with the official Algorand APIs */
|
|
11
12
|
export interface AlgoSdkClients {
|
|
12
13
|
/** Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ */
|
|
@@ -16,24 +17,28 @@ export interface AlgoSdkClients {
|
|
|
16
17
|
/** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */
|
|
17
18
|
kmd?: algosdk.Kmd;
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
/** Params to get an app factory from `ClientManager`. */
|
|
21
|
+
export type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>;
|
|
22
|
+
/** Params to get an app client by creator address and name from `ClientManager`. */
|
|
23
|
+
export type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>;
|
|
24
|
+
/** Params to get an app client by ID from `ClientManager`. */
|
|
25
|
+
export type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>;
|
|
26
|
+
/** Params to get an app client by network from `ClientManager`. */
|
|
27
|
+
export type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>;
|
|
28
|
+
/** Params to get a typed app client by creator address and name from `ClientManager`. */
|
|
29
|
+
export type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
|
|
30
|
+
/** Params to get a typed app client by ID from `ClientManager`. */
|
|
31
|
+
export type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
|
|
32
|
+
/** Params to get a typed app client by network from `ClientManager`. */
|
|
33
|
+
export type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>;
|
|
34
|
+
/** Params to get a typed app factory from `ClientManager`. */
|
|
35
|
+
export type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>;
|
|
32
36
|
/** Exposes access to various API clients. */
|
|
33
37
|
export declare class ClientManager {
|
|
34
38
|
private _algod;
|
|
35
39
|
private _indexer?;
|
|
36
40
|
private _kmd?;
|
|
41
|
+
private _algorand?;
|
|
37
42
|
/**
|
|
38
43
|
* algosdk clients or config for interacting with the official Algorand APIs.
|
|
39
44
|
* @param clientsOrConfig The clients or config to use
|
|
@@ -54,11 +59,13 @@ export declare class ClientManager {
|
|
|
54
59
|
* const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
|
|
55
60
|
* ```
|
|
56
61
|
*/
|
|
57
|
-
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients);
|
|
62
|
+
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface);
|
|
58
63
|
/** Returns an algosdk Algod API client. */
|
|
59
64
|
get algod(): algosdk.Algodv2;
|
|
60
65
|
/** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
|
|
61
66
|
get indexer(): algosdk.Indexer;
|
|
67
|
+
/** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */
|
|
68
|
+
get indexerIfPresent(): algosdk.Indexer | undefined;
|
|
62
69
|
/** Returns an algosdk KMD API client or throws an error if it's not been provided. */
|
|
63
70
|
get kmd(): algosdk.Kmd;
|
|
64
71
|
private _getNetworkPromise;
|
|
@@ -95,10 +102,10 @@ export declare class ClientManager {
|
|
|
95
102
|
isMainNet(): Promise<boolean>;
|
|
96
103
|
/**
|
|
97
104
|
* Returns a TestNet Dispenser API client.
|
|
105
|
+
*
|
|
98
106
|
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
99
107
|
*
|
|
100
108
|
* @param params An object containing parameters for the TestNetDispenserApiClient class.
|
|
101
|
-
* Or null if you want the client to load the access token from the environment variable `ALGOKIT_DISPENSER_ACCESS_TOKEN`.
|
|
102
109
|
* @example
|
|
103
110
|
* const client = clientManager.getTestNetDispenser(
|
|
104
111
|
* {
|
|
@@ -109,35 +116,156 @@ export declare class ClientManager {
|
|
|
109
116
|
*
|
|
110
117
|
* @returns An instance of the TestNetDispenserApiClient class.
|
|
111
118
|
*/
|
|
112
|
-
getTestNetDispenser(params
|
|
119
|
+
getTestNetDispenser(params: TestNetDispenserApiClientParams): TestNetDispenserApiClient;
|
|
120
|
+
/**
|
|
121
|
+
* Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.
|
|
122
|
+
*
|
|
123
|
+
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
124
|
+
*
|
|
125
|
+
* @param params An object containing parameters for the TestNetDispenserApiClient class.
|
|
126
|
+
* @example
|
|
127
|
+
* const client = clientManager.getTestNetDispenserFromEnvironment(
|
|
128
|
+
* {
|
|
129
|
+
* requestTimeout: 15,
|
|
130
|
+
* }
|
|
131
|
+
* )
|
|
132
|
+
*
|
|
133
|
+
* @returns An instance of the TestNetDispenserApiClient class.
|
|
134
|
+
*/
|
|
135
|
+
getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
|
|
113
136
|
/**
|
|
114
|
-
* Returns a new `
|
|
115
|
-
* @
|
|
116
|
-
*
|
|
117
|
-
*
|
|
137
|
+
* Returns a new `AppFactory` client
|
|
138
|
+
* @example Basic example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const factory = algorand.client.getAppFactory({
|
|
141
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
|
|
142
|
+
* })
|
|
143
|
+
* ```
|
|
144
|
+
* @example Advanced example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const factory = algorand.client.getAppFactory({
|
|
147
|
+
* appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
|
|
148
|
+
* defaultSender: "SENDERADDRESS",
|
|
149
|
+
* appName: "OverriddenAppName",
|
|
150
|
+
* version: "2.0.0",
|
|
151
|
+
* updatable: true,
|
|
152
|
+
* deletable: false,
|
|
153
|
+
* deployTimeParams: { ONE: 1, TWO: 'value' }
|
|
154
|
+
* })
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
getAppFactory(params: ClientAppFactoryParams): AppFactory;
|
|
158
|
+
/**
|
|
159
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
160
|
+
* This method resolves the app ID by looking up the creator address and name
|
|
161
|
+
* using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
|
|
162
|
+
* @param params The parameters to create the app client
|
|
163
|
+
* @example Basic
|
|
164
|
+
* ```typescript
|
|
165
|
+
* const appClient = algorand.client.getAppClientByCreatorAndName({
|
|
166
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
167
|
+
* // appId resolved by looking for app ID of named app by this creator
|
|
168
|
+
* creatorAddress: 'CREATORADDRESS',
|
|
169
|
+
* })
|
|
170
|
+
* ```
|
|
171
|
+
* @returns The `AppClient`
|
|
118
172
|
*/
|
|
119
|
-
getAppClientByCreatorAndName(
|
|
173
|
+
getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
|
|
120
174
|
/**
|
|
121
|
-
* Returns a new `
|
|
122
|
-
* @param
|
|
123
|
-
* @
|
|
175
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
176
|
+
* @param params The parameters to create the app client
|
|
177
|
+
* @example Basic
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const appClient = algorand.client.getAppClientById({
|
|
180
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
181
|
+
* appId: 12345n,
|
|
182
|
+
* })
|
|
183
|
+
* ```
|
|
184
|
+
* @returns The `AppClient`
|
|
185
|
+
*/
|
|
186
|
+
getAppClientById(params: ClientAppClientParams): AppClient;
|
|
187
|
+
/**
|
|
188
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
|
|
189
|
+
* This method resolves the app ID for the current network based on
|
|
190
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
191
|
+
*
|
|
192
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
193
|
+
* @param params The parameters to create the app client
|
|
194
|
+
* @example Basic
|
|
195
|
+
* ```typescript
|
|
196
|
+
* const appClient = algorand.client.getAppClientByNetwork({
|
|
197
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
198
|
+
* // appId resolved by using ARC-56 spec to find app ID for current network
|
|
199
|
+
* })
|
|
200
|
+
* ```
|
|
201
|
+
* @returns The `AppClient`
|
|
124
202
|
*/
|
|
125
|
-
|
|
203
|
+
getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
|
|
126
204
|
/**
|
|
127
205
|
* Returns a new typed client, resolving the app by creator address and name.
|
|
128
206
|
* @param typedClient The typed client type to use
|
|
129
|
-
* @param
|
|
130
|
-
* @
|
|
207
|
+
* @param params The params to resolve the app by creator address and name
|
|
208
|
+
* @example Use name in ARC-32 / ARC-56 app spec
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
211
|
+
* creatorAddress: "CREATORADDRESS",
|
|
212
|
+
* defaultSender: alice,
|
|
213
|
+
* })
|
|
214
|
+
* ```
|
|
215
|
+
* @example Specify name
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
218
|
+
* creatorAddress: "CREATORADDRESS",
|
|
219
|
+
* name: "contract-name",
|
|
220
|
+
* defaultSender: alice,
|
|
221
|
+
* })
|
|
222
|
+
* ```
|
|
131
223
|
* @returns The typed client instance
|
|
132
224
|
*/
|
|
133
|
-
getTypedAppClientByCreatorAndName<TClient
|
|
225
|
+
getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientByCreatorAndNameParams): Promise<InstanceType<TClient>>;
|
|
134
226
|
/**
|
|
135
227
|
* Returns a new typed client, resolving the app by app ID.
|
|
136
228
|
* @param typedClient The typed client type to use
|
|
137
|
-
* @param
|
|
229
|
+
* @param params The params to resolve the app by ID
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
|
|
233
|
+
* appId: 12345n,
|
|
234
|
+
* defaultSender: alice,
|
|
235
|
+
* })
|
|
236
|
+
* ```
|
|
237
|
+
* @returns The typed client instance
|
|
238
|
+
*/
|
|
239
|
+
getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientParams): InstanceType<TClient>;
|
|
240
|
+
/**
|
|
241
|
+
* Returns a new typed client, resolves the app ID for the current network based on
|
|
242
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
243
|
+
*
|
|
244
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
245
|
+
* @param typedClient The typed client type to use
|
|
246
|
+
* @param params The params to resolve the app by network
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
|
|
250
|
+
* defaultSender: alice,
|
|
251
|
+
* })
|
|
252
|
+
* ```
|
|
138
253
|
* @returns The typed client instance
|
|
139
254
|
*/
|
|
140
|
-
|
|
255
|
+
getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params?: ClientTypedAppClientByNetworkParams): Promise<InstanceType<TClient>>;
|
|
256
|
+
/**
|
|
257
|
+
* Returns a new typed app factory.
|
|
258
|
+
* @param typedFactory The typed factory type to use
|
|
259
|
+
* @param params The params to resolve the factory by
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
|
|
263
|
+
* sender: alice,
|
|
264
|
+
* })
|
|
265
|
+
* ```
|
|
266
|
+
* @returns The typed client instance
|
|
267
|
+
*/
|
|
268
|
+
getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams): TClient;
|
|
141
269
|
/**
|
|
142
270
|
* Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
|
|
143
271
|
*
|
|
@@ -214,7 +342,6 @@ export declare class ClientManager {
|
|
|
214
342
|
* Returns an indexer SDK client that automatically retries on idempotent calls
|
|
215
343
|
*
|
|
216
344
|
* @param config The config of the client
|
|
217
|
-
* @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
|
|
218
345
|
* @example AlgoNode (testnet)
|
|
219
346
|
* ```typescript
|
|
220
347
|
* const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
|
|
@@ -230,16 +357,11 @@ export declare class ClientManager {
|
|
|
230
357
|
* const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
|
|
231
358
|
* await indexer.makeHealthCheck().do()
|
|
232
359
|
* ```
|
|
233
|
-
* @example Override int decoding for responses
|
|
234
|
-
* ```typescript
|
|
235
|
-
* const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)
|
|
236
|
-
* ```
|
|
237
360
|
*/
|
|
238
|
-
static getIndexerClient(config: AlgoClientConfig
|
|
361
|
+
static getIndexerClient(config: AlgoClientConfig): Indexer;
|
|
239
362
|
/**
|
|
240
363
|
* Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
|
|
241
364
|
*
|
|
242
|
-
* @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers
|
|
243
365
|
* @example
|
|
244
366
|
*
|
|
245
367
|
* ```typescript
|
|
@@ -248,7 +370,7 @@ export declare class ClientManager {
|
|
|
248
370
|
* await indexer.makeHealthCheck().do()
|
|
249
371
|
* ```
|
|
250
372
|
*/
|
|
251
|
-
static getIndexerClientFromEnvironment(
|
|
373
|
+
static getIndexerClientFromEnvironment(): Indexer;
|
|
252
374
|
/**
|
|
253
375
|
* Returns a KMD SDK client.
|
|
254
376
|
*
|
|
@@ -276,22 +398,13 @@ export declare class ClientManager {
|
|
|
276
398
|
* Interface to identify a typed client that can be used to interact with an application.
|
|
277
399
|
*/
|
|
278
400
|
export interface TypedAppClient<TClient> {
|
|
279
|
-
new (
|
|
401
|
+
new (params: Omit<AppClientParams, 'appSpec'>): TClient;
|
|
402
|
+
fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>;
|
|
403
|
+
fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>;
|
|
280
404
|
}
|
|
281
405
|
/**
|
|
282
|
-
*
|
|
406
|
+
* Interface to identify a typed factory that can be used to create and deploy an application.
|
|
283
407
|
*/
|
|
284
|
-
export
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
*/
|
|
288
|
-
export type TypedAppClientByCreatorAndNameDetails = AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
|
|
289
|
-
/**
|
|
290
|
-
* Details to resolve an app client by app ID.
|
|
291
|
-
*/
|
|
292
|
-
export type AppClientByIdDetails = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
|
|
293
|
-
/**
|
|
294
|
-
* Details to resolve a typed app by app ID.
|
|
295
|
-
*/
|
|
296
|
-
export type TypedAppClientByIdDetails = AppDetailsBase & ResolveAppByIdBase;
|
|
297
|
-
//# sourceMappingURL=client-manager.d.ts.map
|
|
408
|
+
export interface TypedAppFactory<TClient> {
|
|
409
|
+
new (params: Omit<AppFactoryParams, 'appSpec'>): TClient;
|
|
410
|
+
}
|