@gmx-io/sdk 1.4.0 → 1.4.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 (151) hide show
  1. package/build/cjs/src/abis/GlvReader.js +940 -940
  2. package/build/cjs/src/abis/IStargate.js +603 -0
  3. package/build/cjs/src/abis/LayerZeroProvider.js +273 -46
  4. package/build/cjs/src/abis/index.js +2 -2
  5. package/build/cjs/src/configs/batch.js +29 -103
  6. package/build/cjs/src/configs/chainIds.js +2 -2
  7. package/build/cjs/src/configs/chains.js +230 -151
  8. package/build/cjs/src/configs/contracts.js +1 -5
  9. package/build/cjs/src/configs/dataStore.js +5 -4
  10. package/build/cjs/src/configs/express.js +1 -1
  11. package/build/cjs/src/configs/gasLimits.js +41 -0
  12. package/build/cjs/src/configs/markets.js +67 -1
  13. package/build/cjs/src/configs/multichain.js +1 -0
  14. package/build/cjs/src/configs/oracleKeeper.js +18 -20
  15. package/build/cjs/src/configs/tokens.js +53 -14
  16. package/build/cjs/src/modules/markets/index.js +6 -2
  17. package/build/cjs/src/modules/markets/markets.spec.js +5 -5
  18. package/build/cjs/src/modules/markets/query-builders.js +8 -0
  19. package/build/cjs/src/modules/orders/helpers.js +2 -2
  20. package/build/cjs/src/modules/orders/helpers.spec.js +1 -1
  21. package/build/cjs/src/modules/orders/orders.spec.js +1 -1
  22. package/build/cjs/src/modules/positions/positions.spec.js +2 -2
  23. package/build/cjs/src/modules/tokens/tokens.spec.js +2 -2
  24. package/build/cjs/src/modules/trades/trades.spec.js +1 -1
  25. package/build/cjs/src/modules/utils/utils.js +7 -6
  26. package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  27. package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +495 -0
  28. package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +45 -0
  29. package/build/cjs/src/test/mock.js +2 -0
  30. package/build/cjs/src/types/chains.js +2 -0
  31. package/build/cjs/src/types/orders.js +8 -2
  32. package/build/cjs/src/types/subsquid.js +241 -1
  33. package/build/cjs/src/types/tokens.js +7 -0
  34. package/build/cjs/src/utils/__tests__/abort.spec.js +122 -0
  35. package/build/cjs/src/utils/__tests__/numbers.spec.js +94 -14
  36. package/build/cjs/src/utils/abort.js +31 -0
  37. package/build/cjs/src/utils/callContract.js +4 -4
  38. package/build/cjs/src/utils/fees/executionFee.js +14 -11
  39. package/build/cjs/src/utils/fees/index.js +8 -2
  40. package/build/cjs/src/utils/marketKeysAndConfigs.js +8 -0
  41. package/build/cjs/src/utils/markets.js +7 -1
  42. package/build/cjs/src/utils/multicall.js +54 -17
  43. package/build/cjs/src/utils/numbers.js +25 -14
  44. package/build/cjs/src/utils/orders.js +2 -2
  45. package/build/cjs/src/utils/swap/__tests__/mockRouting.spec.js +7 -6
  46. package/build/cjs/src/utils/swap/__tests__/swapRouting.spec.js +5 -4
  47. package/build/cjs/src/utils/swap/__tests__/swapStats.spec.js +10 -9
  48. package/build/cjs/src/utils/swap/buildSwapStrategy.js +10 -9
  49. package/build/cjs/src/utils/swap/swapPath.js +6 -6
  50. package/build/cjs/src/utils/swap/swapRouting.js +8 -4
  51. package/build/cjs/src/utils/swap/swapStats.js +6 -6
  52. package/build/cjs/src/utils/swap/swapValues.js +4 -0
  53. package/build/cjs/src/utils/tokens.js +17 -1
  54. package/build/cjs/src/utils/trade/decrease.js +1 -1
  55. package/build/esm/src/abis/GlvReader.js +940 -940
  56. package/build/esm/src/abis/IStargate.js +601 -0
  57. package/build/esm/src/abis/LayerZeroProvider.js +273 -46
  58. package/build/esm/src/abis/index.js +2 -2
  59. package/build/esm/src/configs/batch.js +30 -104
  60. package/build/esm/src/configs/chainIds.js +1 -1
  61. package/build/esm/src/configs/chains.js +212 -147
  62. package/build/esm/src/configs/contracts.js +1 -5
  63. package/build/esm/src/configs/dataStore.js +1 -0
  64. package/build/esm/src/configs/express.js +1 -1
  65. package/build/esm/src/configs/gasLimits.js +38 -0
  66. package/build/esm/src/configs/markets.js +60 -1
  67. package/build/esm/src/configs/multichain.js +2 -1
  68. package/build/esm/src/configs/oracleKeeper.js +17 -19
  69. package/build/esm/src/configs/tokens.js +52 -13
  70. package/build/esm/src/modules/markets/index.js +6 -2
  71. package/build/esm/src/modules/markets/markets.spec.js +5 -5
  72. package/build/esm/src/modules/markets/query-builders.js +8 -0
  73. package/build/esm/src/modules/orders/helpers.js +3 -3
  74. package/build/esm/src/modules/orders/helpers.spec.js +1 -1
  75. package/build/esm/src/modules/orders/orders.spec.js +1 -1
  76. package/build/esm/src/modules/positions/positions.spec.js +2 -2
  77. package/build/esm/src/modules/tokens/tokens.spec.js +2 -2
  78. package/build/esm/src/modules/trades/trades.spec.js +1 -1
  79. package/build/esm/src/modules/utils/utils.js +7 -6
  80. package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  81. package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +495 -0
  82. package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +45 -0
  83. package/build/esm/src/test/mock.js +2 -0
  84. package/build/esm/src/types/chains.js +1 -0
  85. package/build/esm/src/types/orders.js +8 -2
  86. package/build/esm/src/types/subsquid.js +240 -0
  87. package/build/esm/src/types/tokens.js +6 -1
  88. package/build/esm/src/utils/__tests__/abort.spec.js +120 -0
  89. package/build/esm/src/utils/__tests__/numbers.spec.js +95 -15
  90. package/build/esm/src/utils/abort.js +27 -0
  91. package/build/esm/src/utils/callContract.js +5 -5
  92. package/build/esm/src/utils/fees/executionFee.js +15 -12
  93. package/build/esm/src/utils/fees/index.js +8 -2
  94. package/build/esm/src/utils/marketKeysAndConfigs.js +9 -1
  95. package/build/esm/src/utils/markets.js +5 -0
  96. package/build/esm/src/utils/multicall.js +53 -16
  97. package/build/esm/src/utils/numbers.js +21 -12
  98. package/build/esm/src/utils/orders.js +3 -3
  99. package/build/esm/src/utils/swap/__tests__/mockRouting.spec.js +7 -6
  100. package/build/esm/src/utils/swap/__tests__/swapRouting.spec.js +5 -4
  101. package/build/esm/src/utils/swap/__tests__/swapStats.spec.js +10 -9
  102. package/build/esm/src/utils/swap/buildSwapStrategy.js +10 -9
  103. package/build/esm/src/utils/swap/swapPath.js +6 -6
  104. package/build/esm/src/utils/swap/swapRouting.js +8 -4
  105. package/build/esm/src/utils/swap/swapStats.js +6 -6
  106. package/build/esm/src/utils/swap/swapValues.js +4 -0
  107. package/build/esm/src/utils/tokens.js +15 -1
  108. package/build/esm/src/utils/trade/decrease.js +2 -2
  109. package/build/types/src/abis/IStargate.d.ts +464 -0
  110. package/build/types/src/abis/LayerZeroProvider.d.ts +12 -0
  111. package/build/types/src/abis/index.d.ts +475 -99
  112. package/build/types/src/configs/chainIds.d.ts +1 -1
  113. package/build/types/src/configs/chains.d.ts +170 -27
  114. package/build/types/src/configs/contracts.d.ts +0 -4
  115. package/build/types/src/configs/dataStore.d.ts +1 -0
  116. package/build/types/src/configs/express.d.ts +1 -1
  117. package/build/types/src/configs/gasLimits.d.ts +4 -0
  118. package/build/types/src/configs/markets.d.ts +10 -1
  119. package/build/types/src/configs/oracleKeeper.d.ts +13 -0
  120. package/build/types/src/configs/tokens.d.ts +3 -0
  121. package/build/types/src/index.d.ts +1 -1
  122. package/build/types/src/modules/base.d.ts +1 -1
  123. package/build/types/src/modules/markets/index.d.ts +2 -0
  124. package/build/types/src/modules/markets/query-builders.d.ts +1 -1
  125. package/build/types/src/modules/markets/types.d.ts +2 -2
  126. package/build/types/src/modules/utils/utils.d.ts +2 -3
  127. package/build/types/src/types/chains.d.ts +57 -0
  128. package/build/types/src/types/markets.d.ts +2 -0
  129. package/build/types/src/types/orders.d.ts +8 -2
  130. package/build/types/src/types/subsquid.d.ts +5987 -5172
  131. package/build/types/src/types/tokens.d.ts +11 -3
  132. package/build/types/src/types/trade.d.ts +5 -0
  133. package/build/types/src/utils/__tests__/abort.spec.d.ts +1 -0
  134. package/build/types/src/utils/abort.d.ts +1 -0
  135. package/build/types/src/utils/fees/estimateOraclePriceCount.d.ts +2 -2
  136. package/build/types/src/utils/fees/executionFee.d.ts +6 -6
  137. package/build/types/src/utils/fees/index.d.ts +2 -1
  138. package/build/types/src/utils/marketKeysAndConfigs.d.ts +2 -0
  139. package/build/types/src/utils/markets.d.ts +4 -2
  140. package/build/types/src/utils/multicall.d.ts +4 -2
  141. package/build/types/src/utils/numbers.d.ts +8 -1
  142. package/build/types/src/utils/swap/buildSwapStrategy.d.ts +6 -3
  143. package/build/types/src/utils/swap/swapPath.d.ts +2 -1
  144. package/build/types/src/utils/swap/swapRouting.d.ts +7 -2
  145. package/build/types/src/utils/swap/swapStats.d.ts +3 -2
  146. package/build/types/src/utils/swap/swapValues.d.ts +1 -1
  147. package/build/types/src/utils/tokens.d.ts +3 -0
  148. package/package.json +8 -2
  149. package/build/cjs/src/abis/MultichainUtils.js +0 -133
  150. package/build/esm/src/abis/MultichainUtils.js +0 -131
  151. package/build/types/src/abis/MultichainUtils.d.ts +0 -100
