@socket.tech/dl-common 1.0.16 → 1.0.17
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/confirmations.d.ts +5 -0
- package/dist/constants/confirmations.js +17 -0
- package/dist/constants/enums.d.ts +44 -0
- package/dist/constants/enums.js +52 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.js +19 -0
- package/dist/constants/types.d.ts +136 -0
- package/dist/constants/types.js +53 -0
- package/dist/constants/waitTime.d.ts +8 -0
- package/dist/constants/waitTime.js +45 -0
- 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.js.map +1 -1
- package/dist/dl-common/utils/signer/kms-ethers-signer.js.map +1 -1
- package/dist/dl-common/utils/signer/kms-signer.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +36 -0
- package/dist/models/attestSignature.d.ts +35 -0
- package/dist/models/attestSignature.js +53 -0
- package/dist/models/attestation.d.ts +70 -0
- package/dist/models/attestation.js +86 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +23 -0
- package/dist/models/lastBlock.d.ts +28 -0
- package/dist/models/lastBlock.js +27 -0
- package/dist/models/message.d.ts +171 -0
- package/dist/models/message.js +193 -0
- package/dist/models/packet.d.ts +240 -0
- package/dist/models/packet.js +249 -0
- package/dist/models/proposal.d.ts +127 -0
- package/dist/models/proposal.js +141 -0
- package/dist/models/switchboard.d.ts +69 -0
- package/dist/models/switchboard.js +92 -0
- package/dist/models/transaction.d.ts +0 -0
- package/dist/models/transaction.js +280 -0
- package/dist/services/cacheService.d.ts +14 -0
- package/dist/services/cacheService.js +77 -0
- package/dist/services/eventBridgeService.d.ts +8 -0
- package/dist/services/eventBridgeService.js +40 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.js +20 -0
- package/dist/services/queueService.d.ts +10 -0
- package/dist/services/queueService.js +62 -0
- 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/utils/address.d.ts +2 -0
- package/dist/utils/address.js +8 -0
- package/dist/utils/axios.d.ts +2 -0
- package/dist/utils/axios.js +54 -0
- package/dist/utils/dataStructHelper.d.ts +2 -0
- package/dist/utils/dataStructHelper.js +10 -0
- package/dist/utils/discord.d.ts +2 -0
- package/dist/utils/discord.js +43 -0
- package/dist/utils/ethersAwsKmsSigner.d.ts +2 -0
- package/dist/utils/ethersAwsKmsSigner.js +26 -0
- package/dist/utils/eventGetter.d.ts +4 -0
- package/dist/utils/eventGetter.js +50 -0
- package/dist/utils/extraUtils.d.ts +32 -0
- package/dist/utils/extraUtils.js +103 -0
- package/dist/utils/idUtils.d.ts +14 -0
- package/dist/utils/idUtils.js +50 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +29 -0
- package/dist/utils/relaySigner.d.ts +21 -0
- package/dist/utils/relaySigner.js +68 -0
- package/dist/utils/s3Service.d.ts +11 -0
- package/dist/utils/s3Service.js +70 -0
- package/dist/utils/secretManagerService.d.ts +2 -0
- package/dist/utils/secretManagerService.js +33 -0
- package/dist/utils/signer/adapter.d.ts +18 -0
- package/dist/utils/signer/adapter.js +71 -0
- package/dist/utils/signer/address.d.ts +9 -0
- package/dist/utils/signer/address.js +42 -0
- package/dist/utils/signer/asn1-parser.d.ts +10 -0
- package/dist/utils/signer/asn1-parser.js +79 -0
- package/dist/utils/signer/crypto.d.ts +5 -0
- package/dist/utils/signer/crypto.js +33 -0
- package/dist/utils/signer/index.d.ts +5 -0
- package/dist/utils/signer/index.js +21 -0
- package/dist/utils/signer/kms-ethers-signer.d.ts +19 -0
- package/dist/utils/signer/kms-ethers-signer.js +32 -0
- package/dist/utils/signer/kms-signer.d.ts +13 -0
- package/dist/utils/signer/kms-signer.js +46 -0
- package/dist/utils/signer/signature.d.ts +16 -0
- package/dist/utils/signer/signature.js +65 -0
- package/dist/utils/signer/signer.d.ts +6 -0
- package/dist/utils/signer/signer.js +2 -0
- package/dist/utils/signer/socketSigner.d.ts +39 -0
- package/dist/utils/signer/socketSigner.js +153 -0
- package/dist/utils/time.d.ts +2 -0
- package/dist/utils/time.js +7 -0
- package/package.json +4 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { IntegrationTypes } from "@socket.tech/dl-core";
|
|
3
|
+
// import { DataTypes, Model } from "sequelize";
|
|
4
|
+
// import { toLowerCase } from "../utils";
|
|
5
|
+
// import {Project} from "@socket.tech/socket-plugs";
|
|
6
|
+
// export enum SealRelayStatus {
|
|
7
|
+
// SEALED = "SEALED",
|
|
8
|
+
// SEALING = "SEALING",
|
|
9
|
+
// NO = "NO",
|
|
10
|
+
// SEAL_FAILED = "SEAL_FAILED",
|
|
11
|
+
// }
|
|
12
|
+
// export enum PacketTripRelayStatus {
|
|
13
|
+
// IS_TRIPPING = "IS_TRIPPING",
|
|
14
|
+
// NO = "NO",
|
|
15
|
+
// TRIPPING_FAILED = "TRIPPING_FAILED",
|
|
16
|
+
// TRIPPED = "TRIPPED",
|
|
17
|
+
// }
|
|
18
|
+
// export enum ProposeRelayStatus {
|
|
19
|
+
// PROPOSED = "PROPOSED",
|
|
20
|
+
// PROPOSING = "PROPOSING",
|
|
21
|
+
// CONFIRMING = "CONFIRMING",
|
|
22
|
+
// NO = "NO",
|
|
23
|
+
// PROPOSE_FAILED = "PROPOSE_FAILED",
|
|
24
|
+
// CONFIRM_FAILED = "CONFIRM_FAILED",
|
|
25
|
+
// }
|
|
26
|
+
// export enum TxType {
|
|
27
|
+
// SUPERBRIDGE = "SUPERBRIDGE",
|
|
28
|
+
// SUPERTOKEN = "SUPERTOKEN"
|
|
29
|
+
// }
|
|
30
|
+
// export class Transaction extends Model {
|
|
31
|
+
// declare id: number;
|
|
32
|
+
// srcChainSlug: number;
|
|
33
|
+
// dstChainSlug: number;
|
|
34
|
+
// from: string;
|
|
35
|
+
// to:string;
|
|
36
|
+
// amount:number;
|
|
37
|
+
// token: string;
|
|
38
|
+
// tokenAddress: string;
|
|
39
|
+
// srcPlug: string;
|
|
40
|
+
// dstPlug: string;
|
|
41
|
+
// usdAmount: number;
|
|
42
|
+
// type: TxType;
|
|
43
|
+
// project: Project;
|
|
44
|
+
// srcTxHash: string;
|
|
45
|
+
// txTime: string;
|
|
46
|
+
// root: string;
|
|
47
|
+
// rootSealed: string;
|
|
48
|
+
// sealer: string;
|
|
49
|
+
// sealTxHash: string;
|
|
50
|
+
// sealTxId: string;
|
|
51
|
+
// sealSignature: string;
|
|
52
|
+
// sealTime: number;
|
|
53
|
+
// sealRelayStatus: SealRelayStatus;
|
|
54
|
+
// packetTripTime: number;
|
|
55
|
+
// packetTripTxnHash: string;
|
|
56
|
+
// packetTripErrorMessage: string;
|
|
57
|
+
// isPacketTripped: boolean;
|
|
58
|
+
// packetTripRelayStatus: PacketTripRelayStatus;
|
|
59
|
+
// // proposeTxId, proposeTxHash refers to the proposal sent by us. For details of other proposals, see Proposal table.
|
|
60
|
+
// proposeTxId: string;
|
|
61
|
+
// proposeTxHash: string;
|
|
62
|
+
// proposeRelayStatus: ProposeRelayStatus;
|
|
63
|
+
// selectedProposalCount: number;
|
|
64
|
+
// // attestTxId, attestTxHash refers to the attestation sent by us. For details of other attestations, see Attestation table.
|
|
65
|
+
// attestTxId: string;
|
|
66
|
+
// attestTxHash: string;
|
|
67
|
+
// attestRelayStatus: AttestRelayStatus;
|
|
68
|
+
// outboundTxHash: string;
|
|
69
|
+
// outboundTime: number;
|
|
70
|
+
// sealIndexTime: number;
|
|
71
|
+
// proposeTime: number;
|
|
72
|
+
// attestTime: number;
|
|
73
|
+
// packetTripTxHash: string;
|
|
74
|
+
// isFilled: boolean;
|
|
75
|
+
// isSealed: boolean;
|
|
76
|
+
// isProposed: boolean;
|
|
77
|
+
// isAttested: boolean;
|
|
78
|
+
// isVerified: boolean;
|
|
79
|
+
// isFullyExecuted: boolean;
|
|
80
|
+
// tripreason: TripReason;
|
|
81
|
+
// executionWaitTime: number;
|
|
82
|
+
// }
|
|
83
|
+
// export const PacketModel = {
|
|
84
|
+
// id: {
|
|
85
|
+
// type: DataTypes.INTEGER,
|
|
86
|
+
// autoIncrement: true,
|
|
87
|
+
// },
|
|
88
|
+
// srcChainSlug: {
|
|
89
|
+
// type: DataTypes.BIGINT,
|
|
90
|
+
// },
|
|
91
|
+
// dstChainSlug: {
|
|
92
|
+
// type: DataTypes.BIGINT,
|
|
93
|
+
// },
|
|
94
|
+
// srcCapacitor: {
|
|
95
|
+
// type: DataTypes.STRING,
|
|
96
|
+
// },
|
|
97
|
+
// dstSwitchboard: {
|
|
98
|
+
// type: DataTypes.STRING,
|
|
99
|
+
// },
|
|
100
|
+
// switchboardId: {
|
|
101
|
+
// type: DataTypes.STRING,
|
|
102
|
+
// },
|
|
103
|
+
// integrationType: {
|
|
104
|
+
// type: DataTypes.ENUM,
|
|
105
|
+
// values: [...Object.values(IntegrationTypes)],
|
|
106
|
+
// defaultValue: IntegrationTypes.unknown,
|
|
107
|
+
// },
|
|
108
|
+
// packetId: {
|
|
109
|
+
// type: DataTypes.STRING,
|
|
110
|
+
// primaryKey: true,
|
|
111
|
+
// },
|
|
112
|
+
// capacitorPacketCount: {
|
|
113
|
+
// type: DataTypes.STRING,
|
|
114
|
+
// },
|
|
115
|
+
// root: {
|
|
116
|
+
// type: DataTypes.STRING,
|
|
117
|
+
// },
|
|
118
|
+
// rootSealed: {
|
|
119
|
+
// type: DataTypes.STRING,
|
|
120
|
+
// },
|
|
121
|
+
// isFilled: {
|
|
122
|
+
// type: DataTypes.BOOLEAN,
|
|
123
|
+
// },
|
|
124
|
+
// isSealed: {
|
|
125
|
+
// type: DataTypes.BOOLEAN,
|
|
126
|
+
// defaultValue: false,
|
|
127
|
+
// },
|
|
128
|
+
// isProposed: {
|
|
129
|
+
// type: DataTypes.BOOLEAN,
|
|
130
|
+
// defaultValue: false,
|
|
131
|
+
// },
|
|
132
|
+
// isAttested: {
|
|
133
|
+
// type: DataTypes.BOOLEAN,
|
|
134
|
+
// defaultValue: false,
|
|
135
|
+
// },
|
|
136
|
+
// isVerified: {
|
|
137
|
+
// type: DataTypes.BOOLEAN,
|
|
138
|
+
// defaultValue: false,
|
|
139
|
+
// },
|
|
140
|
+
// isFullyExecuted: {
|
|
141
|
+
// type: DataTypes.BOOLEAN,
|
|
142
|
+
// defaultValue: false,
|
|
143
|
+
// },
|
|
144
|
+
// sealer: {
|
|
145
|
+
// type: DataTypes.STRING,
|
|
146
|
+
// },
|
|
147
|
+
// sealRelayStatus: {
|
|
148
|
+
// type: DataTypes.ENUM,
|
|
149
|
+
// values: [...Object.values(SealRelayStatus)],
|
|
150
|
+
// defaultValue: SealRelayStatus.NO,
|
|
151
|
+
// },
|
|
152
|
+
// sealTxId: {
|
|
153
|
+
// type: DataTypes.STRING,
|
|
154
|
+
// defaultValue: "",
|
|
155
|
+
// },
|
|
156
|
+
// sealTxHash: {
|
|
157
|
+
// type: DataTypes.STRING,
|
|
158
|
+
// defaultValue: "",
|
|
159
|
+
// },
|
|
160
|
+
// outboundTxHash: {
|
|
161
|
+
// type: DataTypes.STRING,
|
|
162
|
+
// defaultValue: "",
|
|
163
|
+
// },
|
|
164
|
+
// outboundTime: {
|
|
165
|
+
// type: DataTypes.INTEGER,
|
|
166
|
+
// },
|
|
167
|
+
// proposeTime: {
|
|
168
|
+
// type: DataTypes.INTEGER,
|
|
169
|
+
// },
|
|
170
|
+
// attestTime: {
|
|
171
|
+
// type: DataTypes.INTEGER,
|
|
172
|
+
// },
|
|
173
|
+
// sealTime: {
|
|
174
|
+
// type: DataTypes.INTEGER,
|
|
175
|
+
// },
|
|
176
|
+
// sealIndexTime: {
|
|
177
|
+
// type: DataTypes.INTEGER,
|
|
178
|
+
// },
|
|
179
|
+
// sealSignature: {
|
|
180
|
+
// type: DataTypes.STRING,
|
|
181
|
+
// },
|
|
182
|
+
// packetTripRelayStatus: {
|
|
183
|
+
// type: DataTypes.ENUM,
|
|
184
|
+
// values: [...Object.values(PacketTripRelayStatus)],
|
|
185
|
+
// defaultValue: PacketTripRelayStatus.NO,
|
|
186
|
+
// },
|
|
187
|
+
// packetTripTxId: {
|
|
188
|
+
// type: DataTypes.STRING,
|
|
189
|
+
// defaultValue: "",
|
|
190
|
+
// },
|
|
191
|
+
// packetTripTxHash: {
|
|
192
|
+
// type: DataTypes.STRING,
|
|
193
|
+
// defaultValue: "",
|
|
194
|
+
// },
|
|
195
|
+
// packetTripErrorMessage: {
|
|
196
|
+
// type: DataTypes.STRING,
|
|
197
|
+
// defaultValue: "",
|
|
198
|
+
// },
|
|
199
|
+
// packetTripTime: {
|
|
200
|
+
// type: DataTypes.INTEGER,
|
|
201
|
+
// },
|
|
202
|
+
// isPacketTripped: {
|
|
203
|
+
// type: DataTypes.BOOLEAN,
|
|
204
|
+
// defaultValue: false,
|
|
205
|
+
// },
|
|
206
|
+
// proposeTxId: {
|
|
207
|
+
// type: DataTypes.STRING,
|
|
208
|
+
// defaultValue: "",
|
|
209
|
+
// },
|
|
210
|
+
// proposeTxHash: {
|
|
211
|
+
// type: DataTypes.STRING,
|
|
212
|
+
// defaultValue: "",
|
|
213
|
+
// },
|
|
214
|
+
// proposeRelayStatus: {
|
|
215
|
+
// type: DataTypes.ENUM,
|
|
216
|
+
// values: [...Object.values(ProposeRelayStatus)],
|
|
217
|
+
// defaultValue: ProposeRelayStatus.NO,
|
|
218
|
+
// },
|
|
219
|
+
// selectedProposalCount: {
|
|
220
|
+
// type: DataTypes.INTEGER,
|
|
221
|
+
// },
|
|
222
|
+
// executionWaitTime: {
|
|
223
|
+
// type: DataTypes.INTEGER,
|
|
224
|
+
// },
|
|
225
|
+
// attestTxId: {
|
|
226
|
+
// type: DataTypes.STRING,
|
|
227
|
+
// defaultValue: "",
|
|
228
|
+
// },
|
|
229
|
+
// attestTxHash: {
|
|
230
|
+
// type: DataTypes.STRING,
|
|
231
|
+
// defaultValue: "",
|
|
232
|
+
// },
|
|
233
|
+
// tripReason: {
|
|
234
|
+
// type: DataTypes.ENUM,
|
|
235
|
+
// values: [...Object.values(TripReason)],
|
|
236
|
+
// defaultValue: TripReason.NO,
|
|
237
|
+
// },
|
|
238
|
+
// // packetTripTxHash: {
|
|
239
|
+
// // type: DataTypes.STRING,
|
|
240
|
+
// // defaultValue: "",
|
|
241
|
+
// // },
|
|
242
|
+
// attestRelayStatus: {
|
|
243
|
+
// type: DataTypes.ENUM,
|
|
244
|
+
// values: [...Object.values(AttestRelayStatus)],
|
|
245
|
+
// defaultValue: AttestRelayStatus.NO,
|
|
246
|
+
// },
|
|
247
|
+
// };
|
|
248
|
+
// function processStrings(packet: Packet): Packet {
|
|
249
|
+
// if (packet.packetId) packet.packetId = toLowerCase(packet.packetId);
|
|
250
|
+
// if (packet.root) packet.root = toLowerCase(packet.root);
|
|
251
|
+
// if (packet.rootSealed) packet.rootSealed = toLowerCase(packet.rootSealed);
|
|
252
|
+
// if (packet.sealer) packet.sealer = toLowerCase(packet.sealer);
|
|
253
|
+
// if (packet.outboundTxHash) {
|
|
254
|
+
// packet.outboundTxHash = toLowerCase(packet.outboundTxHash);
|
|
255
|
+
// }
|
|
256
|
+
// if (packet.sealTxHash) packet.sealTxHash = toLowerCase(packet.sealTxHash);
|
|
257
|
+
// if (packet.sealSignature) {
|
|
258
|
+
// packet.sealSignature = toLowerCase(packet.sealSignature);
|
|
259
|
+
// }
|
|
260
|
+
// if (packet.dstSwitchboard) {
|
|
261
|
+
// packet.dstSwitchboard = toLowerCase(packet.dstSwitchboard);
|
|
262
|
+
// }
|
|
263
|
+
// if (packet.switchboardId) {
|
|
264
|
+
// packet.switchboardId = toLowerCase(packet.switchboardId);
|
|
265
|
+
// }
|
|
266
|
+
// if (packet.packetTripTxHash) {
|
|
267
|
+
// packet.packetTripTxHash = toLowerCase(packet.packetTripTxHash);
|
|
268
|
+
// }
|
|
269
|
+
// return packet;
|
|
270
|
+
// }
|
|
271
|
+
// export const addPacketHooks = () => {
|
|
272
|
+
// Packet.beforeBulkCreate((packet, options) => {
|
|
273
|
+
// for (let index = 0; index < packet.length; index++) {
|
|
274
|
+
// packet[index] = processStrings(packet[index]);
|
|
275
|
+
// }
|
|
276
|
+
// });
|
|
277
|
+
// Packet.beforeSave((packet, options) => {
|
|
278
|
+
// packet = processStrings(packet);
|
|
279
|
+
// });
|
|
280
|
+
// };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare let client: any;
|
|
2
|
+
export declare const initCache: (host: string, port: number, password: string, stage: string, serviceName: string) => void;
|
|
3
|
+
export declare const formatKey: (key: string) => string;
|
|
4
|
+
export declare const getKey: (key: string) => Promise<any>;
|
|
5
|
+
export declare const lock: (key: string, expire?: number) => Promise<boolean>;
|
|
6
|
+
export declare const deleteKey: (key: string) => Promise<any>;
|
|
7
|
+
export declare const unlock: (key: string) => Promise<any>;
|
|
8
|
+
export declare const setKey: (key: string, value: any, expire?: number, setIfNotExist?: boolean) => Promise<boolean>;
|
|
9
|
+
export declare const rpush: (key: string, values: any[]) => Promise<any>;
|
|
10
|
+
export declare const lpop: (key: string) => Promise<any>;
|
|
11
|
+
export declare const getListLength: (key: string) => Promise<any>;
|
|
12
|
+
export declare const increment: (key: string) => Promise<any>;
|
|
13
|
+
export declare const decrement: (key: string) => Promise<any>;
|
|
14
|
+
export declare const sendCommand: (command: string, params: any[]) => Promise<any>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendCommand = exports.decrement = exports.increment = exports.getListLength = exports.lpop = exports.rpush = exports.setKey = exports.unlock = exports.deleteKey = exports.lock = exports.getKey = exports.formatKey = exports.initCache = exports.client = void 0;
|
|
4
|
+
const redis = require("async-redis");
|
|
5
|
+
let deploymentStage;
|
|
6
|
+
let servicePrefix;
|
|
7
|
+
const initCache = (host, port, password, stage, serviceName) => {
|
|
8
|
+
exports.client = redis.createClient({
|
|
9
|
+
port,
|
|
10
|
+
host,
|
|
11
|
+
password,
|
|
12
|
+
});
|
|
13
|
+
deploymentStage = stage;
|
|
14
|
+
servicePrefix = serviceName;
|
|
15
|
+
};
|
|
16
|
+
exports.initCache = initCache;
|
|
17
|
+
const formatKey = (key) => {
|
|
18
|
+
return deploymentStage + "_" + servicePrefix + "_" + key;
|
|
19
|
+
};
|
|
20
|
+
exports.formatKey = formatKey;
|
|
21
|
+
const getKey = async (key) => {
|
|
22
|
+
return await exports.client.get((0, exports.formatKey)(key));
|
|
23
|
+
};
|
|
24
|
+
exports.getKey = getKey;
|
|
25
|
+
const lock = async (key, expire = 0) => {
|
|
26
|
+
return await (0, exports.setKey)(key, "locked", expire, true);
|
|
27
|
+
};
|
|
28
|
+
exports.lock = lock;
|
|
29
|
+
const deleteKey = async (key) => {
|
|
30
|
+
return await exports.client.del((0, exports.formatKey)(key));
|
|
31
|
+
};
|
|
32
|
+
exports.deleteKey = deleteKey;
|
|
33
|
+
const unlock = async (key) => {
|
|
34
|
+
return await exports.client.del((0, exports.formatKey)(key));
|
|
35
|
+
};
|
|
36
|
+
exports.unlock = unlock;
|
|
37
|
+
const setKey = async (key, value, expire = 0, setIfNotExist = false) => {
|
|
38
|
+
let params = [(0, exports.formatKey)(key), value];
|
|
39
|
+
if (expire > 0)
|
|
40
|
+
params.push("EX", expire);
|
|
41
|
+
if (setIfNotExist)
|
|
42
|
+
params.push("NX");
|
|
43
|
+
let response = await exports.client.sendCommand("SET", params);
|
|
44
|
+
if (response) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
else
|
|
48
|
+
return false;
|
|
49
|
+
};
|
|
50
|
+
exports.setKey = setKey;
|
|
51
|
+
const rpush = async (key, values) => {
|
|
52
|
+
return await exports.client.rpush((0, exports.formatKey)(key), values);
|
|
53
|
+
};
|
|
54
|
+
exports.rpush = rpush;
|
|
55
|
+
const lpop = async (key) => {
|
|
56
|
+
return await exports.client.lpop((0, exports.formatKey)(key));
|
|
57
|
+
};
|
|
58
|
+
exports.lpop = lpop;
|
|
59
|
+
const getListLength = async (key) => {
|
|
60
|
+
return await exports.client.llen((0, exports.formatKey)(key));
|
|
61
|
+
};
|
|
62
|
+
exports.getListLength = getListLength;
|
|
63
|
+
const increment = async (key) => {
|
|
64
|
+
let value = await exports.client.incr((0, exports.formatKey)(key));
|
|
65
|
+
console.log("incremented key : ", (0, exports.formatKey)(key), " value : ", value);
|
|
66
|
+
return value;
|
|
67
|
+
};
|
|
68
|
+
exports.increment = increment;
|
|
69
|
+
const decrement = async (key) => {
|
|
70
|
+
return await exports.client.decr((0, exports.formatKey)(key));
|
|
71
|
+
};
|
|
72
|
+
exports.decrement = decrement;
|
|
73
|
+
const sendCommand = async (command, params) => {
|
|
74
|
+
params[0] = (0, exports.formatKey)(params[0]);
|
|
75
|
+
return await exports.client.sendCommand(command, params);
|
|
76
|
+
};
|
|
77
|
+
exports.sendCommand = sendCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type EventBridgeEntry = {
|
|
2
|
+
eventBus: string;
|
|
3
|
+
source: string;
|
|
4
|
+
detailType: string;
|
|
5
|
+
data: Object;
|
|
6
|
+
};
|
|
7
|
+
export declare const initEventBridgeClient: (region?: string) => void;
|
|
8
|
+
export declare const sendEvents: (events: EventBridgeEntry[]) => Promise<import("@aws-sdk/client-eventbridge").PutEventsCommandOutput>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendEvents = exports.initEventBridgeClient = void 0;
|
|
4
|
+
const client_eventbridge_1 = require("@aws-sdk/client-eventbridge");
|
|
5
|
+
let client;
|
|
6
|
+
const initEventBridgeClient = (region = "us-east-1") => {
|
|
7
|
+
client = new client_eventbridge_1.EventBridgeClient({ region });
|
|
8
|
+
};
|
|
9
|
+
exports.initEventBridgeClient = initEventBridgeClient;
|
|
10
|
+
const sendEvents = async (events) => {
|
|
11
|
+
// async/await.
|
|
12
|
+
try {
|
|
13
|
+
if (!client) {
|
|
14
|
+
throw new Error("EventBridge client is not initialized. Call initEventBridgeClient first.");
|
|
15
|
+
}
|
|
16
|
+
let entries = events.map((event) => {
|
|
17
|
+
let { eventBus, source, detailType, data } = event;
|
|
18
|
+
return {
|
|
19
|
+
Source: source,
|
|
20
|
+
DetailType: detailType,
|
|
21
|
+
Detail: JSON.stringify(data),
|
|
22
|
+
EventBusName: eventBus,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const params = {
|
|
26
|
+
Entries: entries,
|
|
27
|
+
};
|
|
28
|
+
const command = new client_eventbridge_1.PutEventsCommand(params);
|
|
29
|
+
return await client.send(command);
|
|
30
|
+
// process data.
|
|
31
|
+
// eslint-disable-next-line no-useless-catch
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
// finally.
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.sendEvents = sendEvents;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./queueService"), exports);
|
|
18
|
+
__exportStar(require("./cacheService"), exports);
|
|
19
|
+
__exportStar(require("./eventBridgeService"), exports);
|
|
20
|
+
// export * from "./apiService";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const initQueue: (region: string) => void;
|
|
2
|
+
export declare const sendStandardSqsMessage: (queueUrl: string, data: any, DelaySeconds?: number) => Promise<import("@aws-sdk/client-sqs").SendMessageCommandOutput>;
|
|
3
|
+
export declare const sendStandardBatchMessages: (QueueUrl: string, dataArray: any[], DelaySecondsArray?: number[]) => Promise<void>;
|
|
4
|
+
export declare const sendFifoSqsMessage: (queueUrl: string, data: any, MessageGroupId: string) => Promise<import("@aws-sdk/client-sqs").SendMessageCommandOutput>;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
sendStandardSqsMessage: (queueUrl: string, data: any, DelaySeconds?: number) => Promise<import("@aws-sdk/client-sqs").SendMessageCommandOutput>;
|
|
7
|
+
sendFifoSqsMessage: (queueUrl: string, data: any, MessageGroupId: string) => Promise<import("@aws-sdk/client-sqs").SendMessageCommandOutput>;
|
|
8
|
+
sendStandardBatchMessages: (QueueUrl: string, dataArray: any[], DelaySecondsArray?: number[]) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendFifoSqsMessage = exports.sendStandardBatchMessages = exports.sendStandardSqsMessage = exports.initQueue = void 0;
|
|
4
|
+
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
let client;
|
|
7
|
+
const initQueue = (region) => {
|
|
8
|
+
client = new client_sqs_1.SQSClient({ region });
|
|
9
|
+
};
|
|
10
|
+
exports.initQueue = initQueue;
|
|
11
|
+
const sendStandardSqsMessage = async (queueUrl, data, DelaySeconds = 0) => {
|
|
12
|
+
let sqsOrderData = {
|
|
13
|
+
MessageBody: JSON.stringify(data),
|
|
14
|
+
QueueUrl: queueUrl,
|
|
15
|
+
DelaySeconds,
|
|
16
|
+
};
|
|
17
|
+
// Send the order data to the SQS queue
|
|
18
|
+
const command = new client_sqs_1.SendMessageCommand(sqsOrderData);
|
|
19
|
+
return await client.send(command);
|
|
20
|
+
};
|
|
21
|
+
exports.sendStandardSqsMessage = sendStandardSqsMessage;
|
|
22
|
+
const sendStandardBatchMessages = async (QueueUrl, dataArray, DelaySecondsArray = []) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const dataChunks = [...(0, utils_1.chunks)(dataArray, 10)];
|
|
25
|
+
const delayChunks = [...(0, utils_1.chunks)(DelaySecondsArray, 10)];
|
|
26
|
+
for (let i = 0; i < dataChunks.length; i++) {
|
|
27
|
+
let Entries = [];
|
|
28
|
+
let currentDataArray = dataChunks[i];
|
|
29
|
+
let currentDelayArray = delayChunks[i];
|
|
30
|
+
for (let j = 0; j < currentDataArray.length; j++) {
|
|
31
|
+
Entries.push({
|
|
32
|
+
MessageBody: JSON.stringify(currentDataArray[j]),
|
|
33
|
+
Id: String(i) + "-" + String(j),
|
|
34
|
+
DelaySeconds: (_a = currentDelayArray[j]) !== null && _a !== void 0 ? _a : 0,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
let sqsOrderData = {
|
|
38
|
+
Entries,
|
|
39
|
+
QueueUrl,
|
|
40
|
+
};
|
|
41
|
+
// Send the order data to the SQS queue
|
|
42
|
+
const command = new client_sqs_1.SendMessageBatchCommand(sqsOrderData);
|
|
43
|
+
await client.send(command);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.sendStandardBatchMessages = sendStandardBatchMessages;
|
|
47
|
+
const sendFifoSqsMessage = async (queueUrl, data, MessageGroupId) => {
|
|
48
|
+
let sqsOrderData = {
|
|
49
|
+
MessageBody: JSON.stringify(data),
|
|
50
|
+
QueueUrl: queueUrl,
|
|
51
|
+
MessageGroupId,
|
|
52
|
+
};
|
|
53
|
+
// Send the order data to the SQS queue
|
|
54
|
+
const command = new client_sqs_1.SendMessageCommand(sqsOrderData);
|
|
55
|
+
return await client.send(command);
|
|
56
|
+
};
|
|
57
|
+
exports.sendFifoSqsMessage = sendFifoSqsMessage;
|
|
58
|
+
exports.default = {
|
|
59
|
+
sendStandardSqsMessage: exports.sendStandardSqsMessage,
|
|
60
|
+
sendFifoSqsMessage: exports.sendFifoSqsMessage,
|
|
61
|
+
sendStandardBatchMessages: exports.sendStandardBatchMessages,
|
|
62
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainSlug } from "@socket.tech/dl-core";
|
|
2
|
+
import { BigNumber } from "ethers";
|
|
3
|
+
export declare const MAX_GAS_LIMIT: {
|
|
4
|
+
[key in ChainSlug]?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getMaxGasLimit: (chainSlug: ChainSlug) => number;
|
|
7
|
+
export declare const DEFAULT_MAX_GAS_LIMIT = 4000000;
|
|
8
|
+
export declare const gasLimits: Record<number, BigNumber>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gasLimits = exports.DEFAULT_MAX_GAS_LIMIT = exports.getMaxGasLimit = exports.MAX_GAS_LIMIT = void 0;
|
|
4
|
+
const dl_core_1 = require("@socket.tech/dl-core");
|
|
5
|
+
const ethers_1 = require("ethers");
|
|
6
|
+
const utils_1 = require("ethers/lib/utils");
|
|
7
|
+
exports.MAX_GAS_LIMIT = {
|
|
8
|
+
[dl_core_1.ChainSlug.ARBITRUM]: 2500000,
|
|
9
|
+
[dl_core_1.ChainSlug.REYA]: 200000000,
|
|
10
|
+
};
|
|
11
|
+
const getMaxGasLimit = (chainSlug) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = exports.MAX_GAS_LIMIT[chainSlug]) !== null && _a !== void 0 ? _a : exports.DEFAULT_MAX_GAS_LIMIT;
|
|
14
|
+
};
|
|
15
|
+
exports.getMaxGasLimit = getMaxGasLimit;
|
|
16
|
+
exports.DEFAULT_MAX_GAS_LIMIT = 4000000;
|
|
17
|
+
const COMMON_GAS_LIMIT = ethers_1.BigNumber.from(3000000);
|
|
18
|
+
const relayerBalThreshold = {
|
|
19
|
+
[dl_core_1.ChainSlug.BSC]: (0, utils_1.parseUnits)("0.03", "ether"),
|
|
20
|
+
[dl_core_1.ChainSlug.OPTIMISM]: (0, utils_1.parseUnits)("0.02", "ether"),
|
|
21
|
+
[dl_core_1.ChainSlug.AEVO]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
22
|
+
[dl_core_1.ChainSlug.ARBITRUM]: (0, utils_1.parseUnits)("0.02", "ether"),
|
|
23
|
+
[dl_core_1.ChainSlug.MAINNET]: (0, utils_1.parseUnits)("0.15", "ether"),
|
|
24
|
+
[dl_core_1.ChainSlug.POLYGON_MAINNET]: (0, utils_1.parseUnits)("4", "ether"),
|
|
25
|
+
[dl_core_1.ChainSlug.BSC_TESTNET]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
26
|
+
[dl_core_1.ChainSlug.OPTIMISM_GOERLI]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
27
|
+
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
28
|
+
[dl_core_1.ChainSlug.GOERLI]: (0, utils_1.parseUnits)("0.05", "ether"),
|
|
29
|
+
[dl_core_1.ChainSlug.POLYGON_MUMBAI]: (0, utils_1.parseUnits)("4", "ether"),
|
|
30
|
+
[dl_core_1.ChainSlug.AEVO_TESTNET]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
31
|
+
[dl_core_1.ChainSlug.LYRA]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
32
|
+
[dl_core_1.ChainSlug.LYRA_TESTNET]: (0, utils_1.parseUnits)("0.01", "ether"),
|
|
33
|
+
};
|
|
34
|
+
const gasPrice = {
|
|
35
|
+
[dl_core_1.ChainSlug.OPTIMISM]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
36
|
+
[dl_core_1.ChainSlug.AEVO]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
37
|
+
[dl_core_1.ChainSlug.ARBITRUM]: (0, utils_1.parseUnits)("0.15", "gwei"),
|
|
38
|
+
[dl_core_1.ChainSlug.OPTIMISM_GOERLI]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
39
|
+
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: (0, utils_1.parseUnits)("0.15", "gwei"),
|
|
40
|
+
[dl_core_1.ChainSlug.AEVO_TESTNET]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
41
|
+
[dl_core_1.ChainSlug.LYRA]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
42
|
+
[dl_core_1.ChainSlug.LYRA_TESTNET]: (0, utils_1.parseUnits)("0.1", "gwei"),
|
|
43
|
+
};
|
|
44
|
+
exports.gasLimits = {
|
|
45
|
+
[dl_core_1.ChainSlug.BSC]: COMMON_GAS_LIMIT,
|
|
46
|
+
[dl_core_1.ChainSlug.OPTIMISM]: relayerBalThreshold[dl_core_1.ChainSlug.OPTIMISM].div(gasPrice[dl_core_1.ChainSlug.OPTIMISM]),
|
|
47
|
+
[dl_core_1.ChainSlug.AEVO]: relayerBalThreshold[dl_core_1.ChainSlug.AEVO].div(gasPrice[dl_core_1.ChainSlug.AEVO]),
|
|
48
|
+
[dl_core_1.ChainSlug.ARBITRUM]: relayerBalThreshold[dl_core_1.ChainSlug.ARBITRUM].div(gasPrice[dl_core_1.ChainSlug.ARBITRUM]),
|
|
49
|
+
[dl_core_1.ChainSlug.MAINNET]: COMMON_GAS_LIMIT,
|
|
50
|
+
[dl_core_1.ChainSlug.POLYGON_MAINNET]: COMMON_GAS_LIMIT,
|
|
51
|
+
[dl_core_1.ChainSlug.BSC_TESTNET]: COMMON_GAS_LIMIT,
|
|
52
|
+
[dl_core_1.ChainSlug.OPTIMISM_GOERLI]: relayerBalThreshold[dl_core_1.ChainSlug.OPTIMISM_GOERLI].div(gasPrice[dl_core_1.ChainSlug.OPTIMISM_GOERLI]),
|
|
53
|
+
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: relayerBalThreshold[dl_core_1.ChainSlug.ARBITRUM_GOERLI].div(gasPrice[dl_core_1.ChainSlug.ARBITRUM_GOERLI]),
|
|
54
|
+
[dl_core_1.ChainSlug.GOERLI]: COMMON_GAS_LIMIT,
|
|
55
|
+
[dl_core_1.ChainSlug.POLYGON_MUMBAI]: COMMON_GAS_LIMIT,
|
|
56
|
+
[dl_core_1.ChainSlug.AEVO_TESTNET]: relayerBalThreshold[dl_core_1.ChainSlug.AEVO_TESTNET].div(gasPrice[dl_core_1.ChainSlug.AEVO_TESTNET]),
|
|
57
|
+
[dl_core_1.ChainSlug.SEPOLIA]: COMMON_GAS_LIMIT,
|
|
58
|
+
[dl_core_1.ChainSlug.HARDHAT]: COMMON_GAS_LIMIT,
|
|
59
|
+
[dl_core_1.ChainSlug.LYRA]: COMMON_GAS_LIMIT,
|
|
60
|
+
[dl_core_1.ChainSlug.LYRA_TESTNET]: COMMON_GAS_LIMIT,
|
|
61
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/relayers/propose/main.ts"],"names":[],"mappings":";;;;AAAA,uCAAgD;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/relayers/propose/main.ts"],"names":[],"mappings":";;;;AAAA,uCAAgD;AAChD,oDAAkD;AAClD,+CAUyB;AACzB,sDAMmC;AAInC,yCAA+B;AAC/B,sCAA+D;AAC/D,gEAA0E;AAC1E,0DAAqE;AACrE,oDAA6D;AAC7D,yEAAiE;AACjE,uCAAqD;AAErD,mCAAqC;AACrC,mDAIyB;AACzB,uCAA2C;AAEpC,MAAM,YAAY,GAAG,CAAO,SAAqB,EAAE,EAAE;IAC1D,IAAI,CAAC,4BAAgB,EAAE,CAAC;QACtB,IAAA,eAAO,EAAC;YACN,IAAI,EAAE,6BAA6B;YACnC,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;SACd,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,+BAAmB,CAAC;IACvC,MAAM,kBAAkB,GAAoB,MAAM,IAAA,kCAAwB,EACxE,UAAU,CACX,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,CAAO,SAAS,EAAE,EAAE;QACjC,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA;YAAE,OAAO;QAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,G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EAAC;gBACN,IAAI,EAAE,kBAAkB;gBACxB,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;gBAC5D,UAAU,EAAE,EAAE;aACf,CAAC,CAAC;YAGH,MAAM;QACR,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,gBAAQ,EAAC;YACP,IAAI,EAAE,sBAAsB;YAC5B,KAAK;YACL,SAAS;YACT,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AAhDW,QAAA,eAAe,mBAgD1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PacketMessageAttestJoin } from "../constants";
|
|
2
|
+
import { type ChainSlug } from "@socket.tech/dl-core";
|
|
3
|
+
type PacketsPerChain = Record<number, PacketMessageAttestJoin[]>;
|
|
4
|
+
export declare const relayPropose: (chainSlug?: ChainSlug) => Promise<void>;
|
|
5
|
+
export declare const getPendingProposePackets: (dstChainSlugs: number[]) => Promise<PacketsPerChain>;
|
|
6
|
+
export declare const checkAndPropose: () => Promise<void>;
|
|
7
|
+
export {};
|