@paraswap/dex-lib 4.7.14-multi-route.0 → 4.7.14-multi-route.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.
Files changed (38) hide show
  1. package/build/abi/pharaoh-v3/PharaohV3Factory.abi.json +39 -0
  2. package/build/abi/pharaoh-v3/PharaohV3Pool.abi.json +802 -0
  3. package/build/abi/pharaoh-v3/PharaohV3StateMulticall.abi.json +781 -0
  4. package/build/abi/uniswap-v4/hooks/arena/arena-fee-helper.abi.json +476 -0
  5. package/build/dex/simple-exchange.js +7 -1
  6. package/build/dex/simple-exchange.js.map +1 -1
  7. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-factory.d.ts +7 -0
  8. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-factory.js +20 -0
  9. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-factory.js.map +1 -0
  10. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.d.ts +12 -0
  11. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js +139 -0
  12. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js.map +1 -0
  13. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.d.ts +11 -0
  14. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js +128 -0
  15. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js.map +1 -0
  16. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.d.ts +4 -0
  17. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js +56 -0
  18. package/build/dex/uniswap-v3/forks/pharaoh-v3/utils.js.map +1 -0
  19. package/build/dex/uniswap-v4/hooks/arena/arena-fee-helper.d.ts +36 -0
  20. package/build/dex/uniswap-v4/hooks/arena/arena-fee-helper.js +125 -0
  21. package/build/dex/uniswap-v4/hooks/arena/arena-fee-helper.js.map +1 -0
  22. package/build/dex/uniswap-v4/hooks/arena/arena-hook.d.ts +21 -0
  23. package/build/dex/uniswap-v4/hooks/arena/arena-hook.js +93 -0
  24. package/build/dex/uniswap-v4/hooks/arena/arena-hook.js.map +1 -0
  25. package/build/dex/uniswap-v4/hooks/arena/config.d.ts +3 -0
  26. package/build/dex/uniswap-v4/hooks/arena/config.js +11 -0
  27. package/build/dex/uniswap-v4/hooks/arena/config.js.map +1 -0
  28. package/build/dex/uniswap-v4/hooks/arena/types.d.ts +5 -0
  29. package/build/dex/uniswap-v4/hooks/arena/types.js +3 -0
  30. package/build/dex/uniswap-v4/hooks/arena/types.js.map +1 -0
  31. package/build/dex/uniswap-v4/hooks/types.d.ts +60 -0
  32. package/build/dex/uniswap-v4/hooks/types.js +3 -0
  33. package/build/dex/uniswap-v4/hooks/types.js.map +1 -0
  34. package/build/executor/types.d.ts +3 -3
  35. package/build/generic-swap-transaction-builder.d.ts +3 -2
  36. package/build/generic-swap-transaction-builder.js +61 -50
  37. package/build/generic-swap-transaction-builder.js.map +1 -1
  38. package/package.json +1 -1
