@paraswap/dex-lib 3.5.4-v6.2.2 → 3.5.4
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/build/config.js +36 -36
- package/build/constants.d.ts +0 -2
- package/build/constants.js +1 -3
- package/build/constants.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.d.ts +2 -2
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.d.ts +2 -2
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +2 -2
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v2/curve-v2.d.ts +2 -2
- package/build/dex/curve-v2/curve-v2.js.map +1 -1
- package/build/dex/generic-rfq/generic-rfq.d.ts +1 -1
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/idex.d.ts +2 -2
- package/build/dex/maker-psm/maker-psm.d.ts +3 -12
- package/build/dex/maker-psm/maker-psm.js +0 -66
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/maker-psm/types.d.ts +1 -15
- package/build/dex/uniswap-v2/uniswap-v2.d.ts +2 -2
- package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +2 -2
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/zerox/index.d.ts +1 -1
- package/build/dex/zerox/index.js.map +1 -1
- package/build/generic-swap-transaction-builder.d.ts +3 -5
- package/build/generic-swap-transaction-builder.js +7 -22
- package/build/generic-swap-transaction-builder.js.map +1 -1
- package/package.json +2 -2
- package/src/config.ts +36 -36
- package/src/constants.ts +0 -2
- package/src/dex/balancer-v2/balancer-v2.ts +2 -2
- package/src/dex/curve-v1/curve-v1.ts +2 -2
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +2 -2
- package/src/dex/curve-v2/curve-v2.ts +2 -2
- package/src/dex/generic-rfq/generic-rfq.ts +1 -1
- package/src/dex/idex.ts +2 -2
- package/src/dex/maker-psm/maker-psm-e2e.test.ts +33 -8
- package/src/dex/maker-psm/maker-psm.ts +5 -136
- package/src/dex/maker-psm/types.ts +1 -17
- package/src/dex/uniswap-v2/uniswap-v2.ts +2 -2
- package/src/dex/uniswap-v3/uniswap-v3.ts +2 -2
- package/src/dex/zerox/index.ts +1 -1
- package/src/generic-swap-transaction-builder.ts +0 -40
- package/tests/constants-e2e.ts +1 -1
|
@@ -12,11 +12,9 @@ import {
|
|
|
12
12
|
ETHER_ADDRESS,
|
|
13
13
|
FEE_PERCENT_IN_BASIS_POINTS_MASK,
|
|
14
14
|
IS_CAP_SURPLUS_MASK,
|
|
15
|
-
IS_DIRECT_TRANSFER_MASK,
|
|
16
15
|
IS_REFERRAL_MASK,
|
|
17
16
|
IS_SKIP_BLACKLIST_MASK,
|
|
18
17
|
IS_TAKE_SURPLUS_MASK,
|
|
19
|
-
IS_USER_SURPLUS_MASK,
|
|
20
18
|
NULL_ADDRESS,
|
|
21
19
|
SwapSide,
|
|
22
20
|
} from './constants';
|
|
@@ -45,8 +43,6 @@ interface FeeParams {
|
|
|
45
43
|
feePercent: string;
|
|
46
44
|
isTakeSurplus: boolean;
|
|
47
45
|
isCapSurplus: boolean;
|
|
48
|
-
isSurplusToUser: boolean;
|
|
49
|
-
isDirectFeeTransfer: boolean;
|
|
50
46
|
isReferral: boolean;
|
|
51
47
|
isSkipBlacklist: boolean;
|
|
52
48
|
}
|
|
@@ -213,8 +209,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
213
209
|
partnerFeePercent: string,
|
|
214
210
|
takeSurplus: boolean,
|
|
215
211
|
isCapSurplus: boolean,
|
|
216
|
-
isSurplusToUser: boolean,
|
|
217
|
-
isDirectFeeTransfer: boolean,
|
|
218
212
|
beneficiary: Address,
|
|
219
213
|
permit: string,
|
|
220
214
|
deadline: string,
|
|
@@ -243,8 +237,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
243
237
|
partnerFeePercent,
|
|
244
238
|
takeSurplus,
|
|
245
239
|
isCapSurplus,
|
|
246
|
-
isSurplusToUser,
|
|
247
|
-
isDirectFeeTransfer,
|
|
248
240
|
priceRoute,
|
|
249
241
|
});
|
|
250
242
|
|
|
@@ -288,8 +280,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
288
280
|
partnerFeePercent: string,
|
|
289
281
|
takeSurplus: boolean,
|
|
290
282
|
isCapSurplus: boolean,
|
|
291
|
-
isSurplusToUser: boolean,
|
|
292
|
-
isDirectFeeTransfer: boolean,
|
|
293
283
|
permit: string,
|
|
294
284
|
uuid: string,
|
|
295
285
|
beneficiary: Address,
|
|
@@ -334,8 +324,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
334
324
|
partnerFeePercent,
|
|
335
325
|
takeSurplus,
|
|
336
326
|
isCapSurplus,
|
|
337
|
-
isSurplusToUser,
|
|
338
|
-
isDirectFeeTransfer,
|
|
339
327
|
priceRoute,
|
|
340
328
|
});
|
|
341
329
|
|
|
@@ -361,8 +349,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
361
349
|
priceRoute,
|
|
362
350
|
takeSurplus,
|
|
363
351
|
isCapSurplus,
|
|
364
|
-
isSurplusToUser,
|
|
365
|
-
isDirectFeeTransfer,
|
|
366
352
|
partnerAddress,
|
|
367
353
|
partnerFeePercent,
|
|
368
354
|
skipBlacklist = false,
|
|
@@ -372,8 +358,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
372
358
|
partnerFeePercent: string;
|
|
373
359
|
takeSurplus: boolean;
|
|
374
360
|
isCapSurplus: boolean;
|
|
375
|
-
isSurplusToUser: boolean;
|
|
376
|
-
isDirectFeeTransfer: boolean;
|
|
377
361
|
priceRoute: OptimalRate;
|
|
378
362
|
skipBlacklist?: boolean;
|
|
379
363
|
}) {
|
|
@@ -383,8 +367,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
383
367
|
feePercent: '0',
|
|
384
368
|
isTakeSurplus: takeSurplus,
|
|
385
369
|
isCapSurplus,
|
|
386
|
-
isSurplusToUser,
|
|
387
|
-
isDirectFeeTransfer,
|
|
388
370
|
isReferral: true,
|
|
389
371
|
isSkipBlacklist: skipBlacklist,
|
|
390
372
|
})
|
|
@@ -393,8 +375,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
393
375
|
feePercent: partnerFeePercent,
|
|
394
376
|
isTakeSurplus: takeSurplus,
|
|
395
377
|
isCapSurplus,
|
|
396
|
-
isSurplusToUser,
|
|
397
|
-
isDirectFeeTransfer,
|
|
398
378
|
isSkipBlacklist: skipBlacklist,
|
|
399
379
|
isReferral: false,
|
|
400
380
|
});
|
|
@@ -411,8 +391,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
411
391
|
partnerFeePercent,
|
|
412
392
|
takeSurplus,
|
|
413
393
|
isCapSurplus,
|
|
414
|
-
isSurplusToUser,
|
|
415
|
-
isDirectFeeTransfer,
|
|
416
394
|
gasPrice,
|
|
417
395
|
maxFeePerGas,
|
|
418
396
|
maxPriorityFeePerGas,
|
|
@@ -430,8 +408,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
430
408
|
partnerFeePercent: string;
|
|
431
409
|
takeSurplus?: boolean;
|
|
432
410
|
isCapSurplus?: boolean;
|
|
433
|
-
isSurplusToUser?: boolean;
|
|
434
|
-
isDirectFeeTransfer?: boolean;
|
|
435
411
|
gasPrice?: string;
|
|
436
412
|
maxFeePerGas?: string;
|
|
437
413
|
maxPriorityFeePerGas?: string;
|
|
@@ -462,8 +438,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
462
438
|
partnerFeePercent,
|
|
463
439
|
takeSurplus ?? false,
|
|
464
440
|
isCapSurplus ?? true,
|
|
465
|
-
isSurplusToUser ?? false,
|
|
466
|
-
isDirectFeeTransfer ?? false,
|
|
467
441
|
permit || '0x',
|
|
468
442
|
uuid,
|
|
469
443
|
_beneficiary,
|
|
@@ -478,8 +452,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
478
452
|
partnerFeePercent,
|
|
479
453
|
takeSurplus ?? false,
|
|
480
454
|
isCapSurplus ?? true,
|
|
481
|
-
isSurplusToUser ?? false,
|
|
482
|
-
isDirectFeeTransfer ?? false,
|
|
483
455
|
_beneficiary,
|
|
484
456
|
permit || '0x',
|
|
485
457
|
deadline,
|
|
@@ -513,8 +485,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
513
485
|
feePercent,
|
|
514
486
|
isTakeSurplus,
|
|
515
487
|
isCapSurplus,
|
|
516
|
-
isSurplusToUser,
|
|
517
|
-
isDirectFeeTransfer,
|
|
518
488
|
isReferral,
|
|
519
489
|
isSkipBlacklist,
|
|
520
490
|
}: FeeParams): string {
|
|
@@ -552,16 +522,6 @@ export class GenericSwapTransactionBuilder {
|
|
|
552
522
|
partialFeeCodeWithBitFlags.or(IS_CAP_SURPLUS_MASK);
|
|
553
523
|
}
|
|
554
524
|
|
|
555
|
-
if (isSurplusToUser) {
|
|
556
|
-
partialFeeCodeWithBitFlags =
|
|
557
|
-
partialFeeCodeWithBitFlags.or(IS_USER_SURPLUS_MASK);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
if (isDirectFeeTransfer) {
|
|
561
|
-
partialFeeCodeWithBitFlags = partialFeeCodeWithBitFlags.or(
|
|
562
|
-
IS_DIRECT_TRANSFER_MASK,
|
|
563
|
-
);
|
|
564
|
-
}
|
|
565
525
|
// Combine partnerBigInt and feePercentBigInt
|
|
566
526
|
const feeCode = partialFeeCodeWithPartnerAddress.or(
|
|
567
527
|
partialFeeCodeWithBitFlags,
|
package/tests/constants-e2e.ts
CHANGED
|
@@ -1314,7 +1314,7 @@ export const Holders: {
|
|
|
1314
1314
|
CVX: '0x0aCA67Fa70B142A3b9bF2eD89A81B40ff85dACdC',
|
|
1315
1315
|
MIM: '0xa046a8660e66d178ee07ec97c585eeb6aa18c26c',
|
|
1316
1316
|
AnkETH: '0xF7260D4ADc48fEefd5a19a9Eb23f9747CeE15C92',
|
|
1317
|
-
DAI: '
|
|
1317
|
+
DAI: '0x2fEb1512183545f48f6b9C5b4EbfCaF49CfCa6F3',
|
|
1318
1318
|
oldFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1319
1319
|
newFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1320
1320
|
FEI: '0x19c549357034d10db8d75ed812b45be1dd8a7218',
|