@algorandfoundation/algokit-utils 7.0.0-beta.17 → 7.0.0-beta.19
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/package.json +1 -1
- package/types/app-arc56.d.ts +20 -10
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +8 -2
- package/types/app-client.js +111 -11
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +111 -11
- package/types/app-client.mjs.map +1 -1
- package/types/logic-error.d.ts +2 -3
- 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/logic-error.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type algosdk from 'algosdk';
|
|
2
1
|
/**
|
|
3
2
|
* Details about a smart contract logic error
|
|
4
3
|
*/
|
|
@@ -30,7 +29,7 @@ export declare class LogicError extends Error {
|
|
|
30
29
|
* Create a new logic error object.
|
|
31
30
|
* @param errorDetails The details of the logic error
|
|
32
31
|
* @param program The TEAL source code, split by line
|
|
33
|
-
* @param
|
|
32
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
34
33
|
*/
|
|
35
|
-
constructor(errorDetails: LogicErrorDetails, program: string[],
|
|
34
|
+
constructor(errorDetails: LogicErrorDetails, program: string[], getLineForPc: (pc: number) => number | undefined);
|
|
36
35
|
}
|
package/types/logic-error.js
CHANGED
|
@@ -25,15 +25,15 @@ class LogicError extends Error {
|
|
|
25
25
|
* Create a new logic error object.
|
|
26
26
|
* @param errorDetails The details of the logic error
|
|
27
27
|
* @param program The TEAL source code, split by line
|
|
28
|
-
* @param
|
|
28
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
29
29
|
*/
|
|
30
|
-
constructor(errorDetails, program,
|
|
30
|
+
constructor(errorDetails, program, getLineForPc) {
|
|
31
31
|
super();
|
|
32
32
|
this.lines = 5;
|
|
33
33
|
this.teal_line = 0;
|
|
34
34
|
this.led = errorDetails;
|
|
35
35
|
this.program = program;
|
|
36
|
-
const line =
|
|
36
|
+
const line = getLineForPc(errorDetails.pc);
|
|
37
37
|
this.teal_line = line === undefined ? 0 : line;
|
|
38
38
|
this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
|
|
39
39
|
if (this.teal_line > 0) {
|
package/types/logic-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic-error.js","sources":["../../src/types/logic-error.ts"],"sourcesContent":["
|
|
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\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 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(res[3] ? 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"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,2EAA2E,CAAA;AAkB/F;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AACnC;;;AAGG;;IAEH,OAAO,eAAe,CAAC,KAAU,EAAA;AAC/B,QAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;QAClC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,OAAO,SAAS,CAAA;QAErD,OAAO;AACL,YAAA,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACZ,YAAA,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACX,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;SACA,CAAA;KACvB;AAQD;;;;;AAKG;AACH,IAAA,WAAA,CAAY,YAA+B,EAAE,OAAiB,EAAE,YAAgD,EAAA;AAC9G,QAAA,KAAK,EAAE,CAAA;QAXF,IAAK,CAAA,KAAA,GAAG,CAAC,CAAA;QACT,IAAS,CAAA,SAAA,GAAG,CAAC,CAAA;AAWlB,QAAA,IAAI,CAAC,GAAG,GAAG,YAAY,CAAA;AACvB,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,MAAM,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AAC1C,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,IAAI,CAAA;AAE9C,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAQ,KAAA,EAAA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;AAE9D,QAAA,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;AAC3E,YAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAA;YAExG,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAE9C,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,CAAA;YAEpD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACpC;KACF;AACF;;;;"}
|
package/types/logic-error.mjs
CHANGED
|
@@ -23,15 +23,15 @@ class LogicError extends Error {
|
|
|
23
23
|
* Create a new logic error object.
|
|
24
24
|
* @param errorDetails The details of the logic error
|
|
25
25
|
* @param program The TEAL source code, split by line
|
|
26
|
-
* @param
|
|
26
|
+
* @param getLineForPc The source map of the TEAL source code
|
|
27
27
|
*/
|
|
28
|
-
constructor(errorDetails, program,
|
|
28
|
+
constructor(errorDetails, program, getLineForPc) {
|
|
29
29
|
super();
|
|
30
30
|
this.lines = 5;
|
|
31
31
|
this.teal_line = 0;
|
|
32
32
|
this.led = errorDetails;
|
|
33
33
|
this.program = program;
|
|
34
|
-
const line =
|
|
34
|
+
const line = getLineForPc(errorDetails.pc);
|
|
35
35
|
this.teal_line = line === undefined ? 0 : line;
|
|
36
36
|
this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;
|
|
37
37
|
if (this.teal_line > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic-error.mjs","sources":["../../src/types/logic-error.ts"],"sourcesContent":["
|
|
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\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 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(res[3] ? 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"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,2EAA2E,CAAA;AAkB/F;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AACnC;;;AAGG;;IAEH,OAAO,eAAe,CAAC,KAAU,EAAA;AAC/B,QAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAA;QAClC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,OAAO,SAAS,CAAA;QAErD,OAAO;AACL,YAAA,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACZ,YAAA,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACX,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACnC,MAAM,EAAE,KAAK,CAAC,MAAM;SACA,CAAA;KACvB;AAQD;;;;;AAKG;AACH,IAAA,WAAA,CAAY,YAA+B,EAAE,OAAiB,EAAE,YAAgD,EAAA;AAC9G,QAAA,KAAK,EAAE,CAAA;QAXF,IAAK,CAAA,KAAA,GAAG,CAAC,CAAA;QACT,IAAS,CAAA,SAAA,GAAG,CAAC,CAAA;AAWlB,QAAA,IAAI,CAAC,GAA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