@algorandfoundation/algokit-utils 7.0.0-beta.2 → 7.0.0-beta.20
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 +3 -25
- package/account/account.d.ts +1 -2
- package/account/account.js +6 -4
- package/account/account.js.map +1 -1
- package/account/account.mjs +6 -4
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +0 -1
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +0 -1
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +0 -1
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/index.d.ts +0 -1
- package/account/mnemonic-account.d.ts +0 -1
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +14 -5
- package/amount.js +6 -0
- package/amount.js.map +1 -1
- package/amount.mjs +6 -0
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +15 -1
- package/app-client.js +15 -0
- package/app-client.js.map +1 -1
- package/app-client.mjs +15 -0
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +0 -1
- package/app-deploy.js +4 -6
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +7 -9
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +10 -11
- package/app.js +15 -11
- package/app.js.map +1 -1
- package/app.mjs +15 -11
- package/app.mjs.map +1 -1
- package/asset.d.ts +3 -4
- package/asset.js +3 -6
- package/asset.js.map +1 -1
- package/asset.mjs +3 -6
- package/asset.mjs.map +1 -1
- package/config.d.ts +0 -1
- package/config.js.map +1 -1
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +3 -5
- package/debugging/debugging.js +4 -128
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +4 -109
- package/debugging/debugging.mjs.map +1 -1
- package/debugging/index.d.ts +0 -2
- package/dispenser-client.d.ts +0 -1
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +6 -5
- package/index.js +48 -38
- package/index.js.map +1 -1
- package/index.mjs +6 -5
- package/index.mjs.map +1 -1
- package/indexer-lookup.d.ts +0 -1
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +0 -1
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +0 -1
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/index.d.ts +0 -1
- package/localnet/is-localnet.d.ts +0 -1
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +0 -1
- package/network-client.js.map +1 -1
- package/network-client.mjs.map +1 -1
- package/package.json +2 -2
- package/testing/_asset.d.ts +0 -1
- package/testing/account.d.ts +0 -1
- package/testing/account.js.map +1 -1
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +0 -1
- package/testing/fixtures/algorand-fixture.js +1 -1
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/fixtures/index.d.ts +0 -1
- package/testing/index.d.ts +0 -1
- package/testing/indexer.d.ts +0 -1
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +0 -1
- package/testing/test-logger.js +1 -3
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +1 -3
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +0 -1
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/index.d.ts +0 -1
- package/transaction/legacy-bridge.d.ts +5 -6
- package/transaction/legacy-bridge.js +1 -1
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +4 -4
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +41 -6
- package/transaction/transaction.js +113 -61
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +113 -62
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/index.d.ts +0 -1
- package/transfer/transfer-algos.d.ts +1 -2
- package/transfer/transfer-algos.js +1 -1
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +1 -1
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +1 -2
- package/transfer/transfer.js +3 -3
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +3 -3
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +15 -7
- package/types/account-manager.js +27 -11
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +29 -13
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +9 -1
- package/types/account.js.map +1 -1
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +0 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- 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 +33 -34
- package/types/algorand-client-transaction-creator.js +31 -31
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +31 -31
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +31 -32
- package/types/algorand-client-transaction-sender.js +25 -9
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +25 -9
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +13 -13
- package/types/algorand-client.js +10 -10
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +12 -12
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +10 -11
- package/types/amount.js +7 -7
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +7 -7
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +358 -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 +1488 -8
- package/types/app-client.js +1000 -19
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1000 -20
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +19 -14
- package/types/app-deployer.js +25 -25
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +27 -27
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +846 -0
- package/types/app-factory.js +411 -0
- package/types/app-factory.js.map +1 -0
- package/types/app-factory.mjs +409 -0
- package/types/app-factory.mjs.map +1 -0
- package/types/app-manager.d.ts +12 -3
- package/types/app-manager.js +13 -15
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +13 -15
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +2 -1
- package/types/app-spec.js +121 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +120 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +14 -9
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +7 -7
- package/types/asset-manager.js +5 -6
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +5 -6
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +0 -1
- package/types/async-event-emitter.d.ts +14 -0
- package/types/async-event-emitter.js +50 -0
- package/types/async-event-emitter.js.map +1 -0
- package/types/async-event-emitter.mjs +48 -0
- package/types/async-event-emitter.mjs.map +1 -0
- package/types/client-manager.d.ts +131 -51
- package/types/client-manager.js +143 -23
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +144 -24
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +110 -37
- package/types/composer.js +139 -26
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +140 -27
- 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 +1 -2
- package/types/dispenser-client.js +6 -5
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +6 -5
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +0 -1
- package/types/indexer.d.ts +0 -1
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +0 -1
- package/types/kmd-account-manager.js +2 -2
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +4 -4
- 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 +13 -1
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +3 -4
- package/types/transaction.d.ts +14 -4
- package/types/transfer.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.js +1 -1
- package/types/urlTokenBaseHTTPClient.js.map +1 -1
- package/types/urlTokenBaseHTTPClient.mjs +1 -1
- package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
- package/util.d.ts +2 -2
- package/util.js +11 -10
- package/util.js.map +1 -1
- package/util.mjs +11 -10
- package/util.mjs.map +1 -1
- package/account/account.d.ts.map +0 -1
- package/account/get-account-config-from-environment.d.ts.map +0 -1
- package/account/get-account.d.ts.map +0 -1
- package/account/get-dispenser-account.d.ts.map +0 -1
- package/account/index.d.ts.map +0 -1
- package/account/mnemonic-account.d.ts.map +0 -1
- package/amount.d.ts.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app.d.ts.map +0 -1
- package/asset.d.ts.map +0 -1
- package/config.d.ts.map +0 -1
- package/debugging/debugging.d.ts.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/index.d.ts.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/index.d.ts.map +0 -1
- package/localnet/is-localnet.d.ts.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/testing/_asset.d.ts.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.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/test-logger.d.ts.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/transaction/index.d.ts.map +0 -1
- package/transaction/legacy-bridge.d.ts.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
- package/transaction/transaction.d.ts.map +0 -1
- package/transfer/index.d.ts.map +0 -1
- package/transfer/transfer-algos.d.ts.map +0 -1
- package/transfer/transfer.d.ts.map +0 -1
- package/types/account-manager.d.ts.map +0 -1
- package/types/account.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algorand-client-transaction-creator.d.ts.map +0 -1
- package/types/algorand-client-transaction-sender.d.ts.map +0 -1
- package/types/algorand-client.d.ts.map +0 -1
- package/types/amount.d.ts.map +0 -1
- package/types/app-client.d.ts.map +0 -1
- package/types/app-deployer.d.ts.map +0 -1
- package/types/app-manager.d.ts.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.d.ts.map +0 -1
- package/types/asset-manager.d.ts.map +0 -1
- package/types/asset.d.ts.map +0 -1
- package/types/client-manager.d.ts.map +0 -1
- package/types/composer.d.ts.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/debugging.d.ts.map +0 -1
- package/types/dispenser-client.d.ts.map +0 -1
- package/types/expand.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.map +0 -1
- package/util.d.ts.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
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;
|
|
@@ -16,24 +18,28 @@ export interface AlgoSdkClients {
|
|
|
16
18
|
/** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */
|
|
17
19
|
kmd?: algosdk.Kmd;
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
/** Params to get an app factory from `ClientManager`. */
|
|
22
|
+
export type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>;
|
|
23
|
+
/** Params to get an app client by creator address and name from `ClientManager`. */
|
|
24
|
+
export type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>;
|
|
25
|
+
/** Params to get an app client by ID from `ClientManager`. */
|
|
26
|
+
export type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>;
|
|
27
|
+
/** Params to get an app client by network from `ClientManager`. */
|
|
28
|
+
export type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>;
|
|
29
|
+
/** Params to get a typed app client by creator address and name from `ClientManager`. */
|
|
30
|
+
export type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>;
|
|
31
|
+
/** Params to get a typed app client by ID from `ClientManager`. */
|
|
32
|
+
export type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>;
|
|
33
|
+
/** Params to get a typed app client by network from `ClientManager`. */
|
|
34
|
+
export type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>;
|
|
35
|
+
/** Params to get a typed app factory from `ClientManager`. */
|
|
36
|
+
export type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>;
|
|
32
37
|
/** Exposes access to various API clients. */
|
|
33
38
|
export declare class ClientManager {
|
|
34
39
|
private _algod;
|
|
35
40
|
private _indexer?;
|
|
36
41
|
private _kmd?;
|
|
42
|
+
private _algorand?;
|
|
37
43
|
/**
|
|
38
44
|
* algosdk clients or config for interacting with the official Algorand APIs.
|
|
39
45
|
* @param clientsOrConfig The clients or config to use
|
|
@@ -54,7 +60,7 @@ export declare class ClientManager {
|
|
|
54
60
|
* const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
|
|
55
61
|
* ```
|
|
56
62
|
*/
|
|
57
|
-
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients);
|
|
63
|
+
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface);
|
|
58
64
|
/** Returns an algosdk Algod API client. */
|
|
59
65
|
get algod(): algosdk.Algodv2;
|
|
60
66
|
/** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
|
|
@@ -129,28 +135,82 @@ export declare class ClientManager {
|
|
|
129
135
|
*/
|
|
130
136
|
getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
|
|
131
137
|
/**
|
|
132
|
-
* Returns a new `
|
|
133
|
-
* @
|
|
134
|
-
*
|
|
135
|
-
*
|
|
138
|
+
* Returns a new `AppFactory` client
|
|
139
|
+
* @example Basic example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const factory = algorand.client.getAppFactory({
|
|
142
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
|
|
143
|
+
* })
|
|
144
|
+
* ```
|
|
145
|
+
* @example Advanced example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const factory = algorand.client.getAppFactory({
|
|
148
|
+
* appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
|
|
149
|
+
* defaultSender: "SENDERADDRESS",
|
|
150
|
+
* appName: "OverriddenAppName",
|
|
151
|
+
* version: "2.0.0",
|
|
152
|
+
* updatable: true,
|
|
153
|
+
* deletable: false,
|
|
154
|
+
* deployTimeParams: { ONE: 1, TWO: 'value' }
|
|
155
|
+
* })
|
|
156
|
+
* ```
|
|
136
157
|
*/
|
|
137
|
-
|
|
158
|
+
getAppFactory(params: ClientAppFactoryParams): AppFactory;
|
|
138
159
|
/**
|
|
139
|
-
* Returns a new `
|
|
140
|
-
*
|
|
141
|
-
*
|
|
160
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
161
|
+
* This method resolves the app ID by looking up the creator address and name
|
|
162
|
+
* using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
|
|
163
|
+
* @param params The parameters to create the app client
|
|
164
|
+
* @example Basic
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const appClient = algorand.client.getAppClientByCreatorAndName({
|
|
167
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
168
|
+
* // appId resolved by looking for app ID of named app by this creator
|
|
169
|
+
* creatorAddress: 'CREATORADDRESS',
|
|
170
|
+
* })
|
|
171
|
+
* ```
|
|
172
|
+
* @returns The `AppClient`
|
|
142
173
|
*/
|
|
143
|
-
|
|
174
|
+
getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
|
|
175
|
+
/**
|
|
176
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
177
|
+
* @param params The parameters to create the app client
|
|
178
|
+
* @example Basic
|
|
179
|
+
* ```typescript
|
|
180
|
+
* const appClient = algorand.client.getAppClientById({
|
|
181
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
182
|
+
* appId: 12345n,
|
|
183
|
+
* })
|
|
184
|
+
* ```
|
|
185
|
+
* @returns The `AppClient`
|
|
186
|
+
*/
|
|
187
|
+
getAppClientById(params: ClientAppClientParams): AppClient;
|
|
188
|
+
/**
|
|
189
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
|
|
190
|
+
* This method resolves the app ID for the current network based on
|
|
191
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
192
|
+
*
|
|
193
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
194
|
+
* @param params The parameters to create the app client
|
|
195
|
+
* @example Basic
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const appClient = algorand.client.getAppClientByNetwork({
|
|
198
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
199
|
+
* // appId resolved by using ARC-56 spec to find app ID for current network
|
|
200
|
+
* })
|
|
201
|
+
* ```
|
|
202
|
+
* @returns The `AppClient`
|
|
203
|
+
*/
|
|
204
|
+
getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
|
|
144
205
|
/**
|
|
145
206
|
* Returns a new typed client, resolving the app by creator address and name.
|
|
146
207
|
* @param typedClient The typed client type to use
|
|
147
|
-
* @param
|
|
148
|
-
* @
|
|
149
|
-
* @example Use name in ARC-32 app spec
|
|
208
|
+
* @param params The params to resolve the app by creator address and name
|
|
209
|
+
* @example Use name in ARC-32 / ARC-56 app spec
|
|
150
210
|
* ```typescript
|
|
151
211
|
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
152
212
|
* creatorAddress: "CREATORADDRESS",
|
|
153
|
-
*
|
|
213
|
+
* defaultSender: alice,
|
|
154
214
|
* })
|
|
155
215
|
* ```
|
|
156
216
|
* @example Specify name
|
|
@@ -158,26 +218,55 @@ export declare class ClientManager {
|
|
|
158
218
|
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
159
219
|
* creatorAddress: "CREATORADDRESS",
|
|
160
220
|
* name: "contract-name",
|
|
161
|
-
*
|
|
221
|
+
* defaultSender: alice,
|
|
162
222
|
* })
|
|
163
223
|
* ```
|
|
164
224
|
* @returns The typed client instance
|
|
165
225
|
*/
|
|
166
|
-
getTypedAppClientByCreatorAndName<TClient
|
|
226
|
+
getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientByCreatorAndNameParams): Promise<InstanceType<TClient>>;
|
|
167
227
|
/**
|
|
168
228
|
* Returns a new typed client, resolving the app by app ID.
|
|
169
229
|
* @param typedClient The typed client type to use
|
|
170
|
-
* @param
|
|
230
|
+
* @param params The params to resolve the app by ID
|
|
171
231
|
* @example
|
|
172
232
|
* ```typescript
|
|
173
233
|
* const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
|
|
174
|
-
*
|
|
234
|
+
* appId: 12345n,
|
|
235
|
+
* defaultSender: alice,
|
|
236
|
+
* })
|
|
237
|
+
* ```
|
|
238
|
+
* @returns The typed client instance
|
|
239
|
+
*/
|
|
240
|
+
getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params: ClientTypedAppClientParams): InstanceType<TClient>;
|
|
241
|
+
/**
|
|
242
|
+
* Returns a new typed client, resolves the app ID for the current network based on
|
|
243
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
244
|
+
*
|
|
245
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
246
|
+
* @param typedClient The typed client type to use
|
|
247
|
+
* @param params The params to resolve the app by network
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
|
|
251
|
+
* defaultSender: alice,
|
|
252
|
+
* })
|
|
253
|
+
* ```
|
|
254
|
+
* @returns The typed client instance
|
|
255
|
+
*/
|
|
256
|
+
getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(typedClient: TClient, params?: ClientTypedAppClientByNetworkParams): Promise<InstanceType<TClient>>;
|
|
257
|
+
/**
|
|
258
|
+
* Returns a new typed app factory.
|
|
259
|
+
* @param typedFactory The typed factory type to use
|
|
260
|
+
* @param params The params to resolve the factory by
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
|
|
175
264
|
* sender: alice,
|
|
176
265
|
* })
|
|
177
266
|
* ```
|
|
178
267
|
* @returns The typed client instance
|
|
179
268
|
*/
|
|
180
|
-
|
|
269
|
+
getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams): TClient;
|
|
181
270
|
/**
|
|
182
271
|
* Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
|
|
183
272
|
*
|
|
@@ -316,22 +405,13 @@ export declare class ClientManager {
|
|
|
316
405
|
* Interface to identify a typed client that can be used to interact with an application.
|
|
317
406
|
*/
|
|
318
407
|
export interface TypedAppClient<TClient> {
|
|
319
|
-
new (
|
|
408
|
+
new (params: Omit<AppClientParams, 'appSpec'>): TClient;
|
|
409
|
+
fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>;
|
|
410
|
+
fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>;
|
|
320
411
|
}
|
|
321
412
|
/**
|
|
322
|
-
*
|
|
323
|
-
*/
|
|
324
|
-
export type AppClientByCreatorAndNameDetails = AppSpecAppDetailsBase & AppDetailsBase & Omit<ResolveAppByCreatorAndNameBase, 'findExistingUsing'>;
|
|
325
|
-
/**
|
|
326
|
-
* Details to resolve a typed app creator address and name.
|
|
413
|
+
* Interface to identify a typed factory that can be used to create and deploy an application.
|
|
327
414
|
*/
|
|
328
|
-
export
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
*/
|
|
332
|
-
export type AppClientByIdDetails = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase;
|
|
333
|
-
/**
|
|
334
|
-
* Details to resolve a typed app by app ID.
|
|
335
|
-
*/
|
|
336
|
-
export type TypedAppClientByIdDetails = AppDetailsBase & ResolveAppByIdBase;
|
|
337
|
-
//# sourceMappingURL=client-manager.d.ts.map
|
|
415
|
+
export interface TypedAppFactory<TClient> {
|
|
416
|
+
new (params: Omit<AppFactoryParams, 'appSpec'>): TClient;
|
|
417
|
+
}
|
package/types/client-manager.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
4
|
var types_algoHttpClientWithRetry = require('./algo-http-client-with-retry.js');
|
|
5
5
|
var types_appClient = require('./app-client.js');
|
|
6
|
+
var types_appFactory = require('./app-factory.js');
|
|
6
7
|
var types_dispenserClient = require('./dispenser-client.js');
|
|
7
8
|
var types_networkClient = require('./network-client.js');
|
|
8
9
|
|
|
@@ -31,7 +32,7 @@ class ClientManager {
|
|
|
31
32
|
* const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
|
-
constructor(clientsOrConfig) {
|
|
35
|
+
constructor(clientsOrConfig, algorandClient) {
|
|
35
36
|
const _clients = 'algod' in clientsOrConfig
|
|
36
37
|
? clientsOrConfig
|
|
37
38
|
: {
|
|
@@ -42,6 +43,7 @@ class ClientManager {
|
|
|
42
43
|
this._algod = _clients.algod;
|
|
43
44
|
this._indexer = _clients.indexer;
|
|
44
45
|
this._kmd = _clients.kmd;
|
|
46
|
+
this._algorand = algorandClient;
|
|
45
47
|
}
|
|
46
48
|
/** Returns an algosdk Algod API client. */
|
|
47
49
|
get algod() {
|
|
@@ -152,32 +154,105 @@ class ClientManager {
|
|
|
152
154
|
return new types_dispenserClient.TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined);
|
|
153
155
|
}
|
|
154
156
|
/**
|
|
155
|
-
* Returns a new `
|
|
156
|
-
* @
|
|
157
|
-
*
|
|
158
|
-
*
|
|
157
|
+
* Returns a new `AppFactory` client
|
|
158
|
+
* @example Basic example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const factory = algorand.client.getAppFactory({
|
|
161
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
|
|
162
|
+
* })
|
|
163
|
+
* ```
|
|
164
|
+
* @example Advanced example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const factory = algorand.client.getAppFactory({
|
|
167
|
+
* appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
|
|
168
|
+
* defaultSender: "SENDERADDRESS",
|
|
169
|
+
* appName: "OverriddenAppName",
|
|
170
|
+
* version: "2.0.0",
|
|
171
|
+
* updatable: true,
|
|
172
|
+
* deletable: false,
|
|
173
|
+
* deployTimeParams: { ONE: 1, TWO: 'value' }
|
|
174
|
+
* })
|
|
175
|
+
* ```
|
|
159
176
|
*/
|
|
160
|
-
|
|
161
|
-
|
|
177
|
+
getAppFactory(params) {
|
|
178
|
+
if (!this._algorand) {
|
|
179
|
+
throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
|
|
180
|
+
}
|
|
181
|
+
return new types_appFactory.AppFactory({ ...params, algorand: this._algorand });
|
|
162
182
|
}
|
|
163
183
|
/**
|
|
164
|
-
* Returns a new `
|
|
165
|
-
*
|
|
166
|
-
*
|
|
184
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
185
|
+
* This method resolves the app ID by looking up the creator address and name
|
|
186
|
+
* using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).
|
|
187
|
+
* @param params The parameters to create the app client
|
|
188
|
+
* @example Basic
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const appClient = algorand.client.getAppClientByCreatorAndName({
|
|
191
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
192
|
+
* // appId resolved by looking for app ID of named app by this creator
|
|
193
|
+
* creatorAddress: 'CREATORADDRESS',
|
|
194
|
+
* })
|
|
195
|
+
* ```
|
|
196
|
+
* @returns The `AppClient`
|
|
197
|
+
*/
|
|
198
|
+
getAppClientByCreatorAndName(params) {
|
|
199
|
+
if (!this._algorand) {
|
|
200
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
201
|
+
}
|
|
202
|
+
return types_appClient.AppClient.fromCreatorAndName({
|
|
203
|
+
...params,
|
|
204
|
+
algorand: this._algorand,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.
|
|
209
|
+
* @param params The parameters to create the app client
|
|
210
|
+
* @example Basic
|
|
211
|
+
* ```typescript
|
|
212
|
+
* const appClient = algorand.client.getAppClientById({
|
|
213
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
214
|
+
* appId: 12345n,
|
|
215
|
+
* })
|
|
216
|
+
* ```
|
|
217
|
+
* @returns The `AppClient`
|
|
218
|
+
*/
|
|
219
|
+
getAppClientById(params) {
|
|
220
|
+
if (!this._algorand) {
|
|
221
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
222
|
+
}
|
|
223
|
+
return new types_appClient.AppClient({ ...params, algorand: this._algorand });
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Returns a new `AppClient` client for managing calls and state for an ARC-56 app.
|
|
227
|
+
* This method resolves the app ID for the current network based on
|
|
228
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
229
|
+
*
|
|
230
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
231
|
+
* @param params The parameters to create the app client
|
|
232
|
+
* @example Basic
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const appClient = algorand.client.getAppClientByNetwork({
|
|
235
|
+
* appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
|
|
236
|
+
* // appId resolved by using ARC-56 spec to find app ID for current network
|
|
237
|
+
* })
|
|
238
|
+
* ```
|
|
239
|
+
* @returns The `AppClient`
|
|
167
240
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
241
|
+
async getAppClientByNetwork(params) {
|
|
242
|
+
if (!this._algorand) {
|
|
243
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
244
|
+
}
|
|
245
|
+
return types_appClient.AppClient.fromNetwork({ ...params, algorand: this._algorand });
|
|
170
246
|
}
|
|
171
247
|
/**
|
|
172
248
|
* Returns a new typed client, resolving the app by creator address and name.
|
|
173
249
|
* @param typedClient The typed client type to use
|
|
174
|
-
* @param
|
|
175
|
-
* @
|
|
176
|
-
* @example Use name in ARC-32 app spec
|
|
250
|
+
* @param params The params to resolve the app by creator address and name
|
|
251
|
+
* @example Use name in ARC-32 / ARC-56 app spec
|
|
177
252
|
* ```typescript
|
|
178
253
|
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
179
254
|
* creatorAddress: "CREATORADDRESS",
|
|
180
|
-
*
|
|
255
|
+
* defaultSender: alice,
|
|
181
256
|
* })
|
|
182
257
|
* ```
|
|
183
258
|
* @example Specify name
|
|
@@ -185,29 +260,74 @@ class ClientManager {
|
|
|
185
260
|
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
186
261
|
* creatorAddress: "CREATORADDRESS",
|
|
187
262
|
* name: "contract-name",
|
|
188
|
-
*
|
|
263
|
+
* defaultSender: alice,
|
|
189
264
|
* })
|
|
190
265
|
* ```
|
|
191
266
|
* @returns The typed client instance
|
|
192
267
|
*/
|
|
193
|
-
getTypedAppClientByCreatorAndName(typedClient,
|
|
194
|
-
|
|
268
|
+
async getTypedAppClientByCreatorAndName(typedClient, params) {
|
|
269
|
+
if (!this._algorand) {
|
|
270
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
271
|
+
}
|
|
272
|
+
return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand });
|
|
195
273
|
}
|
|
196
274
|
/**
|
|
197
275
|
* Returns a new typed client, resolving the app by app ID.
|
|
198
276
|
* @param typedClient The typed client type to use
|
|
199
|
-
* @param
|
|
277
|
+
* @param params The params to resolve the app by ID
|
|
200
278
|
* @example
|
|
201
279
|
* ```typescript
|
|
202
280
|
* const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
|
|
203
|
-
*
|
|
281
|
+
* appId: 12345n,
|
|
282
|
+
* defaultSender: alice,
|
|
283
|
+
* })
|
|
284
|
+
* ```
|
|
285
|
+
* @returns The typed client instance
|
|
286
|
+
*/
|
|
287
|
+
getTypedAppClientById(typedClient, params) {
|
|
288
|
+
if (!this._algorand) {
|
|
289
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
290
|
+
}
|
|
291
|
+
return new typedClient({ ...params, algorand: this._algorand });
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Returns a new typed client, resolves the app ID for the current network based on
|
|
295
|
+
* pre-determined network-specific app IDs specified in the ARC-56 app spec.
|
|
296
|
+
*
|
|
297
|
+
* If no IDs are in the app spec or the network isn't recognised, an error is thrown.
|
|
298
|
+
* @param typedClient The typed client type to use
|
|
299
|
+
* @param params The params to resolve the app by network
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
|
|
303
|
+
* defaultSender: alice,
|
|
304
|
+
* })
|
|
305
|
+
* ```
|
|
306
|
+
* @returns The typed client instance
|
|
307
|
+
*/
|
|
308
|
+
getTypedAppClientByNetwork(typedClient, params) {
|
|
309
|
+
if (!this._algorand) {
|
|
310
|
+
throw new Error('Attempt to get app client from a ClientManager without an Algorand client');
|
|
311
|
+
}
|
|
312
|
+
return typedClient.fromNetwork({ ...params, algorand: this._algorand });
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Returns a new typed app factory.
|
|
316
|
+
* @param typedFactory The typed factory type to use
|
|
317
|
+
* @param params The params to resolve the factory by
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
|
|
204
321
|
* sender: alice,
|
|
205
322
|
* })
|
|
206
323
|
* ```
|
|
207
324
|
* @returns The typed client instance
|
|
208
325
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
326
|
+
getTypedAppFactory(typedFactory, params) {
|
|
327
|
+
if (!this._algorand) {
|
|
328
|
+
throw new Error('Attempt to get app factory from a ClientManager without an Algorand client');
|
|
329
|
+
}
|
|
330
|
+
return new typedFactory({ ...params, algorand: this._algorand });
|
|
211
331
|
}
|
|
212
332
|
/**
|
|
213
333
|
* Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-manager.js","sources":["../../src/types/client-manager.ts"],"sourcesContent":[null],"names":["genesisIdIsLocalNet","TestNetDispenserApiClient","ApplicationClient","AlgoHttpClientWithRetry"],"mappings":";;;;;;;;AAcA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AA0BxC;MACa,aAAa,CAAA;AAKxB;;;;;;;;;;;;;;;;;;;AAmBG;AACH,IAAA,WAAA,CAAY,eAA4C,EAAA;AACtD,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB,cAAE,eAAe;AACjB,cAAE;gBACE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,CAAC;AAChE,gBAAA,OAAO,EAAE,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC,gBAAgB,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,SAAS;AAClH,gBAAA,GAAG,EAAE,eAAe,CAAC,SAAS,GAAG,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,SAAS;aACnG,CAAA;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAA;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;AAChC,QAAA,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAA;KACzB;;AAGD,IAAA,IAAW,KAAK,GAAA;QACd,OAAO,IAAI,CAAC,MAAM,CAAA;KACnB;;AAGD,IAAA,IAAW,OAAO,GAAA;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAA;QACnH,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C,KAAK,CAAC,CAAA;AAChE,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;;;;;AAWG;IACI,OAAO,+BAA+B,CAAC,mBAAiC,EAAA;QAC7E,OAAO,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,+BAA+B,EAAE,EAAE,mBAAmB,CAAC,CAAA;KAC5G;AAED;;;;;;;;;;AAUG;IACI,OAAO,YAAY,CAAC,MAAwB,EAAA;QACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;QACtC,OAAO,IAAI,GAAG,CAAC,KAAe,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;KAC9C;AAED;;;;;;;;AAQG;AACI,IAAA,OAAO,2BAA2B,GAAA;;;QAGvC,OAAO,aAAa,CAAC,YAAY,CAAC,EAAE,GAAG,aAAa,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAA;KAChI;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"client-manager.js","sources":["../../src/types/client-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { SuggestedParamsWithMinFee } from 'algosdk/dist/types/types/transactions/base'\nimport { AlgoHttpClientWithRetry } from './algo-http-client-with-retry'\nimport { AlgorandClientInterface } from './algorand-client-interface'\nimport { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client'\nimport { AppFactory, AppFactoryParams } from './app-factory'\nimport { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client'\nimport { Expand } from './expand'\nimport { AlgoClientConfig, AlgoConfig, NetworkDetails, genesisIdIsLocalNet } from './network-client'\nimport Kmd = algosdk.Kmd\nimport Indexer = algosdk.Indexer\nimport Algodv2 = algosdk.Algodv2\nimport IntDecoding = algosdk.IntDecoding\n\n/** Clients from algosdk that interact with the official Algorand APIs */\nexport interface AlgoSdkClients {\n /** Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ */\n algod: algosdk.Algodv2\n /** Optional indexer client, see https://developer.algorand.org/docs/rest-apis/indexer/ */\n indexer?: algosdk.Indexer\n /** Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ */\n kmd?: algosdk.Kmd\n}\n\n/** Params to get an app factory from `ClientManager`. */\nexport type ClientAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand'>>\n\n/** Params to get an app client by creator address and name from `ClientManager`. */\nexport type ClientResolveAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand'>>\n\n/** Params to get an app client by ID from `ClientManager`. */\nexport type ClientAppClientParams = Expand<Omit<AppClientParams, 'algorand'>>\n\n/** Params to get an app client by network from `ClientManager`. */\nexport type ClientAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appId'>>\n\n/** Params to get a typed app client by creator address and name from `ClientManager`. */\nexport type ClientTypedAppClientByCreatorAndNameParams = Expand<Omit<ResolveAppClientByCreatorAndName, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by ID from `ClientManager`. */\nexport type ClientTypedAppClientParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec'>>\n\n/** Params to get a typed app client by network from `ClientManager`. */\nexport type ClientTypedAppClientByNetworkParams = Expand<Omit<AppClientParams, 'algorand' | 'appSpec' | 'appId'>>\n\n/** Params to get a typed app factory from `ClientManager`. */\nexport type ClientTypedAppFactoryParams = Expand<Omit<AppFactoryParams, 'algorand' | 'appSpec'>>\n\n/** Exposes access to various API clients. */\nexport class ClientManager {\n private _algod: algosdk.Algodv2\n private _indexer?: algosdk.Indexer\n private _kmd?: algosdk.Kmd\n private _algorand?: AlgorandClientInterface\n\n /**\n * algosdk clients or config for interacting with the official Algorand APIs.\n * @param clientsOrConfig The clients or config to use\n * @example Algod client only\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient })\n * ```\n * @example All clients\n * ```typescript\n * const clientManager = new ClientManager({ algod: algodClient, indexer: indexerClient, kmd: kmdClient })\n * ```\n * @example Algod config only\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig })\n * ```\n * @example All client configs\n * ```typescript\n * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })\n * ```\n */\n constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface) {\n const _clients =\n 'algod' in clientsOrConfig\n ? clientsOrConfig\n : {\n algod: ClientManager.getAlgodClient(clientsOrConfig.algodConfig),\n indexer: clientsOrConfig.indexerConfig ? ClientManager.getIndexerClient(clientsOrConfig.indexerConfig) : undefined,\n kmd: clientsOrConfig.kmdConfig ? ClientManager.getKmdClient(clientsOrConfig.kmdConfig) : undefined,\n }\n this._algod = _clients.algod\n this._indexer = _clients.indexer\n this._kmd = _clients.kmd\n this._algorand = algorandClient\n }\n\n /** Returns an algosdk Algod API client. */\n public get algod(): algosdk.Algodv2 {\n return this._algod\n }\n\n /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */\n public get indexer(): algosdk.Indexer {\n if (!this._indexer) throw new Error('Attempt to use Indexer client in AlgoKit instance with no Indexer configured')\n return this._indexer\n }\n\n /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */\n public get indexerIfPresent(): algosdk.Indexer | undefined {\n return this._indexer\n }\n\n /** Returns an algosdk KMD API client or throws an error if it's not been provided. */\n public get kmd(): algosdk.Kmd {\n if (!this._kmd) throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n return this._kmd\n }\n\n private _getNetworkPromise: Promise<SuggestedParamsWithMinFee> | undefined\n /**\n * Get details about the current network.\n * @example Getting genesis ID\n * ```typescript\n * const network = await networkClient.network()\n * const genesisId = network.genesisId\n * ```\n * @returns The current network details\n */\n public async network(): Promise<NetworkDetails> {\n if (!this._getNetworkPromise) {\n this._getNetworkPromise = this._algod.getTransactionParams().do()\n }\n\n const params = await this._getNetworkPromise\n return {\n isTestNet: ['testnet-v1.0', 'testnet-v1', 'testnet'].includes(params.genesisID),\n isMainNet: ['mainnet-v1.0', 'mainnet-v1', 'mainnet'].includes(params.genesisID),\n isLocalNet: ClientManager.genesisIdIsLocalNet(params.genesisID),\n genesisId: params.genesisID,\n genesisHash: params.genesisHash,\n }\n }\n\n /**\n * Returns true if the given network genesisId is associated with a LocalNet network.\n * @param genesisId The network genesis ID\n * @returns Whether the given genesis ID is associated with a LocalNet network\n */\n public static genesisIdIsLocalNet(genesisId: string) {\n return genesisIdIsLocalNet(genesisId)\n }\n\n /**\n * Returns true if the current network is LocalNet.\n * @returns True if the current network is LocalNet.\n */\n public async isLocalNet() {\n return (await this.network()).isLocalNet\n }\n\n /**\n * Returns true if the current network is TestNet.\n * @returns True if the current network is TestNet.\n */\n public async isTestNet() {\n return (await this.network()).isTestNet\n }\n\n /**\n * Returns true if the current network is MainNet.\n * @returns True if the current network is MainNet.\n */\n public async isMainNet() {\n return (await this.network()).isMainNet\n }\n\n /**\n * Returns a TestNet Dispenser API client.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenser(\n * {\n * authToken: 'your_auth_token',\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenser(params: TestNetDispenserApiClientParams) {\n return new TestNetDispenserApiClient(params)\n }\n\n /**\n * Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.\n *\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * @example\n * const client = clientManager.getTestNetDispenserFromEnvironment(\n * {\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\n public getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>) {\n return new TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined)\n }\n\n /**\n * Returns a new `AppFactory` client\n * @example Basic example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\/}',\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const factory = algorand.client.getAppFactory({\n * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,\n * defaultSender: \"SENDERADDRESS\",\n * appName: \"OverriddenAppName\",\n * version: \"2.0.0\",\n * updatable: true,\n * deletable: false,\n * deployTimeParams: { ONE: 1, TWO: 'value' }\n * })\n * ```\n */\n public getAppFactory(params: ClientAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new AppFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * This method resolves the app ID by looking up the creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByCreatorAndName({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by looking for app ID of named app by this creator\n * creatorAddress: 'CREATORADDRESS',\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return AppClient.fromCreatorAndName({\n ...params,\n algorand: this._algorand,\n })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientById({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * appId: 12345n,\n * })\n * ```\n * @returns The `AppClient`\n */\n public getAppClientById(params: ClientAppClientParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return new AppClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new `AppClient` client for managing calls and state for an ARC-56 app.\n * This method resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param params The parameters to create the app client\n * @example Basic\n * ```typescript\n * const appClient = algorand.client.getAppClientByNetwork({\n * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\\}',\n * // appId resolved by using ARC-56 spec to find app ID for current network\n * })\n * ```\n * @returns The `AppClient`\n */\n public async getAppClientByNetwork(params: ClientAppClientByNetworkParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n return AppClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by creator address and name.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by creator address and name\n * @example Use name in ARC-32 / ARC-56 app spec\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * defaultSender: alice,\n * })\n * ```\n * @example Specify name\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {\n * creatorAddress: \"CREATORADDRESS\",\n * name: \"contract-name\",\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public async getTypedAppClientByCreatorAndName<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientByCreatorAndNameParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolving the app by app ID.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by ID\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {\n * appId: 12345n,\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientById<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params: ClientTypedAppClientParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return new typedClient({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed client, resolves the app ID for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param typedClient The typed client type to use\n * @param params The params to resolve the app by network\n * @example\n * ```typescript\n * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {\n * defaultSender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppClientByNetwork<TClient extends TypedAppClient<InstanceType<TClient>>>(\n typedClient: TClient,\n params?: ClientTypedAppClientByNetworkParams,\n ) {\n if (!this._algorand) {\n throw new Error('Attempt to get app client from a ClientManager without an Algorand client')\n }\n\n return typedClient.fromNetwork({ ...params, algorand: this._algorand })\n }\n\n /**\n * Returns a new typed app factory.\n * @param typedFactory The typed factory type to use\n * @param params The params to resolve the factory by\n * @example\n * ```typescript\n * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {\n * sender: alice,\n * })\n * ```\n * @returns The typed client instance\n */\n public getTypedAppFactory<TClient>(typedFactory: TypedAppFactory<TClient>, params?: ClientTypedAppFactoryParams) {\n if (!this._algorand) {\n throw new Error('Attempt to get app factory from a ClientManager without an Algorand client')\n }\n\n return new typedFactory({ ...params, algorand: this._algorand })\n }\n\n /**\n * Retrieve client configurations from environment variables when defined or get defaults (expects to be called from a Node.js environment)\n *\n * If both `process.env.INDEXER_SERVER` and `process.env.ALGOD_SERVER` is defined it will use both along with optional `process.env.ALGOD_PORT`, `process.env.ALGOD_TOKEN`, `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.\n *\n * If only `process.env.ALGOD_SERVER` is defined it will use this along with optional `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN` and leave indexer as `undefined`.\n *\n * If only `process.env.INDEXER_SERVER` is defined it will use the default (LocalNet) configuration for both algod and indexer.\n *\n * It will return a KMD configuration that uses `process.env.KMD_PORT` (or port 4002) if `process.env.ALGOD_SERVER` is defined,\n * otherwise it will use the default LocalNet config unless it detects testnet or mainnet.\n * @example\n * ```typescript\n * const config = ClientManager.getConfigFromEnvironmentOrLocalNet()\n * ```\n * @returns The config for algod, indexer and kmd\n */\n public static getConfigFromEnvironmentOrLocalNet(): AlgoConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default client configuration from a non Node.js context; supply the config instead')\n }\n const [algodConfig, indexerConfig, kmdConfig] = process.env.ALGOD_SERVER\n ? [\n ClientManager.getAlgodConfigFromEnvironment(),\n process.env.INDEXER_SERVER ? ClientManager.getIndexerConfigFromEnvironment() : undefined,\n !process.env.ALGOD_SERVER.includes('mainnet') && !process.env.ALGOD_SERVER.includes('testnet')\n ? { ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' }\n : undefined,\n ]\n : [\n ClientManager.getDefaultLocalNetConfig('algod'),\n ClientManager.getDefaultLocalNetConfig('indexer'),\n ClientManager.getDefaultLocalNetConfig('kmd'),\n ]\n\n return {\n algodConfig,\n indexerConfig,\n kmdConfig,\n }\n }\n\n /** Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)\n *\n * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.\n */\n public static getAlgodConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default algod configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.ALGOD_SERVER) {\n throw new Error('Attempt to get default algod configuration without specifying ALGOD_SERVER in the environment variables')\n }\n\n return {\n server: process.env.ALGOD_SERVER,\n port: process.env.ALGOD_PORT,\n token: process.env.ALGOD_TOKEN,\n }\n }\n\n /**\n * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).\n *\n * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.\n */\n public static getIndexerConfigFromEnvironment(): AlgoClientConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get default indexer configuration from a non Node.js context; supply the config instead')\n }\n\n if (!process.env.INDEXER_SERVER) {\n throw new Error('Attempt to get default indexer configuration without specifying INDEXER_SERVER in the environment variables')\n }\n\n return {\n server: process.env.INDEXER_SERVER,\n port: process.env.INDEXER_PORT,\n token: process.env.INDEXER_TOKEN,\n }\n }\n\n /** Returns the Algorand configuration to point to the free tier of the AlgoNode service.\n *\n * @param network Which network to connect to - TestNet or MainNet\n * @param config Which algod config to return - Algod or Indexer\n */\n public static getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig {\n return {\n server: `https://${network}-${config === 'algod' ? 'api' : 'idx'}.algonode.cloud/`,\n port: 443,\n }\n }\n\n /** Returns the Algorand configuration to point to the default LocalNet.\n *\n * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number\n */\n public static getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig {\n return {\n server: `http://localhost`,\n port: configOrPort === 'algod' ? 4001 : configOrPort === 'indexer' ? 8980 : configOrPort === 'kmd' ? 4002 : configOrPort,\n token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n }\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls.\n *\n * @param config The config of the client\n * @example AlgoNode (testnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('mainnet', 'algod'))\n * await algod.healthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet)\n * ```typescript\n * const algod = ClientManager.getAlgodClient({server: 'http://localhost', port: '4001', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClient(config: AlgoClientConfig): Algodv2 {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Algo-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n return new algosdk.Algodv2(httpClientWithRetry, server)\n }\n\n /**\n * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN\n * const algod = ClientManager.getAlgodClientFromEnvironment()\n * await algod.healthCheck().do()\n * ```\n */\n public static getAlgodClientFromEnvironment(): Algodv2 {\n return ClientManager.getAlgodClient(ClientManager.getAlgodConfigFromEnvironment())\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls\n *\n * @param config The config of the client\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example AlgoNode (testnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example AlgoNode (mainnet)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('mainnet', 'indexer'))\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const indexer = ClientManager.getIndexerClient({server: 'http://localhost', port: '8980', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * await indexer.makeHealthCheck().do()\n * ```\n * @example Override int decoding for responses\n * ```typescript\n * const indexer = ClientManager.getIndexerClient(config, IntDecoding.BIGINT)\n * ```\n */\n public static getIndexerClient(config: AlgoClientConfig, overrideIntDecoding?: IntDecoding): Indexer {\n const { token, server, port } = config\n const tokenHeader = typeof token === 'string' ? { 'X-Indexer-API-Token': token } : token ?? {}\n const httpClientWithRetry = new AlgoHttpClientWithRetry(tokenHeader, server, port)\n const indexer = new Indexer(httpClientWithRetry)\n // Use mixed int decoding by default so bigints don't have lost precision\n indexer.setIntEncoding(overrideIntDecoding ?? IntDecoding.MIXED)\n return indexer\n }\n\n /**\n * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @param overrideIntDecoding Override the default int decoding for responses, uses MIXED by default to avoid lost precision for big integers\n * @example\n *\n * ```typescript\n * // Uses process.env.INDEXER_SERVER, process.env.INDEXER_PORT and process.env.INDEXER_TOKEN\n * const indexer = ClientManager.getIndexerClientFromEnvironment()\n * await indexer.makeHealthCheck().do()\n * ```\n */\n public static getIndexerClientFromEnvironment(overrideIntDecoding?: IntDecoding): Indexer {\n return ClientManager.getIndexerClient(ClientManager.getIndexerConfigFromEnvironment(), overrideIntDecoding)\n }\n\n /**\n * Returns a KMD SDK client.\n *\n * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.\n *\n * @param config The config for the client\n * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)\n * ```typescript\n * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})\n * ```\n */\n public static getKmdClient(config: AlgoClientConfig): Kmd {\n const { token, server, port } = config\n return new Kmd(token as string, server, port)\n }\n\n /**\n * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).\n *\n * @example\n * ```typescript\n * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN\n * const kmd = ClientManager.getKmdClientFromEnvironment()\n * ```\n */\n public static getKmdClientFromEnvironment(): Kmd {\n // We can only use Kmd on the LocalNet otherwise it's not exposed so this makes some assumptions\n // (e.g. same token and server as algod and port 4002 by default)\n return ClientManager.getKmdClient({ ...ClientManager.getAlgodConfigFromEnvironment(), port: process?.env?.KMD_PORT ?? '4002' })\n }\n}\n\n/**\n * Interface to identify a typed client that can be used to interact with an application.\n */\nexport interface TypedAppClient<TClient> {\n new (params: Omit<AppClientParams, 'appSpec'>): TClient\n fromNetwork(params: Omit<AppClientParams, 'appId' | 'appSpec'>): Promise<TClient>\n fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<TClient>\n}\n\n/**\n * Interface to identify a typed factory that can be used to create and deploy an application.\n */\nexport interface TypedAppFactory<TClient> {\n new (params: Omit<AppFactoryParams, 'appSpec'>): TClient\n}\n"],"names":["genesisIdIsLocalNet","TestNetDispenserApiClient","AppFactory","AppClient","AlgoHttpClientWithRetry"],"mappings":";;;;;;;;;AASA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AAoCxC;MACa,aAAa,CAAA;AAMxB;;;;;;;;;;;;;;;;;;;AAmBG;IACH,WAAY,CAAA,eAA4C,EAAE,cAAwC,EAAA;AAChG,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB,cAAE,eAAe;AACjB,cAAE;gBACE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,CAAC;AAChE,gBAAA,OAAO,EAAE,eAAe,CAAC,aAAa,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