@socket.tech/dl-common 1.0.2-test.1 → 1.0.2-test.3
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/index.d.ts +1 -0
- package/dist/constants/index.js +17 -0
- package/dist/constants/waitTime.d.ts +7 -0
- package/dist/constants/waitTime.js +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/packet.d.ts +12 -0
- package/dist/models/packet.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./waitTime";
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./waitTime"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChainSlug, IntegrationTypes } from "@socket.tech/dl-core";
|
|
2
|
+
export declare const getWaitTime: (integrationType: IntegrationTypes, srcChainSlug: ChainSlug, dstChainSlug: ChainSlug) => number;
|
|
3
|
+
export declare const NativeWaitTime: {
|
|
4
|
+
[srcChain in ChainSlug]?: {
|
|
5
|
+
[dstChain in ChainSlug]?: number;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeWaitTime = exports.getWaitTime = void 0;
|
|
4
|
+
const dl_core_1 = require("@socket.tech/dl-core");
|
|
5
|
+
const getWaitTime = (integrationType, srcChainSlug, dstChainSlug) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
switch (integrationType) {
|
|
8
|
+
case dl_core_1.IntegrationTypes.fast:
|
|
9
|
+
return 0;
|
|
10
|
+
case dl_core_1.IntegrationTypes.fast2:
|
|
11
|
+
return 0;
|
|
12
|
+
case dl_core_1.IntegrationTypes.optimistic:
|
|
13
|
+
return 2 * 3600;
|
|
14
|
+
case dl_core_1.IntegrationTypes.native:
|
|
15
|
+
return (_b = (_a = exports.NativeWaitTime[srcChainSlug]) === null || _a === void 0 ? void 0 : _a[dstChainSlug]) !== null && _b !== void 0 ? _b : 2 * 3600;
|
|
16
|
+
default:
|
|
17
|
+
return 0;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.getWaitTime = getWaitTime;
|
|
22
|
+
exports.NativeWaitTime = {
|
|
23
|
+
[dl_core_1.ChainSlug.OPTIMISM_GOERLI]: {
|
|
24
|
+
[dl_core_1.ChainSlug.GOERLI]: 15 * 60,
|
|
25
|
+
},
|
|
26
|
+
[dl_core_1.ChainSlug.ARBITRUM_GOERLI]: {
|
|
27
|
+
[dl_core_1.ChainSlug.GOERLI]: 15 * 60,
|
|
28
|
+
},
|
|
29
|
+
[dl_core_1.ChainSlug.ARBITRUM]: {
|
|
30
|
+
[dl_core_1.ChainSlug.MAINNET]: 7 * 24 * 3600,
|
|
31
|
+
},
|
|
32
|
+
[dl_core_1.ChainSlug.OPTIMISM]: {
|
|
33
|
+
[dl_core_1.ChainSlug.MAINNET]: 7 * 24 * 3600,
|
|
34
|
+
},
|
|
35
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/models/packet.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare class Packet extends Model {
|
|
|
63
63
|
attestRelayStatus: AttestRelayStatus;
|
|
64
64
|
outboundTxHash: string;
|
|
65
65
|
outboundTime: number;
|
|
66
|
+
proposeTime: number;
|
|
67
|
+
attestTime: number;
|
|
66
68
|
packetTripTxHash: string;
|
|
67
69
|
isFilled: boolean;
|
|
68
70
|
isSealed: boolean;
|
|
@@ -71,6 +73,7 @@ export declare class Packet extends Model {
|
|
|
71
73
|
isVerified: boolean;
|
|
72
74
|
isFullyExecuted: boolean;
|
|
73
75
|
tripreason: TripReason;
|
|
76
|
+
executionWaitTime: number;
|
|
74
77
|
}
|
|
75
78
|
export declare const PacketModel: {
|
|
76
79
|
id: {
|
|
@@ -153,6 +156,12 @@ export declare const PacketModel: {
|
|
|
153
156
|
outboundTime: {
|
|
154
157
|
type: DataTypes.IntegerDataTypeConstructor;
|
|
155
158
|
};
|
|
159
|
+
proposeTime: {
|
|
160
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
161
|
+
};
|
|
162
|
+
attestTime: {
|
|
163
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
164
|
+
};
|
|
156
165
|
sealTime: {
|
|
157
166
|
type: DataTypes.IntegerDataTypeConstructor;
|
|
158
167
|
};
|
|
@@ -199,6 +208,9 @@ export declare const PacketModel: {
|
|
|
199
208
|
selectedProposalCount: {
|
|
200
209
|
type: DataTypes.IntegerDataTypeConstructor;
|
|
201
210
|
};
|
|
211
|
+
executionWaitTime: {
|
|
212
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
213
|
+
};
|
|
202
214
|
attestTxId: {
|
|
203
215
|
type: DataTypes.StringDataTypeConstructor;
|
|
204
216
|
defaultValue: string;
|
package/dist/models/packet.js
CHANGED
|
@@ -124,6 +124,12 @@ exports.PacketModel = {
|
|
|
124
124
|
outboundTime: {
|
|
125
125
|
type: sequelize_1.DataTypes.INTEGER,
|
|
126
126
|
},
|
|
127
|
+
proposeTime: {
|
|
128
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
129
|
+
},
|
|
130
|
+
attestTime: {
|
|
131
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
132
|
+
},
|
|
127
133
|
sealTime: {
|
|
128
134
|
type: sequelize_1.DataTypes.INTEGER,
|
|
129
135
|
},
|
|
@@ -170,6 +176,9 @@ exports.PacketModel = {
|
|
|
170
176
|
selectedProposalCount: {
|
|
171
177
|
type: sequelize_1.DataTypes.INTEGER,
|
|
172
178
|
},
|
|
179
|
+
executionWaitTime: {
|
|
180
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
181
|
+
},
|
|
173
182
|
attestTxId: {
|
|
174
183
|
type: sequelize_1.DataTypes.STRING,
|
|
175
184
|
defaultValue: "",
|