@layerzerolabs/ton-sdk-tools 3.0.12-ton.0 → 3.0.13-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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @layerzerolabs/ton-sdk-tools
2
2
 
3
+ ## 3.0.13-ton.0
4
+
5
+ ### Patch Changes
6
+
7
+ - loopback wire
8
+
3
9
  ## 3.0.12-ton.0
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var fs2 = require('fs');
4
- var path2 = require('path');
3
+ var fs = require('fs');
4
+ var path = require('path');
5
5
  var core = require('@ton/core');
6
6
  var bigintBuffer = require('bigint-buffer');
7
7
  var crc32 = require('crc-32');
@@ -27,70 +27,12 @@ function _interopNamespace(e) {
27
27
  return Object.freeze(n);
28
28
  }
29
29
 
30
- var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
31
- var path2__namespace = /*#__PURE__*/_interopNamespace(path2);
30
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
31
+ var path__namespace = /*#__PURE__*/_interopNamespace(path);
32
32
  var crc32__namespace = /*#__PURE__*/_interopNamespace(crc32);
33
33
 
34
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
35
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
36
- }) : x)(function(x) {
37
- if (typeof require !== "undefined")
38
- return require.apply(this, arguments);
39
- throw Error('Dynamic require of "' + x + '" is not supported');
40
- });
41
- function thisPkgRoot(startDir = __dirname) {
42
- let currentDir = startDir;
43
- while (currentDir !== path2__namespace.default.parse(currentDir).root) {
44
- const packageJsonPath = path2__namespace.default.join(currentDir, "package.json");
45
- if (fs2__namespace.default.existsSync(packageJsonPath)) {
46
- return currentDir;
47
- }
48
- currentDir = path2__namespace.default.dirname(currentDir);
49
- }
50
- return "";
51
- }
52
- function assertActiveCell(state) {
53
- if (state.type !== "active") {
54
- throw new Error("Contract is not active");
55
- }
56
- if (!state.data) {
57
- throw new Error("Contract data is empty");
58
- }
59
- return core.Cell.fromBoc(state.data)[0];
60
- }
61
- function getContractsPath(overrideInputPath) {
62
- return overrideInputPath ?? process.env.CONTRACTS_FOLDER ?? path2__namespace.default.dirname(__require.resolve("@layerzerolabs/layerzero-v2-ton/package.json"));
63
- }
64
- function getSdkPath() {
65
- return process.env.SDK_FOLDER ?? thisPkgRoot();
66
- }
67
- function getContractsCodePath() {
68
- return path2__namespace.default.resolve(getContractsPath(), "src");
69
- }
70
- function getSdkCodePath() {
71
- return path2__namespace.default.resolve(getSdkPath(), "src");
72
- }
73
- function getContractBuildPath(name, overrideInputPath) {
74
- const contractsRoot = getContractsPath(overrideInputPath);
75
- const f = path2__namespace.default.join(contractsRoot, "build", `${name}.compiled.json`);
76
- if (!fs2__namespace.default.existsSync(f)) {
77
- const altPath = path2__namespace.default.dirname(__require.resolve("@layerzerolabs/layerzero-v2-ton/package.json"));
78
- const altF = path2__namespace.default.join(altPath, "build", `${name}.compiled.json`);
79
- if (fs2__namespace.default.existsSync(altF)) {
80
- return altF;
81
- } else {
82
- throw new Error(
83
- `Contract build file not found: ${f}, did you forget to run 'yarn compile' in ton/contracts?`
84
- );
85
- }
86
- }
87
- return f;
88
- }
89
- function getCompiledCode(name, overrideInputPath) {
90
- const compiledJson = fs2__namespace.default.readFileSync(getContractBuildPath(name, overrideInputPath), "utf-8");
91
- const { hex: code } = JSON.parse(compiledJson);
92
- return core.Cell.fromBoc(Buffer.from(code, "hex"))[0];
93
- }
34
+ // src/sdk-tools.ts
35
+ var cellFromArtifact = ({ hex }) => core.Cell.fromHex(hex);
94
36
  function getOpcodeCRC(input) {
95
37
  return BigInt(crc32__namespace.str(input) >>> 0);
96
38
  }