@@ -3,52 +3,158 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
4
  {
5
5
  inputs: [
6
- { internalType: "contract DataStore", name: "_dataStore", type: "address" },
7
- { internalType: "contract RoleStore", name: "_roleStore", type: "address" },
8
- { internalType: "contract EventEmitter", name: "_eventEmitter", type: "address" },
9
- { internalType: "contract MultichainVault", name: "_multichainVault", type: "address" },
10
- { internalType: "contract IMultichainGmRouter", name: "_multichainGmRouter", type: "address" },
11
- { internalType: "contract IMultichainGlvRouter", name: "_multichainGlvRouter", type: "address" },
12
- { internalType: "contract IMultichainOrderRouter", name: "_multichainOrderRouter", type: "address" },
6
+ {
7
+ internalType: "contract DataStore",
8
+ name: "_dataStore",
9
+ type: "address",
10
+ },
11
+ {
12
+ internalType: "contract RoleStore",
13
+ name: "_roleStore",
14
+ type: "address",
15
+ },
16
+ {
17
+ internalType: "contract EventEmitter",
18
+ name: "_eventEmitter",
19
+ type: "address",
20
+ },
21
+ {
22
+ internalType: "contract MultichainVault",
23
+ name: "_multichainVault",
24
+ type: "address",
25
+ },
26
+ {
27
+ internalType: "contract IMultichainGmRouter",
28
+ name: "_multichainGmRouter",
29
+ type: "address",
30
+ },
31
+ {
32
+ internalType: "contract IMultichainGlvRouter",
33
+ name: "_multichainGlvRouter",
34
+ type: "address",
35
+ },
36
+ {
37
+ internalType: "contract IMultichainOrderRouter",
38
+ name: "_multichainOrderRouter",
39
+ type: "address",
40
+ },
13
41
  ],
14
42
  stateMutability: "nonpayable",
15
43
  type: "constructor",
16
44
  },
