@layerzerolabs/ton-sdk-tools 3.0.13-ton.0 → 3.0.18-ton.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 +12 -0
- package/dist/index.cjs +65 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +65 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -105,6 +105,9 @@ declare const addressToBigInt: (address: Address) => bigint;
|
|
|
105
105
|
* @param maxIntermediateBufferSize
|
|
106
106
|
*/
|
|
107
107
|
declare function to32ByteBuffer(value: bigint | number | string | Uint8Array, maxIntermediateBufferSize?: number): Buffer;
|
|
108
|
+
declare function findDeepestCell(cell: Cell): {
|
|
109
|
+
subTreeCells: number;
|
|
110
|
+
};
|
|
108
111
|
|
|
109
112
|
interface SendRequestOptions {
|
|
110
113
|
value: number | bigint | string;
|
|
@@ -445,4 +448,4 @@ declare function printTransactionTrace(transactions: Transaction[], opcodeInfo:
|
|
|
445
448
|
[p: string]: string;
|
|
446
449
|
}, callerStack?: string, profile?: Profile): void;
|
|
447
450
|
|
|
448
|
-
export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
|
451
|
+
export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -105,6 +105,9 @@ declare const addressToBigInt: (address: Address) => bigint;
|
|
|
105
105
|
* @param maxIntermediateBufferSize
|
|
106
106
|
*/
|
|
107
107
|
declare function to32ByteBuffer(value: bigint | number | string | Uint8Array, maxIntermediateBufferSize?: number): Buffer;
|
|
108
|
+
declare function findDeepestCell(cell: Cell): {
|
|
109
|
+
subTreeCells: number;
|
|
110
|
+
};
|
|
108
111
|
|
|
109
112
|
interface SendRequestOptions {
|
|
110
113
|
value: number | bigint | string;
|
|
@@ -445,4 +448,4 @@ declare function printTransactionTrace(transactions: Transaction[], opcodeInfo:
|
|
|
445
448
|
[p: string]: string;
|
|
446
449
|
}, callerStack?: string, profile?: Profile): void;
|
|
447
450
|
|
|
448
|
-
export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
|
451
|
+
export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
package/dist/index.mjs
CHANGED
|
@@ -62,6 +62,18 @@ function isValidHex(str2) {
|
|
|
62
62
|
const hexRegex = /^(0x)?[0-9A-Fa-f]+$/;
|
|
63
63
|
return hexRegex.test(str2);
|
|
64
64
|
}
|
|
65
|
+
function findDeepestCell(cell) {
|
|
66
|
+
const refs = Array.from({ length: cell.refs.length }, (_, i) => cell.refs.at(i));
|
|
67
|
+
if (refs.length === 0) {
|
|
68
|
+
return { subTreeCells: 1 };
|
|
69
|
+
}
|
|
70
|
+
let size = 0;
|
|
71
|
+
for (const ref of refs) {
|
|
72
|
+
if (!ref) continue;
|
|
73
|
+
size += findDeepestCell(ref).subTreeCells;
|
|
74
|
+
}
|
|
75
|
+
return { subTreeCells: size };
|
|
76
|
+
}
|
|
65
77
|
|
|
66
78
|
// src/sdk-tools.ts
|
|
67
79
|
var file_signature_header = `////// Generated by sdk/sdk-generator.ts`;
|
|
@@ -150,6 +162,7 @@ function tsTypeToTSGetterName(tsType, wrapperName = "platonic") {
|
|
|
150
162
|
return `${wrapperName}.getClCell`;
|
|
151
163
|
case "Tuple":
|
|
152
164
|
return `${wrapperName}.getClObj`;
|
|
165
|
+
// TODO: this will definitely bite me in the future
|
|
153
166
|
case "LzDict":
|
|
154
167
|
return "getLzDict";
|
|
155
168
|
default:
|
|
@@ -456,15 +469,24 @@ export class TonContractWrapper extends BaseWrapper {
|
|
|
456
469
|
return ret.stack.readCell()
|
|
457
470
|
}
|
|
458
471
|
|
|
459
|
-
async
|
|
472
|
+
async getDictCellItem(provider: ContractProvider, dict_cell: Cell, key: bigint): Promise<Cell> {
|
|
460
473
|
const args: TupleItem[] = [
|
|
461
474
|
{ type: 'cell', cell: dict_cell },
|
|
462
475
|
{ type: 'int', value: key },
|
|
463
476
|
]
|
|
464
|
-
const ret = await provider.get('cl::dict256::get', args)
|
|
477
|
+
const ret = await provider.get('cl::dict256::get<cellRef>', args)
|
|
465
478
|
return ret.stack.readCell()
|
|
466
479
|
}
|
|
467
480
|
|
|
481
|
+
async getDictUint256Item(provider: ContractProvider, dict_cell: Cell, key: bigint): Promise<bigint> {
|
|
482
|
+
const args: TupleItem[] = [
|
|
483
|
+
{ type: 'cell', cell: dict_cell },
|
|
484
|
+
{ type: 'int', value: key },
|
|
485
|
+
]
|
|
486
|
+
const ret = await provider.get('cl::dict256::get<uint256>', args)
|
|
487
|
+
return ret.stack.readBigNumber()
|
|
488
|
+
}
|
|
489
|
+
|
|
468
490
|
async getSetDictItem(provider: ContractProvider, dict_cell: Cell, key: bigint, value: Cell): Promise<Cell> {
|
|
469
491
|
const args: TupleItem[] = [
|
|
470
492
|
{ type: 'cell', cell: dict_cell },
|
|
@@ -543,8 +565,12 @@ export class LzDict {
|
|
|
543
565
|
return new LzDict(beginCell().endCell())
|
|
544
566
|
}
|
|
545
567
|
|
|
546
|
-
async
|
|
547
|
-
return wrapper.
|
|
568
|
+
async getCell(key: bigint, wrapper: ExtendedContract<TonContractWrapper>): Promise<Cell> {
|
|
569
|
+
return wrapper.getDictCellItem(this._cell, key)
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
async getBigInt(key: bigint, wrapper: ExtendedContract<TonContractWrapper>): Promise<bigint> {
|
|
573
|
+
return wrapper.getDictUint256Item(this._cell, key)
|
|
548
574
|
}
|
|
549
575
|
|
|
550
576
|
async set(key: bigint, value: Cell, wrapper: ExtendedContract<TonContractWrapper>): Promise<void> {
|
|
@@ -813,55 +839,39 @@ ${Object.entries(tonObjects).map(([_, constructor]) => constructor.deconstructor
|
|
|
813
839
|
fs.writeFileSync(path.join(directory, "TonObjectUnwrapper.ts"), savedCode);
|
|
814
840
|
}
|
|
815
841
|
function findClass(tonClasses, name) {
|
|
816
|
-
if (name in tonClasses)
|
|
817
|
-
return tonClasses[name];
|
|
842
|
+
if (name in tonClasses) return tonClasses[name];
|
|
818
843
|
const lzName = "lz::" + name;
|
|
819
|
-
if (lzName in tonClasses)
|
|
820
|
-
return tonClasses[lzName];
|
|
844
|
+
if (lzName in tonClasses) return tonClasses[lzName];
|
|
821
845
|
const mdName = "md::" + name;
|
|
822
|
-
if (mdName in tonClasses)
|
|
823
|
-
return tonClasses[mdName];
|
|
846
|
+
if (mdName in tonClasses) return tonClasses[mdName];
|
|
824
847
|
const clName = "cl::" + name;
|
|
825
|
-
if (clName in tonClasses)
|
|
826
|
-
return tonClasses[clName];
|
|
848
|
+
if (clName in tonClasses) return tonClasses[clName];
|
|
827
849
|
const packetV1Key = "lz::" + name.replace("packet", "packet_v1");
|
|
828
|
-
if (packetV1Key in tonClasses)
|
|
829
|
-
return tonClasses[packetV1Key];
|
|
850
|
+
if (packetV1Key in tonClasses) return tonClasses[packetV1Key];
|
|
830
851
|
const packetV1UnderscoreKey = "lz::" + name.replace("packet", "packet_v1_");
|
|
831
|
-
if (packetV1UnderscoreKey in tonClasses)
|
|
832
|
-
return tonClasses[packetV1UnderscoreKey];
|
|
852
|
+
if (packetV1UnderscoreKey in tonClasses) return tonClasses[packetV1UnderscoreKey];
|
|
833
853
|
const packetV2Key = "lz::" + name.replace("packet", "packet_v2");
|
|
834
|
-
if (packetV2Key in tonClasses)
|
|
835
|
-
return tonClasses[packetV2Key];
|
|
854
|
+
if (packetV2Key in tonClasses) return tonClasses[packetV2Key];
|
|
836
855
|
const packetV2UnderscoreKey = "lz::" + name.replace("packet", "packet_v2_");
|
|
837
|
-
if (packetV2UnderscoreKey in tonClasses)
|
|
838
|
-
return tonClasses[packetV2UnderscoreKey];
|
|
856
|
+
if (packetV2UnderscoreKey in tonClasses) return tonClasses[packetV2UnderscoreKey];
|
|
839
857
|
return void 0;
|
|
840
858
|
}
|
|
841
859
|
function findClassKey(tonClasses, name) {
|
|
842
|
-
if (name in tonClasses)
|
|
843
|
-
return name;
|
|
860
|
+
if (name in tonClasses) return name;
|
|
844
861
|
const lzName = "lz::" + name;
|
|
845
|
-
if (lzName in tonClasses)
|
|
846
|
-
return lzName;
|
|
862
|
+
if (lzName in tonClasses) return lzName;
|
|
847
863
|
const mdName = "md::" + name;
|
|
848
|
-
if (mdName in tonClasses)
|
|
849
|
-
return mdName;
|
|
864
|
+
if (mdName in tonClasses) return mdName;
|
|
850
865
|
const clName = "cl::" + name;
|
|
851
|
-
if (clName in tonClasses)
|
|
852
|
-
return clName;
|
|
866
|
+
if (clName in tonClasses) return clName;
|
|
853
867
|
const packetV1Key = "lz::" + name.replace("packet", "packet_v1");
|
|
854
|
-
if (packetV1Key in tonClasses)
|
|
855
|
-
return packetV1Key;
|
|
868
|
+
if (packetV1Key in tonClasses) return packetV1Key;
|
|
856
869
|
const packetV1UnderscoreKey = "lz::" + name.replace("packet", "packet_v1_");
|
|
857
|
-
if (packetV1UnderscoreKey in tonClasses)
|
|
858
|
-
return packetV1UnderscoreKey;
|
|
870
|
+
if (packetV1UnderscoreKey in tonClasses) return packetV1UnderscoreKey;
|
|
859
871
|
const packetV2Key = "lz::" + name.replace("packet", "packet_v2");
|
|
860
|
-
if (packetV2Key in tonClasses)
|
|
861
|
-
return packetV2Key;
|
|
872
|
+
if (packetV2Key in tonClasses) return packetV2Key;
|
|
862
873
|
const packetV2UnderscoreKey = "lz::" + name.replace("packet", "packet_v2_");
|
|
863
|
-
if (packetV2UnderscoreKey in tonClasses)
|
|
864
|
-
return packetV2UnderscoreKey;
|
|
874
|
+
if (packetV2UnderscoreKey in tonClasses) return packetV2UnderscoreKey;
|
|
865
875
|
return void 0;
|
|
866
876
|
}
|
|
867
877
|
function generateConstructorCodes(className, tonClasses) {
|
|
@@ -872,6 +882,10 @@ function generateConstructorCodes(className, tonClasses) {
|
|
|
872
882
|
const { constructorInputArgs: inputArgs } = tonClass;
|
|
873
883
|
const fnName = snakeToCamelCase(`getNew_${className}`);
|
|
874
884
|
const scratchFnName = snakeToCamelCase(`getNew_${className}FromScratch`);
|
|
885
|
+
let methodIdName = `${className}::New`;
|
|
886
|
+
if (className.includes("::New")) {
|
|
887
|
+
methodIdName = className;
|
|
888
|
+
}
|
|
875
889
|
tonClass.constructorName = fnName;
|
|
876
890
|
tonClass.fromScratchConstructorName = scratchFnName;
|
|
877
891
|
tonClass.nonClassConstructorArgs = {};
|
|
@@ -879,7 +893,7 @@ function generateConstructorCodes(className, tonClasses) {
|
|
|
879
893
|
async ${fnName}(provider: ContractProvider${Object.keys(inputArgs).length > 0 ? `, args: {
|
|
880
894
|
${Object.entries(inputArgs).map(([argName, argType]) => `${argName}: ${tonTypeToTStype(argType)}`).join(",\n ")}
|
|
881
895
|
}` : ""}): Promise<Cell> {
|
|
882
|
-
const getResult = await provider.get('${
|
|
896
|
+
const getResult = await provider.get('${methodIdName}', [
|
|
883
897
|
${Object.entries(inputArgs).map(
|
|
884
898
|
([argName, argType]) => `{ type: '${tonTypeToTupleType(argType)}', ${tonTypeToTupleValueName(argType)}: ${tonTypeToTupleValue(Object.keys(inputArgs).length > 0 ? `args.${argName}` : argName, argType)} }`
|
|
885
899
|
).join(",\n ")}
|
|
@@ -894,7 +908,7 @@ function generateConstructorCodes(className, tonClasses) {
|
|
|
894
908
|
async ${fnName}Cell(provider: ContractProvider${Object.keys(inputArgs).length > 0 ? `, args: {
|
|
895
909
|
${Object.entries(cellArgs).map(([argName, argType]) => `${argName}: ${tonTypeToTStype(argType, "Slice", true)}`).join(",\n ")}
|
|
896
910
|
}` : ""}): Promise<Cell> {
|
|
897
|
-
const getResult = await provider.get('${
|
|
911
|
+
const getResult = await provider.get('${methodIdName}', [
|
|
898
912
|
${Object.entries(cellArgs).map(
|
|
899
913
|
([argName, argType]) => `{ type: '${tonTypeToTupleType(argType)}', ${tonTypeToTupleValueName(argType)}: ${tonTypeToTupleValue(Object.keys(inputArgs).length > 0 ? `args.${argName}` : argName, argType)} }`
|
|
900
914
|
).join(",\n ")}
|
|
@@ -1416,8 +1430,8 @@ import { FlatTransactionComparable } from '@ton/test-utils'
|
|
|
1416
1430
|
import ChannelArtifact from '@layerzerolabs/layerzero-v2-ton/build/Channel.compiled.json'
|
|
1417
1431
|
import ControllerArtifact from '@layerzerolabs/layerzero-v2-ton/build/Controller.compiled.json'
|
|
1418
1432
|
import EndpointArtifact from '@layerzerolabs/layerzero-v2-ton/build/Endpoint.compiled.json'
|
|
1419
|
-
import MultiSigArtifact from '@layerzerolabs/layerzero-v2-ton/
|
|
1420
|
-
import MultiSigOrderArtifact from '@layerzerolabs/layerzero-v2-ton/
|
|
1433
|
+
import MultiSigArtifact from '@layerzerolabs/layerzero-v2-ton/src/multisig/bocs/MultiSig.compiled.json'
|
|
1434
|
+
import MultiSigOrderArtifact from '@layerzerolabs/layerzero-v2-ton/src/multisig/bocs/MultiSigOrder.compiled.json'
|
|
1421
1435
|
import SmlConnectionArtifact from '@layerzerolabs/layerzero-v2-ton/build/SmlConnection.compiled.json'
|
|
1422
1436
|
import SmlManagerArtifact from '@layerzerolabs/layerzero-v2-ton/build/SmlManager.compiled.json'
|
|
1423
1437
|
import ZroMinterArtifact from '@layerzerolabs/layerzero-v2-ton/build/ZroMinter.compiled.json'
|
|
@@ -2642,7 +2656,7 @@ export async function openAndDeploySmlConnection(
|
|
|
2642
2656
|
{
|
|
2643
2657
|
from: srcFixture.oApp.address,
|
|
2644
2658
|
to: smlManager.address,
|
|
2645
|
-
op: Number(OPCODES.
|
|
2659
|
+
op: Number(OPCODES.MsglibManager_OP_DEPLOY_CONNECTION),
|
|
2646
2660
|
success: true,
|
|
2647
2661
|
},
|
|
2648
2662
|
{
|
|
@@ -3415,15 +3429,12 @@ var getMsgPrices = (configRaw, workchain) => {
|
|
|
3415
3429
|
};
|
|
3416
3430
|
};
|
|
3417
3431
|
var storageCollected = (trans) => {
|
|
3418
|
-
if (trans.description.type !== "generic")
|
|
3419
|
-
throw new Error("Expected generic transaction");
|
|
3432
|
+
if (trans.description.type !== "generic") throw new Error("Expected generic transaction");
|
|
3420
3433
|
return trans.description.storagePhase ? trans.description.storagePhase.storageFeesCollected : 0n;
|
|
3421
3434
|
};
|
|
3422
3435
|
var computedGeneric = (trans) => {
|
|
3423
|
-
if (trans.description.type !== "generic")
|
|
3424
|
-
|
|
3425
|
-
if (trans.description.computePhase.type !== "vm")
|
|
3426
|
-
throw new Error("Compute phase expected");
|
|
3436
|
+
if (trans.description.type !== "generic") throw new Error("Expected generic transaction");
|
|
3437
|
+
if (trans.description.computePhase.type !== "vm") throw new Error("Compute phase expected");
|
|
3427
3438
|
return trans.description.computePhase;
|
|
3428
3439
|
};
|
|
3429
3440
|
var Txiterator = class {
|
|
@@ -3440,8 +3451,7 @@ var Txiterator = class {
|
|
|
3440
3451
|
throw new Error("MsgQueued is undefined");
|
|
3441
3452
|
}
|
|
3442
3453
|
const inMsg = curMsg.msg;
|
|
3443
|
-
if (inMsg.info.type !== "internal")
|
|
3444
|
-
throw new Error("Internal only");
|
|
3454
|
+
if (inMsg.info.type !== "internal") throw new Error("Internal only");
|
|
3445
3455
|
const smc = await this.blockchain.getContract(inMsg.info.dest);
|
|
3446
3456
|
const res = await smc.receiveMessage(inMsg, { now: this.blockchain.now });
|
|
3447
3457
|
const bcRes = {
|
|
@@ -3821,8 +3831,7 @@ function formatCoinsPure(value, precision = 6) {
|
|
|
3821
3831
|
return `${whole.toString()}${frac !== 0n ? "." + frac.toString().padStart(precision, "0").replace(/0+$/, "") : ""}`;
|
|
3822
3832
|
}
|
|
3823
3833
|
function formatCoins(value, precision = 6) {
|
|
3824
|
-
if (value === void 0)
|
|
3825
|
-
return "N/A";
|
|
3834
|
+
if (value === void 0) return "N/A";
|
|
3826
3835
|
return formatCoinsPure(value, precision);
|
|
3827
3836
|
}
|
|
3828
3837
|
function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
|
|
@@ -3839,8 +3848,7 @@ function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
|
|
|
3839
3848
|
}
|
|
3840
3849
|
console.table(
|
|
3841
3850
|
transactions.map((tx) => {
|
|
3842
|
-
if (tx.description.type !== "generic")
|
|
3843
|
-
return void 0;
|
|
3851
|
+
if (tx.description.type !== "generic") return void 0;
|
|
3844
3852
|
const body = tx.inMessage?.info.type === "internal" ? tx.inMessage.body.beginParse() : void 0;
|
|
3845
3853
|
const op = body === void 0 ? 0n : body.remainingBits >= 32 ? body.preloadUint(32) : 0n;
|
|
3846
3854
|
const totalFees = formatCoins(tx.totalFees.coins);
|
|
@@ -3863,8 +3871,7 @@ function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
|
|
|
3863
3871
|
const addressString = tx.address.toString(16).length != 64 ? "UNKNOWN" : Address.parseRaw("1:" + tx.address.toString(16));
|
|
3864
3872
|
const opString = op.toString() in opcodeInfo ? opcodeInfo[op.toString()] : op.toString();
|
|
3865
3873
|
cumulativeFees += tx.totalFees.coins + (tx.description.actionPhase?.totalFwdFees ?? 0n);
|
|
3866
|
-
if (profile?.profileGas)
|
|
3867
|
-
gasInfo[opString] = formatCoins(cumulativeFees);
|
|
3874
|
+
if (profile?.profileGas) gasInfo[opString] = formatCoins(cumulativeFees);
|
|
3868
3875
|
return {
|
|
3869
3876
|
address: addressString,
|
|
3870
3877
|
op: opString,
|
|
@@ -3881,10 +3888,9 @@ function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
|
|
|
3881
3888
|
};
|
|
3882
3889
|
}).filter((v) => v !== void 0)
|
|
3883
3890
|
);
|
|
3884
|
-
if (profile?.profileGas)
|
|
3885
|
-
sortAndSave(filePath, gasInfo);
|
|
3891
|
+
if (profile?.profileGas) sortAndSave(filePath, gasInfo);
|
|
3886
3892
|
}
|
|
3887
3893
|
|
|
3888
|
-
export { BASE_CHAIN_ID, BaseWrapper, Errors, JettonMinter, JettonWallet, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, Op, Order, Txiterator, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
|
3889
|
-
//# sourceMappingURL=
|
|
3894
|
+
export { BASE_CHAIN_ID, BaseWrapper, Errors, JettonMinter, JettonWallet, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, Op, Order, Txiterator, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
|
|
3895
|
+
//# sourceMappingURL=index.mjs.map
|
|
3890
3896
|
//# sourceMappingURL=index.mjs.map
|