@tychosdk/disasm 0.1.0 → 0.1.1

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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export type { Code, CodeBlock, CodeBlockTail, Data, DataBlock, Item, ItemId, JumpTable, Library, Link, LinkType, Opcode, } from "./env";
2
2
  import type { Code } from "./env";
3
- export declare function disasmStructured(code: string): Promise<Code>;
3
+ import { Cell } from "@ton/core";
4
+ export declare function disasmStructured(code: Cell | string): Promise<Code>;
package/dist/index.js CHANGED
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.disasmStructured = disasmStructured;
4
+ const core_1 = require("@ton/core");
4
5
  const env_1 = require("./env");
5
6
  async function disasmStructured(code) {
6
7
  await (0, env_1.wasmLoaded)();
7
- const res = env_1.wasm.disasm_structured(code);
8
+ let boc;
9
+ if (code instanceof core_1.Cell) {
10
+ boc = code.toBoc({ idx: false }).toString("base64");
11
+ }
12
+ else {
13
+ boc = code;
14
+ }
15
+ const res = env_1.wasm.disasm_structured(boc);
8
16
  return JSON.parse(res);
9
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tychosdk/disasm",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Tycho TVM disasm",
5
5
  "main": "dist/index.js",
6
6
  "browser": {
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@ton/core": "^0.60.1",
20
+ "@ton/crypto": "^3.3.0",
20
21
  "@types/jest": "^29.5.14",
21
22
  "@types/node": "^18.15.11",
22
23
  "jest": "^29.7.0",