17
- { inputs: [], name: "EmptyHoldingAddress", type: "error" },
18
- { inputs: [], name: "EmptyReceiver", type: "error" },
19
45
  {
20
- inputs: [{ internalType: "address", name: "token", type: "address" }],
46
+ inputs: [],
47
+ name: "EmptyHoldingAddress",
48
+ type: "error",
49
+ },
50
+ {
51
+ inputs: [],
52
+ name: "EmptyReceiver",
53
+ type: "error",
54
+ },
55
+ {
56
+ inputs: [
57
+ {
58
+ internalType: "address",
59
+ name: "token",
60
+ type: "address",
61
+ },
62
+ ],
21
63
  name: "EmptyTokenTranferGasLimit",
22
64
  type: "error",
23
65
  },
24
- { inputs: [], name: "EmptyWithdrawalAmount", type: "error" },
66
+ {
67
+ inputs: [],
68
+ name: "EmptyWithdrawalAmount",
69
+ type: "error",
70
+ },
25
71
  {
26
72
  inputs: [
27
- { internalType: "uint256", name: "gas", type: "uint256" },
28
- { internalType: "uint256", name: "estimatedGasLimit", type: "uint256" },
73
+ {
74
+ internalType: "uint256",
75
+ name: "gas",
76
+ type: "uint256",
77
+ },
78
+ {
79
+ internalType: "uint256",
80
+ name: "estimatedGasLimit",
81
+ type: "uint256",
82
+ },
29
83
  ],
30
84
  name: "InsufficientGasLeft",
31
85
  type: "error",
32
86
  },
