@socket.tech/dl-common 1.0.3-test.34 → 1.0.3-test.35

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.
@@ -34,5 +34,6 @@ export declare enum StatusCodes {
34
34
  NOT_FOUND = "NOT_FOUND",
35
35
  BAD_REQUEST = "BAD_REQUEST",
36
36
  UNAUTHORIZED = "UNAUTHORIZED",
37
- INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
37
+ INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
38
+ RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED"
38
39
  }
@@ -42,4 +42,5 @@ var StatusCodes;
42
42
  StatusCodes["BAD_REQUEST"] = "BAD_REQUEST";
43
43
  StatusCodes["UNAUTHORIZED"] = "UNAUTHORIZED";
44
44
  StatusCodes["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
45
+ StatusCodes["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
45
46
  })(StatusCodes || (exports.StatusCodes = StatusCodes = {}));
@@ -20,6 +20,13 @@ export declare enum RelayerAPIStatus {
20
20
  COMPLETED = "COMPLETED",
21
21
  DUPLICATE_NONCE_TX = "DUPLICATE_NONCE_TX"
22
22
  }
23
+ export declare const ErrorReasons: {
24
+ ZERO_AMOUNT: string;
25
+ PRE_EXEC_VALIDATION_ERROR: string;
26
+ WRONG_PLUG_CONNECTION: string;
27
+ INBOUND_FAILURE: string;
28
+ LOW_GAS_LIMIT: string;
29
+ };
23
30
  export declare class ServerError {
24
31
  code: Omit<StatusCodes, StatusCodes.SUCCESS>;
25
32
  message?: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
3
+ exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.ErrorReasons = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
4
4
  const enums_1 = require("./enums");
5
5
  var InboundStatus;
6
6
  (function (InboundStatus) {
@@ -16,6 +16,13 @@ var RelayerAPIStatus;
16
16
  RelayerAPIStatus["COMPLETED"] = "COMPLETED";
17
17
  RelayerAPIStatus["DUPLICATE_NONCE_TX"] = "DUPLICATE_NONCE_TX";
18
18
  })(RelayerAPIStatus || (exports.RelayerAPIStatus = RelayerAPIStatus = {}));
19
+ exports.ErrorReasons = {
20
+ ZERO_AMOUNT: "ZERO_AMOUNT",
21
+ PRE_EXEC_VALIDATION_ERROR: "PRE_EXEC_VALIDATION_ERROR",
22
+ WRONG_PLUG_CONNECTION: "WRONG_PLUG_CONNECTION",
23
+ INBOUND_FAILURE: "INBOUND_FAILURE",
24
+ LOW_GAS_LIMIT: "LOW_GAS_LIMIT",
25
+ };
19
26
  class ServerError {
20
27
  constructor(code, message) {
21
28
  this.code = code;
@@ -1 +1,2 @@
1
1
  export declare const currentTimestampInSeconds: () => number;
2
+ export declare const sleep: (ms: number) => Promise<unknown>;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.currentTimestampInSeconds = void 0;
3
+ exports.sleep = exports.currentTimestampInSeconds = void 0;
4
4
  const currentTimestampInSeconds = () => Math.floor(new Date().getTime() / 1000);
5
5
  exports.currentTimestampInSeconds = currentTimestampInSeconds;
6
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
7
+ exports.sleep = sleep;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socket.tech/dl-common",
3
- "version": "1.0.3-test.34",
3
+ "version": "1.0.3-test.35",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "description": "common utilities for socket data layer.",
@@ -45,7 +45,7 @@
45
45
  "@aws-sdk/client-sqs": "^3.421.0",
46
46
  "@aws-sdk/smithy-client": "^3.329.0",
47
47
  "@ethersproject/providers": "^5.7.2",
48
- "@socket.tech/dl-core": "2.4.16",
48
+ "@socket.tech/dl-core": "2.4.20",
49
49
  "@socket.tech/ll-common": "^0.0.19",
50
50
  "async-redis": "^2.0.0",
51
51
  "aws-kms-ethers-signer": "^0.1.3",