@socket.tech/dl-common 1.0.2-test.1 → 1.0.2-test.2
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 +4 -0
- package/dist/models/packet.js +3 -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
|
@@ -71,6 +71,7 @@ export declare class Packet extends Model {
|
|
|
71
71
|
isVerified: boolean;
|
|
72
72
|
isFullyExecuted: boolean;
|
|
73
73
|
tripreason: TripReason;
|
|
74
|
+
executionWaitTime: number;
|
|
74
75
|
}
|
|
75
76
|
export declare const PacketModel: {
|
|
76
77
|
id: {
|
|
@@ -199,6 +200,9 @@ export declare const PacketModel: {
|
|
|
199
200
|
selectedProposalCount: {
|
|
200
201
|
type: DataTypes.IntegerDataTypeConstructor;
|
|
201
202
|
};
|
|
203
|
+
executionWaitTime: {
|
|
204
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
205
|
+
};
|
|
202
206
|
attestTxId: {
|
|
203
207
|
type: DataTypes.StringDataTypeConstructor;
|
|
204
208
|
defaultValue: string;
|
package/dist/models/packet.js
CHANGED
|
@@ -170,6 +170,9 @@ exports.PacketModel = {
|
|
|
170
170
|
selectedProposalCount: {
|
|
171
171
|
type: sequelize_1.DataTypes.INTEGER,
|
|
172
172
|
},
|
|
173
|
+
executionWaitTime: {
|
|
174
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
175
|
+
},
|
|
173
176
|
attestTxId: {
|
|
174
177
|
type: sequelize_1.DataTypes.STRING,
|
|
175
178
|
defaultValue: "",
|