33
87
  {
34
- inputs: [{ internalType: "address", name: "token", type: "address" }],
88
+ inputs: [
89
+ {
90
+ internalType: "uint256",
91
+ name: "msgValue",
92
+ type: "uint256",
93
+ },
94
+ {
95
+ internalType: "uint256",
96
+ name: "expectedNativeValue",
97
+ type: "uint256",
98
+ },
99
+ ],
100
+ name: "InsufficientNativeTokenAmount",
101
+ type: "error",
102
+ },
103
+ {
104
+ inputs: [
105
+ {
106
+ internalType: "address",
107
+ name: "token",
108
+ type: "address",
109
+ },
110
+ ],
35
111
  name: "InvalidBridgeOutToken",
36
112
  type: "error",
37
113
  },
38
- { inputs: [{ internalType: "uint256", name: "eid", type: "uint256" }], name: "InvalidEid", type: "error" },
39
114
  {
40
115
  inputs: [
41
- { internalType: "address", name: "token", type: "address" },
42
- { internalType: "address", name: "receiver", type: "address" },
43
- { internalType: "uint256", name: "amount", type: "uint256" },
116
+ {
117
+ internalType: "uint256",
118
+ name: "eid",
119
+ type: "uint256",
120
+ },
121
+ ],
122
+ name: "InvalidEid",
123
+ type: "error",
124
+ },
125
+ {
126
+ inputs: [
127
+ {
128
+ internalType: "address",
129
+ name: "token",
130
+ type: "address",
131
+ },
132
+ {
133
+ internalType: "address",
134
+ name: "receiver",
135
+ type: "address",
136
+ },
137
+ {
138
+ internalType: "uint256",
139
+ name: "amount",
140
+ type: "uint256",
141
+ },
44
142
  ],
45
143
  name: "TokenTransferError",
46
144
  type: "error",
47
145
  },