@@ -331,15 +273,15 @@ function mergeInputArgs(result, added) {
331
273
  }
332
274
  function parseDirectory(directoryPath) {
333
275
  let result = {};
334
- const items = fs2__namespace.readdirSync(directoryPath);
276
+ const items = fs__namespace.readdirSync(directoryPath);
335
277
  items.forEach((item) => {
336
- const itemPath = path2__namespace.join(directoryPath, item);
337
- const stats = fs2__namespace.statSync(itemPath);
278
+ const itemPath = path__namespace.join(directoryPath, item);
279
+ const stats = fs__namespace.statSync(itemPath);
338
280
  if (itemPath.includes("base_storage")) ;
339
281
  if (stats.isDirectory()) {
340
282
  result = mergeConstructorDicts(result, parseDirectory(itemPath));
341
- } else if (stats.isFile() && path2__namespace.extname(item) === ".fc" && !itemPath.includes("@ston-fi")) {
342
- const content = fs2__namespace.readFileSync(itemPath, "utf8");
283
+ } else if (stats.isFile() && path__namespace.extname(item) === ".fc" && !itemPath.includes("@ston-fi")) {
284
+ const content = fs__namespace.readFileSync(itemPath, "utf8");
343
285
  result = mergeConstructorDicts(result, parseClasses(content));
344
286
  }
345
287
  });
@@ -585,7 +527,7 @@ export class TonContractWrapper extends BaseWrapper {
585
527
  ${generatedMethods}
586
528
  }
587
529
  `;
588
- fs2__namespace.writeFileSync(path2__namespace.join(directory, "TonContractWrapper.ts"), savedCode);
530
+ fs__namespace.writeFileSync(path__namespace.join(directory, "TonContractWrapper.ts"), savedCode);
589
531
  }
590
532
  function saveAllTypes(tonObjects, directory) {
591
533
  const generatedTypes = Object.entries(tonObjects).filter(([_, tonObject]) => tonObject.attributes.length > 0).map(([_, tonObject]) => "export " + (tonObject.tsTypeCode ?? "")).join("");
@@ -642,7 +584,7 @@ ${generatedTypes}
642
584
 
643
585
  ${generatedNameMap}
644
586
  `;
645
- fs2__namespace.writeFileSync(path2__namespace.join(directory, "allTypes.ts"), savedCode);
587
+ fs__namespace.writeFileSync(path__namespace.join(directory, "allTypes.ts"), savedCode);
646
588
  }
