@tonappchain/sdk 0.7.2-payload-builder-0.1 → 0.7.2-payload-builder-0.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.
|
@@ -19,3 +19,4 @@ export declare function startTrackingMultiple(transactionLinkers: TransactionLin
|
|
|
19
19
|
txFinalizerConfig?: TxFinalizerConfig;
|
|
20
20
|
logger?: ILogger;
|
|
21
21
|
}): Promise<void | ExecutionStages[]>;
|
|
22
|
+
export declare function printExecutionStagesTable(stages: ExecutionStages, logger: ILogger): void;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.startTracking = startTracking;
|
|
7
4
|
exports.startTrackingMultiple = startTrackingMultiple;
|
|
8
|
-
|
|
5
|
+
exports.printExecutionStagesTable = printExecutionStagesTable;
|
|
9
6
|
const Struct_1 = require("../structs/Struct");
|
|
10
7
|
const Consts_1 = require("./Consts");
|
|
11
8
|
const Logger_1 = require("./Logger");
|
|
@@ -160,35 +157,60 @@ function formatExecutionStages(stages) {
|
|
|
160
157
|
bytesError: data.exists && data.stageData && data.stageData.note != null ? data.stageData.note.internalBytesError : '-',
|
|
161
158
|
}));
|
|
162
159
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
'
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Simple table formatter that works in both browser and Node.js without external dependencies
|
|
162
|
+
*/
|
|
163
|
+
function createSimpleTable(headers, rows, colWidths) {
|
|
164
|
+
const lines = [];
|
|
165
|
+
// Helper to truncate and pad text to fit column width
|
|
166
|
+
const fitToWidth = (text, width) => {
|
|
167
|
+
// Handle multi-line text by taking only the first line for table cell
|
|
168
|
+
const firstLine = text.split('\n')[0];
|
|
169
|
+
if (firstLine.length > width - 2) {
|
|
170
|
+
return firstLine.substring(0, width - 5) + '...';
|
|
171
|
+
}
|
|
172
|
+
return firstLine.padEnd(width, ' ');
|
|
173
|
+
};
|
|
174
|
+
// Create separator line
|
|
175
|
+
const separator = '+' + colWidths.map((w) => '-'.repeat(w)).join('+') + '+';
|
|
176
|
+
// Create header row
|
|
177
|
+
const headerRow = '|' + headers.map((h, i) => fitToWidth(h, colWidths[i])).join('|') + '|';
|
|
178
|
+
lines.push(separator);
|
|
179
|
+
lines.push(headerRow);
|
|
180
|
+
lines.push(separator);
|
|
181
|
+
// Create data rows
|
|
182
|
+
rows.forEach((row) => {
|
|
183
|
+
const dataRow = '|' + row.map((cell, i) => fitToWidth(cell, colWidths[i])).join('|') + '|';
|
|
184
|
+
lines.push(dataRow);
|
|
178
185
|
});
|
|
186
|
+
lines.push(separator);
|
|
187
|
+
return lines.join('\n');
|
|
188
|
+
}
|
|
189
|
+
function printExecutionStagesTable(stages, logger) {
|
|
190
|
+
const headers = [
|
|
191
|
+
'Stage',
|
|
192
|
+
'Exists',
|
|
193
|
+
'Success',
|
|
194
|
+
'Timestamp',
|
|
195
|
+
'Transactions',
|
|
196
|
+
'NoteContent',
|
|
197
|
+
'ErrorName',
|
|
198
|
+
'InternalMsg',
|
|
199
|
+
'BytesError',
|
|
200
|
+
];
|
|
201
|
+
const colWidths = [30, 8, 9, 13, 70, 13, 13, 13, 13];
|
|
179
202
|
const tableData = formatExecutionStages(stages);
|
|
180
|
-
tableData.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
logger.debug(table.toString());
|
|
203
|
+
const rows = tableData.map((row) => [
|
|
204
|
+
row.stage,
|
|
205
|
+
row.exists,
|
|
206
|
+
row.success,
|
|
207
|
+
row.timestamp,
|
|
208
|
+
row.transactions,
|
|
209
|
+
row.noteContent,
|
|
210
|
+
row.errorName,
|
|
211
|
+
row.internalMsg,
|
|
212
|
+
row.bytesError,
|
|
213
|
+
]);
|
|
214
|
+
const table = createSimpleTable(headers, rows, colWidths);
|
|
215
|
+
logger.debug(table);
|
|
194
216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.7.2-payload-builder-0.
|
|
3
|
+
"version": "0.7.2-payload-builder-0.2",
|
|
4
4
|
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
5
|
"author": "TAC. <developers@tac>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
"@tonappchain/ton-lite-client": "3.0.6",
|
|
74
74
|
"@tonconnect/ui": "^2.0.11",
|
|
75
75
|
"bn.js": "^5.2.1",
|
|
76
|
-
"cli-table3": "^0.6.5",
|
|
77
76
|
"dotenv": "^16.4.7",
|
|
78
77
|
"ethers": "^6.13.5",
|
|
79
78
|
"ton-crypto": "^3.2.0"
|