48
146
  {
49
147
  inputs: [
50
- { internalType: "address", name: "msgSender", type: "address" },
51
- { internalType: "string", name: "role", type: "string" },
148
+ {
149
+ internalType: "address",
150
+ name: "msgSender",
151
+ type: "address",
152
+ },
153
+ {
154
+ internalType: "string",
155
+ name: "role",
156
+ type: "string",
157
+ },
52
158
  ],
53
159
  name: "Unauthorized",
54
160
  type: "error",
@@ -56,23 +162,61 @@ exports.default = [
56
162
  {
57
163
  anonymous: false,
58
164
  inputs: [
59
- { indexed: false, internalType: "string", name: "reason", type: "string" },
60
- { indexed: false, internalType: "bytes", name: "returndata", type: "bytes" },
165
+ {
166
+ indexed: false,
167
+ internalType: "string",
168
+ name: "reason",
169
+ type: "string",
170
+ },
171
+ {
172
+ indexed: false,
173
+ internalType: "bytes",
174
+ name: "returndata",
175
+ type: "bytes",
176
+ },
61
177
  ],
62
178
  name: "TokenTransferReverted",
63
179
  type: "event",
64
180
  },
65
181
  {
66
182
  inputs: [
67
- { internalType: "address", name: "account", type: "address" },
68
- { internalType: "uint256", name: "srcChainId", type: "uint256" },
183
+ {
184
+ internalType: "address",
185
+ name: "account",
186
+ type: "address",
187
+ },
188
+ {
189
+ internalType: "uint256",
190
+ name: "srcChainId",
191
+ type: "uint256",
192
+ },
69
193
  {
70
194
  components: [
71
- { internalType: "address", name: "token", type: "address" },
72
- { internalType: "uint256", name: "amount", type: "uint256" },
73
- { internalType: "uint256", name: "minAmountOut", type: "uint256" },
74
- { internalType: "address", name: "provider", type: "address" },
75
- { internalType: "bytes", name: "data", type: "bytes" },
195
+ {
196
+ internalType: "address",
197
+ name: "token",
198
+ type: "address",
199
+ },
200
+ {
201
+ internalType: "uint256",
202
+ name: "amount",
203
+ type: "uint256",
204
+ },
205
+ {
206
+ internalType: "uint256",
207
+ name: "minAmountOut",
208
+ type: "uint256",
209
+ },
210
+ {
211
+ internalType: "address",
212
+ name: "provider",
213
+ type: "address",
214
+ },
215
+ {
216
+ internalType: "bytes",
217
+ name: "data",
218
+ type: "bytes",
219
+ },
76
220
  ],
77
221
  internalType: "struct IRelayUtils.BridgeOutParams",
78
222
  name: "params",
@@ -80,31 +224,69 @@ exports.default = [
80
224
  },
81
225
  ],
82
226
  name: "bridgeOut",
83
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
227
+ outputs: [
228
+ {
229
+ internalType: "uint256",
230
+ name: "",
231
+ type: "uint256",
232
+ },
233
+ ],
84
234
  stateMutability: "nonpayable",
85
235
  type: "function",
86
236
  },
87
237
  {
88
238
  inputs: [],
89
239
  name: "dataStore",
90
- outputs: [{ internalType: "contract DataStore", name: "", type: "address" }],
240
+ outputs: [
241
+ {
242
+ internalType: "contract DataStore",
243
+ name: "",
244
+ type: "address",
245
+ },
246
+ ],
91
247
  stateMutability: "view",
92
248
  type: "function",
93
249
  },
94
250
  {
95
251
  inputs: [],
96
252
  name: "eventEmitter",
97
- outputs: [{ internalType: "contract EventEmitter", name: "", type: "address" }],
253
+ outputs: [
254
+ {
255
+ internalType: "contract EventEmitter",
256
+ name: "",
257
+ type: "address",
258
+ },
259
+ ],
98
260
  stateMutability: "view",
99
261
  type: "function",
100
262
  },
101
263
  {
102
264
  inputs: [
103
- { internalType: "address", name: "from", type: "address" },
104
- { internalType: "bytes32", name: "", type: "bytes32" },
105
- { internalType: "bytes", name: "message", type: "bytes" },
106
- { internalType: "address", name: "", type: "address" },
107
- { internalType: "bytes", name: "", type: "bytes" },
265
+ {
266
+ internalType: "address",
267
+ name: "from",
268
+ type: "address",
269
+ },
270
+ {
271
+ internalType: "bytes32",
272
+ name: "",
273
+ type: "bytes32",
274
+ },
275
+ {
276
+ internalType: "bytes",
277
+ name: "message",
278
+ type: "bytes",
279
+ },
280
+ {
281
+ internalType: "address",
282
+ name: "",
283
+ type: "address",
284
+ },
285
+ {
286
+ internalType: "bytes",
287
+ name: "",
288
+ type: "bytes",
289
+ },
108
290
  ],
109
291
  name: "lzCompose",
110
292
  outputs: [],
@@ -114,48 +296,93 @@ exports.default = [
114
296
  {
115
297
  inputs: [],
116
298
  name: "multichainGlvRouter",
117
- outputs: [{ internalType: "contract IMultichainGlvRouter", name: "", type: "address" }],
299
+ outputs: [
300
+ {
301
+ internalType: "contract IMultichainGlvRouter",
302
+ name: "",
303
+ type: "address",
304
+ },
305
+ ],
118
306
  stateMutability: "view",
119
307
  type: "function",
120
308
  },
121
309
  {
122
310
  inputs: [],
123
311
  name: "multichainGmRouter",
124
- outputs: [{ internalType: "contract IMultichainGmRouter", name: "", type: "address" }],
312
+ outputs: [
313
+ {
314
+ internalType: "contract IMultichainGmRouter",
315
+ name: "",
316
+ type: "address",
317
+ },
318
+ ],
125
319
  stateMutability: "view",
126
320
  type: "function",
127
321
  },
128
322
  {
129
323
  inputs: [],
130
324
  name: "multichainOrderRouter",
131
- outputs: [{ internalType: "contract IMultichainOrderRouter", name: "", type: "address" }],
325
+ outputs: [
326
+ {
327
+ internalType: "contract IMultichainOrderRouter",
328
+ name: "",
329
+ type: "address",
330
+ },
331
+ ],
132
332
  stateMutability: "view",
133
333
  type: "function",
134
334
  },
135
335
  {
136
336
  inputs: [],
137
337
  name: "multichainVault",
138
- outputs: [{ internalType: "contract MultichainVault", name: "", type: "address" }],
338
+ outputs: [
339
+ {
340
+ internalType: "contract MultichainVault",
341
+ name: "",
342
+ type: "address",
343
+ },
344
+ ],
139
345
  stateMutability: "view",
140
346
  type: "function",
141
347
  },
142
348
  {
143
349
  inputs: [],
144
350
  name: "roleStore",
145
- outputs: [{ internalType: "contract RoleStore", name: "", type: "address" }],
351
+ outputs: [
352
+ {
353
+ internalType: "contract RoleStore",
354
+ name: "",
355
+ type: "address",
356
+ },
357
+ ],
146
358
  stateMutability: "view",
147
359
  type: "function",
148
360
  },
149
361
  {
150
362
  inputs: [
151
- { internalType: "address", name: "token", type: "address" },
152
- { internalType: "address", name: "receiver", type: "address" },
153
- { internalType: "uint256", name: "amount", type: "uint256" },
363
+ {
364
+ internalType: "address",
365
+ name: "token",
366
+ type: "address",
367
+ },
368
+ {
369
+ internalType: "address",
370
+ name: "receiver",
371
+ type: "address",
372
+ },
373
+ {
374
+ internalType: "uint256",
375
+ name: "amount",
376
+ type: "uint256",
377
+ },
154
378
  ],
155
379
  name: "withdrawTokens",
156
380
  outputs: [],
157
381
  stateMutability: "nonpayable",
158
382
  type: "function",
159
383
  },
160
- { stateMutability: "payable", type: "receive" },
384
+ {
385
+ stateMutability: "payable",
386
+ type: "receive",
387
+ },
161
388
  ];
@@ -19,6 +19,7 @@ const GlvReader_1 = __importDefault(require("./GlvReader"));
19
19
  const GlvRouter_1 = __importDefault(require("./GlvRouter"));
20
20
  const GmxMigrator_1 = __importDefault(require("./GmxMigrator"));
21
21
  const GovToken_1 = __importDefault(require("./GovToken"));
22
+ const IStargate_1 = __importDefault(require("./IStargate"));
22
23
  const LayerZeroProvider_1 = __importDefault(require("./LayerZeroProvider"));
23
24
  const MintableBaseToken_1 = __importDefault(require("./MintableBaseToken"));
24
25
  const Multicall_1 = __importDefault(require("./Multicall"));
@@ -28,7 +29,6 @@ const MultichainGmRouter_1 = __importDefault(require("./MultichainGmRouter"));
28
29
  const MultichainOrderRouter_1 = __importDefault(require("./MultichainOrderRouter"));
29
30
  const MultichainSubaccountRouter_1 = __importDefault(require("./MultichainSubaccountRouter"));
30
31
  const MultichainTransferRouter_1 = __importDefault(require("./MultichainTransferRouter"));
31
- const MultichainUtils_1 = __importDefault(require("./MultichainUtils"));
32
32
  const MultichainVault_1 = __importDefault(require("./MultichainVault"));
33
33
  const Reader_1 = __importDefault(require("./Reader"));
34
34
  const ReaderV2_1 = __importDefault(require("./ReaderV2"));
@@ -105,7 +105,6 @@ exports.abis = {
105
105
  MultichainOrderRouter: MultichainOrderRouter_1.default,
106
106
  MultichainSubaccountRouter: MultichainSubaccountRouter_1.default,
107
107
  MultichainTransferRouter: MultichainTransferRouter_1.default,
108
- MultichainUtils: MultichainUtils_1.default,
109
108
  MultichainVault: MultichainVault_1.default,
110
109
  ReferralStorage: ReferralStorage_1.default,
111
110
  RelayParams: RelayParams_1.default,
@@ -135,4 +134,5 @@ exports.abis = {
135
134
  VenusVToken: VenusVToken_1.default,
136
135
  Vester: Vester_1.default,
137
136
  WETH: WETH_1.default,
137
+ IStargate: IStargate_1.default,
138
138
  };
@@ -2,114 +2,40 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SUBSQUID_PAGINATION_LIMIT = exports.BATCH_CONFIGS = void 0;
4
4
  const chains_1 = require("./chains");
5
- exports.BATCH_CONFIGS = {
6
- [chains_1.ARBITRUM]: {
7
- http: {
8
- batchSize: 0, // disable batches, here batchSize is the number of eth_calls in a batch
9
- wait: 0, // keep this setting in case batches are enabled in future
10
- },
11
- client: {
12
- multicall: {
13
- batchSize: 1024 * 1024, // here batchSize is the number of bytes in a multicall
14
- wait: 0, // zero delay means formation of a batch in the current macro-task, like setTimeout(fn, 0)
15
- },
16
- },
17
- },
18
- [chains_1.AVALANCHE]: {
19
- http: {
20
- batchSize: 0,
21
- wait: 0,
22
- },
23
- client: {
24
- multicall: {
25
- batchSize: 1024 * 1024,
26
- wait: 0,
27
- },
28
- },
29
- },
30
- [chains_1.SOURCE_BASE_MAINNET]: {
31
- http: {
32
- batchSize: 0,
33
- wait: 0,
34
- },
35
- client: {
36
- multicall: {
37
- batchSize: 1024 * 1024,
38
- wait: 0,
39
- },
40
- },
41
- },
42
- [chains_1.SOURCE_BSC_MAINNET]: {
43
- http: {
44
- batchSize: 0,
45
- wait: 0,
46
- },
47
- client: {
48
- multicall: {
49
- batchSize: 1024 * 1024,
50
- wait: 0,
51
- },
52
- },
53
- },
54
- [chains_1.AVALANCHE_FUJI]: {
55
- http: {
56
- batchSize: 40,
57
- wait: 0,
58
- },
59
- client: {
60
- multicall: {
61
- batchSize: 1024 * 1024,
62
- wait: 0,
63
- },
64
- },
65
- },
66
- [chains_1.BOTANIX]: {
67
- http: {
68
- batchSize: 0,
69
- wait: 0,
70
- },
71
- client: {
72
- multicall: {
73
- batchSize: 1024 * 1024,
74
- wait: 0,
75
- },
76
- },
77
- },
78
- [chains_1.ARBITRUM_SEPOLIA]: {
79
- http: {
80
- batchSize: 40,
81
- wait: 100,
82
- },
83
- client: {
84
- multicall: {
85
- batchSize: 1024 * 1024,
86
- wait: 100,
87
- },
88
- },
5
+ const DEFAULT_PROD_BATCH_CONFIG = {
6
+ http: {
7
+ batchSize: 0, // disable batches, here batchSize is the number of eth_calls in a batch
8
+ wait: 0, // keep this setting in case batches are enabled in future
89
9
  },
90
- [chains_1.SOURCE_OPTIMISM_SEPOLIA]: {
91
- http: {
92
- batchSize: 40,
93
- wait: 100,
94
- },
95
- client: {
96
- multicall: {
97
- batchSize: 1024 * 1024,
98
- wait: 100,
99
- },
10
+ client: {
11
+ multicall: {
12
+ batchSize: 1024 * 1024, // here batchSize is the number of bytes in a multicall
13
+ wait: 0, // zero delay means formation of a batch in the current macro-task, like setTimeout(fn, 0)
100
14
  },
101
15
  },
102
- [chains_1.SOURCE_SEPOLIA]: {
103
- http: {
104
- batchSize: 40,
16
+ };
17
+ const DEFAULT_TESTNET_BATCH_CONFIG = {
18
+ http: {
19
+ batchSize: 40,
20
+ wait: 100,
21
+ },
22
+ client: {
23
+ multicall: {
24
+ batchSize: 1024 * 1024,
105
25
  wait: 100,
106
26
  },
107
- client: {
108
- multicall: {
109
- batchSize: 1024 * 1024,
110
- wait: 100,
111
- },
112
- },
113
27
  },
114
28
  };
29
+ exports.BATCH_CONFIGS = {
30
+ [chains_1.ARBITRUM]: DEFAULT_PROD_BATCH_CONFIG,
31
+ [chains_1.AVALANCHE]: DEFAULT_PROD_BATCH_CONFIG,
32
+ [chains_1.BOTANIX]: DEFAULT_PROD_BATCH_CONFIG,
33
+ [chains_1.SOURCE_BASE_MAINNET]: DEFAULT_PROD_BATCH_CONFIG,
34
+ [chains_1.SOURCE_BSC_MAINNET]: DEFAULT_PROD_BATCH_CONFIG,
35
+ [chains_1.SOURCE_ETHEREUM_MAINNET]: DEFAULT_PROD_BATCH_CONFIG,
36
+ [chains_1.AVALANCHE_FUJI]: DEFAULT_TESTNET_BATCH_CONFIG,
37
+ [chains_1.ARBITRUM_SEPOLIA]: DEFAULT_TESTNET_BATCH_CONFIG,
38
+ [chains_1.SOURCE_OPTIMISM_SEPOLIA]: DEFAULT_TESTNET_BATCH_CONFIG,
39
+ [chains_1.SOURCE_SEPOLIA]: DEFAULT_TESTNET_BATCH_CONFIG,
40
+ };
115
41
  exports.SUBSQUID_PAGINATION_LIMIT = 500;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SOURCE_SEPOLIA = exports.SOURCE_OPTIMISM_SEPOLIA = exports.ARBITRUM_SEPOLIA = exports.AVALANCHE_FUJI = exports.SOURCE_BSC_MAINNET = exports.SOURCE_BASE_MAINNET = exports.BOTANIX = exports.ARBITRUM = exports.AVALANCHE = exports.ETH_MAINNET = void 0;
4
- exports.ETH_MAINNET = 1;
3
+ exports.SOURCE_SEPOLIA = exports.SOURCE_OPTIMISM_SEPOLIA = exports.ARBITRUM_SEPOLIA = exports.AVALANCHE_FUJI = exports.SOURCE_BSC_MAINNET = exports.SOURCE_BASE_MAINNET = exports.SOURCE_ETHEREUM_MAINNET = exports.BOTANIX = exports.ARBITRUM = exports.AVALANCHE = void 0;
5
4
  // Production
6
5
  exports.AVALANCHE = 43114;
7
6
  exports.ARBITRUM = 42161;
8
7
  exports.BOTANIX = 3637;
9
8
  // Production source
9
+ exports.SOURCE_ETHEREUM_MAINNET = 1;
10
10
  exports.SOURCE_BASE_MAINNET = 8453;
11
11
  exports.SOURCE_BSC_MAINNET = 56;
12
12
  // Testnets