647
589
  function saveTonObjectUnwrapper(tonObjects, directory) {
648
590
  const allTypes = [
@@ -890,7 +832,7 @@ export class TonObjectUnwrapper {
890
832
  ${Object.entries(tonObjects).map(([_, constructor]) => constructor.deconstructorCode ?? "").join("\n")}
891
833
  }
892
834
  `;
893
- fs2__namespace.writeFileSync(path2__namespace.join(directory, "TonObjectUnwrapper.ts"), savedCode);
835
+ fs__namespace.writeFileSync(path__namespace.join(directory, "TonObjectUnwrapper.ts"), savedCode);
894
836
  }
895
837
  function findClass(tonClasses, name) {
896
838
  if (name in tonClasses)
@@ -1214,12 +1156,12 @@ function recursiveGenDeconstructorCode(classConstructors, key = "") {
1214
1156
  function getSpecificFiles(dirPath, includeName) {
1215
1157
  const files = [];
1216
1158
  function traverseDir(currentPath) {
1217
- const entries = fs2__namespace.readdirSync(currentPath, { withFileTypes: true });
1159
+ const entries = fs__namespace.readdirSync(currentPath, { withFileTypes: true });
1218
1160
  for (const entry of entries) {
1219
- const fullPath = path2__namespace.join(currentPath, entry.name);
1161
+ const fullPath = path__namespace.join(currentPath, entry.name);
1220
1162
  if (entry.isDirectory()) {
1221
1163
  traverseDir(fullPath);
1222
- } else if (entry.isFile() && entry.name.toLowerCase().includes(includeName) && (path2__namespace.extname(entry.name) === ".fc" || path2__namespace.extname(entry.name) === ".func")) {
1164
+ } else if (entry.isFile() && entry.name.toLowerCase().includes(includeName) && (path__namespace.extname(entry.name) === ".fc" || path__namespace.extname(entry.name) === ".func")) {
1223
1165
  files.push(fullPath);
1224
1166
  }
1225
1167
  }
@@ -1255,7 +1197,7 @@ export const tonObjects = {
1255
1197
  }
1256
1198
  tsCode += `} as const
1257
1199
  `;
1258
- fs2__namespace.writeFileSync(path2__namespace.resolve(filePath, fileName), tsCode, "utf8");
1200
+ fs__namespace.writeFileSync(path__namespace.resolve(filePath, fileName), tsCode, "utf8");
1259
1201
  }
1260
1202
  function tonConstNameToTSName(name) {
1261
1203
  return name.replace(/::/g, "_");
@@ -1275,7 +1217,7 @@ function extractConstants(fileNames, constType) {
1275
1217
  }
1276
1218
  const result = /* @__PURE__ */ new Map();
1277
1219
  for (const fileName of fileNames) {
1278
- const fileContent = fs2__namespace.readFileSync(fileName, "utf-8");
1220
+ const fileContent = fs__namespace.readFileSync(fileName, "utf-8");
1279
1221
  const lines = fileContent.split("\n");
1280
1222
  for (const line of lines) {
1281
1223
  const trimmedLine = line.trim();
@@ -1324,7 +1266,7 @@ function extractEvents(fileNames) {
1324
1266
  const eventRegex = /^const\s+(?:int\s+)?([\w:]+::[eE][vV][eE][nN][tT]::[\w:]+)\s*=\s*"([\w:]+)"[uc];$/;
1325
1267
  const result = /* @__PURE__ */ new Map();
1326
1268
  for (const fileName of fileNames) {
1327
- const fileContent = fs2__namespace.readFileSync(fileName, "utf-8");
1269
+ const fileContent = fs__namespace.readFileSync(fileName, "utf-8");
1328
1270
  const lines = fileContent.split("\n");
1329
1271
  for (const line of lines) {
1330
1272
  const trimmedLine = line.trim();
@@ -1345,7 +1287,7 @@ export const ${variableName} = {
1345
1287
  ${Array.from(events.entries()).map(([key, [rawValue, intValue]]) => ` ${key}: {stringValue: "${rawValue}", intValue: ${intValue}n},`).join("\n")}
1346
1288
  } as const
1347
1289
  `;
1348
- fs2__namespace.writeFileSync(path2__namespace.join(directory, filename), savedCode);
1290
+ fs__namespace.writeFileSync(path__namespace.join(directory, filename), savedCode);
1349
1291
  }
1350
1292
  function saveConstantsFile(constants, directory, variableName, filename) {
1351
1293
  const savedCode = `${file_signature_header}
@@ -1353,30 +1295,30 @@ export const ${variableName} = {
1353
1295
  ${Array.from(constants.entries()).map(([key, value]) => ` ${key}: ${value}n,`).join("\n")}
1354
1296
  } as const
1355
1297
  `;
1356
- fs2__namespace.writeFileSync(path2__namespace.join(directory, filename), savedCode);
1298
+ fs__namespace.writeFileSync(path__namespace.join(directory, filename), savedCode);
1357
1299
  }