@@ -0,0 +1,476 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ { "internalType": "address", "name": "_owner", "type": "address" },
5
+ {
6
+ "internalType": "address",
7
+ "name": "_referralRegistry",
8
+ "type": "address"
9
+ },
10
+ { "internalType": "uint16", "name": "_protocolFeePpm", "type": "uint16" },
11
+ {
12
+ "internalType": "address",
13
+ "name": "_protocolFeeRecipient",
14
+ "type": "address"
15
+ },
16
+ { "internalType": "uint16", "name": "_referralFeePpm", "type": "uint16" }
17
+ ],
18
+ "stateMutability": "nonpayable",
19
+ "type": "constructor"
20
+ },
21
+ {
22
+ "inputs": [],
23
+ "name": "FeeArrayLengthExceedsMaxFeeArrayLength",
24
+ "type": "error"
25
+ },
26
+ { "inputs": [], "name": "FeeRecipientNotFound", "type": "error" },
27
+ { "inputs": [], "name": "FeeSetterOnly", "type": "error" },
28
+ { "inputs": [], "name": "FeesAlreadyInitialized", "type": "error" },
29
+ {
30
+ "inputs": [
31
+ { "internalType": "address", "name": "owner", "type": "address" }
32
+ ],
33
+ "name": "OwnableInvalidOwner",
34
+ "type": "error"
35
+ },
36
+ {
37
+ "inputs": [
38
+ { "internalType": "address", "name": "account", "type": "address" }
39
+ ],
40
+ "name": "OwnableUnauthorizedAccount",
41
+ "type": "error"
42
+ },
43
+ {
44
+ "inputs": [],
45
+ "name": "ProtocolFeePpmMustBeGreaterThanReferralFeePpm",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "inputs": [],
50
+ "name": "ProtocolFeePpmMustBeGreaterThanZero",
51
+ "type": "error"
52
+ },
53
+ { "inputs": [], "name": "RecipientCantBeZeroAddress", "type": "error" },
54
+ {
55
+ "inputs": [],
56
+ "name": "RecipientIndexDoesNotMatchRecipient",
57
+ "type": "error"
58
+ },
59
+ { "inputs": [], "name": "RecipientIndexOutOfBounds", "type": "error" },
60
+ { "inputs": [], "name": "TotalFeePpmBelowMinFeePpm", "type": "error" },
61
+ { "inputs": [], "name": "TotalFeePpmExceedsMaxFeePpm", "type": "error" },
62
+ {
63
+ "anonymous": false,
64
+ "inputs": [
65
+ {
66
+ "indexed": true,
67
+ "internalType": "PoolId",
68
+ "name": "poolId",
69
+ "type": "bytes32"
70
+ },
71
+ {
72
+ "components": [
73
+ { "internalType": "address", "name": "recipient", "type": "address" },
74
+ { "internalType": "uint16", "name": "feePpm", "type": "uint16" }
75
+ ],
76
+ "indexed": false,
77
+ "internalType": "struct IArenaFeeHelperMinimal.Fee[]",
78
+ "name": "fees",
79
+ "type": "tuple[]"
80
+ }
81
+ ],
82
+ "name": "FeeArraySet",
83
+ "type": "event"
84
+ },
85
+ {
86
+ "anonymous": false,
87
+ "inputs": [
88
+ {
89
+ "indexed": true,
90
+ "internalType": "address",
91
+ "name": "feeSetter",
92
+ "type": "address"
93
+ },
94
+ {
95
+ "indexed": false,
96
+ "internalType": "bool",
97
+ "name": "isFeeSetter",
98
+ "type": "bool"
99
+ }
100
+ ],
101
+ "name": "FeeSetterSet",
102
+ "type": "event"
103
+ },
104
+ {
105
+ "anonymous": false,
106
+ "inputs": [
107
+ {
108
+ "indexed": true,
109
+ "internalType": "address",
110
+ "name": "previousOwner",
111
+ "type": "address"
112
+ },
113
+ {
114
+ "indexed": true,
115
+ "internalType": "address",
116
+ "name": "newOwner",
117
+ "type": "address"
118
+ }
119
+ ],
120
+ "name": "OwnershipTransferStarted",
121
+ "type": "event"
122
+ },
123
+ {
124
+ "anonymous": false,
125
+ "inputs": [
126
+ {
127
+ "indexed": true,
128
+ "internalType": "address",
129
+ "name": "previousOwner",
130
+ "type": "address"
131
+ },
132
+ {
133
+ "indexed": true,
134
+ "internalType": "address",
135
+ "name": "newOwner",
136
+ "type": "address"
137
+ }
138
+ ],
139
+ "name": "OwnershipTransferred",
140
+ "type": "event"
141
+ },
142
+ {
143
+ "anonymous": false,
144
+ "inputs": [
145
+ {
146
+ "components": [
147
+ { "internalType": "address", "name": "recipient", "type": "address" },
148
+ {
149
+ "internalType": "uint16",
150
+ "name": "protocolFeePpm",
151
+ "type": "uint16"
152
+ },
153
+ {
154
+ "internalType": "uint16",
155
+ "name": "referralFeePpm",
156
+ "type": "uint16"
157
+ }
158
+ ],
159
+ "indexed": false,
160
+ "internalType": "struct ArenaFeeHelper.ProtocolFeeSettings",
161
+ "name": "settings",
162
+ "type": "tuple"
163
+ }
164
+ ],
165
+ "name": "ProtocolFeeSettingsSet",
166
+ "type": "event"
167
+ },
168
+ {
169
+ "anonymous": false,
170
+ "inputs": [
171
+ {
172
+ "indexed": false,
173
+ "internalType": "address",
174
+ "name": "referralRegistry",
175
+ "type": "address"
176
+ }
177
+ ],
178
+ "name": "ReferralRegistrySet",
179
+ "type": "event"
180
+ },
181
+ {
182
+ "inputs": [],
183
+ "name": "MAX_FEE_ARRAY_LENGTH",
184
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
185
+ "stateMutability": "view",
186
+ "type": "function"
187
+ },
188
+ {
189
+ "inputs": [],
190
+ "name": "MAX_POOL_FEE_PPM",
191
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
192
+ "stateMutability": "view",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "inputs": [],
197
+ "name": "MAX_PROTOCOL_FEE_PPM",
198
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
199
+ "stateMutability": "view",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [],
204
+ "name": "acceptOwnership",
205
+ "outputs": [],
206
+ "stateMutability": "nonpayable",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "inputs": [
211
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
212
+ { "internalType": "address", "name": "_recipient", "type": "address" },
213
+ { "internalType": "uint16", "name": "_feePpm", "type": "uint16" }
214
+ ],
215
+ "name": "addFeeRecipient",
216
+ "outputs": [],
217
+ "stateMutability": "nonpayable",
218
+ "type": "function"
219
+ },
220
+ {
221
+ "inputs": [
222
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" }
223
+ ],
224
+ "name": "getFeesForPool",
225
+ "outputs": [
226
+ {
227
+ "components": [
228
+ { "internalType": "address", "name": "recipient", "type": "address" },
229
+ { "internalType": "uint16", "name": "feePpm", "type": "uint16" }
230
+ ],
231
+ "internalType": "struct IArenaFeeHelperMinimal.Fee[]",
232
+ "name": "feeRecipients",
233
+ "type": "tuple[]"
234
+ }
235
+ ],
236
+ "stateMutability": "view",
237
+ "type": "function"
238
+ },
239
+ {
240
+ "inputs": [],
241
+ "name": "getProtocolFeeSettings",
242
+ "outputs": [
243
+ {
244
+ "components": [
245
+ { "internalType": "address", "name": "recipient", "type": "address" },
246
+ {
247
+ "internalType": "uint16",
248
+ "name": "protocolFeePpm",
249
+ "type": "uint16"
250
+ },
251
+ {
252
+ "internalType": "uint16",
253
+ "name": "referralFeePpm",
254
+ "type": "uint16"
255
+ }
256
+ ],
257
+ "internalType": "struct ArenaFeeHelper.ProtocolFeeSettings",
258
+ "name": "",
259
+ "type": "tuple"
260
+ }
261
+ ],
262
+ "stateMutability": "view",
263
+ "type": "function"
264
+ },
265
+ {
266
+ "inputs": [
267
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" }
268
+ ],
269
+ "name": "getTotalFeePpm",
270
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
271
+ "stateMutability": "view",
272
+ "type": "function"
273
+ },
274
+ {
275
+ "inputs": [
276
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
277
+ {
278
+ "components": [
279
+ { "internalType": "address", "name": "recipient", "type": "address" },
280
+ { "internalType": "uint16", "name": "feePpm", "type": "uint16" }
281
+ ],
282
+ "internalType": "struct IArenaFeeHelperMinimal.Fee[]",
283
+ "name": "_fees",
284
+ "type": "tuple[]"
285
+ }
286
+ ],
287
+ "name": "initializeFeesForPool",
288
+ "outputs": [],
289
+ "stateMutability": "nonpayable",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
294
+ "name": "isFeeSetter",
295
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
296
+ "stateMutability": "view",
297
+ "type": "function"
298
+ },
299
+ {
300
+ "inputs": [],
301
+ "name": "owner",
302
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
303
+ "stateMutability": "view",
304
+ "type": "function"
305
+ },
306
+ {
307
+ "inputs": [],
308
+ "name": "pendingOwner",
309
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
310
+ "stateMutability": "view",
311
+ "type": "function"
312
+ },
313
+ {
314
+ "inputs": [
315
+ { "internalType": "PoolId", "name": "", "type": "bytes32" },
316
+ { "internalType": "uint256", "name": "", "type": "uint256" }
317
+ ],
318
+ "name": "poolIdToFees",
319
+ "outputs": [
320
+ { "internalType": "address", "name": "recipient", "type": "address" },
321
+ { "internalType": "uint16", "name": "feePpm", "type": "uint16" }
322
+ ],
323
+ "stateMutability": "view",
324
+ "type": "function"
325
+ },
326
+ {
327
+ "inputs": [{ "internalType": "PoolId", "name": "", "type": "bytes32" }],
328
+ "name": "poolIdToTotalFeePpm",
329
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
330
+ "stateMutability": "view",
331
+ "type": "function"
332
+ },
333
+ {
334
+ "inputs": [],
335
+ "name": "protocolFeeSettings",
336
+ "outputs": [
337
+ { "internalType": "address", "name": "recipient", "type": "address" },
338
+ { "internalType": "uint16", "name": "protocolFeePpm", "type": "uint16" },
339
+ { "internalType": "uint16", "name": "referralFeePpm", "type": "uint16" }
340
+ ],
341
+ "stateMutability": "view",
342
+ "type": "function"
343
+ },
344
+ {
345
+ "inputs": [],
346
+ "name": "referralRegistry",
347
+ "outputs": [
348
+ {
349
+ "internalType": "contract IArenaReferralRegistry",
350
+ "name": "",
351
+ "type": "address"
352
+ }
353
+ ],
354
+ "stateMutability": "view",
355
+ "type": "function"
356
+ },
357
+ {
358
+ "inputs": [
359
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
360
+ { "internalType": "address", "name": "_recipient", "type": "address" },
361
+ {
362
+ "internalType": "uint256",
363
+ "name": "_recipientIndex",
364
+ "type": "uint256"
365
+ }
366
+ ],
367
+ "name": "removeFeeRecipient",
368
+ "outputs": [],
369
+ "stateMutability": "nonpayable",
370
+ "type": "function"
371
+ },
372
+ {
373
+ "inputs": [],
374
+ "name": "renounceOwnership",
375
+ "outputs": [],
376
+ "stateMutability": "nonpayable",
377
+ "type": "function"
378
+ },
379
+ {
380
+ "inputs": [
381
+ { "internalType": "address", "name": "_feeSetter", "type": "address" },
382
+ { "internalType": "bool", "name": "_isFeeSetter", "type": "bool" }
383
+ ],
384
+ "name": "setFeeSetter",
385
+ "outputs": [],
386
+ "stateMutability": "nonpayable",
387
+ "type": "function"
388
+ },
389
+ {
390
+ "inputs": [
391
+ { "internalType": "address", "name": "_recipient", "type": "address" },
392
+ { "internalType": "uint16", "name": "_protocolFeePpm", "type": "uint16" },
393
+ { "internalType": "uint16", "name": "_referralFeePpm", "type": "uint16" }
394
+ ],
395
+ "name": "setProtocolFeeSettings",
396
+ "outputs": [],
397
+ "stateMutability": "nonpayable",
398
+ "type": "function"
399
+ },
400
+ {
401
+ "inputs": [
402
+ {
403
+ "internalType": "address",
404
+ "name": "_referralRegistry",
405
+ "type": "address"
406
+ }
407
+ ],
408
+ "name": "setReferralRegistry",
409
+ "outputs": [],
410
+ "stateMutability": "nonpayable",
411
+ "type": "function"
412
+ },
413
+ {
414
+ "inputs": [
415
+ { "internalType": "address", "name": "newOwner", "type": "address" }
416
+ ],
417
+ "name": "transferOwnership",
418
+ "outputs": [],
419
+ "stateMutability": "nonpayable",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [
424
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
425
+ {
426
+ "components": [
427
+ { "internalType": "address", "name": "recipient", "type": "address" },
428
+ { "internalType": "uint16", "name": "feePpm", "type": "uint16" }
429
+ ],
430
+ "internalType": "struct IArenaFeeHelperMinimal.Fee[]",
431
+ "name": "_fees",
432
+ "type": "tuple[]"
433
+ }
434
+ ],
435
+ "name": "updateFeesForPool",
436
+ "outputs": [],
437
+ "stateMutability": "nonpayable",
438
+ "type": "function"
439
+ },
440
+ {
441
+ "inputs": [
442
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
443
+ {
444
+ "internalType": "address",
445
+ "name": "_recipientToReplace",
446
+ "type": "address"
447
+ },
448
+ { "internalType": "address", "name": "_newRecipient", "type": "address" },
449
+ {
450
+ "internalType": "uint256",
451
+ "name": "_recipientIndex",
452
+ "type": "uint256"
453
+ }
454
+ ],
455
+ "name": "updateRecipientAddress",
456
+ "outputs": [],
457
+ "stateMutability": "nonpayable",
458
+ "type": "function"
459
+ },
460
+ {
461
+ "inputs": [
462
+ { "internalType": "PoolId", "name": "poolId", "type": "bytes32" },
463
+ { "internalType": "address", "name": "_recipient", "type": "address" },
464
+ { "internalType": "uint16", "name": "_feePpm", "type": "uint16" },
465
+ {
466
+ "internalType": "uint256",
467
+ "name": "_recipientIndex",
468
+ "type": "uint256"
469
+ }
470
+ ],
471
+ "name": "updateRecipientFeePpm",
472
+ "outputs": [],
473
+ "stateMutability": "nonpayable",
474
+ "type": "function"
475
+ }
476
+ ]
@@ -22,7 +22,13 @@ const ABI_json_1 = __importDefault(require("../abi/augustus-v6/ABI.json"));
22
22
  * Here we decide to go with a high enough default so that the local deadline rarely supersedes the global router deadline.
