@layerzerolabs/ton-sdk-tools 3.0.83 → 3.0.84-aptos-301.0
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/CHANGELOG.md +0 -12
- package/dist/index.cjs +49 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.mjs +50 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -329,6 +329,7 @@ function parseClasses(strInput) {
|
|
|
329
329
|
const name = rawName.replace(/::New$/, "");
|
|
330
330
|
const functionName = snakeToCamelCase("getnew_" + name);
|
|
331
331
|
const [fieldMap, inverseFieldMap] = parseFieldNames(strInput);
|
|
332
|
+
console.log(`Parsing ${name}...`);
|
|
332
333
|
const tonNameRegex = /const int\s+(?:md::)?[\w:]+::NAME = "(.*?)"u;/;
|
|
333
334
|
const tonNameMatch = strInput.match(tonNameRegex);
|
|
334
335
|
const tonName = tonNameMatch ? tonNameMatch[1] : name;
|
|
@@ -1372,6 +1373,8 @@ import {
|
|
|
1372
1373
|
keyMap,
|
|
1373
1374
|
} from '${options.relativeSrcPath}'
|
|
1374
1375
|
|
|
1376
|
+
const RECURSIVE_DECODE = false
|
|
1377
|
+
|
|
1375
1378
|
export const ActionTypes: { [key: string]: bigint } = {
|
|
1376
1379
|
increment: BigInt(1),
|
|
1377
1380
|
aba: BigInt(2),
|
|
@@ -5977,12 +5980,6 @@ var JettonWallet = class _JettonWallet {
|
|
|
5977
5980
|
return res.balance;
|
|
5978
5981
|
}
|
|
5979
5982
|
};
|
|
5980
|
-
function setLzTonSdkWriteToConsole(enabled) {
|
|
5981
|
-
process.env.LZ_TON_SDK_WRITE_TO_CONSOLE = enabled.toString();
|
|
5982
|
-
}
|
|
5983
|
-
function setLzTonSdkSaveToJson(enabled) {
|
|
5984
|
-
process.env.LZ_TON_SDK_SAVE_TO_JSON = enabled.toString();
|
|
5985
|
-
}
|
|
5986
5983
|
var decimalCount = 9;
|
|
5987
5984
|
var decimal = pow10(decimalCount);
|
|
5988
5985
|
var defaultPath = "gasInfo";
|
|
@@ -6034,62 +6031,58 @@ function formatCoins(value, precision = 6) {
|
|
|
6034
6031
|
function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
|
|
6035
6032
|
const { stack } = new Error();
|
|
6036
6033
|
callerStack ?? (callerStack = stack);
|
|
6034
|
+
console.info(callerStack?.split("\n")[2].trim());
|
|
6037
6035
|
let cumulativeFees = 0n;
|
|
6038
6036
|
let gasInfo = {};
|
|
6039
6037
|
let filePath = profile?.filePath ?? defaultPath;
|
|
6040
|
-
|
|
6041
|
-
const shouldWriteToConsole = profile?.writeToConsole ?? process.env.LZ_TON_SDK_WRITE_TO_CONSOLE === "true";
|
|
6042
|
-
if (shouldProfileGas) {
|
|
6038
|
+
if (profile?.profileGas) {
|
|
6043
6039
|
createDirectoryIfNotExist(filePath);
|
|
6044
|
-
filePath = path__namespace.default.join(filePath, `${profile
|
|
6040
|
+
filePath = path__namespace.default.join(filePath, `${profile.fileName}.json`);
|
|
6045
6041
|
gasInfo = readOrCreateJsonFile(filePath);
|
|
6046
6042
|
}
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
)
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
);
|
|
6091
|
-
}
|
|
6092
|
-
if (shouldProfileGas) sortAndSave(filePath, gasInfo);
|
|
6043
|
+
console.table(
|
|
6044
|
+
transactions.map((tx) => {
|
|
6045
|
+
if (tx.description.type !== "generic") return void 0;
|
|
6046
|
+
const body = tx.inMessage?.info.type === "internal" ? tx.inMessage.body.beginParse() : void 0;
|
|
6047
|
+
const op = body === void 0 ? 0n : body.remainingBits >= 32 ? body.preloadUint(32) : 0n;
|
|
6048
|
+
const totalFees = formatCoins(tx.totalFees.coins);
|
|
6049
|
+
const computeFees = formatCoins(
|
|
6050
|
+
tx.description.computePhase.type === "vm" ? tx.description.computePhase.gasFees : void 0
|
|
6051
|
+
);
|
|
6052
|
+
const totalFwdFees = formatCoins(tx.description.actionPhase?.totalFwdFees ?? void 0);
|
|
6053
|
+
formatCoins(
|
|
6054
|
+
tx.inMessage?.info.type === "internal" ? tx.inMessage.info.value.coins : void 0
|
|
6055
|
+
);
|
|
6056
|
+
formatCoins(
|
|
6057
|
+
tx.outMessages.values().reduce(
|
|
6058
|
+
(total, message) => total + (message.info.type === "internal" ? message.info.value.coins : 0n),
|
|
6059
|
+
0n
|
|
6060
|
+
)
|
|
6061
|
+
);
|
|
6062
|
+
const forwardIn = formatCoins(
|
|
6063
|
+
tx.inMessage?.info.type === "internal" ? tx.inMessage.info.forwardFee : void 0
|
|
6064
|
+
);
|
|
6065
|
+
const addressString = tx.address.toString(16).length != 64 ? "UNKNOWN" : core.Address.parseRaw("1:" + tx.address.toString(16));
|
|
6066
|
+
const opString = op.toString() in opcodeInfo ? opcodeInfo[op.toString()] : op.toString();
|
|
6067
|
+
cumulativeFees += tx.totalFees.coins + (tx.description.actionPhase?.totalFwdFees ?? 0n);
|
|
6068
|
+
if (profile?.profileGas) gasInfo[opString] = formatCoins(cumulativeFees);
|
|
6069
|
+
return {
|
|
6070
|
+
address: addressString,
|
|
6071
|
+
op: opString,
|
|
6072
|
+
// valueIn,
|
|
6073
|
+
// valueOut,
|
|
6074
|
+
totalFees,
|
|
6075
|
+
inForwardFee: forwardIn,
|
|
6076
|
+
outForwardFee: totalFwdFees,
|
|
6077
|
+
// outActions: tx.description.actionPhase?.totalActions ?? 'N/A',
|
|
6078
|
+
computeFee: computeFees,
|
|
6079
|
+
// exitCode: tx.description.computePhase.type === 'vm' ? tx.description.computePhase.exitCode : 'N/A',
|
|
6080
|
+
// actionCode: tx.description.actionPhase?.resultCode ?? 'N/A',
|
|
6081
|
+
cumulativeFee: formatCoins(cumulativeFees)
|
|
6082
|
+
};
|
|
6083
|
+
}).filter((v) => v !== void 0)
|
|
6084
|
+
);
|
|
6085
|
+
if (profile?.profileGas) sortAndSave(filePath, gasInfo);
|
|
6093
6086
|
}
|
|
6094
6087
|
async function sendMessageViaMultisigAndExpect({
|
|
6095
6088
|
blockchain,
|
|
@@ -6274,8 +6267,6 @@ exports.saveTonObjectUnwrapper = saveTonObjectUnwrapper;
|
|
|
6274
6267
|
exports.saveViewFunctions = saveViewFunctions;
|
|
6275
6268
|
exports.sendInternalMessageAndExpect = sendInternalMessageAndExpect;
|
|
6276
6269
|
exports.sendMessageViaMultisigAndExpect = sendMessageViaMultisigAndExpect;
|
|
6277
|
-
exports.setLzTonSdkSaveToJson = setLzTonSdkSaveToJson;
|
|
6278
|
-
exports.setLzTonSdkWriteToConsole = setLzTonSdkWriteToConsole;
|
|
6279
6270
|
exports.storageCollected = storageCollected;
|
|
6280
6271
|
exports.to32ByteBuffer = to32ByteBuffer;
|
|
6281
6272
|
exports.toHaveTransactions = toHaveTransactions;
|