@algorandfoundation/algokit-utils 8.2.2 → 9.0.0-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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","sources":["../../src/types/config.ts"],"sourcesContent":["import { AsyncEventEmitter } from './async-event-emitter'\nimport { Logger, consoleLogger, nullLogger } from './logging'\n\n/** The AlgoKit configuration type */\nexport interface Config {\n /** Logger */\n logger: Logger\n /** Whether or not debug mode is enabled */\n debug: boolean\n /** The path to the project root directory */\n projectRoot: string | null\n /** Indicates whether to trace all operations */\n traceAll: boolean\n /** The size of the trace buffer in megabytes */\n traceBufferSizeMb: number\n /** The maximum depth to search for a specific file */\n maxSearchDepth: number\n /**\n * Whether to enable populateAppCallResources in sendParams by default.\n * Default value is false.\n */\n populateAppCallResources: boolean\n\n events: AsyncEventEmitter\n}\n\n/** Updatable AlgoKit config */\nexport class UpdatableConfig implements Readonly<Config> {\n private config: Config\n\n get populateAppCallResources() {\n return this.config.populateAppCallResources\n }\n\n get logger() {\n return this.config.logger\n }\n\n get debug() {\n return this.config.debug\n }\n\n get projectRoot() {\n return this.config.projectRoot\n }\n\n get traceAll() {\n return this.config.traceAll\n }\n\n get traceBufferSizeMb() {\n return this.config.traceBufferSizeMb\n }\n\n get maxSearchDepth() {\n return this.config.maxSearchDepth\n }\n\n get events() {\n return this.config.events\n }\n\n /**\n * Returns the current logger, or the null logger if true is passed in to `returnNullLogger`\n * @param returnNullLogger Whether or not to return the null logger\n * @returns The requested logger\n */\n getLogger(returnNullLogger?: boolean) {\n if (returnNullLogger) {\n return nullLogger\n }\n\n return this.logger\n }\n\n /**\n * Temporarily run with debug set to true.\n * @param lambda A lambda expression with code to run with debug config set to true\n */\n withDebug(lambda: () => unknown) {\n const original = this.config.debug\n try {\n this.config.debug = true\n lambda()\n } finally {\n this.config.debug = original\n }\n }\n\n constructor() {\n this.config = {\n logger: consoleLogger,\n debug: false,\n projectRoot: null,\n traceAll: false,\n traceBufferSizeMb: 256,\n maxSearchDepth: 10,\n populateAppCallResources: false,\n events: new AsyncEventEmitter(),\n }\n }\n\n /**\n * Update the AlgoKit configuration with your own configuration settings\n * @param newConfig Partial or complete config to replace\n */\n configure(newConfig: Partial<Config>) {\n this.config = { ...this.config, ...newConfig }\n }\n}\n"],"names":[],"mappings":";;;AA0BA;MACa,eAAe,CAAA;AAG1B,IAAA,IAAI,wBAAwB,GAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB;;AAG7C,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;;AAG3B,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;;AAG1B,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW;;AAGhC,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ;;AAG7B,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB;;AAGtC,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc;;AAGnC,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;;AAG3B;;;;AAIG;AACH,IAAA,SAAS,CAAC,gBAA0B,EAAA;QAClC,IAAI,gBAAgB,EAAE;AACpB,YAAA,OAAO,UAAU;;QAGnB,OAAO,IAAI,CAAC,MAAM;;AAGpB;;;AAGG;AACH,IAAA,SAAS,CAAC,MAAqB,EAAA;AAC7B,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK;AAClC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI;AACxB,YAAA,MAAM,EAAE;;gBACA;AACR,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ;;;AAIhC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,MAAM,EAAE,aAAa;AACrB,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,iBAAiB,EAAE,GAAG;AACtB,YAAA,cAAc,EAAE,EAAE;AAClB,YAAA,wBAAwB,EAAE,KAAK;YAC/B,MAAM,EAAE,IAAI,iBAAiB,EAAE;SAChC;;AAGH;;;AAGG;AACH,IAAA,SAAS,CAAC,SAA0B,EAAA;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE;;AAEjD;;;;"}
1
+ {"version":3,"file":"config.mjs","sources":["../../src/types/config.ts"],"sourcesContent":["import { AsyncEventEmitter } from './async-event-emitter'\nimport { Logger, consoleLogger, nullLogger } from './logging'\n\n/** The AlgoKit configuration type */\nexport interface Config {\n /** Logger */\n logger: Logger\n /** Whether or not debug mode is enabled */\n debug: boolean\n /** The path to the project root directory */\n projectRoot: string | null\n /** Indicates whether to trace all operations */\n traceAll: boolean\n /** The size of the trace buffer in megabytes */\n traceBufferSizeMb: number\n /** The maximum depth to search for a specific file */\n maxSearchDepth: number\n /**\n * Whether to enable populateAppCallResources in sendParams by default.\n * Default value is false.\n */\n populateAppCallResources: boolean\n\n events: AsyncEventEmitter\n}\n\n/** Updatable AlgoKit config */\nexport class UpdatableConfig implements Readonly<Config> {\n private config: Config\n\n get populateAppCallResources() {\n return this.config.populateAppCallResources\n }\n\n get logger() {\n return this.config.logger\n }\n\n get debug() {\n return this.config.debug\n }\n\n get projectRoot() {\n return this.config.projectRoot\n }\n\n get traceAll() {\n return this.config.traceAll\n }\n\n get traceBufferSizeMb() {\n return this.config.traceBufferSizeMb\n }\n\n get maxSearchDepth() {\n return this.config.maxSearchDepth\n }\n\n get events() {\n return this.config.events\n }\n\n /**\n * Returns the current logger, or the null logger if true is passed in to `returnNullLogger`\n * @param returnNullLogger Whether or not to return the null logger\n * @returns The requested logger\n */\n getLogger(returnNullLogger?: boolean) {\n if (returnNullLogger) {\n return nullLogger\n }\n\n return this.logger\n }\n\n /**\n * Temporarily run with debug set to true.\n * @param lambda A lambda expression with code to run with debug config set to true\n */\n withDebug(lambda: () => unknown) {\n const original = this.config.debug\n try {\n this.config.debug = true\n lambda()\n } finally {\n this.config.debug = original\n }\n }\n\n constructor() {\n this.config = {\n logger: consoleLogger,\n debug: false,\n projectRoot: null,\n traceAll: false,\n traceBufferSizeMb: 256,\n maxSearchDepth: 10,\n populateAppCallResources: true,\n events: new AsyncEventEmitter(),\n }\n }\n\n /**\n * Update the AlgoKit configuration with your own configuration settings\n * @param newConfig Partial or complete config to replace\n */\n configure(newConfig: Partial<Config>) {\n this.config = { ...this.config, ...newConfig }\n }\n}\n"],"names":[],"mappings":";;;AA0BA;MACa,eAAe,CAAA;AAG1B,IAAA,IAAI,wBAAwB,GAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB;;AAG7C,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;;AAG3B,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK;;AAG1B,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW;;AAGhC,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ;;AAG7B,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB;;AAGtC,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc;;AAGnC,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;;AAG3B;;;;AAIG;AACH,IAAA,SAAS,CAAC,gBAA0B,EAAA;QAClC,IAAI,gBAAgB,EAAE;AACpB,YAAA,OAAO,UAAU;;QAGnB,OAAO,IAAI,CAAC,MAAM;;AAGpB;;;AAGG;AACH,IAAA,SAAS,CAAC,MAAqB,EAAA;AAC7B,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK;AAClC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI;AACxB,YAAA,MAAM,EAAE;;gBACA;AACR,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ;;;AAIhC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,MAAM,EAAE,aAAa;AACrB,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,iBAAiB,EAAE,GAAG;AACtB,YAAA,cAAc,EAAE,EAAE;AAClB,YAAA,wBAAwB,EAAE,IAAI;YAC9B,MAAM,EAAE,IAAI,iBAAiB,EAAE;SAChC;;AAGH;;;AAGG;AACH,IAAA,SAAS,CAAC,SAA0B,EAAA;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE;;AAEjD;;;;"}
@@ -1,52 +0,0 @@
1
- import algosdk from 'algosdk';
2
- import { AlgorandClientTransactionCreator } from './algorand-client-transaction-creator';
3
- import { AlgorandClientTransactionSender } from './algorand-client-transaction-sender';
4
- import { AppDeployer } from './app-deployer';
5
- import { AppManager } from './app-manager';
6
- import { TransactionComposer } from './composer';
7
- import { NetworkDetails } from './network-client';
8
- import Algodv2 = algosdk.Algodv2;
9
- import Indexer = algosdk.Indexer;
10
- import type { AlgorandClient } from './algorand-client';
11
- import { InterfaceOf } from './interface-of';
12
- /**
13
- * @deprecated Use `AlgorandClient` with `import type` instead since this
14
- * interface does not implement the full interface for the AlgorandClient
15
- * and will get removed in the next major release
16
- *
17
- * @see https://github.com/algorandfoundation/algokit-utils-ts/pull/365
18
- */
19
- interface OldAlgorandClientInterface {
20
- app: AppManager;
21
- appDeployer: AppDeployer;
22
- send: AlgorandClientTransactionSender;
23
- createTransaction: AlgorandClientTransactionCreator;
24
- newGroup(): TransactionComposer;
25
- client: {
26
- algod: Algodv2;
27
- indexer?: Indexer;
28
- network(): Promise<NetworkDetails>;
29
- isLocalNet(): Promise<boolean>;
30
- isTestNet(): Promise<boolean>;
31
- isMainNet(): Promise<boolean>;
32
- };
33
- }
34
- /**
35
- * @deprecated Use `AlgorandClient` with `import type` instead since this interface
36
- * will get removed in the next major release
37
- *
38
- * This type is a solution to the problem raised in the PR below.
39
- * In summary, we needed to update the interface without making a breaking
40
- * change so this was the best option. This interface has some optional properties,
41
- * such as `account`, but unless you are using a custom implementation of AlgorandClient
42
- * (you probably aren't) you can be sure these will always be defined.
43
- *
44
- * @example
45
- * ```ts
46
- * algorand.account!.getInformation(addr);
47
- * ```
48
- *
49
- * @see https://github.com/algorandfoundation/algokit-utils-ts/pull/365
50
- */
51
- export type AlgorandClientInterface = OldAlgorandClientInterface & Partial<InterfaceOf<AlgorandClient>>;
52
- export {};
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=algorand-client-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"algorand-client-interface.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=algorand-client-interface.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"algorand-client-interface.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export type InterfaceOf<ClassType> = {
2
- [Member in keyof ClassType]: ClassType[Member];
3
- };
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- //# sourceMappingURL=interface-of.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface-of.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=interface-of.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface-of.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}