@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.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/_virtual/_rolldown/runtime.js +33 -0
- package/_virtual/_rolldown/runtime.mjs +13 -0
- package/account/account.d.ts +25 -30
- package/account/account.js +151 -146
- package/account/account.js.map +1 -1
- package/account/account.mjs +149 -144
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +7 -2
- package/account/get-account-config-from-environment.js +19 -21
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs +19 -19
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +14 -12
- package/account/get-account.js +56 -59
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +56 -57
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +9 -5
- package/account/get-dispenser-account.js +20 -18
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +20 -16
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.d.ts +7 -3
- package/account/mnemonic-account.js +17 -17
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +15 -15
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +40 -35
- package/amount.js +33 -34
- package/amount.js.map +1 -1
- package/amount.mjs +33 -32
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +10 -6
- package/app-client.js +91 -86
- package/app-client.js.map +1 -1
- package/app-client.mjs +91 -84
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +26 -24
- package/app-deploy.js +235 -253
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +233 -251
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +45 -46
- package/app.js +253 -271
- package/app.js.map +1 -1
- package/app.mjs +249 -267
- package/app.mjs.map +1 -1
- package/asset.d.ts +16 -12
- package/asset.js +116 -122
- package/asset.js.map +1 -1
- package/asset.mjs +116 -120
- package/asset.mjs.map +1 -1
- package/config.d.ts +7 -2
- package/config.js +5 -7
- package/config.js.map +1 -1
- package/config.mjs +5 -4
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +5 -1
- package/debugging/debugging.js +11 -11
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +11 -9
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.d.ts +7 -2
- package/dispenser-client.js +23 -24
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +23 -22
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +27 -18
- package/index.js +140 -143
- package/index.mjs +27 -29
- package/indexer-lookup.d.ts +18 -11
- package/indexer-lookup.js +112 -120
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +105 -118
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +9 -7
- package/localnet/get-kmd-wallet-account.js +28 -26
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +28 -24
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +7 -5
- package/localnet/get-localnet-dispenser-account.js +17 -15
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +17 -13
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
- package/localnet/get-or-create-kmd-wallet-account.js +28 -26
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.d.ts +7 -3
- package/localnet/is-localnet.js +9 -10
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +9 -8
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +17 -15
- package/network-client.js +115 -116
- package/network-client.js.map +1 -1
- package/network-client.mjs +115 -114
- package/network-client.mjs.map +1 -1
- package/package.json +12 -3
- package/testing/account.d.ts +11 -9
- package/testing/account.js +31 -33
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +29 -31
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
- package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +9 -4
- package/testing/fixtures/algorand-fixture.js +67 -62
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +66 -59
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +7 -5
- package/testing/index.js +13 -18
- package/testing/index.mjs +7 -7
- package/testing/indexer.d.ts +5 -1
- package/testing/indexer.js +28 -37
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs +28 -35
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +41 -36
- package/testing/test-logger.js +71 -76
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +71 -74
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +30 -27
- package/testing/transaction-logger.js +77 -93
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs +74 -90
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +100 -111
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +97 -108
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
- package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +34 -35
- package/transaction/transaction.js +716 -914
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +713 -911
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +9 -5
- package/transfer/transfer-algos.js +26 -27
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +26 -25
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +11 -8
- package/transfer/transfer.js +94 -100
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +94 -98
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +432 -429
- package/types/account-manager.js +591 -602
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +587 -599
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +192 -202
- package/types/account.js +91 -88
- package/types/account.js.map +1 -1
- package/types/account.mjs +88 -86
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +15 -10
- package/types/algo-http-client-with-retry.js +70 -92
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +69 -90
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +778 -771
- package/types/algorand-client-transaction-creator.js +733 -732
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +732 -730
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +1090 -1360
- package/types/algorand-client-transaction-sender.js +930 -961
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +927 -959
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +239 -236
- package/types/algorand-client.js +322 -320
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +321 -318
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +47 -43
- package/types/amount.js +66 -70
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +63 -68
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +235 -272
- package/types/app-arc56.js +124 -170
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs +121 -168
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +1128 -2009
- package/types/app-client.js +1633 -1791
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1624 -1783
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +139 -141
- package/types/app-deployer.js +344 -384
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +341 -382
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +762 -932
- package/types/app-factory.js +496 -488
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +491 -484
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +304 -310
- package/types/app-manager.js +422 -475
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +419 -473
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +118 -117
- package/types/app-spec.js +125 -135
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +121 -132
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +229 -241
- package/types/app.js +36 -28
- package/types/app.js.map +1 -1
- package/types/app.mjs +33 -26
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +204 -199
- package/types/asset-manager.js +165 -174
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +164 -172
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +95 -91
- package/types/asset.js +0 -3
- package/types/asset.mjs +0 -2
- package/types/async-event-emitter.d.ts +18 -13
- package/types/async-event-emitter.js +37 -49
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +36 -47
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +453 -451
- package/types/client-manager.js +602 -598
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +597 -594
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1211 -1258
- package/types/composer.js +1436 -1498
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +1430 -1493
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +53 -48
- package/types/config.js +78 -77
- package/types/config.js.map +1 -1
- package/types/config.mjs +77 -75
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +25 -23
- package/types/debugging.js +9 -11
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +8 -9
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +57 -52
- package/types/dispenser-client.js +120 -141
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +119 -139
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +5 -3
- package/types/expand.js +0 -3
- package/types/expand.mjs +0 -2
- package/types/indexer.d.ts +104 -100
- package/types/indexer.js +36 -31
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +32 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +5 -3
- package/types/instance-of.js +0 -3
- package/types/instance-of.mjs +0 -2
- package/types/kmd-account-manager.d.ts +75 -70
- package/types/kmd-account-manager.js +150 -184
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +147 -182
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +13 -8
- package/types/lifecycle-events.js +10 -7
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +9 -7
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +15 -11
- package/types/logging.js +30 -31
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +29 -29
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +33 -29
- package/types/logic-error.js +50 -49
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +49 -47
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +32 -27
- package/types/network-client.js +10 -9
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -7
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +131 -132
- package/types/testing.js +0 -3
- package/types/testing.mjs +0 -2
- package/types/transaction.d.ts +110 -110
- package/types/transaction.js +0 -3
- package/types/transaction.mjs +0 -2
- package/types/transfer.d.ts +70 -66
- package/types/transfer.js +0 -3
- package/types/transfer.mjs +0 -2
- package/util.js +73 -118
- package/util.js.map +1 -1
- package/util.mjs +73 -116
- package/util.mjs.map +1 -1
- package/account/index.d.ts +0 -5
- package/debugging/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/localnet/index.d.ts +0 -4
- package/testing/_asset.d.ts +0 -3
- package/testing/fixtures/index.d.ts +0 -2
- package/testing/index.js.map +0 -1
- package/testing/index.mjs.map +0 -1
- package/transaction/index.d.ts +0 -2
- package/transaction/legacy-bridge.d.ts +0 -35
- package/transfer/index.d.ts +0 -2
- package/types/asset.js.map +0 -1
- package/types/asset.mjs.map +0 -1
- package/types/expand.js.map +0 -1
- package/types/expand.mjs.map +0 -1
- package/types/instance-of.js.map +0 -1
- package/types/instance-of.mjs.map +0 -1
- package/types/testing.js.map +0 -1
- package/types/testing.mjs.map +0 -1
- package/types/transaction.js.map +0 -1
- package/types/transaction.mjs.map +0 -1
- package/types/transfer.js.map +0 -1
- package/types/transfer.mjs.map +0 -1
- package/util.d.ts +0 -48
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var types_kmdAccountManager = require('../types/kmd-account-manager.js');
|
|
5
|
-
|
|
1
|
+
const require_client_manager = require("../types/client-manager.js");
|
|
2
|
+
const require_kmd_account_manager = require("../types/kmd-account-manager.js");
|
|
3
|
+
//#region src/localnet/get-kmd-wallet-account.ts
|
|
6
4
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
* @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.
|
|
6
|
+
*
|
|
7
|
+
* Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).
|
|
8
|
+
*
|
|
9
|
+
* @param walletAccount The details of the wallet, with:
|
|
10
|
+
* * `name`: The name of the wallet to retrieve an account from
|
|
11
|
+
* * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)
|
|
12
|
+
* @param algod An algod client
|
|
13
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
14
|
+
* @example Get default funded account in a LocalNet
|
|
15
|
+
*
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const defaultDispenserAccount = await getKmdWalletAccount(algod,
|
|
18
|
+
* 'unencrypted-default-wallet',
|
|
19
|
+
* a => a.status !== 'Offline' && a.amount > 1_000_000_000
|
|
20
|
+
* )
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
25
23
|
async function getKmdWalletAccount(walletAccount, algod, kmdClient) {
|
|
26
|
-
|
|
24
|
+
return (await new require_kmd_account_manager.KmdAccountManager(new require_client_manager.ClientManager({
|
|
25
|
+
algod,
|
|
26
|
+
kmd: kmdClient
|
|
27
|
+
})).getWalletAccount(walletAccount.name, walletAccount.predicate))?.account;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
//#endregion
|
|
29
30
|
exports.getKmdWalletAccount = getKmdWalletAccount;
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=get-kmd-wallet-account.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-kmd-wallet-account.js","sources":["../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-kmd-wallet-account.js","names":["KmdAccountManager","ClientManager"],"sources":["../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,eAAsB,oBACpB,eAKA,OACA,WAC8B;CAC9B,QACE,MAAM,IAAIA,4BAAAA,kBAAkB,IAAIC,uBAAAA,cAAc;EAAE;EAAO,KAAK;CAAU,CAAC,CAAC,CAAC,CAAC,iBAAiB,cAAc,MAAM,cAAc,SAAS,EAAA,EACrI;AACL"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { ClientManager } from
|
|
2
|
-
import { KmdAccountManager } from
|
|
3
|
-
|
|
1
|
+
import { ClientManager } from "../types/client-manager.mjs";
|
|
2
|
+
import { KmdAccountManager } from "../types/kmd-account-manager.mjs";
|
|
3
|
+
//#region src/localnet/get-kmd-wallet-account.ts
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
* @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.
|
|
6
|
+
*
|
|
7
|
+
* Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).
|
|
8
|
+
*
|
|
9
|
+
* @param walletAccount The details of the wallet, with:
|
|
10
|
+
* * `name`: The name of the wallet to retrieve an account from
|
|
11
|
+
* * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)
|
|
12
|
+
* @param algod An algod client
|
|
13
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
14
|
+
* @example Get default funded account in a LocalNet
|
|
15
|
+
*
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const defaultDispenserAccount = await getKmdWalletAccount(algod,
|
|
18
|
+
* 'unencrypted-default-wallet',
|
|
19
|
+
* a => a.status !== 'Offline' && a.amount > 1_000_000_000
|
|
20
|
+
* )
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
23
|
async function getKmdWalletAccount(walletAccount, algod, kmdClient) {
|
|
24
|
-
|
|
24
|
+
return (await new KmdAccountManager(new ClientManager({
|
|
25
|
+
algod,
|
|
26
|
+
kmd: kmdClient
|
|
27
|
+
})).getWalletAccount(walletAccount.name, walletAccount.predicate))?.account;
|
|
25
28
|
}
|
|
26
|
-
|
|
29
|
+
//#endregion
|
|
27
30
|
export { getKmdWalletAccount };
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=get-kmd-wallet-account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-kmd-wallet-account.mjs","sources":["../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-kmd-wallet-account.mjs","names":[],"sources":["../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,eAAsB,oBACpB,eAKA,OACA,WAC8B;CAC9B,QACE,MAAM,IAAI,kBAAkB,IAAI,cAAc;EAAE;EAAO,KAAK;CAAU,CAAC,CAAC,CAAC,CAAC,iBAAiB,cAAc,MAAM,cAAc,SAAS,EAAA,EACrI;AACL"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import algosdk from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import Kmd = algosdk.Kmd;
|
|
1
|
+
import algosdk from "algosdk";
|
|
2
|
+
|
|
3
|
+
//#region src/localnet/get-localnet-dispenser-account.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.
|
|
7
6
|
*
|
|
@@ -10,4 +9,7 @@ import Kmd = algosdk.Kmd;
|
|
|
10
9
|
* @param algod An algod client
|
|
11
10
|
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
declare function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getLocalNetDispenserAccount };
|
|
15
|
+
//# sourceMappingURL=get-localnet-dispenser-account.d.ts.map
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var types_clientManager = require('../types/client-manager.js');
|
|
5
|
-
|
|
1
|
+
const require_client_manager = require("../types/client-manager.js");
|
|
2
|
+
const require_account_manager = require("../types/account-manager.js");
|
|
3
|
+
//#region src/localnet/get-localnet-dispenser-account.ts
|
|
6
4
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
* @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.
|
|
6
|
+
*
|
|
7
|
+
* Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)
|
|
8
|
+
*
|
|
9
|
+
* @param algod An algod client
|
|
10
|
+
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
11
|
+
*/
|
|
14
12
|
async function getLocalNetDispenserAccount(algod, kmd) {
|
|
15
|
-
|
|
13
|
+
return (await new require_account_manager.AccountManager(new require_client_manager.ClientManager({
|
|
14
|
+
algod,
|
|
15
|
+
kmd
|
|
16
|
+
})).kmd.getLocalNetDispenserAccount()).account;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
//#endregion
|
|
18
19
|
exports.getLocalNetDispenserAccount = getLocalNetDispenserAccount;
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=get-localnet-dispenser-account.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-localnet-dispenser-account.js","sources":["../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-localnet-dispenser-account.js","names":["AccountManager","ClientManager"],"sources":["../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"mappings":";;;;;;;;;;;AAcA,eAAsB,4BAA4B,OAAgB,KAA6B;CAC7F,QAAQ,MAAM,IAAIA,wBAAAA,eAAe,IAAIC,uBAAAA,cAAc;EAAE;EAAO;CAAI,CAAC,CAAC,CAAC,CAAC,IAAI,4BAA4B,EAAA,CAAG;AACzG"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { ClientManager } from "../types/client-manager.mjs";
|
|
2
|
+
import { AccountManager } from "../types/account-manager.mjs";
|
|
3
|
+
//#region src/localnet/get-localnet-dispenser-account.ts
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
* @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.
|
|
6
|
+
*
|
|
7
|
+
* Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)
|
|
8
|
+
*
|
|
9
|
+
* @param algod An algod client
|
|
10
|
+
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
11
|
+
*/
|
|
12
12
|
async function getLocalNetDispenserAccount(algod, kmd) {
|
|
13
|
-
|
|
13
|
+
return (await new AccountManager(new ClientManager({
|
|
14
|
+
algod,
|
|
15
|
+
kmd
|
|
16
|
+
})).kmd.getLocalNetDispenserAccount()).account;
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
//#endregion
|
|
16
19
|
export { getLocalNetDispenserAccount };
|
|
17
|
-
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=get-localnet-dispenser-account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-localnet-dispenser-account.mjs","sources":["../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-localnet-dispenser-account.mjs","names":[],"sources":["../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"mappings":";;;;;;;;;;;AAcA,eAAsB,4BAA4B,OAAgB,KAA6B;CAC7F,QAAQ,MAAM,IAAI,eAAe,IAAI,cAAc;EAAE;EAAO;CAAI,CAAC,CAAC,CAAC,CAAC,IAAI,4BAA4B,EAAA,CAAG;AACzG"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import Kmd = algosdk.Kmd;
|
|
1
|
+
import { AlgoAmount } from "../types/amount.js";
|
|
2
|
+
import algosdk from "algosdk";
|
|
3
|
+
|
|
4
|
+
//#region src/localnet/get-or-create-kmd-wallet-account.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.
|
|
8
7
|
*
|
|
@@ -22,7 +21,10 @@ import Kmd = algosdk.Kmd;
|
|
|
22
21
|
*
|
|
23
22
|
* @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
declare function getOrCreateKmdWalletAccount(walletAccount: {
|
|
25
|
+
name: string;
|
|
26
|
+
fundWith?: AlgoAmount;
|
|
28
27
|
}, algod: Algodv2, kmdClient?: Kmd): Promise<Account>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { getOrCreateKmdWalletAccount };
|
|
30
|
+
//# sourceMappingURL=get-or-create-kmd-wallet-account.d.ts.map
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var types_kmdAccountManager = require('../types/kmd-account-manager.js');
|
|
5
|
-
|
|
1
|
+
const require_client_manager = require("../types/client-manager.js");
|
|
2
|
+
const require_kmd_account_manager = require("../types/kmd-account-manager.js");
|
|
3
|
+
//#region src/localnet/get-or-create-kmd-wallet-account.ts
|
|
6
4
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
* @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.
|
|
6
|
+
*
|
|
7
|
+
* Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.
|
|
8
|
+
*
|
|
9
|
+
* This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).
|
|
10
|
+
*
|
|
11
|
+
* This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.
|
|
12
|
+
*
|
|
13
|
+
* If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!
|
|
14
|
+
*
|
|
15
|
+
* @param walletAccount The wallet details with:
|
|
16
|
+
* * `name`: The name of the wallet to retrieve / create
|
|
17
|
+
* * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
|
|
18
|
+
* @param algod An algod client
|
|
19
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
20
|
+
*
|
|
21
|
+
* @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you
|
|
22
|
+
*/
|
|
25
23
|
async function getOrCreateKmdWalletAccount(walletAccount, algod, kmdClient) {
|
|
26
|
-
|
|
24
|
+
return (await new require_kmd_account_manager.KmdAccountManager(new require_client_manager.ClientManager({
|
|
25
|
+
algod,
|
|
26
|
+
kmd: kmdClient
|
|
27
|
+
})).getOrCreateWalletAccount(walletAccount.name, walletAccount.fundWith)).account;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
//#endregion
|
|
29
30
|
exports.getOrCreateKmdWalletAccount = getOrCreateKmdWalletAccount;
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=get-or-create-kmd-wallet-account.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-or-create-kmd-wallet-account.js","sources":["../../src/localnet/get-or-create-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.\n *\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param walletAccount The wallet details with:\n * * `name`: The name of the wallet to retrieve / create\n * * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\nexport async function getOrCreateKmdWalletAccount(\n walletAccount: { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getOrCreateWalletAccount(\n walletAccount.name,\n walletAccount.fundWith,\n )\n ).account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-or-create-kmd-wallet-account.js","names":["KmdAccountManager","ClientManager"],"sources":["../../src/localnet/get-or-create-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.\n *\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param walletAccount The wallet details with:\n * * `name`: The name of the wallet to retrieve / create\n * * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\nexport async function getOrCreateKmdWalletAccount(\n walletAccount: { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getOrCreateWalletAccount(\n walletAccount.name,\n walletAccount.fundWith,\n )\n ).account\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA,eAAsB,4BACpB,eACA,OACA,WACkB;CAClB,QACE,MAAM,IAAIA,4BAAAA,kBAAkB,IAAIC,uBAAAA,cAAc;EAAE;EAAO,KAAK;CAAU,CAAC,CAAC,CAAC,CAAC,yBACxE,cAAc,MACd,cAAc,QAChB,EAAA,CACA;AACJ"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { ClientManager } from
|
|
2
|
-
import { KmdAccountManager } from
|
|
3
|
-
|
|
1
|
+
import { ClientManager } from "../types/client-manager.mjs";
|
|
2
|
+
import { KmdAccountManager } from "../types/kmd-account-manager.mjs";
|
|
3
|
+
//#region src/localnet/get-or-create-kmd-wallet-account.ts
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
* @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.
|
|
6
|
+
*
|
|
7
|
+
* Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.
|
|
8
|
+
*
|
|
9
|
+
* This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).
|
|
10
|
+
*
|
|
11
|
+
* This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.
|
|
12
|
+
*
|
|
13
|
+
* If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!
|
|
14
|
+
*
|
|
15
|
+
* @param walletAccount The wallet details with:
|
|
16
|
+
* * `name`: The name of the wallet to retrieve / create
|
|
17
|
+
* * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
|
|
18
|
+
* @param algod An algod client
|
|
19
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
20
|
+
*
|
|
21
|
+
* @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you
|
|
22
|
+
*/
|
|
23
23
|
async function getOrCreateKmdWalletAccount(walletAccount, algod, kmdClient) {
|
|
24
|
-
|
|
24
|
+
return (await new KmdAccountManager(new ClientManager({
|
|
25
|
+
algod,
|
|
26
|
+
kmd: kmdClient
|
|
27
|
+
})).getOrCreateWalletAccount(walletAccount.name, walletAccount.fundWith)).account;
|
|
25
28
|
}
|
|
26
|
-
|
|
29
|
+
//#endregion
|
|
27
30
|
export { getOrCreateKmdWalletAccount };
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=get-or-create-kmd-wallet-account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-or-create-kmd-wallet-account.mjs","sources":["../../src/localnet/get-or-create-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.\n *\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param walletAccount The wallet details with:\n * * `name`: The name of the wallet to retrieve / create\n * * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\nexport async function getOrCreateKmdWalletAccount(\n walletAccount: { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getOrCreateWalletAccount(\n walletAccount.name,\n walletAccount.fundWith,\n )\n ).account\n}\n"],"
|
|
1
|
+
{"version":3,"file":"get-or-create-kmd-wallet-account.mjs","names":[],"sources":["../../src/localnet/get-or-create-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getOrCreateWalletAccount(name, fundWith)` or `new KMDAccountManager(clientManager).getOrCreateWalletAccount(name, fundWith)` instead.\n *\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param walletAccount The wallet details with:\n * * `name`: The name of the wallet to retrieve / create\n * * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\nexport async function getOrCreateKmdWalletAccount(\n walletAccount: { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getOrCreateWalletAccount(\n walletAccount.name,\n walletAccount.fundWith,\n )\n ).account\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA,eAAsB,4BACpB,eACA,OACA,WACkB;CAClB,QACE,MAAM,IAAI,kBAAkB,IAAI,cAAc;EAAE;EAAO,KAAK;CAAU,CAAC,CAAC,CAAC,CAAC,yBACxE,cAAc,MACd,cAAc,QAChB,EAAA,CACA;AACJ"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import algosdk from
|
|
2
|
-
|
|
1
|
+
import algosdk from "algosdk";
|
|
2
|
+
|
|
3
|
+
//#region src/localnet/is-localnet.d.ts
|
|
3
4
|
/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.
|
|
4
5
|
*
|
|
5
6
|
* Returns true if the algod client is pointing to a LocalNet Algorand network
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
declare function isLocalNet(algod: Algodv2): Promise<boolean>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { isLocalNet };
|
|
11
|
+
//# sourceMappingURL=is-localnet.d.ts.map
|
package/localnet/is-localnet.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var types_clientManager = require('../types/client-manager.js');
|
|
4
|
-
|
|
1
|
+
const require_client_manager = require("../types/client-manager.js");
|
|
2
|
+
//#region src/localnet/is-localnet.ts
|
|
5
3
|
/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
*
|
|
5
|
+
* Returns true if the algod client is pointing to a LocalNet Algorand network
|
|
6
|
+
*/
|
|
9
7
|
async function isLocalNet(algod) {
|
|
10
|
-
|
|
8
|
+
return await new require_client_manager.ClientManager({ algod }).isLocalNet();
|
|
11
9
|
}
|
|
12
|
-
|
|
10
|
+
//#endregion
|
|
13
11
|
exports.isLocalNet = isLocalNet;
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=is-localnet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localnet.js","sources":["../../src/localnet/is-localnet.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport Algodv2 = algosdk.Algodv2\n\n/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.\n *\n * Returns true if the algod client is pointing to a LocalNet Algorand network\n */\nexport async function isLocalNet(algod: Algodv2): Promise<boolean> {\n return await new ClientManager({ algod }).isLocalNet()\n}\n"],"
|
|
1
|
+
{"version":3,"file":"is-localnet.js","names":["ClientManager"],"sources":["../../src/localnet/is-localnet.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport Algodv2 = algosdk.Algodv2\n\n/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.\n *\n * Returns true if the algod client is pointing to a LocalNet Algorand network\n */\nexport async function isLocalNet(algod: Algodv2): Promise<boolean> {\n return await new ClientManager({ algod }).isLocalNet()\n}\n"],"mappings":";;;;;;AAQA,eAAsB,WAAW,OAAkC;CACjE,OAAO,MAAM,IAAIA,uBAAAA,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW;AACvD"}
|
package/localnet/is-localnet.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ClientManager } from
|
|
2
|
-
|
|
1
|
+
import { ClientManager } from "../types/client-manager.mjs";
|
|
2
|
+
//#region src/localnet/is-localnet.ts
|
|
3
3
|
/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
*
|
|
5
|
+
* Returns true if the algod client is pointing to a LocalNet Algorand network
|
|
6
|
+
*/
|
|
7
7
|
async function isLocalNet(algod) {
|
|
8
|
-
|
|
8
|
+
return await new ClientManager({ algod }).isLocalNet();
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
//#endregion
|
|
11
11
|
export { isLocalNet };
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=is-localnet.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-localnet.mjs","sources":["../../src/localnet/is-localnet.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport Algodv2 = algosdk.Algodv2\n\n/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.\n *\n * Returns true if the algod client is pointing to a LocalNet Algorand network\n */\nexport async function isLocalNet(algod: Algodv2): Promise<boolean> {\n return await new ClientManager({ algod }).isLocalNet()\n}\n"],"
|
|
1
|
+
{"version":3,"file":"is-localnet.mjs","names":[],"sources":["../../src/localnet/is-localnet.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport Algodv2 = algosdk.Algodv2\n\n/** @deprecated Use `await algorand.client.isLocalNet()` or `await new ClientManager({ algod }).isLocalNet()` instead.\n *\n * Returns true if the algod client is pointing to a LocalNet Algorand network\n */\nexport async function isLocalNet(algod: Algodv2): Promise<boolean> {\n return await new ClientManager({ algod }).isLocalNet()\n}\n"],"mappings":";;;;;;AAQA,eAAsB,WAAW,OAAkC;CACjE,OAAO,MAAM,IAAI,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW;AACvD"}
|
package/network-client.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import Kmd = algosdk.Kmd;
|
|
1
|
+
import { AlgoClientConfig, AlgoConfig } from "./types/network-client.js";
|
|
2
|
+
import algosdk from "algosdk";
|
|
3
|
+
|
|
4
|
+
//#region src/network-client.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* @deprecated Use `ClientManager.getConfigFromEnvironmentOrLocalNet()` instead.
|
|
8
7
|
*
|
|
9
8
|
* Retrieve configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment not algod-side)
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
declare function getConfigFromEnvOrDefaults(): AlgoConfig;
|
|
12
11
|
/**
|
|
13
12
|
* @deprecated Use `ClientManager.getAlgodConfigFromEnvironment()` instead.
|
|
14
13
|
*
|
|
15
14
|
* Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment not algod-side)
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
declare function getAlgodConfigFromEnvironment(): AlgoClientConfig;
|
|
18
17
|
/**
|
|
19
18
|
* @deprecated Use `ClientManager.getIndexerConfigFromEnvironment()` instead.
|
|
20
19
|
*
|
|
21
20
|
* Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment not algod-side)
|
|
22
21
|
*/
|
|
23
|
-
|
|
22
|
+
declare function getIndexerConfigFromEnvironment(): AlgoClientConfig;
|
|
24
23
|
/**
|
|
25
24
|
* @deprecated Use `ClientManager.getAlgoNodeConfig(network, config)` instead.
|
|
26
25
|
*
|
|
@@ -29,7 +28,7 @@ export declare function getIndexerConfigFromEnvironment(): AlgoClientConfig;
|
|
|
29
28
|
* @param network Which network to connect to - TestNet or MainNet
|
|
30
29
|
* @param config Which algod config to return - Algod or Indexer
|
|
31
30
|
*/
|
|
32
|
-
|
|
31
|
+
declare function getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig;
|
|
33
32
|
/**
|
|
34
33
|
* @deprecated Use `ClientManager.getDefaultLocalNetConfig(configOrPort)` instead.
|
|
35
34
|
*
|
|
@@ -37,7 +36,7 @@ export declare function getAlgoNodeConfig(network: 'testnet' | 'mainnet', config
|
|
|
37
36
|
*
|
|
38
37
|
* @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
declare function getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig;
|
|
41
40
|
/**
|
|
42
41
|
* @deprecated Use `ClientManager.getAlgodClient(config)` or `ClientManager.getAlgodClientFromEnvironment()` instead.
|
|
43
42
|
*
|
|
@@ -68,7 +67,7 @@ export declare function getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexe
|
|
|
68
67
|
* await algod.healthCheck().do()
|
|
69
68
|
* ```
|
|
70
69
|
*/
|
|
71
|
-
|
|
70
|
+
declare function getAlgoClient(config?: AlgoClientConfig): Algodv2;
|
|
72
71
|
/**
|
|
73
72
|
* @deprecated Use `ClientManager.getIndexerClient(config, overrideIntDecoding)` or `ClientManager.getIndexerClientFromEnvironment(overrideIntDecoding)` instead.
|
|
74
73
|
*
|
|
@@ -98,7 +97,7 @@ export declare function getAlgoClient(config?: AlgoClientConfig): Algodv2;
|
|
|
98
97
|
* await indexer.makeHealthCheck().do()
|
|
99
98
|
* ```
|
|
100
99
|
*/
|
|
101
|
-
|
|
100
|
+
declare function getAlgoIndexerClient(config?: AlgoClientConfig): Indexer;
|
|
102
101
|
/**
|
|
103
102
|
* @deprecated Use `ClientManager.getKmdClient(config)` or `ClientManager.getKmdClientFromEnvironment()` instead.
|
|
104
103
|
*
|
|
@@ -118,8 +117,11 @@ export declare function getAlgoIndexerClient(config?: AlgoClientConfig): Indexer
|
|
|
118
117
|
* const kmd = getAlgoKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
|
|
119
118
|
* ```
|
|
120
119
|
*/
|
|
121
|
-
|
|
120
|
+
declare function getAlgoKmdClient(config?: AlgoClientConfig): Kmd;
|
|
122
121
|
/** @deprecated Use `await algorand.client.isTestNet()` or `await new ClientManager({ algod }).isTestNet()` instead. */
|
|
123
|
-
|
|
122
|
+
declare function isTestNet(algod: Algodv2): Promise<boolean>;
|
|
124
123
|
/** @deprecated Use `await algorand.client.isMainNet()` or `await new ClientManager({ algod }).isMainNet()` instead. */
|
|
125
|
-
|
|
124
|
+
declare function isMainNet(algod: Algodv2): Promise<boolean>;
|
|
125
|
+
//#endregion
|
|
126
|
+
export { getAlgoClient, getAlgoIndexerClient, getAlgoKmdClient, getAlgoNodeConfig, getAlgodConfigFromEnvironment, getConfigFromEnvOrDefaults, getDefaultLocalNetConfig, getIndexerConfigFromEnvironment, isMainNet, isTestNet };
|
|
127
|
+
//# sourceMappingURL=network-client.d.ts.map
|