@prosopo/account 0.3.36 → 0.3.37

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.
@@ -19,14 +19,14 @@ class ProsopoBaseError extends Error {
19
19
  this.translationKey = error;
20
20
  this.context = options?.context;
21
21
  }
22
- if (options?.silent)
22
+ if (!options?.silent)
23
23
  this.logError(logger$1, logLevel);
24
24
  }
25
25
  logError(logger2, logLevel) {
26
26
  const errorFormatter = "\n*************** ERROR ***************\n";
27
27
  const errorName = `Error Type: ${this.name}
28
28
  `;
29
- const errorParams = JSON.stringify({ error: this.message, context: this.context });
29
+ const errorParams = JSON.stringify({ error: this.message, context: this.context }, null, 4);
30
30
  const errorMessage = `${errorFormatter}${errorName}${errorParams}`;
31
31
  logger2[logLevel](errorMessage);
32
32
  }
@@ -52,6 +52,13 @@ class ProsopoContractError extends ProsopoBaseError {
52
52
  super(error, options);
53
53
  }
54
54
  }
55
+ class ProsopoTxQueueError extends ProsopoBaseError {
56
+ constructor(error, options) {
57
+ const errorName = options?.name || "ProsopoTxQueueError";
58
+ options = { ...options, name: errorName };
59
+ super(error, options);
60
+ }
61
+ }
55
62
  class ProsopoDBError extends ProsopoBaseError {
56
63
  constructor(error, options) {
57
64
  const errorName = options?.name || "ProsopoDBError";
@@ -90,3 +97,4 @@ exports.ProsopoDBError = ProsopoDBError;
90
97
  exports.ProsopoDatasetError = ProsopoDatasetError;
91
98
  exports.ProsopoEnvError = ProsopoEnvError;
92
99
  exports.ProsopoError = ProsopoError;
100
+ exports.ProsopoTxQueueError = ProsopoTxQueueError;
@@ -25,6 +25,7 @@ exports.ProsopoDBError = error.ProsopoDBError;
25
25
  exports.ProsopoDatasetError = error.ProsopoDatasetError;
26
26
  exports.ProsopoEnvError = error.ProsopoEnvError;
27
27
  exports.ProsopoError = error.ProsopoError;
28
+ exports.ProsopoTxQueueError = error.ProsopoTxQueueError;
28
29
  exports.LogLevel = logger.LogLevel;
29
30
  exports.Loggable = logger.Loggable;
30
31
  exports.getLogLevel = logger.getLogLevel;
@@ -56,7 +56,9 @@ const CONTRACT = {
56
56
  UNKNOWN_ERROR: "Unknown error",
57
57
  CHAIN_DECIMALS_UNDEFINED: "Chain decimals are not defined",
58
58
  INVALID_DATA_FORMAT: "Invalid data format",
59
- INVALID_BLOCKHASH: "Invalid blockhash"
59
+ INVALID_BLOCKHASH: "Invalid blockhash",
60
+ TX_QUEUE_ERROR: "Error in Transaction Queue",
61
+ DISPATCH_ERROR: "Error dispatching transaction"
60
62
  };
61
63
  const CONFIG = {
62
64
  UNKNOWN_ENVIRONMENT: "Unknown environment requested",
@@ -23,7 +23,7 @@ function getLeafFieldPath(obj) {
23
23
  }
24
24
  const translationKeys = getLeafFieldPath(en.default);
25
25
  const trimProviderUrl = (url) => {
26
- return hex.hexToString(url).replace(/\0/g, "");
26
+ return hex.hexToString(url);
27
27
  };
28
28
  function snakeToCamelCase(str) {
29
29
  return str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace("-", "").replace("_", ""));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/account",
3
- "version": "0.3.36",
3
+ "version": "0.3.37",
4
4
  "description": "Services and Utils for Prosopo account gen and management",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -46,12 +46,12 @@
46
46
  "@polkadot/rpc-provider": "10.11.2",
47
47
  "@polkadot/util": "12.6.2",
48
48
  "@polkadot/util-crypto": "12.6.2",
49
- "@prosopo/common": "0.3.36",
50
- "@prosopo/types": "0.3.36",
51
- "@prosopo/util": "0.3.36"
49
+ "@prosopo/common": "0.3.37",
50
+ "@prosopo/types": "0.3.37",
51
+ "@prosopo/util": "0.3.37"
52
52
  },
53
53
  "devDependencies": {
54
- "@prosopo/config": "0.3.36",
54
+ "@prosopo/config": "0.3.37",
55
55
  "tslib": "2.6.2",
56
56
  "typescript": "5.1.6"
57
57
  },