@socket.tech/dl-common 1.0.3-test.8 → 1.0.4-test.1

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.
Files changed (67) hide show
  1. package/dist/constants/confirmations.d.ts +5 -0
  2. package/dist/constants/confirmations.js +17 -0
  3. package/dist/constants/enums.d.ts +9 -2
  4. package/dist/constants/enums.js +9 -1
  5. package/dist/constants/types.d.ts +14 -5
  6. package/dist/constants/types.js +9 -1
  7. package/dist/constants/waitTime.d.ts +1 -0
  8. package/dist/constants/waitTime.js +7 -13
  9. package/dist/index.js +30 -14
  10. package/dist/models/attestation.d.ts +2 -2
  11. package/dist/models/attestation.js +2 -2
  12. package/dist/models/index.d.ts +1 -0
  13. package/dist/models/index.js +1 -0
  14. package/dist/models/lastBlock.d.ts +28 -0
  15. package/dist/models/lastBlock.js +27 -0
  16. package/dist/models/message.d.ts +8 -3
  17. package/dist/models/message.js +13 -3
  18. package/dist/models/packet.d.ts +10 -2
  19. package/dist/models/packet.js +11 -2
  20. package/dist/models/proposal.d.ts +2 -2
  21. package/dist/models/proposal.js +2 -2
  22. package/dist/models/switchboard.d.ts +10 -2
  23. package/dist/models/switchboard.js +22 -5
  24. package/dist/models/transaction.d.ts +0 -0
  25. package/dist/models/transaction.js +280 -0
  26. package/dist/services/eventBridgeService.d.ts +8 -0
  27. package/dist/services/eventBridgeService.js +40 -0
  28. package/dist/services/index.d.ts +1 -0
  29. package/dist/services/index.js +1 -0
  30. package/dist/services/queueService.d.ts +2 -2
  31. package/dist/services/queueService.js +22 -14
  32. package/dist/utils/ethersAwsKmsSigner.d.ts +2 -2
  33. package/dist/utils/ethersAwsKmsSigner.js +6 -3
  34. package/dist/utils/index.d.ts +2 -0
  35. package/dist/utils/index.js +2 -0
  36. package/dist/utils/relaySigner.d.ts +2 -4
  37. package/dist/utils/relaySigner.js +7 -10
  38. package/dist/utils/s3Service.d.ts +5 -0
  39. package/dist/utils/s3Service.js +45 -0
  40. package/dist/utils/signer/adapter.d.ts +18 -0
  41. package/dist/utils/signer/adapter.js +71 -0
  42. package/dist/utils/signer/address.d.ts +10 -0
  43. package/dist/utils/signer/address.js +42 -0
  44. package/dist/utils/signer/asn1-parser.d.ts +11 -0
  45. package/dist/utils/signer/asn1-parser.js +80 -0
  46. package/dist/utils/signer/crypto.d.ts +6 -0
  47. package/dist/utils/signer/crypto.js +34 -0
  48. package/dist/utils/signer/index.d.ts +4 -0
  49. package/dist/{types → utils/signer}/index.js +4 -2
  50. package/dist/utils/signer/kms-ethers-signer.d.ts +19 -0
  51. package/dist/utils/signer/kms-ethers-signer.js +32 -0
  52. package/dist/utils/signer/kms-signer.d.ts +14 -0
  53. package/dist/utils/signer/kms-signer.js +46 -0
  54. package/dist/utils/signer/signature.d.ts +17 -0
  55. package/dist/utils/signer/signature.js +65 -0
  56. package/dist/utils/signer/signer.d.ts +7 -0
  57. package/dist/utils/signer/signer.js +2 -0
  58. package/dist/utils/time.d.ts +1 -0
  59. package/dist/utils/time.js +3 -1
  60. package/package.json +51 -16
  61. package/dist/models/attestations.d.ts +0 -69
  62. package/dist/models/attestations.js +0 -59
  63. package/dist/types/codes.d.ts +0 -22
  64. package/dist/types/codes.js +0 -28
  65. package/dist/types/index.d.ts +0 -2
  66. package/dist/types/types.d.ts +0 -86
  67. package/dist/types/types.js +0 -41
