@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/README.md +8 -2
- package/dist/_tsup-dts-rollup.d.cts +105 -19
- package/dist/_tsup-dts-rollup.d.ts +105 -19
- package/dist/abieos.cjs +261 -122
- package/dist/abieos.js +230 -91
- package/dist/abieos.node +0 -0
- package/dist/abieos.ts +210 -42
- package/package.json +55 -54
- package/.cache/jb/UpdateWork.dat +0 -0
- package/.cache/jb/compilation_graph.txt +0 -2
- package/.cache/jb/module.modulemap +0 -0
- package/.cache/jb/modules_graph.txt +0 -3
- package/.cache/jb/version.txt +0 -1
- package/.gitmodules +0 -4
- package/lib/abieos.node +0 -0
- package/lib/abieos.ts +0 -100
- package/tsup.config.ts +0 -12
- package/update-version.mjs +0 -31
package/package.json
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@eosrio/node-abieos",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"build:linux": "cmake-js compile
|
|
22
|
-
"build
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
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
|
}
|
package/.cache/jb/UpdateWork.dat
DELETED
|
Binary file
|
|
File without changes
|
package/.cache/jb/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(ssh://git@git.jetbrains.team/llvm/llvm-project.git f4157ca9dd49181f6d35eaf6d324ffa84a40f01b based on LLVM 31f1590e4fb324c43dc36199587c453e27b6f6fa revision)
|
package/.gitmodules
DELETED
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
package/update-version.mjs
DELETED
|
@@ -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
|
-
});
|