@socket.tech/dl-common 1.0.3-test.42 → 1.0.3-test.46
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/dist/constants/types.d.ts +11 -1
- package/dist/constants/types.js +9 -1
- package/dist/constants/waitTime.js +0 -4
- package/dist/index.js +30 -14
- package/dist/models/packet.d.ts +0 -1
- package/dist/models/packet.js +0 -1
- package/dist/services/eventBridgeService.js +1 -0
- package/dist/utils/s3Service.d.ts +1 -1
- package/dist/utils/s3Service.js +1 -1
- package/package.json +7 -8
|
@@ -27,6 +27,13 @@ export declare const ErrorReasons: {
|
|
|
27
27
|
INBOUND_FAILURE: string;
|
|
28
28
|
LOW_GAS_LIMIT: string;
|
|
29
29
|
};
|
|
30
|
+
export declare enum SigPendingReason {
|
|
31
|
+
INVALID_MESSAGE_OUTBOUND_TX = "INVALID_MESSAGE_OUTBOUND_TX",
|
|
32
|
+
MISSING_SEAL_EVENT = "MISSING_SEAL_EVENT",
|
|
33
|
+
PENDING_CONFIRMATIONS = "PENDING_CONFIRMATIONS",
|
|
34
|
+
INALID_SEAL_TX = "INALID_SEAL_TX",
|
|
35
|
+
NO = "NO"
|
|
36
|
+
}
|
|
30
37
|
export declare class ServerError {
|
|
31
38
|
code: Omit<StatusCodes, StatusCodes.SUCCESS>;
|
|
32
39
|
message?: string;
|
|
@@ -97,6 +104,8 @@ export interface AttestRequest {
|
|
|
97
104
|
packetId: string;
|
|
98
105
|
root: string;
|
|
99
106
|
proposalCount: number;
|
|
107
|
+
outboundTxHash: string;
|
|
108
|
+
sealTxHash: string;
|
|
100
109
|
}
|
|
101
110
|
export interface AttestSuccess {
|
|
102
111
|
proposalValid: true;
|
|
@@ -110,7 +119,8 @@ export interface AttestFailure {
|
|
|
110
119
|
proposalValid: false;
|
|
111
120
|
packetId: string;
|
|
112
121
|
proposalCount: number;
|
|
113
|
-
|
|
122
|
+
tripReason: TripReason;
|
|
123
|
+
sigPendingReason: SigPendingReason;
|
|
114
124
|
}
|
|
115
125
|
export type AttestResponse = AttestSuccess | AttestFailure;
|
|
116
126
|
export type MessageData = {
|
package/dist/constants/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.ErrorReasons = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
|
|
3
|
+
exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.SigPendingReason = exports.ErrorReasons = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
|
|
4
4
|
const enums_1 = require("./enums");
|
|
5
5
|
var InboundStatus;
|
|
6
6
|
(function (InboundStatus) {
|
|
@@ -23,6 +23,14 @@ exports.ErrorReasons = {
|
|
|
23
23
|
INBOUND_FAILURE: "INBOUND_FAILURE",
|
|
24
24
|
LOW_GAS_LIMIT: "LOW_GAS_LIMIT",
|
|
25
25
|
};
|
|
26
|
+
var SigPendingReason;
|
|
27
|
+
(function (SigPendingReason) {
|
|
28
|
+
SigPendingReason["INVALID_MESSAGE_OUTBOUND_TX"] = "INVALID_MESSAGE_OUTBOUND_TX";
|
|
29
|
+
SigPendingReason["MISSING_SEAL_EVENT"] = "MISSING_SEAL_EVENT";
|
|
30
|
+
SigPendingReason["PENDING_CONFIRMATIONS"] = "PENDING_CONFIRMATIONS";
|
|
31
|
+
SigPendingReason["INALID_SEAL_TX"] = "INALID_SEAL_TX";
|
|
32
|
+
SigPendingReason["NO"] = "NO";
|
|
33
|
+
})(SigPendingReason || (exports.SigPendingReason = SigPendingReason = {}));
|
|
26
34
|
class ServerError {
|
|
27
35
|
constructor(code, message) {
|
|
28
36
|
this.code = code;
|
|
@@ -29,11 +29,7 @@ exports.NativeWaitTime = {
|
|
|
29
29
|
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: {
|
|
30
30
|
[dl_core_1.ChainSlug.GOERLI]: 5 * 60,
|
|
31
31
|
},
|
|
32
|
-
[dl_core_1.ChainSlug.POLYGON_MUMBAI]: {
|
|
33
|
-
[dl_core_1.ChainSlug.GOERLI]: 10 * 60,
|
|
34
|
-
},
|
|
35
32
|
[dl_core_1.ChainSlug.GOERLI]: {
|
|
36
|
-
[dl_core_1.ChainSlug.POLYGON_MUMBAI]: 5 * 60,
|
|
37
33
|
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: 5 * 60,
|
|
38
34
|
[dl_core_1.ChainSlug.OPTIMISM_GOERLI]: 5 * 60,
|
|
39
35
|
},
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (
|
|
9
|
+
!desc ||
|
|
10
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}
|
|
21
|
+
: function (o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
});
|
|
25
|
+
var __exportStar =
|
|
26
|
+
(this && this.__exportStar) ||
|
|
27
|
+
function (m, exports) {
|
|
28
|
+
for (var p in m)
|
|
29
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
30
|
+
__createBinding(exports, m, p);
|
|
31
|
+
};
|
|
16
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
33
|
__exportStar(require("./models"), exports);
|
|
18
34
|
__exportStar(require("./services"), exports);
|
package/dist/models/packet.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export declare enum AttestRelayStatus {
|
|
|
29
29
|
export declare enum TripReason {
|
|
30
30
|
SWITCHBOARD_MISMATCHED = "SWITCHBOARD_MISMATCHED",
|
|
31
31
|
ROOT_MISMATCHED = "ROOT_MISMATCHED",
|
|
32
|
-
MISSING_SEAL = "MISSING_SEAL",
|
|
33
32
|
NO = "NO"
|
|
34
33
|
}
|
|
35
34
|
export declare class Packet extends Model {
|
package/dist/models/packet.js
CHANGED
|
@@ -38,7 +38,6 @@ var TripReason;
|
|
|
38
38
|
(function (TripReason) {
|
|
39
39
|
TripReason["SWITCHBOARD_MISMATCHED"] = "SWITCHBOARD_MISMATCHED";
|
|
40
40
|
TripReason["ROOT_MISMATCHED"] = "ROOT_MISMATCHED";
|
|
41
|
-
TripReason["MISSING_SEAL"] = "MISSING_SEAL";
|
|
42
41
|
TripReason["NO"] = "NO";
|
|
43
42
|
})(TripReason || (exports.TripReason = TripReason = {}));
|
|
44
43
|
class Packet extends sequelize_1.Model {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeploymentMode } from "@socket.tech/dl-core";
|
|
2
2
|
import { Accounts } from "..";
|
|
3
|
-
export declare const initS3Client: (region: string) =>
|
|
3
|
+
export declare const initS3Client: (region: string) => void;
|
|
4
4
|
export declare const getFileFromS3: (bucket: string, filePath: string) => Promise<any>;
|
|
5
5
|
export declare const getS3Config: (deploymentMode: DeploymentMode, region?: string, account?: Accounts.dl | Accounts.ll) => Promise<any>;
|
package/dist/utils/s3Service.js
CHANGED
|
@@ -6,7 +6,7 @@ const dl_core_1 = require("@socket.tech/dl-core");
|
|
|
6
6
|
const __1 = require("..");
|
|
7
7
|
// Set your AWS credentials and region
|
|
8
8
|
let s3Client;
|
|
9
|
-
const initS3Client =
|
|
9
|
+
const initS3Client = (region) => {
|
|
10
10
|
s3Client = new client_s3_1.S3Client({
|
|
11
11
|
region,
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socket.tech/dl-common",
|
|
3
|
-
"version": "1.0.3-test.
|
|
3
|
+
"version": "1.0.3-test.46",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"description": "common utilities for socket data layer.",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
|
|
17
16
|
"url": "git+https://github.com/SocketDotTech/dl-batcher-service.git"
|
|
18
17
|
},
|
|
19
18
|
"license": "MIT",
|
|
@@ -21,19 +20,19 @@
|
|
|
21
20
|
"start": "serverless offline start --reloadHandler -s dev",
|
|
22
21
|
"start:dev": "serverless offline start -s dev",
|
|
23
22
|
"deploy": "npm run lint && npx sls deploy -s dev --verbose",
|
|
24
|
-
"deploy:prod": "npm run lint && export AWS_PROFILE=llprod && npx sls deploy -s prod --verbose",
|
|
23
|
+
"deploy:prod": "tsc && npm run lint && export AWS_PROFILE=llprod && npx sls deploy -s prod --verbose",
|
|
25
24
|
"deploy:surge": "npx sls deploy -s surge --verbose",
|
|
26
25
|
"build": "tsc --project lib.tsconfig.json",
|
|
27
26
|
"build:clean": "rm -rf tsconfig.build.tsbuildinfo && rm -rf ./dist",
|
|
28
27
|
"eslint:check": "npx eslint src/ --ext .ts,.js",
|
|
29
28
|
"eslint:fix": "npx eslint src --ext ts,js --fix",
|
|
30
|
-
"lint": "
|
|
29
|
+
"lint": "npm run prettier:fix",
|
|
31
30
|
"prettier:fix": "npx prettier src dl-common __tests__ --write ./**/*.{ts,js,json,yml,md}",
|
|
32
31
|
"format": "prettier \"./**\" --write --ignore-unknown",
|
|
33
32
|
"format:check": "prettier \"./**\" --ignore-unknown --check",
|
|
34
33
|
"prepare": "husky install",
|
|
35
34
|
"publishp": "yarn lint && yarn build",
|
|
36
|
-
"eslint:cachefix":"eslint --fix",
|
|
35
|
+
"eslint:cachefix": "eslint --fix",
|
|
37
36
|
"testc": "jest --testPathIgnorePatterns '.db.test.ts$' --coverage",
|
|
38
37
|
"testdb": "jest --testMatch **/*.db.test.ts --runInBand",
|
|
39
38
|
"testdbc": "jest --testMatch **/*.db.test.ts --runInBand --coverage",
|
|
@@ -48,12 +47,12 @@
|
|
|
48
47
|
"dependencies": {
|
|
49
48
|
"@aws-sdk/client-eventbridge": "^3.449.0",
|
|
50
49
|
"@aws-sdk/client-kms": "^3.454.0",
|
|
51
|
-
"@aws-sdk/client-s3": "^3.
|
|
50
|
+
"@aws-sdk/client-s3": "^3.600.0",
|
|
52
51
|
"@aws-sdk/client-secrets-manager": "^3.433.0",
|
|
53
52
|
"@aws-sdk/client-sqs": "^3.421.0",
|
|
54
|
-
"@aws-sdk/smithy-client": "^3.
|
|
53
|
+
"@aws-sdk/smithy-client": "^3.374.0",
|
|
55
54
|
"@ethersproject/providers": "^5.7.2",
|
|
56
|
-
"@socket.tech/dl-core": "2.
|
|
55
|
+
"@socket.tech/dl-core": "^2.7.0",
|
|
57
56
|
"@socket.tech/ll-common": "^0.0.19",
|
|
58
57
|
"async-redis": "^2.0.0",
|
|
59
58
|
"aws-kms-ethers-signer": "^0.1.3",
|