@socket.tech/dl-common 1.0.14 → 1.0.16-test
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/enums.d.ts +8 -2
- package/dist/constants/enums.js +8 -1
- package/dist/constants/types.d.ts +11 -1
- package/dist/constants/types.js +9 -1
- package/dist/constants/waitTime.js +0 -4
- package/dist/dl-common/constants/index.d.ts +1 -0
- package/dist/dl-common/constants/index.js +1 -0
- package/dist/dl-common/constants/index.js.map +1 -1
- package/dist/dl-common/constants/relay-types.d.ts +70 -0
- package/dist/dl-common/constants/relay-types.js +23 -0
- package/dist/dl-common/constants/relay-types.js.map +1 -0
- package/dist/dl-common/utils/index.d.ts +1 -0
- package/dist/dl-common/utils/index.js +1 -0
- package/dist/dl-common/utils/index.js.map +1 -1
- package/dist/dl-common/utils/relaySigner.d.ts +2 -0
- package/dist/dl-common/utils/relaySigner.js +16 -0
- package/dist/dl-common/utils/relaySigner.js.map +1 -1
- package/dist/dl-common/utils/relayUtils.d.ts +2 -0
- package/dist/dl-common/utils/relayUtils.js +21 -0
- package/dist/dl-common/utils/relayUtils.js.map +1 -0
- package/dist/dl-common/utils/signer/adapter.d.ts +3 -1
- package/dist/dl-common/utils/signer/adapter.js +5 -0
- package/dist/dl-common/utils/signer/adapter.js.map +1 -1
- package/dist/dl-common/utils/signer/kms-ethers-signer.d.ts +3 -1
- package/dist/dl-common/utils/signer/kms-ethers-signer.js +5 -0
- package/dist/dl-common/utils/signer/kms-ethers-signer.js.map +1 -1
- package/dist/dl-common/utils/signer/kms-signer.d.ts +2 -0
- package/dist/dl-common/utils/signer/kms-signer.js +7 -0
- package/dist/dl-common/utils/signer/kms-signer.js.map +1 -1
- package/dist/dl-common/utils/signer/signer.d.ts +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/lastBlock.d.ts +28 -0
- package/dist/models/lastBlock.js +27 -0
- package/dist/models/message.d.ts +6 -1
- package/dist/models/message.js +11 -1
- package/dist/models/packet.d.ts +0 -1
- package/dist/models/packet.js +0 -1
- package/dist/models/transaction.d.ts +0 -0
- package/dist/models/transaction.js +280 -0
- package/dist/services/eventBridgeService.js +1 -0
- package/dist/services/queueService.d.ts +2 -2
- package/dist/services/queueService.js +22 -14
- package/dist/src/constants/gasEstimation.d.ts +8 -0
- package/dist/src/constants/gasEstimation.js +61 -0
- package/dist/src/relayers/propose/main.js.map +1 -1
- package/dist/src/relayers/proposeRelayer.d.ts +7 -0
- package/dist/src/relayers/proposeRelayer.js +587 -0
- package/dist/src/services/batcherService.d.ts +9 -0
- package/dist/src/services/batcherService.js +197 -0
- package/dist/src/services/executeService.d.ts +16 -0
- package/dist/src/services/executeService.js +209 -0
- package/dist/src/services/sealService.js +12 -0
- package/dist/src/services/sealService.js.map +1 -1
- package/dist/utils/dataStructHelper.js +2 -2
- package/dist/utils/discord.d.ts +2 -2
- package/dist/utils/discord.js +11 -3
- package/dist/utils/idUtils.js +2 -2
- package/dist/utils/s3Service.d.ts +10 -3
- package/dist/utils/s3Service.js +38 -9
- package/dist/utils/signer/address.d.ts +0 -1
- package/dist/utils/signer/asn1-parser.d.ts +0 -1
- package/dist/utils/signer/asn1-parser.js +2 -3
- package/dist/utils/signer/crypto.d.ts +0 -1
- package/dist/utils/signer/crypto.js +3 -4
- package/dist/utils/signer/index.d.ts +1 -0
- package/dist/utils/signer/index.js +1 -0
- package/dist/utils/signer/kms-signer.d.ts +0 -1
- package/dist/utils/signer/signature.d.ts +0 -1
- package/dist/utils/signer/signer.d.ts +0 -1
- package/dist/utils/signer/socketSigner.d.ts +39 -0
- package/dist/utils/signer/socketSigner.js +153 -0
- package/package.json +6 -6
|
@@ -7,7 +7,8 @@ export declare enum tableNames {
|
|
|
7
7
|
proposal = "proposals",
|
|
8
8
|
switchboard = "switchboards",
|
|
9
9
|
tripState = "trip_states",
|
|
10
|
-
attestSignatures = "attest_signatures"
|
|
10
|
+
attestSignatures = "attest_signatures",
|
|
11
|
+
lastBlock = "last_blocks"
|
|
11
12
|
}
|
|
12
13
|
export declare enum MessageStatuses {
|
|
13
14
|
RECEIVED = "RECEIVED",
|
|
@@ -34,5 +35,10 @@ export declare enum StatusCodes {
|
|
|
34
35
|
NOT_FOUND = "NOT_FOUND",
|
|
35
36
|
BAD_REQUEST = "BAD_REQUEST",
|
|
36
37
|
UNAUTHORIZED = "UNAUTHORIZED",
|
|
37
|
-
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
|
|
38
|
+
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
39
|
+
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED"
|
|
40
|
+
}
|
|
41
|
+
export declare enum Accounts {
|
|
42
|
+
dl = "dl",
|
|
43
|
+
ll = "ll"
|
|
38
44
|
}
|
package/dist/constants/enums.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StatusCodes = exports.MessageStatusStep = exports.MessageStatuses = exports.tableNames = void 0;
|
|
3
|
+
exports.Accounts = exports.StatusCodes = exports.MessageStatusStep = exports.MessageStatuses = exports.tableNames = void 0;
|
|
4
4
|
var tableNames;
|
|
5
5
|
(function (tableNames) {
|
|
6
6
|
tableNames["packet"] = "packets";
|
|
@@ -12,6 +12,7 @@ var tableNames;
|
|
|
12
12
|
tableNames["switchboard"] = "switchboards";
|
|
13
13
|
tableNames["tripState"] = "trip_states";
|
|
14
14
|
tableNames["attestSignatures"] = "attest_signatures";
|
|
15
|
+
tableNames["lastBlock"] = "last_blocks";
|
|
15
16
|
})(tableNames || (exports.tableNames = tableNames = {}));
|
|
16
17
|
var MessageStatuses;
|
|
17
18
|
(function (MessageStatuses) {
|
|
@@ -42,4 +43,10 @@ var StatusCodes;
|
|
|
42
43
|
StatusCodes["BAD_REQUEST"] = "BAD_REQUEST";
|
|
43
44
|
StatusCodes["UNAUTHORIZED"] = "UNAUTHORIZED";
|
|
44
45
|
StatusCodes["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
|
|
46
|
+
StatusCodes["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
|
|
45
47
|
})(StatusCodes || (exports.StatusCodes = StatusCodes = {}));
|
|
48
|
+
var Accounts;
|
|
49
|
+
(function (Accounts) {
|
|
50
|
+
Accounts["dl"] = "dl";
|
|
51
|
+
Accounts["ll"] = "ll";
|
|
52
|
+
})(Accounts || (exports.Accounts = Accounts = {}));
|
|
@@ -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
|
},
|
|
@@ -4,4 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./waitTime"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./enums"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./types"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./relay-types"), exports);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dl-common/constants/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,kDAAwB;AACxB,kDAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dl-common/constants/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,kDAAwB;AACxB,kDAAwB;AACxB,wDAA8B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { providers } from "ethers";
|
|
2
|
+
export type TxStatusUpdate = {
|
|
3
|
+
chainId: number;
|
|
4
|
+
txHash: string;
|
|
5
|
+
status: string;
|
|
6
|
+
confirmations: number;
|
|
7
|
+
txId: string;
|
|
8
|
+
source: string;
|
|
9
|
+
revertReason: string;
|
|
10
|
+
receipt?: providers.TransactionReceipt;
|
|
11
|
+
metadata?: object;
|
|
12
|
+
};
|
|
13
|
+
export declare enum TxStatus {
|
|
14
|
+
PENDING = "PENDING",
|
|
15
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
16
|
+
SUCCESS = "SUCCESS",
|
|
17
|
+
FAILED = "FAILED"
|
|
18
|
+
}
|
|
19
|
+
export declare enum RelayerStatus {
|
|
20
|
+
PENDING = "PENDING",
|
|
21
|
+
STARTED = "STARTED",
|
|
22
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
23
|
+
COMPLETED = "COMPLETED",
|
|
24
|
+
FAILED = "FAILED",
|
|
25
|
+
MAX_RETRY_REACHED = "MAX_RETRY_REACHED",
|
|
26
|
+
DUPLICATE_NONCE_TX = "DUPLICATE_NONCE_TX",
|
|
27
|
+
SIMULATION_FAILED = "SIMULATION_FAILED",
|
|
28
|
+
QUEUED = "QUEUED"
|
|
29
|
+
}
|
|
30
|
+
export interface RelayRequest {
|
|
31
|
+
to: string;
|
|
32
|
+
data: string;
|
|
33
|
+
chainId: number;
|
|
34
|
+
gasLimit?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface RelayResponse {
|
|
37
|
+
txId: string;
|
|
38
|
+
status: string;
|
|
39
|
+
chainId: number;
|
|
40
|
+
}
|
|
41
|
+
export interface RelayerStatusResponse {
|
|
42
|
+
txId: string;
|
|
43
|
+
status: string;
|
|
44
|
+
chainId: number;
|
|
45
|
+
txHash?: string;
|
|
46
|
+
to?: string;
|
|
47
|
+
gasLimit?: number;
|
|
48
|
+
maxFeePerGas?: string;
|
|
49
|
+
maxPriorityFeePerGas?: string;
|
|
50
|
+
nonce?: number;
|
|
51
|
+
relayerIndex?: number;
|
|
52
|
+
blockNumber?: number;
|
|
53
|
+
retryCount?: number;
|
|
54
|
+
replacementCount?: number;
|
|
55
|
+
revertReason?: string;
|
|
56
|
+
timings?: {
|
|
57
|
+
queuedAt: string;
|
|
58
|
+
processedAt: string | null;
|
|
59
|
+
completedAt: string | null;
|
|
60
|
+
queueTime: number | null;
|
|
61
|
+
processingTime: number | null;
|
|
62
|
+
totalTime: number;
|
|
63
|
+
};
|
|
64
|
+
replacedTxHashes?: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface RelayerApiResponse<T> {
|
|
67
|
+
success: boolean;
|
|
68
|
+
data: T;
|
|
69
|
+
timestamp: string;
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayerStatus = exports.TxStatus = void 0;
|
|
4
|
+
var TxStatus;
|
|
5
|
+
(function (TxStatus) {
|
|
6
|
+
TxStatus["PENDING"] = "PENDING";
|
|
7
|
+
TxStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
8
|
+
TxStatus["SUCCESS"] = "SUCCESS";
|
|
9
|
+
TxStatus["FAILED"] = "FAILED";
|
|
10
|
+
})(TxStatus || (exports.TxStatus = TxStatus = {}));
|
|
11
|
+
var RelayerStatus;
|
|
12
|
+
(function (RelayerStatus) {
|
|
13
|
+
RelayerStatus["PENDING"] = "PENDING";
|
|
14
|
+
RelayerStatus["STARTED"] = "STARTED";
|
|
15
|
+
RelayerStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
16
|
+
RelayerStatus["COMPLETED"] = "COMPLETED";
|
|
17
|
+
RelayerStatus["FAILED"] = "FAILED";
|
|
18
|
+
RelayerStatus["MAX_RETRY_REACHED"] = "MAX_RETRY_REACHED";
|
|
19
|
+
RelayerStatus["DUPLICATE_NONCE_TX"] = "DUPLICATE_NONCE_TX";
|
|
20
|
+
RelayerStatus["SIMULATION_FAILED"] = "SIMULATION_FAILED";
|
|
21
|
+
RelayerStatus["QUEUED"] = "QUEUED";
|
|
22
|
+
})(RelayerStatus || (exports.RelayerStatus = RelayerStatus = {}));
|
|
23
|
+
//# sourceMappingURL=relay-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-types.js","sourceRoot":"","sources":["../../../dl-common/constants/relay-types.ts"],"names":[],"mappings":";;;AAcA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,uCAA2B,CAAA;IAC3B,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,4CAA2B,CAAA;IAC3B,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,wDAAuC,CAAA;IACvC,0DAAyC,CAAA;IACzC,wDAAuC,CAAA;IACvC,kCAAiB,CAAA;AACnB,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB"}
|
|
@@ -14,4 +14,5 @@ tslib_1.__exportStar(require("./ethersAwsKmsSigner"), exports);
|
|
|
14
14
|
tslib_1.__exportStar(require("./secretManagerService"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./eventGetter"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./s3Service"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./relayUtils"), exports);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dl-common/utils/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,6DAAmC;AACnC,uDAA6B;AAC7B,iDAAuB;AACvB,mDAAyB;AACzB,+DAAqC;AACrC,iEAAuC;AACvC,wDAA8B;AAC9B,sDAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dl-common/utils/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,oDAA0B;AAC1B,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,6DAAmC;AACnC,uDAA6B;AAC7B,iDAAuB;AACvB,mDAAyB;AACzB,+DAAqC;AACrC,iEAAuC;AACvC,wDAA8B;AAC9B,sDAA4B;AAC5B,uDAA6B"}
|
|
@@ -2,6 +2,7 @@ import { Provider, TransactionRequest, TransactionResponse } from "@ethersprojec
|
|
|
2
2
|
import { Signer } from "@ethersproject/abstract-signer";
|
|
3
3
|
import { Bytes } from "@ethersproject/bytes";
|
|
4
4
|
import { Deferrable } from "@ethersproject/properties";
|
|
5
|
+
import { RelayerStatusResponse } from "../constants";
|
|
5
6
|
export declare class SocketRelaySigner extends Signer {
|
|
6
7
|
readonly provider: Provider;
|
|
7
8
|
readonly chainId: number;
|
|
@@ -18,4 +19,5 @@ export declare class SocketRelaySigner extends Signer {
|
|
|
18
19
|
addMetadata(metadata: object): SocketRelaySigner;
|
|
19
20
|
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
20
21
|
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
22
|
+
getTransactionStatus(txId: string): Promise<RelayerStatusResponse | null>;
|
|
21
23
|
}
|
|
@@ -63,6 +63,22 @@ class SocketRelaySigner extends abstract_signer_1.Signer {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
getTransactionStatus(txId) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const headers = {
|
|
69
|
+
"x-api-key": this.relayerAPIKey,
|
|
70
|
+
};
|
|
71
|
+
const response = yield (0, axios_1.axiosGet)(`${this.relayUrl}/status?txId=${txId}`, {
|
|
72
|
+
headers: headers,
|
|
73
|
+
});
|
|
74
|
+
if (response.success) {
|
|
75
|
+
return response.data;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
throw new Error("response unsuccessful");
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
exports.SocketRelaySigner = SocketRelaySigner;
|
|
68
84
|
//# sourceMappingURL=relaySigner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relaySigner.js","sourceRoot":"","sources":["../../../dl-common/utils/relaySigner.ts"],"names":[],"mappings":";;;;AAKA,oEAAwD;AAIxD,
|
|
1
|
+
{"version":3,"file":"relaySigner.js","sourceRoot":"","sources":["../../../dl-common/utils/relaySigner.ts"],"names":[],"mappings":";;;;AAKA,oEAAwD;AAIxD,mCAA8C;AAO9C,MAAa,iBAAkB,SAAQ,wBAAM;IAC3C,YACW,QAAkB,EAClB,OAAe,EACf,QAAgB,EAChB,aAAqB,EACrB,aAAsB,KAAK,EAG3B,aAAsB,KAAK,EAC3B,WAAmB,EAAE;QAE9B,KAAK,EAAE,CAAC;QAVC,aAAQ,GAAR,QAAQ,CAAU;QAClB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,kBAAa,GAAb,aAAa,CAAQ;QACrB,eAAU,GAAV,UAAU,CAAiB;QAG3B,eAAU,GAAV,UAAU,CAAiB;QAC3B,aAAQ,GAAR,QAAQ,CAAa;IAGhC,CAAC;IAEY,UAAU;;YAErB,OAAO,4CAA4C,CAAC;QACtD,CAAC;KAAA;IAEY,WAAW,CAAC,OAAuB;;YAC9C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;KAAA;IAEM,OAAO,CAAC,QAAkB;QAC/B,OAAO,IAAI,iBAAiB,CAC1B,QAAQ,EACR,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,QAAQ,CACd,CAAC;IACJ,CAAC;IAEM,WAAW,CAAC,UAAmB;QACpC,OAAO,IAAI,iBAAiB,CAC1B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,UAAU,EACf,UAAU,EACV,IAAI,CAAC,QAA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,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;IAEY,oBAAoB,CAC/B,IAAY;;YAEZ,MAAM,OAAO,GAAG;gBACd,WAAW,EAAE,IAAI,CAAC,aAAa;aAChC,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,IAAA,gBAAQ,EAAC,GAAG,IAAI,CAAC,QAAQ,gBAAgB,IAAI,EAAE,EAAE;gBACtE,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;KAAA;CACF;AAhHD,8CAgHC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapRelayerStatusToTxStatus = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const mapRelayerStatusToTxStatus = (relayerStatus) => {
|
|
6
|
+
switch (relayerStatus.toUpperCase()) {
|
|
7
|
+
case constants_1.RelayerStatus.COMPLETED:
|
|
8
|
+
return constants_1.TxStatus.SUCCESS;
|
|
9
|
+
case constants_1.RelayerStatus.QUEUED:
|
|
10
|
+
case constants_1.RelayerStatus.PENDING:
|
|
11
|
+
return constants_1.TxStatus.PENDING;
|
|
12
|
+
case constants_1.RelayerStatus.IN_PROGRESS:
|
|
13
|
+
return constants_1.TxStatus.IN_PROGRESS;
|
|
14
|
+
case constants_1.RelayerStatus.FAILED:
|
|
15
|
+
return constants_1.TxStatus.FAILED;
|
|
16
|
+
default:
|
|
17
|
+
return constants_1.TxStatus.PENDING;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.mapRelayerStatusToTxStatus = mapRelayerStatusToTxStatus;
|
|
21
|
+
//# sourceMappingURL=relayUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relayUtils.js","sourceRoot":"","sources":["../../../dl-common/utils/relayUtils.ts"],"names":[],"mappings":";;;AAEA,4CAA8E;AAGvE,MAAM,0BAA0B,GAAG,CAAC,aAAqB,EAAY,EAAE;IAC5E,QAAQ,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,KAAK,yBAAa,CAAC,SAAS;YAC1B,OAAO,oBAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,yBAAa,CAAC,MAAM,CAAC;QAC1B,KAAK,yBAAa,CAAC,OAAO;YACxB,OAAO,oBAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,yBAAa,CAAC,WAAW;YAC5B,OAAO,oBAAQ,CAAC,WAAW,CAAC;QAC9B,KAAK,yBAAa,CAAC,MAAM;YACvB,OAAO,oBAAQ,CAAC,MAAM,CAAC;QACzB;YACE,OAAO,oBAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,0BAA0B,8BAcrC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Signer as ISigner } from "./signer";
|
|
2
|
-
import { Signer } from "@ethersproject/abstract-signer";
|
|
2
|
+
import { Signer, TypedDataDomain, TypedDataField } from "@ethersproject/abstract-signer";
|
|
3
3
|
import { Deferrable } from "@ethersproject/properties";
|
|
4
4
|
import { Bytes } from "@ethersproject/bytes";
|
|
5
5
|
import type { Provider, TransactionRequest } from "@ethersproject/abstract-provider";
|
|
6
|
+
import { Signature } from "./signature";
|
|
6
7
|
export type AdapterConfig = {
|
|
7
8
|
signer: ISigner;
|
|
8
9
|
version: string;
|
|
@@ -13,6 +14,7 @@ export declare class Adapter extends Signer {
|
|
|
13
14
|
constructor(config: AdapterConfig, provider?: Provider);
|
|
14
15
|
getAddress(): Promise<string>;
|
|
15
16
|
signMessage(message: Bytes | string): Promise<string>;
|
|
17
|
+
signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<Signature>;
|
|
16
18
|
signTransaction(deferrableTransaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
17
19
|
connect(provider: Provider): Adapter;
|
|
18
20
|
}
|
|
@@ -31,6 +31,11 @@ class Adapter extends abstract_signer_1.Signer {
|
|
|
31
31
|
return "0x" + signature.toString();
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
signTypedData(domain, types, value) {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return this.signer.signTypedData(domain, types, value);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
34
39
|
signTransaction(deferrableTransaction) {
|
|
35
40
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
41
|
const transaction = yield (0, properties_1.resolveProperties)(deferrableTransaction);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/adapter.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/adapter.ts"],"names":[],"mappings":";;;;AACA,oEAIwC;AACxC,0DAImC;AACnC,gDAA6D;AAK7D,8CAAkD;AAClD,kDAA+C;AAC/C,oDAAoD;AACpD,wDAAqD;AACrD,wDAAqD;AACrD,8DAA6E;AAQ7E,MAAa,OAAQ,SAAQ,wBAAM;IAIjC,YAAY,MAAqB,EAAE,QAAmB;QACpD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAA,2BAAc,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE3C,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEK,UAAU;;YACd,MAAM,OAAO,GAAG,MAAM,IAA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zD,CAAC;KAAA;IAED,OAAO,CAAC,QAAkB;QACxB,OAAO,IAAI,OAAO,CAChB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EACrD,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAhGD,0BAgGC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Signer } from "@ethersproject/abstract-signer";
|
|
1
|
+
import { Signer, TypedDataDomain, TypedDataField } from "@ethersproject/abstract-signer";
|
|
2
2
|
import type { Deferrable } from "@ethersproject/properties";
|
|
3
3
|
import type { Bytes } from "@ethersproject/bytes";
|
|
4
4
|
import type { Provider, TransactionRequest } from "@ethersproject/abstract-provider";
|
|
5
5
|
import type { KMSClientConfig } from "@aws-sdk/client-kms";
|
|
6
|
+
import { Signature } from "./signature";
|
|
6
7
|
export type KmsEthersSignerConfig = {
|
|
7
8
|
keyId: string;
|
|
8
9
|
kmsClientConfig?: KMSClientConfig;
|
|
@@ -14,6 +15,7 @@ export declare class KmsEthersSigner extends Signer {
|
|
|
14
15
|
constructor(config: KmsEthersSignerConfig, provider?: Provider);
|
|
15
16
|
getAddress(): Promise<string>;
|
|
16
17
|
signMessage(message: Bytes | string): Promise<string>;
|
|
18
|
+
signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<Signature>;
|
|
17
19
|
signTransaction(deferrableTransaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
18
20
|
connect(provider: Provider): KmsEthersSigner;
|
|
19
21
|
}
|
|
@@ -26,6 +26,11 @@ class KmsEthersSigner extends abstract_signer_1.Signer {
|
|
|
26
26
|
return this.adapter.signMessage(message);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
signTypedData(domain, types, value) {
|
|
30
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
return this.adapter.signTypedData(domain, types, value);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
29
34
|
signTransaction(deferrableTransaction) {
|
|
30
35
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
36
|
return this.adapter.signTransaction(deferrableTransaction);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kms-ethers-signer.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/kms-ethers-signer.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"kms-ethers-signer.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/kms-ethers-signer.ts"],"names":[],"mappings":";;;;AAAA,oEAIwC;AACxC,0DAA2D;AAQ3D,6CAAyC;AACzC,uCAAoC;AAIpC,MAAM,OAAO,GAAG,OAAO,CAAC;AAOxB,MAAa,eAAgB,SAAQ,wBAAM;IAIzC,YACmB,MAA6B,EAC9C,QAAmB;;QAEnB,KAAK,EAAE,CAAC;QAHS,WAAM,GAAN,MAAM,CAAuB;QAI9C,IAAA,2BAAc,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE3C,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAS,CAAC,MAAM,CAAC,KAAK,EAAE,MAAA,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC,CAAC;QAE3E,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC;IAEK,UAAU;;YACd,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACnC,CAAC;KAAA;IAEK,WAAW,CAAC,OAAuB;;YACvC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;KAAA;IAEK,aAAa,CACjB,MAAuB,EACvB,KAAuC,EACvC,KAA0B;;YAE1B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;KAAA;IAEK,eAAe,CACnB,qBAAqD;;YAErD,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;QAC7D,CAAC;KAAA;IAED,OAAO,CAAC,QAAkB;QACxB,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;CACF;AAzCD,0CAyCC"}
|
|
@@ -2,10 +2,12 @@ import { KMSClientConfig } from "@aws-sdk/client-kms";
|
|
|
2
2
|
import { Signature } from "./signature";
|
|
3
3
|
import { Address } from "./address";
|
|
4
4
|
import { Signer } from "./signer";
|
|
5
|
+
import { TypedDataDomain, TypedDataField } from "ethers";
|
|
5
6
|
export declare class KmsSigner implements Signer {
|
|
6
7
|
private readonly keyId;
|
|
7
8
|
private readonly client;
|
|
8
9
|
constructor(keyId: string, config?: KMSClientConfig);
|
|
10
|
+
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<Signature>;
|
|
9
11
|
sign(digest: Buffer): Promise<Signature>;
|
|
10
12
|
getAddress(): Promise<Address>;
|
|
11
13
|
getPublicKey(): Promise<Buffer>;
|
|
@@ -6,11 +6,18 @@ const client_kms_1 = require("@aws-sdk/client-kms");
|
|
|
6
6
|
const signature_1 = require("./signature");
|
|
7
7
|
const asn1_parser_1 = require("./asn1-parser");
|
|
8
8
|
const address_1 = require("./address");
|
|
9
|
+
const ethers_1 = require("ethers");
|
|
9
10
|
class KmsSigner {
|
|
10
11
|
constructor(keyId, config) {
|
|
11
12
|
this.keyId = keyId;
|
|
12
13
|
this.client = new client_kms_1.KMSClient(config !== null && config !== void 0 ? config : {});
|
|
13
14
|
}
|
|
15
|
+
signTypedData(domain, types, value) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const hash = ethers_1.ethers.utils._TypedDataEncoder.hash(domain, types, value);
|
|
18
|
+
return this.sign(Buffer.from(hash.slice(2), "hex"));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
14
21
|
sign(digest) {
|
|
15
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
23
|
const asn1Signature = yield this._sign(digest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kms-signer.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/kms-signer.ts"],"names":[],"mappings":";;;;AAAA,oDAK6B;AAC7B,2CAAwC;AACxC,+CAA+D;AAC/D,uCAAoC;
|
|
1
|
+
{"version":3,"file":"kms-signer.js","sourceRoot":"","sources":["../../../../dl-common/utils/signer/kms-signer.ts"],"names":[],"mappings":";;;;AAAA,oDAK6B;AAC7B,2CAAwC;AACxC,+CAA+D;AAC/D,uCAAoC;AAEpC,mCAAiE;AAEjE,MAAa,SAAS;IAIpB,YAAmB,KAAa,EAAE,MAAwB;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAS,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAEK,aAAa,CACjB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;;YAE1B,MAAM,IAAI,GAAG,eAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC;KAAA;IAEY,IAAI,CAAC,MAAc;;YAC9B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;Y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CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;KAAA;CACF;AA1DD,8BA0DC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { TypedDataDomain, TypedDataField } from "ethers";
|
|
1
2
|
import { Address } from "./address";
|
|
2
3
|
import { Signature } from "./signature";
|
|
3
4
|
export interface Signer {
|
|
4
5
|
sign(digest: Buffer): Promise<Signature>;
|
|
5
6
|
getAddress(): Promise<Address>;
|
|
7
|
+
signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<Signature>;
|
|
6
8
|
}
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataTypes, Model } from "sequelize";
|
|
2
|
+
export declare class LastBlock extends Model {
|
|
3
|
+
id: number;
|
|
4
|
+
chainSlug: number;
|
|
5
|
+
blockNumber: number;
|
|
6
|
+
isFullySynced: boolean;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const LastBlockModel: {
|
|
10
|
+
id: {
|
|
11
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
12
|
+
autoIncrement: boolean;
|
|
13
|
+
};
|
|
14
|
+
chainSlug: {
|
|
15
|
+
type: DataTypes.BigIntDataTypeConstructor;
|
|
16
|
+
primaryKey: boolean;
|
|
17
|
+
};
|
|
18
|
+
blockNumber: {
|
|
19
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
20
|
+
};
|
|
21
|
+
isFullySynced: {
|
|
22
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
23
|
+
};
|
|
24
|
+
isActive: {
|
|
25
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
26
|
+
defaultValue: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LastBlockModel = exports.LastBlock = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class LastBlock extends sequelize_1.Model {
|
|
6
|
+
}
|
|
7
|
+
exports.LastBlock = LastBlock;
|
|
8
|
+
exports.LastBlockModel = {
|
|
9
|
+
id: {
|
|
10
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
11
|
+
autoIncrement: true,
|
|
12
|
+
},
|
|
13
|
+
chainSlug: {
|
|
14
|
+
type: sequelize_1.DataTypes.BIGINT,
|
|
15
|
+
primaryKey: true,
|
|
16
|
+
},
|
|
17
|
+
blockNumber: {
|
|
18
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
19
|
+
},
|
|
20
|
+
isFullySynced: {
|
|
21
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
22
|
+
},
|
|
23
|
+
isActive: {
|
|
24
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
25
|
+
defaultValue: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
package/dist/models/message.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare class Message extends Model {
|
|
|
42
42
|
executeSignature: string;
|
|
43
43
|
executeMsgGasLimit: string;
|
|
44
44
|
executeRelayStatus: ExecutionRelayStatus;
|
|
45
|
+
executeData: string;
|
|
45
46
|
}
|
|
46
47
|
export declare const MessageModel: {
|
|
47
48
|
id: {
|
|
@@ -60,6 +61,10 @@ export declare const MessageModel: {
|
|
|
60
61
|
destPlug: {
|
|
61
62
|
type: DataTypes.StringDataTypeConstructor;
|
|
62
63
|
};
|
|
64
|
+
executeData: {
|
|
65
|
+
type: DataTypes.TextDataTypeConstructor;
|
|
66
|
+
defaultValue: string;
|
|
67
|
+
};
|
|
63
68
|
messageId: {
|
|
64
69
|
type: DataTypes.StringDataTypeConstructor;
|
|
65
70
|
primaryKey: boolean;
|
|
@@ -159,7 +164,7 @@ export declare const MessageModel: {
|
|
|
159
164
|
defaultValue: boolean;
|
|
160
165
|
};
|
|
161
166
|
inboundRevertString: {
|
|
162
|
-
type: DataTypes.
|
|
167
|
+
type: DataTypes.TextDataTypeConstructor;
|
|
163
168
|
defaultValue: string;
|
|
164
169
|
};
|
|
165
170
|
};
|
package/dist/models/message.js
CHANGED
|
@@ -31,6 +31,10 @@ exports.MessageModel = {
|
|
|
31
31
|
destPlug: {
|
|
32
32
|
type: sequelize_1.DataTypes.STRING,
|
|
33
33
|
},
|
|
34
|
+
executeData: {
|
|
35
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
36
|
+
defaultValue: "",
|
|
37
|
+
},
|
|
34
38
|
messageId: {
|
|
35
39
|
type: sequelize_1.DataTypes.STRING,
|
|
36
40
|
primaryKey: true,
|
|
@@ -130,7 +134,7 @@ exports.MessageModel = {
|
|
|
130
134
|
defaultValue: false,
|
|
131
135
|
},
|
|
132
136
|
inboundRevertString: {
|
|
133
|
-
type: sequelize_1.DataTypes.
|
|
137
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
134
138
|
defaultValue: "",
|
|
135
139
|
},
|
|
136
140
|
};
|
|
@@ -168,6 +172,12 @@ function processStrings(message) {
|
|
|
168
172
|
}
|
|
169
173
|
if (message.rootHash)
|
|
170
174
|
message.rootHash = (0, utils_1.toLowerCase)(message.rootHash);
|
|
175
|
+
if (message.payload)
|
|
176
|
+
message.payload = message.payload.slice(0, 10004);
|
|
177
|
+
if (message.inboundRevertString)
|
|
178
|
+
message.inboundRevertString = message.inboundRevertString.slice(0, 1000);
|
|
179
|
+
if (message.executeData)
|
|
180
|
+
message.executeData = message.executeData.slice(0, 5000);
|
|
171
181
|
return message;
|
|
172
182
|
}
|
|
173
183
|
const addMessageHooks = () => {
|
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 {
|
|
File without changes
|