@eosrio/node-abieos 3.3.4-a9d3362 → 4.0.1-2039717

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/package.json CHANGED
@@ -1,55 +1,56 @@
1
- {
2
- "name": "@eosrio/node-abieos",
3
- "version": "3.3.4-a9d3362",
4
- "description": "Node Bindings for abieos: Binary <> JSON conversion using ABIs.",
5
- "main": "./dist/abieos.js",
6
- "types": "./dist/abieos.d.ts",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/abieos.d.ts",
11
- "import": "./dist/abieos.js",
12
- "require": "./dist/abieos.cjs"
13
- }
14
- },
15
- "scripts": {
16
- "install": "node -e 'process.exit(0)'",
17
- "test": "cd examples && node basic.mjs",
18
- "tsc:watch": "tsc --watch",
19
- "clean": "cmake-js clean",
20
- "build": "tsup",
21
- "build:linux": "cmake-js compile --cc /usr/bin/clang-18 --cxx /usr/bin/clang++-18 && cp build/Release/node_abieos.node lib/abieos.node",
22
- "build:linux:ci": "cmake-js compile && cp build/Release/node_abieos.node lib/abieos.node",
23
- "build:win": "cmake-js",
24
- "update_version": "node update-version.mjs"
25
- },
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/eosrio/node-abieos.git"
29
- },
30
- "author": "EOS Rio",
31
- "license": "MIT",
32
- "bugs": {
33
- "url": "https://github.com/eosrio/node-abieos/issues"
34
- },
35
- "homepage": "https://github.com/eosrio/node-abieos#readme",
36
- "devDependencies": {
37
- "@microsoft/api-extractor": "7.47.11",
38
- "@wharfkit/antelope": "^1.0.13",
39
- "@types/node": "22.9.0",
40
- "cmake-js": "7.3.0",
41
- "node-addon-api": "8.2.2",
42
- "tsup": "^8.3.5",
43
- "typescript": "5.6.3"
44
- },
45
- "binary": {
46
- "napi_versions": [
47
- 9
48
- ]
49
- },
50
- "cmake-js": {
51
- "runtime": "node",
52
- "runtimeVersion": "22.0.0",
53
- "arch": "x64"
54
- }
1
+ {
2
+ "name": "@eosrio/node-abieos",
3
+ "version": "4.0.1-2039717",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "tag": "abieos"
7
+ },
8
+ "description": "Node Bindings for abieos: Binary <> JSON conversion using ABIs.",
9
+ "main": "./dist/abieos.js",
10
+ "types": "./dist/abieos.d.ts",
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/abieos.d.ts",
15
+ "import": "./dist/abieos.js",
16
+ "require": "./dist/abieos.cjs"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "install": "node -e 'process.exit(0)'",
21
+ "build:linux": "cmake-js compile && node scripts/copy-module.mjs",
22
+ "build": "tsup",
23
+ "test": "node --test test/**/*.test.js",
24
+ "test:coverage": "node --test --experimental-test-coverage test/**/*.test.js",
25
+ "test:watch": "node --test --watch --experimental-test-coverage test/**/*.test.js",
26
+ "tsc:watch": "tsc --watch",
27
+ "clean": "cmake-js clean",
28
+ "build:win": "cmake-js",
29
+ "build:mac": "cmake-js",
30
+ "update_version": "node scripts/update-version.mjs"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/eosrio/node-abieos.git"
35
+ },
36
+ "author": "EOS Rio",
37
+ "license": "MIT",
38
+ "bugs": {
39
+ "url": "https://github.com/eosrio/node-abieos/issues"
40
+ },
41
+ "homepage": "https://github.com/eosrio/node-abieos#readme",
42
+ "devDependencies": {
43
+ "@microsoft/api-extractor": "7.52.8",
44
+ "@wharfkit/antelope": "^1.0.13",
45
+ "@types/node": "^22.15.21",
46
+ "cmake-js": "7.3.1",
47
+ "node-addon-api": "8.3.1",
48
+ "tsup": "^8.5.0",
49
+ "typescript": "5.8.3"
50
+ },
51
+ "binary": {
52
+ "napi_versions": [
53
+ 10
54
+ ]
55
+ }
55
56
  }