1358
1300
  function generateAllViewFunctions(rootDir, nameWhitelist, blacklist) {
1359
1301
  const contractDirs = [];
1360
1302
  const viewFunctions = {};
1361
1303
  function findContractDirs(dir) {
1362
- const entries = fs2__namespace.readdirSync(dir, { withFileTypes: true });
1304
+ const entries = fs__namespace.readdirSync(dir, { withFileTypes: true });
1363
1305
  const isAContractFolder = entries.some((entry) => !entry.isDirectory() && nameWhitelist.includes(entry.name));
1364
1306
  if (isAContractFolder && !blacklist.some((word) => dir.includes(word))) {
1365
1307
  contractDirs.push(dir);
1366
1308
  }
1367
1309
  entries.forEach((entry) => {
1368
1310
  if (entry.isDirectory()) {
1369
- findContractDirs(path2__namespace.join(dir, entry.name));
1311
+ findContractDirs(path__namespace.join(dir, entry.name));
1370
1312
  }
1371
1313
  });
1372
1314
  }
1373
1315
  findContractDirs(rootDir);
1374
1316
  contractDirs.forEach((dir) => {
1375
- const files = fs2__namespace.readdirSync(dir).filter((file) => file.endsWith(".fc") || file.endsWith(".func"));
1317
+ const files = fs__namespace.readdirSync(dir).filter((file) => file.endsWith(".fc") || file.endsWith(".func"));
1376
1318
  files.forEach((file) => {
1377
- const filePath = path2__namespace.join(dir, file);
1378
- const contractName = snakeToCamelCase(path2__namespace.basename(path2__namespace.dirname(dir)) + "_" + path2__namespace.basename(dir));
1379
- const content = fs2__namespace.readFileSync(filePath, "utf-8");
1319
+ const filePath = path__namespace.join(dir, file);
1320
+ const contractName = snakeToCamelCase(path__namespace.basename(path__namespace.dirname(dir)) + "_" + path__namespace.basename(dir));
1321
+ const content = fs__namespace.readFileSync(filePath, "utf-8");
1380
1322
  const functionRegex = /(\((?:[^()]+,\s*)*[^()]+\)|[\w:]+)\s+(\w+(?:::\w+)*)\s*\(([\w\s,$·]*)\)\s*·?\s*(impure)?\s*(inline\s*)?method_id\s*\{([^}]*)\}/g;
1381
1323
  let match;
1382
1324
  while ((match = functionRegex.exec(content)) !== null) {
@@ -1440,7 +1382,7 @@ import { ExtendedContract, TonContractWrapper } from '../wrappers'
1440
1382
 
1441
1383
  ${generatedFunctions}
1442
1384
  `;
1443
- fs2__namespace.writeFileSync(path2__namespace.join(directory, filename), savedCode);
1385
+ fs__namespace.writeFileSync(path__namespace.join(directory, filename), savedCode);
1444
1386
  }
1445
1387
  var BaseWrapper = class {
1446
1388
  constructor(address, init) {
@@ -1493,6 +1435,16 @@ import {
1493
1435
  } from '@ton/sandbox'
1494
1436
  import { FlatTransactionComparable } from '@ton/test-utils'
1495
1437
 
1438
+ import ChannelArtifact from '@layerzerolabs/layerzero-v2-ton/build/Channel.compiled.json'
1439
+ import ControllerArtifact from '@layerzerolabs/layerzero-v2-ton/build/Controller.compiled.json'
1440
+ import EndpointArtifact from '@layerzerolabs/layerzero-v2-ton/build/Endpoint.compiled.json'
1441
+ import MultiSigArtifact from '@layerzerolabs/layerzero-v2-ton/build/MultiSig.compiled.json'
1442
+ import MultiSigOrderArtifact from '@layerzerolabs/layerzero-v2-ton/build/MultiSigOrder.compiled.json'
1443
+ import SmlConnectionArtifact from '@layerzerolabs/layerzero-v2-ton/build/SmlConnection.compiled.json'
1444
+ import SmlManagerArtifact from '@layerzerolabs/layerzero-v2-ton/build/SmlManager.compiled.json'
1445
+ import ZroMinterArtifact from '@layerzerolabs/layerzero-v2-ton/build/ZroMinter.compiled.json'
1446
+ import ZroWalletArtifact from '@layerzerolabs/layerzero-v2-ton/build/ZroWallet.compiled.json'
1447
+
1496
1448
  import {
1497
1449
  JettonMinter,
1498
1450
  JettonWallet,
@@ -1502,7 +1454,7 @@ import {
1502
1454
  Profile,
1503
1455
  TransferRequest,
1504
1456
  buildOnchainMetadata,
1505
- getCompiledCode,
1457
+ cellFromArtifact,
1506
1458
  getRandomInt,
1507
1459
  printTransactionTrace,
1508
1460
  } from '@layerzerolabs/ton-sdk-tools'
@@ -1790,6 +1742,10 @@ export async function buildNonceMd(nonce: bigint, allStorages: SandboxContract<T
1790
1742
  return allStorages.getObject('md::Nonce::New', [{ type: 'int', value: nonce }])
1791
1743
  }
1792
1744
 
1745
+ export async function buildLzReceivePrepareMd(nonce: bigint, nanotons: bigint, allStorages: SandboxContract<TonContractWrapper>): Promise<Cell> {
1746
+ return allStorages.getObject('md::LzReceivePrepare::New', [{ type: 'int', value: nonce }, { type: 'int', value: nanotons }])
1747
+ }
1748
+
1793
1749
  export function buildMessageBody(donationNanos: number, origin: Address, opcode: number, md: Cell): Cell {
1794
1750
  return beginMessage(opcode)
1795
1751
  .storeUint(donationNanos, 64)
@@ -2418,9 +2374,9 @@ export async function getZroWallet(
2418
2374
  {
2419
2375
  admin: ownerAddress,
2420
2376
  content: buildOnchainMetadata(zroOnchainMetaData),
2421
- wallet_code: getCompiledCode('ZroWallet'),
2377
+ wallet_code: cellFromArtifact(ZroWalletArtifact),
2422
2378
  },
2423
- getCompiledCode('ZroMinter')
2379
+ cellFromArtifact(ZroMinterArtifact)
2424
2380
  )
2425
2381
  )
2426
2382
 
@@ -2447,12 +2403,12 @@ export async function openAndDeployControllerViaMultiSig(
2447
2403
  ): Promise<[SandboxContract<TonContractWrapper>, SendMessageResult]> {
2448
2404
  const controller: SandboxContract<TonContractWrapper> = blockchain.openContract(
2449
2405
  TonContractWrapper.create(
2450
- getCompiledCode('Controller'),
2406
+ cellFromArtifact(ControllerArtifact),
2451
2407
  await allStorages.getNewControllerCell({
2452
2408
  owner: addressToBigInt(multiSigContract.address),
2453
2409
  eid,
2454
- endpointCode: getCompiledCode('Endpoint'),
2455
- channelCode: getCompiledCode('Channel'),
2410
+ endpointCode: cellFromArtifact(EndpointArtifact),
2411
+ channelCode: cellFromArtifact(ChannelArtifact),
2456
2412
  })
2457
2413
  )
2458
2414
  )
@@ -2530,7 +2486,7 @@ export async function openAndDeployEndpoint(
2530
2486
  ): Promise<[SandboxContract<TonContractWrapper>, SendMessageResult]> {
2531
2487
  const endpoint: SandboxContract<TonContractWrapper> = blockchain.openContract(
2532
2488
  TonContractWrapper.create(
2533
- getCompiledCode('Endpoint'),
2489
+ cellFromArtifact(EndpointArtifact),
2534
2490
  await controller.getNewEndpointCell({
2535
2491
  eid: srcEid,
2536
2492
  dstEid: dstEid,
@@ -2583,7 +2539,7 @@ export async function openAndDeployChannel(
2583
2539
  ): Promise<[SandboxContract<TonContractWrapper>, SendMessageResult]> {
2584
2540
  const channel: SandboxContract<TonContractWrapper> = blockchain.openContract(
2585
2541
  TonContractWrapper.create(
2586
- getCompiledCode('Channel'),
2542
+ cellFromArtifact(ChannelArtifact),
2587
2543
  await srcFixture.controller.getNewChannelCell({
2588
2544
  owner: addressToBigInt(srcFixture.controller.address),
2589
2545
  path: srcFixture.path,
@@ -2636,15 +2592,15 @@ export async function openAndDeploySmlManager(
2636
2592
  ): Promise<[SandboxContract<TonContractWrapper>, SendMessageResult]> {
2637
2593
  const smlManager: SandboxContract<TonContractWrapper> = blockchain.openContract(
2638
2594
  TonContractWrapper.create(
2639
- getCompiledCode('SmlManager'),
2595
+ cellFromArtifact(SmlManagerArtifact),
2640
2596
  await allStorages.getNewSmlManagerCell({
2641
2597
  owner: addressToBigInt(fixture.owner.address),
2642
2598
  eid: fixture.eid,
2643
2599
  version,
2644
2600
  controllerAddress: addressToBigInt(fixture.controller.address),
2645
- endpointCode: getCompiledCode('Endpoint'),
2646
- channelCode: getCompiledCode('Channel'),
2647
- smlConnectionCode: getCompiledCode('SmlConnection'),
2601
+ endpointCode: cellFromArtifact(EndpointArtifact),
2602
+ channelCode: cellFromArtifact(ChannelArtifact),
2603
+ smlConnectionCode: cellFromArtifact(SmlConnectionArtifact),
2648
2604
  })
2649
2605
  )
2650
2606
  )
@@ -2677,7 +2633,7 @@ export async function openAndDeploySmlConnection(
2677
2633
  ): Promise<[SandboxContract<TonContractWrapper>, SendMessageResult]> {
2678
2634
  const smlConnection: SandboxContract<TonContractWrapper> = blockchain.openContract(
2679
2635
  TonContractWrapper.create(
2680
- getCompiledCode('SmlConnection'),
2636
+ cellFromArtifact(SmlConnectionArtifact),
2681
2637
  await allStorages.getNewSmlConnectionCell({
2682
2638
  owner: addressToBigInt(smlManager.address),
2683
2639
  path: srcFixture.path,
@@ -2847,7 +2803,7 @@ export async function setupFixture(
2847
2803
 
2848
2804
  // =============================set up 3/3 multi-sig as the controller owner================================
2849
2805
 
2850
- addLibToBlockchain(blockchain, getCompiledCode('MultiSigOrder'))
2806
+ addLibToBlockchain(blockchain, cellFromArtifact(MultiSigOrderArtifact))
2851
2807
 
2852
2808
  const multiSigners = [multiSigOwner1, multiSigOwner2, multiSigOwner3]
2853
2809
  const proposers = await blockchain.createWallets(getRandomInt(10, 20))
@@ -2860,7 +2816,7 @@ export async function setupFixture(
2860
2816
  }
2861
2817
 
2862
2818
  const multiSigContract = blockchain.openContract(
2863
- Multisig.createFromConfig(multiSigConfig, getCompiledCode('MultiSig'))
2819
+ Multisig.createFromConfig(multiSigConfig, cellFromArtifact(MultiSigArtifact))
2864
2820
  )
2865
2821
 
2866
2822
  // deploy the multisig contract
@@ -2906,9 +2862,9 @@ export async function setupFixture(
2906
2862
  {
2907
2863
  admin: multiSigOwner1.address,
2908
2864
  content: buildOnchainMetadata(zroOnchainMetaData),
2909
- wallet_code: getCompiledCode('ZroWallet'),
2865
+ wallet_code: cellFromArtifact(ZroWalletArtifact),
2910
2866
  },
2911
- getCompiledCode('ZroMinter')
2867
+ cellFromArtifact(ZroMinterArtifact)
2912
2868
  )
2913
2869
  )
2914
2870
 
@@ -3177,7 +3133,7 @@ export async function wireFixturesTogetherWithSML(
3177
3133
  )
3178
3134
  }
3179
3135
  `;
3180
- fs2__namespace.default.writeFileSync(path2__namespace.default.join(directory, filename), savedCode);
3136
+ fs__namespace.default.writeFileSync(path__namespace.default.join(directory, filename), savedCode);
3181
3137
  }
3182
3138
 
3183
3139
  // src/externalWrappers/Multisig-Constants.ts
@@ -3846,20 +3802,20 @@ var decimalCount = 9;
3846
3802
  var decimal = pow10(decimalCount);
3847
3803
  var defaultPath = "gasInfo";
3848
3804
  function createDirectoryIfNotExist(directoryPath) {
3849
- if (!fs2__namespace.existsSync(directoryPath)) {
3850
- fs2__namespace.mkdirSync(directoryPath, { recursive: true });
3805
+ if (!fs__namespace.existsSync(directoryPath)) {
3806
+ fs__namespace.mkdirSync(directoryPath, { recursive: true });
3851
3807
  }
3852
3808
  }
3853
3809
  function sortAndSave(filePath, gasInfo) {
3854
3810
  const entries = Object.entries(gasInfo);
3855
3811
  const sortedEntries = entries.sort(([, valueA], [, valueB]) => parseFloat(valueA) - parseFloat(valueB));
3856
3812
  const jsonData = JSON.stringify(Object.fromEntries(sortedEntries), null, 2);
3857
- fs2__namespace.writeFileSync(filePath, `${jsonData}
3813
+ fs__namespace.writeFileSync(filePath, `${jsonData}
3858
3814
  `, "utf8");
3859
3815
  }
3860
3816
  function readOrCreateJsonFile(filePath) {
3861
- if (fs2__namespace.existsSync(filePath)) {
3862
- const fileContent = fs2__namespace.readFileSync(filePath, "utf8");
3817
+ if (fs__namespace.existsSync(filePath)) {
3818
+ const fileContent = fs__namespace.readFileSync(filePath, "utf8");
3863
3819
  return JSON.parse(fileContent);
3864
3820
  } else {
3865
3821
  return {};
@@ -3900,7 +3856,7 @@ function printTransactionTrace(transactions, opcodeInfo, callerStack, profile) {
3900
3856
  let filePath = profile?.filePath ?? defaultPath;
3901
3857
  if (profile?.profileGas) {
3902
3858
  createDirectoryIfNotExist(filePath);
3903
- filePath = path2__namespace.default.join(filePath, `${profile.fileName}.json`);
3859
+ filePath = path__namespace.default.join(filePath, `${profile.fileName}.json`);
3904
3860
  gasInfo = readOrCreateJsonFile(filePath);
3905
3861
  }
3906
3862
  console.table(
@@ -3966,10 +3922,10 @@ exports.Op = Op;
3966
3922
  exports.Order = Order;
3967
3923
  exports.Txiterator = Txiterator;
3968
3924
  exports.addressToBigInt = addressToBigInt;
3969
- exports.assertActiveCell = assertActiveCell;
3970
3925
  exports.beginMessage = beginMessage;
3971
3926
  exports.bigintToAddress = bigintToAddress;
3972
3927
  exports.buildOnchainMetadata = buildOnchainMetadata;
3928
+ exports.cellFromArtifact = cellFromArtifact;
3973
3929
  exports.computedGeneric = computedGeneric;
3974
3930
  exports.differentAddress = differentAddress;
3975
3931
  exports.executeFrom = executeFrom;
@@ -3980,15 +3936,10 @@ exports.findTransaction = findTransaction;
3980
3936
  exports.formatCoinsPure = formatCoinsPure;
3981
3937
  exports.generateAllViewFunctions = generateAllViewFunctions;
3982
3938
  exports.generateTestUtilsCode = generateTestUtilsCode;
3983
- exports.getCompiledCode = getCompiledCode;
3984
- exports.getContractsCodePath = getContractsCodePath;
3985
- exports.getContractsPath = getContractsPath;
3986
3939
  exports.getMsgPrices = getMsgPrices;
3987
3940
  exports.getOpcodeCRC = getOpcodeCRC;
3988
3941
  exports.getRandom = getRandom;
3989
3942
  exports.getRandomInt = getRandomInt;
3990
- exports.getSdkCodePath = getSdkCodePath;
3991
- exports.getSdkPath = getSdkPath;
3992
3943
  exports.getSpecificFiles = getSpecificFiles;
3993
3944
  exports.jettonContentToCell = jettonContentToCell;
3994
3945
  exports.jettonMinterConfigToCell = jettonMinterConfigToCell;