23
23
  */
24
24
  exports.FRIENDLY_LOCAL_DEADLINE = 7 * 24 * 60 * 60;
25
- const getLocalDeadlineAsFriendlyPlaceholder = () => String(Math.floor(new Date().getTime() / 1000) + exports.FRIENDLY_LOCAL_DEADLINE);
25
+ const currentDateRoundToDay = () => {
26
+ const now = new Date();
27
+ now.setUTCHours(0, 0, 0, 0);
28
+ return now;
29
+ };
30
+ const today = currentDateRoundToDay().getTime();
31
+ const getLocalDeadlineAsFriendlyPlaceholder = () => String(Math.floor(today / 1000) + exports.FRIENDLY_LOCAL_DEADLINE);
26
32
  exports.getLocalDeadlineAsFriendlyPlaceholder = getLocalDeadlineAsFriendlyPlaceholder;
27
33
  class SimpleExchange {
28
34
  dexHelper;
@@ -1 +1 @@
1
- {"version":3,"file":"simple-exchange.js","sourceRoot":"","sources":["../../src/dex/simple-exchange.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAC/C,gEAAiD;AAQjD,4CAA2D;AAC3D,qGAAqE;AACrE,mEAAyC;AACzC,yEAA+C;AAC/C,oCAAwC;AACxC,4CAAwC;AAKxC,2EAAwD;AAIxD;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACjD,MAAM,qCAAqC,GAAG,GAAG,EAAE,CACxD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,+BAAu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AqB,CAAC,GAAG,EAAE,OAAO,IAAI,UAAU,EAAE,SAAS,CAAC,CAAC;QAE5E,MAAM,SAAS,GAAG,CAChB,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAA,oBAAY,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAClE,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO;YACL,OAAO,EAAE;gBACP,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC;gBAC5B,GAAG,YAAY,CAAC,OAAO;gBACvB,UAAU;aACX;YACD,QAAQ,EAAE;gBACR,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,EAAE,CAAC;gBAC7B,GAAG,YAAY,CAAC,QAAQ;gBACxB,YAAY;aACb;YACD,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;YACxE,UAAU;SACX,CAAC;IACJ,CAAC;IAES,MAAM,CAAC,YAAoB;QACnC,MAAM,IAAI,GACR,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,WAAW,EAAE,CAAC;QAErE,OAAO,YAAY,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC;IAC7C,CAAC;CACF;AA9GD,wCA8GC"}
@@ -0,0 +1,7 @@
1
+ import { UniswapV3Factory } from '../../uniswap-v3-factory';
2
+ import { LogDescription } from 'ethers/lib/utils';
3
+ import { Interface } from '@ethersproject/abi';
4
+ export declare class PharaohV3Factory extends UniswapV3Factory {
5
+ readonly factoryIface: Interface;
6
+ handleNewPool(event: LogDescription): Promise<void>;
7
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PharaohV3Factory = void 0;
7
+ const uniswap_v3_factory_1 = require("../../uniswap-v3-factory");
8
+ const abi_1 = require("@ethersproject/abi");
9
+ const PharaohV3Factory_abi_json_1 = __importDefault(require("../../../../abi/pharaoh-v3/PharaohV3Factory.abi.json"));
10
+ class PharaohV3Factory extends uniswap_v3_factory_1.UniswapV3Factory {
11
+ factoryIface = new abi_1.Interface(PharaohV3Factory_abi_json_1.default);
12
+ async handleNewPool(event) {
13
+ const token0 = event.args.token0.toLowerCase();
14
+ const token1 = event.args.token1.toLowerCase();
15
+ const tickSpacing = event.args.tickSpacing;
16
+ await this.onPoolCreated({ token0, token1, fee: tickSpacing });
17
+ }
18
+ }
19
+ exports.PharaohV3Factory = PharaohV3Factory;
20
+ //# sourceMappingURL=pharaoh-v3-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pharaoh-v3-factory.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-factory.ts"],"names":[],"mappings":";;;;;;AAAA,iEAA4D;AAE5D,4CAA+C;AAC/C,qHAA8E;AAE9E,MAAa,gBAAiB,SAAQ,qCAAgB;IACpC,YAAY,GAAG,IAAI,eAAS,CAAC,mCAAU,CAAC,CAAC;IAEzD,KAAK,CAAC,aAAa,CAAC,KAAqB;QACvC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;QAE3C,MAAM,IAAI,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAVD,4CAUC"}
@@ -0,0 +1,12 @@
1
+ import { ethers } from 'ethers';
2
+ import { VelodromeSlipstreamEventPool } from '../velodrome-slipstream/velodrome-slipstream-pool';
3
+ import { MultiCallParams } from '../../../../lib/multi-wrapper';
4
+ import { DecodedStateMultiCallResultWithRelativeBitmaps, PoolState } from '../../types';
5
+ export declare class PharaohV3EventPool extends VelodromeSlipstreamEventPool {
6
+ readonly poolIface: ethers.utils.Interface;
7
+ readonly factoryIface: ethers.utils.Interface;
8
+ protected getCurrentFee(blockNumber: number): Promise<bigint>;
9
+ protected _getStateRequestCallData(): MultiCallParams<bigint | DecodedStateMultiCallResultWithRelativeBitmaps>[];
10
+ generateState(blockNumber: number): Promise<Readonly<PoolState>>;
11
+ protected predictDeterministicAddress(factory: string, implementation: string, salt: string): string;
12
+ }