@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.2
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
package/types/logging.mjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable no-console */
|
|
1
|
+
//#region src/types/logging.ts
|
|
3
2
|
/** A logger implementation that writes to console */
|
|
4
3
|
const consoleLogger = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
error: console.error,
|
|
5
|
+
warn: console.warn,
|
|
6
|
+
info: console.info,
|
|
7
|
+
verbose: () => {},
|
|
8
|
+
debug: console.debug
|
|
10
9
|
};
|
|
11
10
|
const infoConsoleLogger = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
error: console.error,
|
|
12
|
+
warn: console.warn,
|
|
13
|
+
info: console.info,
|
|
14
|
+
verbose: () => {},
|
|
15
|
+
debug: () => {}
|
|
17
16
|
};
|
|
18
17
|
const verboseConsoleLogger = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
error: console.error,
|
|
19
|
+
warn: console.warn,
|
|
20
|
+
info: console.info,
|
|
21
|
+
verbose: console.trace,
|
|
22
|
+
debug: console.debug
|
|
24
23
|
};
|
|
25
24
|
const warningConsoleLogger = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
error: console.error,
|
|
26
|
+
warn: console.warn,
|
|
27
|
+
info: () => {},
|
|
28
|
+
verbose: () => {},
|
|
29
|
+
debug: () => {}
|
|
31
30
|
};
|
|
32
31
|
/** A logger implementation that does nothing */
|
|
33
32
|
const nullLogger = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
error: function(message, ...optionalParams) {},
|
|
34
|
+
warn: function(message, ...optionalParams) {},
|
|
35
|
+
info: function(message, ...optionalParams) {},
|
|
36
|
+
verbose: function(message, ...optionalParams) {},
|
|
37
|
+
debug: function(message, ...optionalParams) {}
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
//#endregion
|
|
41
40
|
export { consoleLogger, infoConsoleLogger, nullLogger, verboseConsoleLogger, warningConsoleLogger };
|
|
42
|
-
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=logging.mjs.map
|
package/types/logging.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.mjs","sources":["../../src/types/logging.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-console */\n\n/** General purpose logger type, compatible with Winston and others. */\nexport type Logger = {\n error(message: string, ...optionalParams: unknown[]): void\n warn(message: string, ...optionalParams: unknown[]): void\n info(message: string, ...optionalParams: unknown[]): void\n verbose(message: string, ...optionalParams: unknown[]): void\n debug(message: string, ...optionalParams: unknown[]): void\n}\n\n/** A logger implementation that writes to console */\nexport const consoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: console.debug,\n}\n\nexport const infoConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: () => {},\n}\n\nexport const verboseConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: console.trace,\n debug: console.debug,\n}\n\nexport const warningConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: () => {},\n verbose: () => {},\n debug: () => {},\n}\n\n/** A logger implementation that does nothing */\nexport const nullLogger: Logger = {\n error: function (message: string, ...optionalParams: unknown[]): void {},\n warn: function (message: string, ...optionalParams: unknown[]): void {},\n info: function (message: string, ...optionalParams: unknown[]): void {},\n verbose: function (message: string, ...optionalParams: unknown[]): void {},\n debug: function (message: string, ...optionalParams: unknown[]): void {},\n}\n"],"
|
|
1
|
+
{"version":3,"file":"logging.mjs","names":[],"sources":["../../src/types/logging.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-console */\n\n/** General purpose logger type, compatible with Winston and others. */\nexport type Logger = {\n error(message: string, ...optionalParams: unknown[]): void\n warn(message: string, ...optionalParams: unknown[]): void\n info(message: string, ...optionalParams: unknown[]): void\n verbose(message: string, ...optionalParams: unknown[]): void\n debug(message: string, ...optionalParams: unknown[]): void\n}\n\n/** A logger implementation that writes to console */\nexport const consoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: console.debug,\n}\n\nexport const infoConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: () => {},\n debug: () => {},\n}\n\nexport const verboseConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: console.info,\n verbose: console.trace,\n debug: console.debug,\n}\n\nexport const warningConsoleLogger: Logger = {\n error: console.error,\n warn: console.warn,\n info: () => {},\n verbose: () => {},\n debug: () => {},\n}\n\n/** A logger implementation that does nothing */\nexport const nullLogger: Logger = {\n error: function (message: string, ...optionalParams: unknown[]): void {},\n warn: function (message: string, ...optionalParams: unknown[]): void {},\n info: function (message: string, ...optionalParams: unknown[]): void {},\n verbose: function (message: string, ...optionalParams: unknown[]): void {},\n debug: function (message: string, ...optionalParams: unknown[]): void {},\n}\n"],"mappings":";;AAaA,MAAa,gBAAwB;CACnC,OAAO,QAAQ;CACf,MAAM,QAAQ;CACd,MAAM,QAAQ;CACd,eAAe,CAAC;CAChB,OAAO,QAAQ;AACjB;AAEA,MAAa,oBAA4B;CACvC,OAAO,QAAQ;CACf,MAAM,QAAQ;CACd,MAAM,QAAQ;CACd,eAAe,CAAC;CAChB,aAAa,CAAC;AAChB;AAEA,MAAa,uBAA+B;CAC1C,OAAO,QAAQ;CACf,MAAM,QAAQ;CACd,MAAM,QAAQ;CACd,SAAS,QAAQ;CACjB,OAAO,QAAQ;AACjB;AAEA,MAAa,uBAA+B;CAC1C,OAAO,QAAQ;CACf,MAAM,QAAQ;CACd,YAAY,CAAC;CACb,eAAe,CAAC;CAChB,aAAa,CAAC;AAChB;;AAGA,MAAa,aAAqB;CAChC,OAAO,SAAU,SAAiB,GAAG,gBAAiC,CAAC;CACvE,MAAM,SAAU,SAAiB,GAAG,gBAAiC,CAAC;CACtE,MAAM,SAAU,SAAiB,GAAG,gBAAiC,CAAC;CACtE,SAAS,SAAU,SAAiB,GAAG,gBAAiC,CAAC;CACzE,OAAO,SAAU,SAAiB,GAAG,gBAAiC,CAAC;AACzE"}
|
package/types/logic-error.d.ts
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
|
+
//#region src/types/logic-error.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Details about a smart contract logic error
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
interface LogicErrorDetails {
|
|
6
|
+
/** The ID of the transaction with the logic error */
|
|
7
|
+
txId: string;
|
|
8
|
+
/** The program counter where the error was */
|
|
9
|
+
pc: number;
|
|
10
|
+
/** The error message */
|
|
11
|
+
msg: string;
|
|
12
|
+
/** The full error description */
|
|
13
|
+
desc: string;
|
|
14
|
+
/** Any trace information included in the error */
|
|
15
|
+
traces: Record<string, unknown>[];
|
|
15
16
|
}
|
|
16
17
|
/** Wraps key functionality around processing logic errors */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
declare class LogicError extends Error {
|
|
19
|
+
/** Takes an error message and parses out the details of any logic errors in there.
|
|
20
|
+
* @param error The error message to parse
|
|
21
|
+
* @returns The logic error details if any, or undefined
|
|
22
|
+
*/
|
|
23
|
+
static parseLogicError(error: any): LogicErrorDetails | undefined;
|
|
24
|
+
led: LogicErrorDetails;
|
|
25
|
+
program: string[];
|
|
26
|
+
lines: number;
|
|
27
|
+
teal_line: number;
|
|
28
|
+
stack?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new logic error object.
|
|
31
|
+
* @param errorDetails The details of the logic error
|
|
32
|
+
* @param program The TEAL source code, split by line
|
|
33
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
34
|
+
*/
|
|
35
|
+
constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined);
|
|
35
36
|
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { LogicError, LogicErrorDetails };
|
|
39
|
+
//# sourceMappingURL=logic-error.d.ts.map
|
package/types/logic-error.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types/logic-error.ts
|
|
3
3
|
const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/;
|
|
4
|
-
// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx
|
|
5
4
|
const INNER_LOGIC_ERROR = /inner tx (\d+) failed:.*?pc=([0-9]+)/;
|
|
6
5
|
/** Wraps key functionality around processing logic errors */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
6
|
+
var LogicError = class extends Error {
|
|
7
|
+
/** Takes an error message and parses out the details of any logic errors in there.
|
|
8
|
+
* @param error The error message to parse
|
|
9
|
+
* @returns The logic error details if any, or undefined
|
|
10
|
+
*/
|
|
11
|
+
static parseLogicError(error) {
|
|
12
|
+
const errorMessage = error.message;
|
|
13
|
+
const res = LOGIC_ERROR.exec(errorMessage);
|
|
14
|
+
const innerRes = INNER_LOGIC_ERROR.exec(errorMessage);
|
|
15
|
+
if (res === null || res.length <= 3) return void 0;
|
|
16
|
+
return {
|
|
17
|
+
txId: res[1],
|
|
18
|
+
msg: res[2],
|
|
19
|
+
desc: errorMessage,
|
|
20
|
+
pc: parseInt(innerRes?.[2] ?? res[3] ?? "0"),
|
|
21
|
+
traces: error.traces
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
led;
|
|
25
|
+
program;
|
|
26
|
+
lines = 5;
|
|
27
|
+
teal_line = 0;
|
|
28
|
+
stack;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new logic error object.
|
|
31
|
+
* @param errorDetails The details of the logic error
|
|
32
|
+
* @param program The TEAL source code, split by line
|
|
33
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
34
|
+
*/
|
|
35
|
+
constructor(errorDetails, program, getLineForPc) {
|
|
36
|
+
super();
|
|
37
|
+
this.led = errorDetails;
|
|
38
|
+
this.program = program;
|
|
39
|
+
const line = getLineForPc(errorDetails.pc);
|
|
40
|
+
this.teal_line = line === void 0 ? 0 : line;
|
|
41
|
+
this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
|
|
42
|
+
if (this.teal_line > 0) {
|
|
43
|
+
const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0;
|
|
44
|
+
const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length;
|
|
45
|
+
const stack_lines = program.slice(start, stop);
|
|
46
|
+
stack_lines[stack_lines.length / 2] += " <--- Error";
|
|
47
|
+
this.stack = stack_lines.join("\n");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
52
|
exports.LogicError = LogicError;
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=logic-error.js.map
|
package/types/logic-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic-error.js","sources":["../../src/types/logic-error.ts"],"sourcesContent":["const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx\nconst INNER_LOGIC_ERROR = /inner tx (\\d+) failed:.*?pc=([0-9]+)/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n const innerRes = INNER_LOGIC_ERROR.exec(errorMessage)\n\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(innerRes?.[2] ?? res[3] ?? '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"logic-error.js","names":[],"sources":["../../src/types/logic-error.ts"],"sourcesContent":["const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx\nconst INNER_LOGIC_ERROR = /inner tx (\\d+) failed:.*?pc=([0-9]+)/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n const innerRes = INNER_LOGIC_ERROR.exec(errorMessage)\n\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(innerRes?.[2] ?? res[3] ?? '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"mappings":";;AAAA,MAAM,cAAc;AAEpB,MAAM,oBAAoB;;AAmB1B,IAAa,aAAb,cAAgC,MAAM;;;;;CAMpC,OAAO,gBAAgB,OAA2C;EAChE,MAAM,eAAe,MAAM;EAC3B,MAAM,MAAM,YAAY,KAAK,YAAY;EACzC,MAAM,WAAW,kBAAkB,KAAK,YAAY;EAEpD,IAAI,QAAQ,QAAQ,IAAI,UAAU,GAAG,OAAO,KAAA;EAE5C,OAAO;GACL,MAAM,IAAI;GACV,KAAK,IAAI;GACT,MAAM;GACN,IAAI,SAAS,WAAW,MAAM,IAAI,MAAM,GAAG;GAC3C,QAAQ,MAAM;EAChB;CACF;CAEA;CACA;CACA,QAAe;CACf,YAAmB;CACnB;;;;;;;CAQA,YAAY,cAAiC,SAAmB,cAAkD;EAChH,MAAM;EACN,KAAK,MAAM;EACX,KAAK,UAAU;EAEf,MAAM,OAAO,aAAa,aAAa,EAAE;EACzC,KAAK,YAAY,SAAS,KAAA,IAAY,IAAI;EAE1C,KAAK,UAAU,GAAG,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,KAAK,IAAI;EAExD,IAAI,KAAK,YAAY,GAAG;GACtB,MAAM,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,YAAY,KAAK,QAAQ;GAC1E,MAAM,OAAO,QAAQ,SAAS,KAAK,YAAY,KAAK,QAAQ,KAAK,YAAY,KAAK,QAAQ,QAAQ;GAElG,MAAM,cAAc,QAAQ,MAAM,OAAO,IAAI;GAE7C,YAAY,YAAY,SAAS,MAAM;GAEvC,KAAK,QAAQ,YAAY,KAAK,IAAI;EACpC;CACF;AACF"}
|
package/types/logic-error.mjs
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
+
//#region src/types/logic-error.ts
|
|
1
2
|
const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/;
|
|
2
|
-
// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx
|
|
3
3
|
const INNER_LOGIC_ERROR = /inner tx (\d+) failed:.*?pc=([0-9]+)/;
|
|
4
4
|
/** Wraps key functionality around processing logic errors */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
5
|
+
var LogicError = class extends Error {
|
|
6
|
+
/** Takes an error message and parses out the details of any logic errors in there.
|
|
7
|
+
* @param error The error message to parse
|
|
8
|
+
* @returns The logic error details if any, or undefined
|
|
9
|
+
*/
|
|
10
|
+
static parseLogicError(error) {
|
|
11
|
+
const errorMessage = error.message;
|
|
12
|
+
const res = LOGIC_ERROR.exec(errorMessage);
|
|
13
|
+
const innerRes = INNER_LOGIC_ERROR.exec(errorMessage);
|
|
14
|
+
if (res === null || res.length <= 3) return void 0;
|
|
15
|
+
return {
|
|
16
|
+
txId: res[1],
|
|
17
|
+
msg: res[2],
|
|
18
|
+
desc: errorMessage,
|
|
19
|
+
pc: parseInt(innerRes?.[2] ?? res[3] ?? "0"),
|
|
20
|
+
traces: error.traces
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
led;
|
|
24
|
+
program;
|
|
25
|
+
lines = 5;
|
|
26
|
+
teal_line = 0;
|
|
27
|
+
stack;
|
|
28
|
+
/**
|
|
29
|
+
* Create a new logic error object.
|
|
30
|
+
* @param errorDetails The details of the logic error
|
|
31
|
+
* @param program The TEAL source code, split by line
|
|
32
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
33
|
+
*/
|
|
34
|
+
constructor(errorDetails, program, getLineForPc) {
|
|
35
|
+
super();
|
|
36
|
+
this.led = errorDetails;
|
|
37
|
+
this.program = program;
|
|
38
|
+
const line = getLineForPc(errorDetails.pc);
|
|
39
|
+
this.teal_line = line === void 0 ? 0 : line;
|
|
40
|
+
this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
|
|
41
|
+
if (this.teal_line > 0) {
|
|
42
|
+
const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0;
|
|
43
|
+
const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length;
|
|
44
|
+
const stack_lines = program.slice(start, stop);
|
|
45
|
+
stack_lines[stack_lines.length / 2] += " <--- Error";
|
|
46
|
+
this.stack = stack_lines.join("\n");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
50
51
|
export { LogicError };
|
|
51
|
-
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=logic-error.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic-error.mjs","sources":["../../src/types/logic-error.ts"],"sourcesContent":["const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx\nconst INNER_LOGIC_ERROR = /inner tx (\\d+) failed:.*?pc=([0-9]+)/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n const innerRes = INNER_LOGIC_ERROR.exec(errorMessage)\n\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(innerRes?.[2] ?? res[3] ?? '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"logic-error.mjs","names":[],"sources":["../../src/types/logic-error.ts"],"sourcesContent":["const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/\n// inner tx 0 failed: logic eval error: err opcode executed. Details: app=6248, pc=29, opcodes=tx\nconst INNER_LOGIC_ERROR = /inner tx (\\d+) failed:.*?pc=([0-9]+)/\n\n/**\n * Details about a smart contract logic error\n */\nexport interface LogicErrorDetails {\n /** The ID of the transaction with the logic error */\n txId: string\n /** The program counter where the error was */\n pc: number\n /** The error message */\n msg: string\n /** The full error description */\n desc: string\n /** Any trace information included in the error */\n traces: Record<string, unknown>[]\n}\n\n/** Wraps key functionality around processing logic errors */\nexport class LogicError extends Error {\n /** Takes an error message and parses out the details of any logic errors in there.\n * @param error The error message to parse\n * @returns The logic error details if any, or undefined\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static parseLogicError(error: any): LogicErrorDetails | undefined {\n const errorMessage = error.message\n const res = LOGIC_ERROR.exec(errorMessage)\n const innerRes = INNER_LOGIC_ERROR.exec(errorMessage)\n\n if (res === null || res.length <= 3) return undefined\n\n return {\n txId: res[1],\n msg: res[2],\n desc: errorMessage,\n pc: parseInt(innerRes?.[2] ?? res[3] ?? '0'),\n traces: error.traces,\n } as LogicErrorDetails\n }\n\n public led: LogicErrorDetails\n public program: string[]\n public lines = 5\n public teal_line = 0\n override stack?: string\n\n /**\n * Create a new logic error object.\n * @param errorDetails The details of the logic error\n * @param program The TEAL source code, split by line\n * @param getLineForPc The source map of the TEAL source code\n */\n constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined) {\n super()\n this.led = errorDetails\n this.program = program\n\n const line = getLineForPc(errorDetails.pc)\n this.teal_line = line === undefined ? 0 : line\n\n this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`\n\n if (this.teal_line > 0) {\n const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0\n const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length\n\n const stack_lines = program.slice(start, stop)\n\n stack_lines[stack_lines.length / 2] += ' <--- Error'\n\n this.stack = stack_lines.join('\\n')\n }\n }\n}\n"],"mappings":";AAAA,MAAM,cAAc;AAEpB,MAAM,oBAAoB;;AAmB1B,IAAa,aAAb,cAAgC,MAAM;;;;;CAMpC,OAAO,gBAAgB,OAA2C;EAChE,MAAM,eAAe,MAAM;EAC3B,MAAM,MAAM,YAAY,KAAK,YAAY;EACzC,MAAM,WAAW,kBAAkB,KAAK,YAAY;EAEpD,IAAI,QAAQ,QAAQ,IAAI,UAAU,GAAG,OAAO,KAAA;EAE5C,OAAO;GACL,MAAM,IAAI;GACV,KAAK,IAAI;GACT,MAAM;GACN,IAAI,SAAS,WAAW,MAAM,IAAI,MAAM,GAAG;GAC3C,QAAQ,MAAM;EAChB;CACF;CAEA;CACA;CACA,QAAe;CACf,YAAmB;CACnB;;;;;;;CAQA,YAAY,cAAiC,SAAmB,cAAkD;EAChH,MAAM;EACN,KAAK,MAAM;EACX,KAAK,UAAU;EAEf,MAAM,OAAO,aAAa,aAAa,EAAE;EACzC,KAAK,YAAY,SAAS,KAAA,IAAY,IAAI;EAE1C,KAAK,UAAU,GAAG,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,KAAK,IAAI;EAExD,IAAI,KAAK,YAAY,GAAG;GACtB,MAAM,QAAQ,KAAK,YAAY,KAAK,QAAQ,KAAK,YAAY,KAAK,QAAQ;GAC1E,MAAM,OAAO,QAAQ,SAAS,KAAK,YAAY,KAAK,QAAQ,KAAK,YAAY,KAAK,QAAQ,QAAQ;GAElG,MAAM,cAAc,QAAQ,MAAM,OAAO,IAAI;GAE7C,YAAY,YAAY,SAAS,MAAM;GAEvC,KAAK,QAAQ,YAAY,KAAK,IAAI;EACpC;CACF;AACF"}
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import { TokenHeader } from
|
|
1
|
+
import { TokenHeader } from "algosdk";
|
|
2
|
+
|
|
3
|
+
//#region src/types/network-client.d.ts
|
|
2
4
|
/** Config for an Algorand SDK client. */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
interface AlgoClientConfig {
|
|
6
|
+
/** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */
|
|
7
|
+
server: string;
|
|
8
|
+
/** The port to use e.g. 4001, 443, etc. */
|
|
9
|
+
port?: string | number;
|
|
10
|
+
/** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */
|
|
11
|
+
token?: string | TokenHeader;
|
|
10
12
|
}
|
|
11
13
|
/** Configuration for algod, indexer and kmd clients. */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
interface AlgoConfig {
|
|
15
|
+
/** Algod client configuration */
|
|
16
|
+
algodConfig: AlgoClientConfig;
|
|
17
|
+
/** Indexer client configuration */
|
|
18
|
+
indexerConfig?: AlgoClientConfig;
|
|
19
|
+
/** Kmd configuration */
|
|
20
|
+
kmdConfig?: AlgoClientConfig;
|
|
19
21
|
}
|
|
20
22
|
/** Details of the current network. */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
interface NetworkDetails {
|
|
24
|
+
/** Whether or not the network is TestNet. */
|
|
25
|
+
isTestNet: boolean;
|
|
26
|
+
/** Whether or not the network is MainNet. */
|
|
27
|
+
isMainNet: boolean;
|
|
28
|
+
/** Whether or not the network is LocalNet. */
|
|
29
|
+
isLocalNet: boolean;
|
|
30
|
+
/** The genesis ID of the current network. */
|
|
31
|
+
genesisId: string;
|
|
32
|
+
/** The base64 genesis hash of the current network. */
|
|
33
|
+
genesisHash: string;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Returns true if the given network genesisId is associated with a LocalNet network.
|
|
35
37
|
* @param genesisId The network genesis ID
|
|
36
38
|
* @returns Whether the given genesis ID is associated with a LocalNet network
|
|
37
39
|
*/
|
|
38
|
-
|
|
40
|
+
declare function genesisIdIsLocalNet(genesisId: string): genesisId is "devnet-v1" | "sandnet-v1" | "dockernet-v1";
|
|
41
|
+
//#endregion
|
|
42
|
+
export { AlgoClientConfig, AlgoConfig, NetworkDetails, genesisIdIsLocalNet };
|
|
43
|
+
//# sourceMappingURL=network-client.d.ts.map
|
package/types/network-client.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types/network-client.ts
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
* Returns true if the given network genesisId is associated with a LocalNet network.
|
|
5
|
+
* @param genesisId The network genesis ID
|
|
6
|
+
* @returns Whether the given genesis ID is associated with a LocalNet network
|
|
7
|
+
*/
|
|
8
8
|
function genesisIdIsLocalNet(genesisId) {
|
|
9
|
-
|
|
9
|
+
return genesisId === "devnet-v1" || genesisId === "sandnet-v1" || genesisId === "dockernet-v1";
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
//#endregion
|
|
12
12
|
exports.genesisIdIsLocalNet = genesisIdIsLocalNet;
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=network-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-client.js","sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"
|
|
1
|
+
{"version":3,"file":"network-client.js","names":[],"sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"mappings":";;;;;;;AAyCA,SAAgB,oBAAoB,WAAmB;CACrD,OAAO,cAAc,eAAe,cAAc,gBAAgB,cAAc;AAClF"}
|
package/types/network-client.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
//#region src/types/network-client.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
* Returns true if the given network genesisId is associated with a LocalNet network.
|
|
4
|
+
* @param genesisId The network genesis ID
|
|
5
|
+
* @returns Whether the given genesis ID is associated with a LocalNet network
|
|
6
|
+
*/
|
|
6
7
|
function genesisIdIsLocalNet(genesisId) {
|
|
7
|
-
|
|
8
|
+
return genesisId === "devnet-v1" || genesisId === "sandnet-v1" || genesisId === "dockernet-v1";
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
//#endregion
|
|
10
11
|
export { genesisIdIsLocalNet };
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=network-client.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-client.mjs","sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"
|
|
1
|
+
{"version":3,"file":"network-client.mjs","names":[],"sources":["../../src/types/network-client.ts"],"sourcesContent":["import { TokenHeader } from 'algosdk'\n\n/** Config for an Algorand SDK client. */\nexport interface AlgoClientConfig {\n /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */\n server: string\n /** The port to use e.g. 4001, 443, etc. */\n port?: string | number\n /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */\n token?: string | TokenHeader\n}\n\n/** Configuration for algod, indexer and kmd clients. */\nexport interface AlgoConfig {\n /** Algod client configuration */\n algodConfig: AlgoClientConfig\n /** Indexer client configuration */\n indexerConfig?: AlgoClientConfig\n /** Kmd configuration */\n kmdConfig?: AlgoClientConfig\n}\n\n/** Details of the current network. */\nexport interface NetworkDetails {\n /** Whether or not the network is TestNet. */\n isTestNet: boolean\n /** Whether or not the network is MainNet. */\n isMainNet: boolean\n /** Whether or not the network is LocalNet. */\n isLocalNet: boolean\n /** The genesis ID of the current network. */\n genesisId: string\n /** The base64 genesis hash of the current network. */\n genesisHash: string\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 */\nexport function genesisIdIsLocalNet(genesisId: string) {\n return genesisId === 'devnet-v1' || genesisId === 'sandnet-v1' || genesisId === 'dockernet-v1'\n}\n"],"mappings":";;;;;;AAyCA,SAAgB,oBAAoB,WAAmB;CACrD,OAAO,cAAc,eAAe,cAAc,gBAAgB,cAAc;AAClF"}
|