@eosrio/node-abieos 3.3.0 → 3.3.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/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "abieos"]
2
2
  path = abieos
3
- url = https://github.com/igorls/abieos.git
3
+ url = https://github.com/AntelopeIO/abieos.git
@@ -0,0 +1,6 @@
1
+ {
2
+ "files.associations": {
3
+ "*.toml": "toml",
4
+ "utility": "cpp"
5
+ }
6
+ }
package/bun.lockb CHANGED
File without changes
package/lib/abieos.d.ts CHANGED
@@ -3,6 +3,7 @@ declare const abieos: any;
3
3
  export declare class Abieos {
4
4
  private static instance;
5
5
  static native: typeof abieos;
6
+ private static instanceId;
6
7
  private constructor();
7
8
  static getInstance(): Abieos;
8
9
  stringToName(nameString: string): BigInteger;
@@ -1 +1 @@
1
- {"version":3,"file":"abieos.d.ts","sourceRoot":"","sources":["abieos.ts"],"names":[],"mappings":";AAAA,QAAA,MAAM,MAAM,KAA2B,CAAC;AAExC,qBAAa,MAAM;IACf,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,OAAc,MAAM,EAAE,OAAO,MAAM,CAAC;IAEpC,OAAO;WAIO,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;IA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Ac,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('action ' + actionName + ' not found on contract ' + contractName);
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('table ' + table_name + ' not found on contract ' + contractName);
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('action ' + actionName + ' not found on contract ' + contractName);
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('table ' + table_name + ' not found on contract ' + contractName);
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eosrio/node-abieos",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Node Bindings for abieos: Binary <> JSON conversion using ABIs.",
5
5
  "main": "./lib/abieos.js",
6
6
  "types": "./lib/abieos.d.ts",