Binary file
@@ -1,2 +0,0 @@
1
- 0
2
- 0
File without changes
@@ -1,3 +0,0 @@
1
- 0
2
- 0
3
- 0
@@ -1 +0,0 @@
1
- (ssh://git@git.jetbrains.team/llvm/llvm-project.git f4157ca9dd49181f6d35eaf6d324ffa84a40f01b based on LLVM 31f1590e4fb324c43dc36199587c453e27b6f6fa revision)
package/.gitmodules DELETED
@@ -1,4 +0,0 @@
1
- [submodule "abieos"]
2
- path = abieos
3
- url = https://github.com/igorls/abieos.git
4
- branch = main
package/lib/abieos.node DELETED
Binary file
package/lib/abieos.ts DELETED
@@ -1,100 +0,0 @@
1
- import { createRequire } from "module";
2
- const abieos = createRequire(import.meta.url)('./abieos.node');
3
-
4
- export class Abieos {
5
-
6
- private static instance: Abieos;
7
- public static native: typeof abieos;
8
-
9
- private constructor() {
10
- if (Abieos.instance) {
11
- throw new Error("This class is a Singleton!");
12
- }
13
- Abieos.native = abieos;
14
- }
15
-
16
- public static getInstance(): Abieos {
17
- if (!Abieos.instance) {
18
- Abieos.instance = new Abieos();
19
- }
20
- return Abieos.instance;
21
- }
22
-
23
- public stringToName(nameString: string): BigInteger {
24
- return Abieos.native.string_to_name(nameString) as BigInteger;
25
- }
26
-
27
- public jsonToHex(contractName: string, type: string, json: string | object): string {
28
- const jsonData = typeof json === 'object' ? JSON.stringify(json) : json
29
- const data: string = Abieos.native.json_to_hex(contractName, type, jsonData);
30
- if (data === 'PARSING_ERROR') {
31
- throw new Error('failed to parse data');
32
- } else {
33
- return data;
34
- }
35
- }
36
-
37
- public hexToJson(contractName: string, type: string, hex: string): any {
38
- const data = Abieos.native.hex_to_json(contractName, type, hex);
39
- if (data) {
40
- try {
41
- return JSON.parse(data);
42
- } catch (e) {
43
- throw new Error('failed to parse json string: ' + data);
44
- }
45
- } else {
46
- throw new Error('failed to parse hex data');
47
- }
48
- }
49
-
50
- public binToJson(contractName: string, type: string, buffer: Buffer): any {
51
- const data = Abieos.native.bin_to_json(contractName, type, buffer);
52
- if (data[0] === '{' || data[0] === '[') {
53
- try {
54
- return JSON.parse(data);
55
- } catch (e) {
56
- throw new Error('json parse error');
57
- }
58
- } else {
59
- throw new Error(data);
60
- }
61
- }
62
-
63
- public loadAbi(contractName: string, abi: string | object): boolean {
64
- if (typeof abi === 'string') {
65
- return Abieos.native.load_abi(contractName, abi) as boolean;
66
- } else {
67
- if (typeof abi === 'object') {
68
- return Abieos.native.load_abi(contractName, JSON.stringify(abi)) as boolean;
69
- } else {
70
- throw new Error('ABI must be a String or Object');
71
- }
72
- }
73
- }
74
-
75
- public loadAbiHex(contractName: string, abihex: string): boolean {
76
- return Abieos.native.load_abi_hex(contractName, abihex) as boolean;
77
- }
78
-
79
- public getTypeForAction(contractName: string, actionName: string): string {
80
- const result = Abieos.native.get_type_for_action(contractName, actionName);
81
- if (result === 'NOT_FOUND') {
82
- throw new Error(`[node-abieos] action ` + actionName + ' not found on contract ' + contractName);
83
- } else {
84
- return result;
85
- }
86
- }
87
-
88
- public getTypeForTable(contractName: string, table_name: string): string {
89
- const result = Abieos.native.get_type_for_table(contractName, table_name);
90
- if (result === 'NOT_FOUND') {
91
- throw new Error(`[node-abieos] table ` + table_name + ' not found on contract ' + contractName);
92
- } else {
93
- return result;
94
- }
95
- }
96
-
97
- public deleteContract(contractName: string): boolean {
98
- return Abieos.native.delete_contract(contractName) as boolean;
99
- }
100
- }
package/tsup.config.ts DELETED
@@ -1,12 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ["lib/abieos.ts"],
5
- publicDir: "lib",
6
- format: ["cjs", "esm"],
7
- shims: true,
8
- minify: false,
9
- sourcemap: false,
10
- clean: true,
11
- experimentalDts: "lib/abieos.ts"
12
- })
@@ -1,31 +0,0 @@
1
- import {promises} from "node:fs";
2
- import {exec} from "node:child_process";
3
-
4
- const oldPackageJson = await promises.readFile('package.json', 'utf8');
5
- if (!oldPackageJson) {
6
- console.error('Failed to read package.json');
7
- process.exit(1);
8
- }
9
-
10
- const parsed = JSON.parse(oldPackageJson.toString());
11
- const [version, hash] = parsed.version.split('-');
12
- console.log(`Old version: ${version}`);
13
- console.log(`Old hash: ${hash}`);
14
-
15
- exec('git rev-parse --short HEAD', {
16
- cwd: './abieos',
17
- }, (error, stdout) => {
18
- if (error) {
19
- console.error('Failed to get git hash');
20
- process.exit(1);
21
- }
22
- console.log(`New hash: ${stdout.trim()}`);
23
- const newVersion = `${version}-${stdout.trim()}`;
24
- console.log(`New version: ${newVersion}`);
25
- parsed.version = newVersion;
26
- const newPackageJson = JSON.stringify(parsed, null, 2);
27
- promises.writeFile('package.json', newPackageJson).catch((err) => {
28
- console.error('Failed to write package.json');
29
- process.exit(1);
30
- });
31
- });