@@ -0,0 +1,5 @@
1
+ import { ChainSlug } from "@socket.tech/dl-core";
2
+ export declare const getConfirmations: (chainSlug: ChainSlug) => number;
3
+ export declare const Confirmations: {
4
+ [chain: number]: number;
5
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Confirmations = exports.getConfirmations = void 0;
4
+ const dl_core_1 = require("@socket.tech/dl-core");
5
+ const getConfirmations = (chainSlug) => {
6
+ if (dl_core_1.TestnetIds.includes(chainSlug)) {
7
+ return 1;
8
+ }
9
+ return exports.Confirmations[chainSlug];
10
+ };
11
+ exports.getConfirmations = getConfirmations;
12
+ exports.Confirmations = {
13
+ [dl_core_1.ChainSlug.MAINNET]: 12,
14
+ [dl_core_1.ChainSlug.ARBITRUM]: 1,
15
+ [dl_core_1.ChainSlug.OPTIMISM]: 18,
16
+ [dl_core_1.ChainSlug.AEVO]: 18,
17
+ };
@@ -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",
@@ -33,5 +34,11 @@ export declare enum StatusCodes {
33
34
  SUCCESS = "SUCCESS",
34
35
  NOT_FOUND = "NOT_FOUND",
35
36
  BAD_REQUEST = "BAD_REQUEST",
36
- INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
37
+ UNAUTHORIZED = "UNAUTHORIZED",
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"
37
44
  }
@@ -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) {
@@ -40,5 +41,12 @@ var StatusCodes;
40
41
  StatusCodes["SUCCESS"] = "SUCCESS";
41
42
  StatusCodes["NOT_FOUND"] = "NOT_FOUND";
42
43
  StatusCodes["BAD_REQUEST"] = "BAD_REQUEST";
44
+ StatusCodes["UNAUTHORIZED"] = "UNAUTHORIZED";
43
45
  StatusCodes["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
46
+ StatusCodes["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
44
47
  })(StatusCodes || (exports.StatusCodes = StatusCodes = {}));
48
+ var Accounts;
49
+ (function (Accounts) {
50
+ Accounts["dl"] = "dl";
51
+ Accounts["ll"] = "ll";
52
+ })(Accounts || (exports.Accounts = Accounts = {}));
@@ -1,6 +1,6 @@
1
1
  import { TripReason } from "../models";
2
2
  import { StatusCodes } from "./enums";
3
- import { ChainSlug, IntegrationTypes } from "@socket.tech/dl-core";
3
+ import { IntegrationTypes } from "@socket.tech/dl-core";
4
4
  export type Speed = "safeLow" | "average" | "fast" | "fastest";
5
5
  export declare enum InboundStatus {
6
6
  NOT_TRIED = "NOT_TRIED",
@@ -17,8 +17,16 @@ export interface FeeEstimate {
17
17
  export declare enum RelayerAPIStatus {
18
18
  FAILED = "FAILED",
19
19
  SIMULATION_FAILED = "SIMULATION_FAILED",
20
- COMPLETED = "COMPLETED"
20
+ COMPLETED = "COMPLETED",
21
+ DUPLICATE_NONCE_TX = "DUPLICATE_NONCE_TX"
21
22
  }
23
+ export declare const ErrorReasons: {
24
+ ZERO_AMOUNT: string;
25
+ PRE_EXEC_VALIDATION_ERROR: string;
26
+ WRONG_PLUG_CONNECTION: string;
27
+ INBOUND_FAILURE: string;
28
+ LOW_GAS_LIMIT: string;
29
+ };
22
30
  export declare class ServerError {
23
31
  code: Omit<StatusCodes, StatusCodes.SUCCESS>;
24
32
  message?: string;
@@ -37,6 +45,7 @@ export type SealParams = {
37
45
  srcChainSlug: number;
38
46
  dstChainSlug: number;
39
47
  dstSwitchboard: string;
48
+ srcSwitchboard: string;
40
49
  integrationType: IntegrationTypes;
41
50
  message: {
42
51
  messageId: string;
@@ -84,7 +93,7 @@ export interface ExecuteSigResponse {
84
93
  }
85
94
  export interface AttestRequest {
86
95
  switchboardAddress: string;
87
- dstChainSlug: ChainSlug;
96
+ dstChainSlug: number;
88
97
  packetId: string;
89
98
  root: string;
90
99
  proposalCount: number;
@@ -108,8 +117,8 @@ export type MessageData = {
108
117
  messageId: string;
109
118
  destPlug: string;
110
119
  srcPlug: string;
111
- dstChainSlug: ChainSlug;
112
- srcChainSlug: ChainSlug;
120
+ dstChainSlug: number;
121
+ srcChainSlug: number;
113
122
  payload: string;
114
123
  minMsgGasLimit: string;
115
124
  executionParams: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
3
+ exports.InternalServerError = exports.BadRequestError = exports.ServerError = exports.ErrorReasons = exports.RelayerAPIStatus = exports.InboundStatus = void 0;
4
4
  const enums_1 = require("./enums");
5
5
  var InboundStatus;
6
6
  (function (InboundStatus) {
@@ -14,7 +14,15 @@ var RelayerAPIStatus;
14
14
  RelayerAPIStatus["FAILED"] = "FAILED";
15
15
  RelayerAPIStatus["SIMULATION_FAILED"] = "SIMULATION_FAILED";
16
16
  RelayerAPIStatus["COMPLETED"] = "COMPLETED";
17
+ RelayerAPIStatus["DUPLICATE_NONCE_TX"] = "DUPLICATE_NONCE_TX";
17
18
  })(RelayerAPIStatus || (exports.RelayerAPIStatus = RelayerAPIStatus = {}));
19
+ exports.ErrorReasons = {
20
+ ZERO_AMOUNT: "ZERO_AMOUNT",
21
+ PRE_EXEC_VALIDATION_ERROR: "PRE_EXEC_VALIDATION_ERROR",
22
+ WRONG_PLUG_CONNECTION: "WRONG_PLUG_CONNECTION",
23
+ INBOUND_FAILURE: "INBOUND_FAILURE",
24
+ LOW_GAS_LIMIT: "LOW_GAS_LIMIT",
25
+ };
18
26
  class ServerError {
19
27
  constructor(code, message) {
20
28
  this.code = code;
@@ -1,5 +1,6 @@
1
1
  import { ChainSlug, IntegrationTypes } from "@socket.tech/dl-core";
2
2
  export declare const getWaitTime: (integrationType: IntegrationTypes, srcChainSlug: ChainSlug, dstChainSlug: ChainSlug) => number;
3
+ export declare const getNativeWaitTime: (srcChainSlug: ChainSlug, dstChainSlug: ChainSlug) => number;
3
4
  export declare const NativeWaitTime: {
4
5
  [srcChain in ChainSlug]?: {
5
6
  [dstChain in ChainSlug]?: number;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NativeWaitTime = exports.getWaitTime = void 0;
3
+ exports.NativeWaitTime = exports.getNativeWaitTime = exports.getWaitTime = void 0;
4
4
  const dl_core_1 = require("@socket.tech/dl-core");
5
5
  const getWaitTime = (integrationType, srcChainSlug, dstChainSlug) => {
6
- var _a, _b;
7
6
  switch (integrationType) {
8
7
  case dl_core_1.IntegrationTypes.fast:
9
8
  return 0;
@@ -12,13 +11,17 @@ const getWaitTime = (integrationType, srcChainSlug, dstChainSlug) => {
12
11
  case dl_core_1.IntegrationTypes.optimistic:
13
12
  return 2 * 3600;
14
13
  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;
14
+ return (0, exports.getNativeWaitTime)(srcChainSlug, dstChainSlug);
16
15
  default:
17
16
  return 0;
18
- break;
19
17
  }
20
18
  };
21
19
  exports.getWaitTime = getWaitTime;
20
+ const getNativeWaitTime = (srcChainSlug, dstChainSlug) => {
21
+ var _a, _b;
22
+ return (_b = (_a = exports.NativeWaitTime[srcChainSlug]) === null || _a === void 0 ? void 0 : _a[dstChainSlug]) !== null && _b !== void 0 ? _b : 0;
23
+ };
24
+ exports.getNativeWaitTime = getNativeWaitTime;
22
25
  exports.NativeWaitTime = {
23
26
  [dl_core_1.ChainSlug.OPTIMISM_GOERLI]: {
24
27
  [dl_core_1.ChainSlug.GOERLI]: 5 * 60,
@@ -26,11 +29,7 @@ exports.NativeWaitTime = {
26
29
  [dl_core_1.ChainSlug.ARBITRUM_GOERLI]: {
27
30
  [dl_core_1.ChainSlug.GOERLI]: 5 * 60,
28
31
  },
29
- [dl_core_1.ChainSlug.POLYGON_MUMBAI]: {
30
- [dl_core_1.ChainSlug.GOERLI]: 10 * 60,
31
- },
32
32
  [dl_core_1.ChainSlug.GOERLI]: {
33
- [dl_core_1.ChainSlug.POLYGON_MUMBAI]: 5 * 60,
34
33
  [dl_core_1.ChainSlug.ARBITRUM_GOERLI]: 5 * 60,
35
34
  [dl_core_1.ChainSlug.OPTIMISM_GOERLI]: 5 * 60,
36
35
  },
@@ -43,9 +42,4 @@ exports.NativeWaitTime = {
43
42
  [dl_core_1.ChainSlug.POLYGON_MAINNET]: {
44
43
  [dl_core_1.ChainSlug.MAINNET]: 4 * 3600,
45
44
  },
46
- [dl_core_1.ChainSlug.MAINNET]: {
47
- [dl_core_1.ChainSlug.ARBITRUM]: 10 * 60,
48
- [dl_core_1.ChainSlug.OPTIMISM]: 10 * 60,
49
- [dl_core_1.ChainSlug.POLYGON_MAINNET]: 10 * 60,
50
- },
51
45
  };
package/dist/index.js CHANGED
@@ -1,18 +1,34 @@
1
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
- };
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);
@@ -33,10 +33,10 @@ export declare const AttestationModel: {
33
33
  type: DataTypes.StringDataTypeConstructor;
34
34
  };
35
35
  srcChainSlug: {
36
- type: DataTypes.IntegerDataTypeConstructor;
36
+ type: DataTypes.BigIntDataTypeConstructor;
37
37
  };
38
38
  dstChainSlug: {
39
- type: DataTypes.IntegerDataTypeConstructor;
39
+ type: DataTypes.BigIntDataTypeConstructor;
40
40
  };
41
41
  integrationType: {
42
42
  type: DataTypes.StringDataTypeConstructor;
@@ -24,10 +24,10 @@ exports.AttestationModel = {
24
24
  type: sequelize_1.DataTypes.STRING,
25
25
  },
26
26
  srcChainSlug: {
27
- type: sequelize_1.DataTypes.INTEGER,
27
+ type: sequelize_1.DataTypes.BIGINT,
28
28
  },
29
29
  dstChainSlug: {
30
- type: sequelize_1.DataTypes.INTEGER,
30
+ type: sequelize_1.DataTypes.BIGINT,
31
31
  },
32
32
  integrationType: {
33
33
  type: sequelize_1.DataTypes.STRING,
@@ -4,3 +4,4 @@ export * from "./attestSignature";
4
4
  export * from "./attestation";
5
5
  export * from "./proposal";
6
6
  export * from "./switchboard";
7
+ export * from "./lastBlock";
@@ -20,3 +20,4 @@ __exportStar(require("./attestSignature"), exports);
20
20
  __exportStar(require("./attestation"), exports);
21
21
  __exportStar(require("./proposal"), exports);
22
22
  __exportStar(require("./switchboard"), exports);
23
+ __exportStar(require("./lastBlock"), exports);
@@ -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
+ };
@@ -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: {
@@ -49,10 +50,10 @@ export declare const MessageModel: {
49
50
  autoIncrement: boolean;
50
51
  };
51
52
  srcChainSlug: {
52
- type: DataTypes.IntegerDataTypeConstructor;
53
+ type: DataTypes.BigIntDataTypeConstructor;
53
54
  };
54
55
  dstChainSlug: {
55
- type: DataTypes.IntegerDataTypeConstructor;
56
+ type: DataTypes.BigIntDataTypeConstructor;
56
57
  };
57
58
  srcPlug: {
58
59
  type: DataTypes.StringDataTypeConstructor;
@@ -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.StringDataTypeConstructor;
167
+ type: DataTypes.TextDataTypeConstructor;
163
168
  defaultValue: string;
164
169
  };
165
170
  };
@@ -20,10 +20,10 @@ exports.MessageModel = {
20
20
  autoIncrement: true,
21
21
  },
22
22
  srcChainSlug: {
23
- type: sequelize_1.DataTypes.INTEGER,
23
+ type: sequelize_1.DataTypes.BIGINT,
24
24
  },
25
25
  dstChainSlug: {
26
- type: sequelize_1.DataTypes.INTEGER,
26
+ type: sequelize_1.DataTypes.BIGINT,
27
27
  },
28
28
  srcPlug: {
29
29
  type: sequelize_1.DataTypes.STRING,
@@ -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.STRING,
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 = () => {
@@ -34,6 +34,7 @@ export declare enum TripReason {
34
34
  }
35
35
  export declare class Packet extends Model {
36
36
  id: number;
37
+ switchboardId: string;
37
38
  packetId: string;
38
39
  srcChainSlug: number;
39
40
  dstChainSlug: number;
@@ -63,6 +64,7 @@ export declare class Packet extends Model {
63
64
  attestRelayStatus: AttestRelayStatus;
64
65
  outboundTxHash: string;
65
66
  outboundTime: number;
67
+ sealIndexTime: number;
66
68
  proposeTime: number;
67
69
  attestTime: number;
68
70
  packetTripTxHash: string;
@@ -81,10 +83,10 @@ export declare const PacketModel: {
81
83
  autoIncrement: boolean;
82
84
  };
83
85
  srcChainSlug: {
84
- type: DataTypes.IntegerDataTypeConstructor;
86
+ type: DataTypes.BigIntDataTypeConstructor;
85
87
  };
86
88
  dstChainSlug: {
87
- type: DataTypes.IntegerDataTypeConstructor;
89
+ type: DataTypes.BigIntDataTypeConstructor;
88
90
  };
89
91
  srcCapacitor: {
90
92
  type: DataTypes.StringDataTypeConstructor;
@@ -92,6 +94,9 @@ export declare const PacketModel: {
92
94
  dstSwitchboard: {
93
95
  type: DataTypes.StringDataTypeConstructor;
94
96
  };
97
+ switchboardId: {
98
+ type: DataTypes.StringDataTypeConstructor;
99
+ };
95
100
  integrationType: {
96
101
  type: DataTypes.EnumDataTypeConstructor;
97
102
  values: IntegrationTypes[];
@@ -165,6 +170,9 @@ export declare const PacketModel: {
165
170
  sealTime: {
166
171
  type: DataTypes.IntegerDataTypeConstructor;
167
172
  };
173
+ sealIndexTime: {
174
+ type: DataTypes.IntegerDataTypeConstructor;
175
+ };
168
176
  sealSignature: {
169
177
  type: DataTypes.StringDataTypeConstructor;
170
178
  };
@@ -50,10 +50,10 @@ exports.PacketModel = {
50
50
  autoIncrement: true,
51
51
  },
52
52
  srcChainSlug: {
53
- type: sequelize_1.DataTypes.INTEGER,
53
+ type: sequelize_1.DataTypes.BIGINT,
54
54
  },
55
55
  dstChainSlug: {
56
- type: sequelize_1.DataTypes.INTEGER,
56
+ type: sequelize_1.DataTypes.BIGINT,
57
57
  },
58
58
  srcCapacitor: {
59
59
  type: sequelize_1.DataTypes.STRING,
@@ -61,6 +61,9 @@ exports.PacketModel = {
61
61
  dstSwitchboard: {
62
62
  type: sequelize_1.DataTypes.STRING,
63
63
  },
64
+ switchboardId: {
65
+ type: sequelize_1.DataTypes.STRING,
66
+ },
64
67
  integrationType: {
65
68
  type: sequelize_1.DataTypes.ENUM,
66
69
  values: [...Object.values(dl_core_1.IntegrationTypes)],
@@ -134,6 +137,9 @@ exports.PacketModel = {
134
137
  sealTime: {
135
138
  type: sequelize_1.DataTypes.INTEGER,
136
139
  },
140
+ sealIndexTime: {
141
+ type: sequelize_1.DataTypes.INTEGER,
142
+ },
137
143
  sealSignature: {
138
144
  type: sequelize_1.DataTypes.STRING,
139
145
  },
@@ -223,6 +229,9 @@ function processStrings(packet) {
223
229
  if (packet.dstSwitchboard) {
224
230
  packet.dstSwitchboard = (0, utils_1.toLowerCase)(packet.dstSwitchboard);
225
231
  }
232
+ if (packet.switchboardId) {
233
+ packet.switchboardId = (0, utils_1.toLowerCase)(packet.switchboardId);
234
+ }
226
235
  if (packet.packetTripTxHash) {
227
236
  packet.packetTripTxHash = (0, utils_1.toLowerCase)(packet.packetTripTxHash);
228
237
  }
@@ -51,10 +51,10 @@ export declare const ProposalModel: {
51
51
  primaryKey: boolean;
52
52
  };
53
53
  srcChainSlug: {
54
- type: DataTypes.IntegerDataTypeConstructor;
54
+ type: DataTypes.BigIntDataTypeConstructor;
55
55
  };
56
56
  dstChainSlug: {
57
- type: DataTypes.IntegerDataTypeConstructor;
57
+ type: DataTypes.BigIntDataTypeConstructor;
58
58
  };
59
59
  packetId: {
60
60
  type: DataTypes.StringDataTypeConstructor;
@@ -40,10 +40,10 @@ exports.ProposalModel = {
40
40
  primaryKey: true,
41
41
  },
42
42
  srcChainSlug: {
43
- type: sequelize_1.DataTypes.INTEGER,
43
+ type: sequelize_1.DataTypes.BIGINT,
44
44
  },
45
45
  dstChainSlug: {
46
- type: sequelize_1.DataTypes.INTEGER,
46
+ type: sequelize_1.DataTypes.BIGINT,
47
47
  },
48
48
  packetId: {
49
49
  type: sequelize_1.DataTypes.STRING,
@@ -6,12 +6,14 @@ export declare enum CapacitorType {
6
6
  }
7
7
  export declare class Switchboard extends Model {
8
8
  id: number;
9
+ switchboardId: string;
9
10
  srcChainSlug: number;
10
11
  dstChainSlug: number;
11
12
  maxPacketLength: number;
12
13
  srcSwitchboard: string;
13
14
  dstSwitchboard: string;
14
15
  srcCapacitor: string;
16
+ srcDecapacitor: string;
15
17
  capacitorType: CapacitorType;
16
18
  isEnabled: boolean;
17
19
  integrationType: IntegrationTypes;
@@ -22,12 +24,15 @@ export declare const SwitchboardModel: {
22
24
  autoIncrement: boolean;
23
25
  primaryKey: boolean;
24
26
  };
27
+ switchboardId: {
28
+ type: DataTypes.StringDataTypeConstructor;
29
+ };
25
30
  srcChainSlug: {
26
- type: DataTypes.IntegerDataTypeConstructor;
31
+ type: DataTypes.BigIntDataTypeConstructor;
27
32
  unique: string;
28
33
  };
29
34
  dstChainSlug: {
30
- type: DataTypes.IntegerDataTypeConstructor;
35
+ type: DataTypes.BigIntDataTypeConstructor;
31
36
  unique: string;
32
37
  };
33
38
  maxPacketLength: {
@@ -43,6 +48,9 @@ export declare const SwitchboardModel: {
43
48
  srcCapacitor: {
44
49
  type: DataTypes.StringDataTypeConstructor;
45
50
  };
51
+ srcDecapacitor: {
52
+ type: DataTypes.StringDataTypeConstructor;
53
+ };
46
54
  capacitorType: {
47
55
  type: DataTypes.EnumDataTypeConstructor;
48
56
  values: CapacitorType[];