@eosrio/node-abieos 3.3.0 → 3.3.2
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/.gitmodules +1 -1
- package/lib/abieos.d.ts +1 -0
- package/lib/abieos.d.ts.map +1 -1
- package/lib/abieos.js +7 -2
- package/lib/abieos.node +0 -0
- package/lib/abieos.ts +8 -2
- package/package.json +1 -1
- package/.github/workflows/build.yml +0 -34
- package/bun.lockb +0 -0
package/.gitmodules
CHANGED
package/lib/abieos.d.ts
CHANGED
package/lib/abieos.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abieos.d.ts","sourceRoot":"","sources":["abieos.ts"],"names":[],"mappings":";AAAA,QAAA,MAAM,MAAM,KAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"abieos.d.ts","sourceRoot":"","sources":["abieos.ts"],"names":[],"mappings":";AAAA,QAAA,MAAM,MAAM,KAA2B,CAAC;AAGxC,qBAAa,MAAM;IACf,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,OAAc,MAAM,EAAE,OAAO,MAAM,CAAC;IACpC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAM;IAE/B,OAAO;WAQO,WAAW,IAAI,MAAM;IAO5B,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU;IAI5C,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAU5E,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG;IAa/D,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG;IAalE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAY5D,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAIzD,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IASlE,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IASjE,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;CAGvD"}
|
package/lib/abieos.js
CHANGED
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Abieos = void 0;
|
|
4
4
|
const abieos = require("./abieos.node");
|
|
5
|
+
const { randomUUID } = require("node:crypto");
|
|
5
6
|
class Abieos {
|
|
6
7
|
constructor() {
|
|
8
|
+
if (Abieos.instance) {
|
|
9
|
+
throw new Error("This class is a Singleton!");
|
|
10
|
+
}
|
|
7
11
|
Abieos.native = abieos;
|
|
12
|
+
Abieos.instanceId = randomUUID();
|
|
8
13
|
}
|
|
9
14
|
static getInstance() {
|
|
10
15
|
if (!Abieos.instance) {
|
|
@@ -72,7 +77,7 @@ class Abieos {
|
|
|
72
77
|
getTypeForAction(contractName, actionName) {
|
|
73
78
|
const result = Abieos.native.get_type_for_action(contractName, actionName);
|
|
74
79
|
if (result === 'NOT_FOUND') {
|
|
75
|
-
throw new Error(
|
|
80
|
+
throw new Error(`[${Abieos.instanceId}] action ` + actionName + ' not found on contract ' + contractName);
|
|
76
81
|
}
|
|
77
82
|
else {
|
|
78
83
|
return result;
|
|
@@ -81,7 +86,7 @@ class Abieos {
|
|
|
81
86
|
getTypeForTable(contractName, table_name) {
|
|
82
87
|
const result = Abieos.native.get_type_for_table(contractName, table_name);
|
|
83
88
|
if (result === 'NOT_FOUND') {
|
|
84
|
-
throw new Error(
|
|
89
|
+
throw new Error(`[${Abieos.instanceId}] table ` + table_name + ' not found on contract ' + contractName);
|
|
85
90
|
}
|
|
86
91
|
else {
|
|
87
92
|
return result;
|
package/lib/abieos.node
CHANGED
|
Binary file
|
package/lib/abieos.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
const abieos = require("./abieos.node");
|
|
2
|
+
const {randomUUID} = require("node:crypto");
|
|
2
3
|
|
|
3
4
|
export class Abieos {
|
|
4
5
|
private static instance: Abieos;
|
|
5
6
|
public static native: typeof abieos;
|
|
7
|
+
private static instanceId: any;
|
|
6
8
|
|
|
7
9
|
private constructor() {
|
|
10
|
+
if (Abieos.instance) {
|
|
11
|
+
throw new Error("This class is a Singleton!");
|
|
12
|
+
}
|
|
8
13
|
Abieos.native = abieos;
|
|
14
|
+
Abieos.instanceId = randomUUID();
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
public static getInstance(): Abieos {
|
|
@@ -74,7 +80,7 @@ export class Abieos {
|
|
|
74
80
|
public getTypeForAction(contractName: string, actionName: string): string {
|
|
75
81
|
const result = Abieos.native.get_type_for_action(contractName, actionName);
|
|
76
82
|
if (result === 'NOT_FOUND') {
|
|
77
|
-
throw new Error(
|
|
83
|
+
throw new Error(`[${Abieos.instanceId}] action ` + actionName + ' not found on contract ' + contractName);
|
|
78
84
|
} else {
|
|
79
85
|
return result;
|
|
80
86
|
}
|
|
@@ -83,7 +89,7 @@ export class Abieos {
|
|
|
83
89
|
public getTypeForTable(contractName: string, table_name: string): string {
|
|
84
90
|
const result = Abieos.native.get_type_for_table(contractName, table_name);
|
|
85
91
|
if (result === 'NOT_FOUND') {
|
|
86
|
-
throw new Error(
|
|
92
|
+
throw new Error(`[${Abieos.instanceId}] table ` + table_name + ' not found on contract ' + contractName);
|
|
87
93
|
} else {
|
|
88
94
|
return result;
|
|
89
95
|
}
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
name: Node.js Addon with CMake
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ "master", "3.3-staging" ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ "master" ]
|
|
8
|
-
|
|
9
|
-
env:
|
|
10
|
-
BUILD_TYPE: Release
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
strategy:
|
|
16
|
-
matrix:
|
|
17
|
-
node-version: [20.x]
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
# Checkout repo and submodules
|
|
21
|
-
- uses: actions/checkout@v4
|
|
22
|
-
with:
|
|
23
|
-
submodules: recursive
|
|
24
|
-
|
|
25
|
-
# Setup Node.js
|
|
26
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
-
uses: actions/setup-node@v4
|
|
28
|
-
with:
|
|
29
|
-
node-version: ${{ matrix.node-version }}
|
|
30
|
-
cache: 'npm'
|
|
31
|
-
- run: npm ci
|
|
32
|
-
- run: npm run build:linux:ci
|
|
33
|
-
- run: npm run build:tsc
|
|
34
|
-
- run: npm run test
|
package/bun.lockb
DELETED
|
Binary file
|