@1inch/fusion-sdk 2.4.7 → 2.4.8-rc.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.
- package/dist/cjs/api/quoter/quote/quote.js +3 -1
- package/dist/cjs/api/quoter/quoter.api.spec.js +38 -0
- package/dist/cjs/api/quoter/types.js +2 -0
- package/dist/cjs/fusion-order/fusion-extension.js +9 -3
- package/dist/cjs/fusion-order/fusion-order.js +5 -0
- package/dist/cjs/fusion-order/fusion-order.spec.js +131 -0
- package/dist/esm/api/quoter/quote/quote.js +3 -1
- package/dist/esm/api/quoter/quoter.api.spec.js +38 -0
- package/dist/esm/api/quoter/types.js +2 -0
- package/dist/esm/fusion-order/fusion-extension.js +9 -3
- package/dist/esm/fusion-order/fusion-order.js +5 -0
- package/dist/esm/fusion-order/fusion-order.spec.js +132 -1
- package/dist/esm/fusion-order/types.js +5 -0
- package/dist/esm/package.json +1 -1
- package/dist/types/src/api/quoter/quote/quote.d.ts +1 -0
- package/dist/types/src/api/quoter/types.d.ts +1 -0
- package/dist/types/src/fusion-order/fusion-extension.d.ts +2 -0
- package/dist/types/src/fusion-order/types.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -80,6 +80,7 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
80
80
|
_define_property(this, "resolverFeePreset", void 0);
|
|
81
81
|
_define_property(this, "surplusFee", void 0);
|
|
82
82
|
_define_property(this, "integratorFeeParams", void 0);
|
|
83
|
+
_define_property(this, "source", void 0);
|
|
83
84
|
this.params = params;
|
|
84
85
|
this.fromTokenAmount = BigInt(response.fromTokenAmount);
|
|
85
86
|
var _obj;
|
|
@@ -102,6 +103,7 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
102
103
|
bps: new _limitordersdk.Bps(BigInt(response.fee.bps))
|
|
103
104
|
};
|
|
104
105
|
this.surplusFee = response.surplusFee;
|
|
106
|
+
this.source = response.source;
|
|
105
107
|
this.integratorFeeParams = this.parseIntegratorFee(response);
|
|
106
108
|
}
|
|
107
109
|
_create_class(Quote, [
|
|
@@ -147,7 +149,7 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
147
149
|
allowPartialFills: allowPartialFills,
|
|
148
150
|
allowMultipleFills: allowMultipleFills,
|
|
149
151
|
orderExpirationDelay: paramsData === null || paramsData === void 0 ? void 0 : paramsData.orderExpirationDelay,
|
|
150
|
-
source: this.params.source,
|
|
152
|
+
source: this.source || this.params.source,
|
|
151
153
|
enablePermit2: params.isPermit2,
|
|
152
154
|
fees: buildFees(this.resolverFeePreset, this.integratorFeeParams, this.surplusFee)
|
|
153
155
|
};
|
|
@@ -501,6 +501,44 @@ describe('Quoter API', function() {
|
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
503
|
}));
|
|
504
|
+
describe('source from response', function() {
|
|
505
|
+
it('should store source from response', function() {
|
|
506
|
+
var responseWithSource = _object_spread_props(_object_spread({}, ResponseMock), {
|
|
507
|
+
source: '0xabcdef01'
|
|
508
|
+
});
|
|
509
|
+
var quote = new _index.Quote(params, responseWithSource);
|
|
510
|
+
expect(quote.source).toBe('0xabcdef01');
|
|
511
|
+
});
|
|
512
|
+
it('should be undefined when response has no source', function() {
|
|
513
|
+
var quote = new _index.Quote(params, ResponseMock);
|
|
514
|
+
expect(quote.source).toBeUndefined();
|
|
515
|
+
});
|
|
516
|
+
it('should prefer response source over request source', function() {
|
|
517
|
+
var paramsWithSource = _quoterrequest.QuoterRequest.new({
|
|
518
|
+
fromTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
519
|
+
toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
520
|
+
amount: '1000000000000000000000',
|
|
521
|
+
walletAddress: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
522
|
+
source: 'user-provided-source'
|
|
523
|
+
});
|
|
524
|
+
var responseWithSource = _object_spread_props(_object_spread({}, ResponseMock), {
|
|
525
|
+
source: '0xabcdef01'
|
|
526
|
+
});
|
|
527
|
+
var quote = new _index.Quote(paramsWithSource, responseWithSource);
|
|
528
|
+
expect(quote.source).toBe('0xabcdef01');
|
|
529
|
+
});
|
|
530
|
+
it('should fall back to request source when response source is absent', function() {
|
|
531
|
+
var paramsWithSource = _quoterrequest.QuoterRequest.new({
|
|
532
|
+
fromTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
533
|
+
toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
534
|
+
amount: '1000000000000000000000',
|
|
535
|
+
walletAddress: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
536
|
+
source: 'user-provided-source'
|
|
537
|
+
});
|
|
538
|
+
var quote = new _index.Quote(paramsWithSource, ResponseMock);
|
|
539
|
+
expect(quote.source).toBeUndefined();
|
|
540
|
+
});
|
|
541
|
+
});
|
|
504
542
|
describe('parseIntegratorFee', function() {
|
|
505
543
|
it('should use response receiver when provided', function() {
|
|
506
544
|
var _quote_integratorFeeParams, _quote_integratorFeeParams1, _quote_integratorFeeParams2;
|
|
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "PresetEnum", {
|
|
|
17
17
|
* In bps
|
|
18
18
|
*/ /**
|
|
19
19
|
* Percentage of the integrator fee that will be shared with the integrator.
|
|
20
|
+
*/ /**
|
|
21
|
+
* Resolved source tracking code
|
|
20
22
|
*/ var PresetEnum = /*#__PURE__*/ function(PresetEnum) {
|
|
21
23
|
PresetEnum["fast"] = "fast";
|
|
22
24
|
PresetEnum["medium"] = "medium";
|
|
@@ -72,12 +72,15 @@ var FusionExtension = /*#__PURE__*/ function() {
|
|
|
72
72
|
{
|
|
73
73
|
key: "build",
|
|
74
74
|
value: function build() {
|
|
75
|
-
var _this_extra;
|
|
75
|
+
var _this_extra, _this_extra1;
|
|
76
76
|
var amountData = this.buildAmountGetterData(true);
|
|
77
77
|
var builder = new _limitordersdk.ExtensionBuilder().withMakingAmountData(this.address, amountData).withTakingAmountData(this.address, amountData).withPostInteraction(new _limitordersdk.Interaction(this.address, this.buildInteractionData()));
|
|
78
78
|
if ((_this_extra = this.extra) === null || _this_extra === void 0 ? void 0 : _this_extra.makerPermit) {
|
|
79
|
-
var
|
|
80
|
-
builder.withMakerPermit((
|
|
79
|
+
var _this_extra2, _this_extra3;
|
|
80
|
+
builder.withMakerPermit((_this_extra2 = this.extra) === null || _this_extra2 === void 0 ? void 0 : _this_extra2.makerPermit.target, (_this_extra3 = this.extra) === null || _this_extra3 === void 0 ? void 0 : _this_extra3.makerPermit.data);
|
|
81
|
+
}
|
|
82
|
+
if ((_this_extra1 = this.extra) === null || _this_extra1 === void 0 ? void 0 : _this_extra1.preInteraction) {
|
|
83
|
+
builder.withPreInteraction(this.extra.preInteraction);
|
|
81
84
|
}
|
|
82
85
|
return builder.build();
|
|
83
86
|
}
|
|
@@ -228,6 +231,7 @@ var FusionExtension = /*#__PURE__*/ function() {
|
|
|
228
231
|
}
|
|
229
232
|
//endregion Parse amount data
|
|
230
233
|
var makerPermit = extension.hasMakerPermit ? _limitordersdk.Interaction.decode(extension.makerPermit) : undefined;
|
|
234
|
+
var preInteraction = extension.hasPreInteraction ? _limitordersdk.Interaction.decode(extension.preInteraction) : undefined;
|
|
231
235
|
(0, _assert.default)(amountData.fees.integratorFee.value === interactionData.fees.integratorFee.value, "invalid extension: integrator fee must be same in interaction data and in amount data");
|
|
232
236
|
(0, _assert.default)(amountData.fees.resolverFee.value === interactionData.fees.resolverFee.value, "invalid extension: resolver fee must be same in interaction data and in amount data");
|
|
233
237
|
(0, _assert.default)(amountData.fees.whitelistDiscount.equal(interactionData.fees.whitelistDiscount), "invalid extension: whitelistDiscount must be same in interaction data and in amount data");
|
|
@@ -240,6 +244,7 @@ var FusionExtension = /*#__PURE__*/ function() {
|
|
|
240
244
|
if (!hasFees) {
|
|
241
245
|
return new FusionExtension(settlementContract, auctionDetails, whitelist, surplusParams, {
|
|
242
246
|
makerPermit: makerPermit,
|
|
247
|
+
preInteraction: preInteraction,
|
|
243
248
|
customReceiver: customReceiver,
|
|
244
249
|
fees: undefined
|
|
245
250
|
});
|
|
@@ -247,6 +252,7 @@ var FusionExtension = /*#__PURE__*/ function() {
|
|
|
247
252
|
var fees = new _index1.Fees(new _index1.ResolverFee(protocolFeeRecipient, interactionData.fees.resolverFee, interactionData.fees.whitelistDiscount), interactionData.fees.integratorFee.isZero() ? _index1.IntegratorFee.ZERO : new _index1.IntegratorFee(integratorFeeRecipient, protocolFeeRecipient, interactionData.fees.integratorFee, interactionData.fees.integratorShare));
|
|
248
253
|
return new FusionExtension(settlementContract, auctionDetails, whitelist, surplusParams, {
|
|
249
254
|
makerPermit: makerPermit,
|
|
255
|
+
preInteraction: preInteraction,
|
|
250
256
|
fees: fees,
|
|
251
257
|
customReceiver: customReceiver
|
|
252
258
|
});
|
|
@@ -102,6 +102,7 @@ var FusionOrder = /*#__PURE__*/ function() {
|
|
|
102
102
|
*/ settlementExtensionContract, orderInfo, auctionDetails, whitelist) {
|
|
103
103
|
var surplusParams = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : _surplusparams.SurplusParams.NO_FEE, extra = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : FusionOrder.defaultExtra, extension = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : new _fusionextension.FusionExtension(settlementExtensionContract, auctionDetails, whitelist, surplusParams, {
|
|
104
104
|
makerPermit: extra.permit ? new _limitordersdk.Interaction(orderInfo.makerAsset, extra.permit) : undefined,
|
|
105
|
+
preInteraction: extra.preInteraction ? _limitordersdk.Interaction.decode(extra.preInteraction) : undefined,
|
|
105
106
|
customReceiver: orderInfo.receiver,
|
|
106
107
|
fees: extra === null || extra === void 0 ? void 0 : extra.fees
|
|
107
108
|
});
|
|
@@ -131,6 +132,9 @@ var FusionOrder = /*#__PURE__*/ function() {
|
|
|
131
132
|
if (enablePermit2) {
|
|
132
133
|
makerTraits.enablePermit2();
|
|
133
134
|
}
|
|
135
|
+
if (extra.preInteraction) {
|
|
136
|
+
makerTraits.enablePreInteraction();
|
|
137
|
+
}
|
|
134
138
|
if (extra.nonce !== undefined) {
|
|
135
139
|
makerTraits.withNonce(extra.nonce);
|
|
136
140
|
}
|
|
@@ -542,6 +546,7 @@ var FusionOrder = /*#__PURE__*/ function() {
|
|
|
542
546
|
enablePermit2: makerTraits.isPermit2(),
|
|
543
547
|
nonce: makerTraits.nonceOrEpoch(),
|
|
544
548
|
permit: extension.makerPermit === _constants.ZX ? undefined : _limitordersdk.Interaction.decode(extension.makerPermit).data,
|
|
549
|
+
preInteraction: extension.preInteraction === _constants.ZX ? undefined : extension.preInteraction,
|
|
545
550
|
unwrapWETH: makerTraits.isNativeUnwrapEnabled(),
|
|
546
551
|
orderExpirationDelay: orderExpirationDelay,
|
|
547
552
|
fees: extra === null || extra === void 0 ? void 0 : extra.fees,
|
|
@@ -466,3 +466,134 @@ describe('FusionOrder Native', function() {
|
|
|
466
466
|
expect(nativeOrder.build().receiver).toEqual(settlementExt.toString());
|
|
467
467
|
});
|
|
468
468
|
});
|
|
469
|
+
describe('FusionOrder preInteraction', function() {
|
|
470
|
+
it('should create order with preInteraction and set PRE_INTERACTION_CALL_FLAG in makerTraits', function() {
|
|
471
|
+
var extensionContract = new _limitordersdk.Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
472
|
+
var preInteraction = new _limitordersdk.Interaction(new _limitordersdk.Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1'), '0xdeadbeef01020304');
|
|
473
|
+
var order = _fusionorder.FusionOrder.new(extensionContract, {
|
|
474
|
+
makerAsset: new _limitordersdk.Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
475
|
+
takerAsset: new _limitordersdk.Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
476
|
+
makingAmount: 1983000000000000n,
|
|
477
|
+
takingAmount: 79052953622246027n,
|
|
478
|
+
maker: new _limitordersdk.Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
479
|
+
}, {
|
|
480
|
+
auction: new _index.AuctionDetails({
|
|
481
|
+
duration: 180n,
|
|
482
|
+
startTime: 1673548149n,
|
|
483
|
+
initialRateBump: 50000,
|
|
484
|
+
points: [
|
|
485
|
+
{
|
|
486
|
+
coefficient: 20000,
|
|
487
|
+
delay: 12
|
|
488
|
+
}
|
|
489
|
+
]
|
|
490
|
+
}),
|
|
491
|
+
whitelist: _index1.Whitelist.new(1673548139n, [
|
|
492
|
+
{
|
|
493
|
+
address: new _limitordersdk.Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
494
|
+
allowFrom: 0n
|
|
495
|
+
}
|
|
496
|
+
]),
|
|
497
|
+
surplus: _surplusparams.SurplusParams.NO_FEE
|
|
498
|
+
}, {
|
|
499
|
+
preInteraction: preInteraction.encode()
|
|
500
|
+
});
|
|
501
|
+
var makerTraits = new _limitordersdk.MakerTraits(BigInt(order.build().makerTraits));
|
|
502
|
+
expect(makerTraits.hasPreInteraction()).toBe(true);
|
|
503
|
+
});
|
|
504
|
+
it('should not set PRE_INTERACTION_CALL_FLAG when no preInteraction', function() {
|
|
505
|
+
var extensionContract = new _limitordersdk.Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
506
|
+
var order = _fusionorder.FusionOrder.new(extensionContract, {
|
|
507
|
+
makerAsset: new _limitordersdk.Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
508
|
+
takerAsset: new _limitordersdk.Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
509
|
+
makingAmount: 1983000000000000n,
|
|
510
|
+
takingAmount: 79052953622246027n,
|
|
511
|
+
maker: new _limitordersdk.Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
512
|
+
}, {
|
|
513
|
+
auction: new _index.AuctionDetails({
|
|
514
|
+
duration: 180n,
|
|
515
|
+
startTime: 1673548149n,
|
|
516
|
+
initialRateBump: 50000,
|
|
517
|
+
points: [
|
|
518
|
+
{
|
|
519
|
+
coefficient: 20000,
|
|
520
|
+
delay: 12
|
|
521
|
+
}
|
|
522
|
+
]
|
|
523
|
+
}),
|
|
524
|
+
whitelist: _index1.Whitelist.new(1673548139n, [
|
|
525
|
+
{
|
|
526
|
+
address: new _limitordersdk.Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
527
|
+
allowFrom: 0n
|
|
528
|
+
}
|
|
529
|
+
]),
|
|
530
|
+
surplus: _surplusparams.SurplusParams.NO_FEE
|
|
531
|
+
});
|
|
532
|
+
var makerTraits = new _limitordersdk.MakerTraits(BigInt(order.build().makerTraits));
|
|
533
|
+
expect(makerTraits.hasPreInteraction()).toBe(false);
|
|
534
|
+
});
|
|
535
|
+
it('should round-trip order with preInteraction via fromDataAndExtension', function() {
|
|
536
|
+
var extensionContract = new _limitordersdk.Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
537
|
+
var preInteractionTarget = new _limitordersdk.Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1');
|
|
538
|
+
var preInteractionCalldata = '0x0599a1fd1975848548e5b765925a935093a96ecc6f2ca216f77dcfd328b8a491';
|
|
539
|
+
var preInteraction = new _limitordersdk.Interaction(preInteractionTarget, preInteractionCalldata);
|
|
540
|
+
var order = _fusionorder.FusionOrder.new(extensionContract, {
|
|
541
|
+
makerAsset: new _limitordersdk.Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
542
|
+
takerAsset: new _limitordersdk.Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
543
|
+
makingAmount: 1983000000000000n,
|
|
544
|
+
takingAmount: 79052953622246027n,
|
|
545
|
+
maker: new _limitordersdk.Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
546
|
+
}, {
|
|
547
|
+
auction: new _index.AuctionDetails({
|
|
548
|
+
duration: 180n,
|
|
549
|
+
startTime: 1673548149n,
|
|
550
|
+
initialRateBump: 50000,
|
|
551
|
+
points: [
|
|
552
|
+
{
|
|
553
|
+
coefficient: 20000,
|
|
554
|
+
delay: 12
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
}),
|
|
558
|
+
whitelist: _index1.Whitelist.new(1673548139n, [
|
|
559
|
+
{
|
|
560
|
+
address: new _limitordersdk.Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
561
|
+
allowFrom: 0n
|
|
562
|
+
}
|
|
563
|
+
]),
|
|
564
|
+
surplus: _surplusparams.SurplusParams.NO_FEE
|
|
565
|
+
}, {
|
|
566
|
+
preInteraction: preInteraction.encode()
|
|
567
|
+
});
|
|
568
|
+
var built = order.build();
|
|
569
|
+
var extension = order.extension;
|
|
570
|
+
var restored = _fusionorder.FusionOrder.fromDataAndExtension({
|
|
571
|
+
salt: built.salt,
|
|
572
|
+
maker: built.maker,
|
|
573
|
+
receiver: built.receiver,
|
|
574
|
+
makerAsset: built.makerAsset,
|
|
575
|
+
takerAsset: built.takerAsset,
|
|
576
|
+
makerTraits: built.makerTraits,
|
|
577
|
+
makingAmount: built.makingAmount,
|
|
578
|
+
takingAmount: built.takingAmount
|
|
579
|
+
}, extension);
|
|
580
|
+
expect(restored.build().salt).toEqual(built.salt);
|
|
581
|
+
expect(restored.extension.encode()).toEqual(extension.encode());
|
|
582
|
+
});
|
|
583
|
+
it('should validate OKX order with preInteraction (real customer data)', function() {
|
|
584
|
+
var extensionHex = '0x000002b800000207000000d2000000d2000000d20000006900000000000000002ad5004c60e16e54d5007c80ce329adde5b51ef50000000000000069c930cb0000b403e4e400000000000064062324dfe7924cb4f3257d000000000000000000006ea9a11ae13b29f5c555d18bd45f0b94f54a968faa848f727be12534f24895770895ad27ad6b0d952ad5004c60e16e54d5007c80ce329adde5b51ef50000000000000069c930cb0000b403e4e400000000000064062324dfe7924cb4f3257d000000000000000000006ea9a11ae13b29f5c555d18bd45f0b94f54a968faa848f727be12534f24895770895ad27ad6b0d953a617c2fbaf8d7c58c793fbbd2d14eb4927876c10100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070b872a96f0000000000000000000000000000000000000000000000000006715eae5b898683d0000000000000000000000000000000000000000000000000000000069c931e800000000000000000000000000000000000000000000000000000000000000410599a1fd1975848548e5b765925a935093a96ecc6f2ca216f77dcfd328b8a4917028648ec3e33d048184f9877d4892fb829ddc5d75a19c1c2ef064d2a38c012b1b000000000000000000000000000000000000000000000000000000000000002ad5004c60e16e54d5007c80ce329adde5b51ef500000000000000000000000000000000000000000090cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000006469c930cb062324dfe7924cb4f3257d000c0000000000000000000000006ea9a11ae13b29f5c5550000d18bd45f0b94f54a968f0000aa848f727be12534f248000095770895ad27ad6b0d950000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00';
|
|
585
|
+
var extension = _limitordersdk.Extension.decode(extensionHex);
|
|
586
|
+
expect(function() {
|
|
587
|
+
_fusionorder.FusionOrder.fromDataAndExtension({
|
|
588
|
+
maker: '0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1',
|
|
589
|
+
makerAsset: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
590
|
+
makerTraits: '69656178681823023809491920669288819567982727296017585526061607372909138935808',
|
|
591
|
+
makingAmount: '1983000000000000',
|
|
592
|
+
receiver: '0xb698362cc878094c406115efeeb13089b544e6c8',
|
|
593
|
+
salt: '1084071965642925953405739669729447852001208220133',
|
|
594
|
+
takerAsset: '0xda7ad9dea9397cffddae2f8a052b82f1484252b3',
|
|
595
|
+
takingAmount: '79052953622246027'
|
|
596
|
+
}, extension);
|
|
597
|
+
}).not.toThrow();
|
|
598
|
+
});
|
|
599
|
+
});
|
|
@@ -65,6 +65,7 @@ export var Quote = /*#__PURE__*/ function() {
|
|
|
65
65
|
_define_property(this, "resolverFeePreset", void 0);
|
|
66
66
|
_define_property(this, "surplusFee", void 0);
|
|
67
67
|
_define_property(this, "integratorFeeParams", void 0);
|
|
68
|
+
_define_property(this, "source", void 0);
|
|
68
69
|
this.params = params;
|
|
69
70
|
this.fromTokenAmount = BigInt(response.fromTokenAmount);
|
|
70
71
|
var _obj;
|
|
@@ -87,6 +88,7 @@ export var Quote = /*#__PURE__*/ function() {
|
|
|
87
88
|
bps: new Bps(BigInt(response.fee.bps))
|
|
88
89
|
};
|
|
89
90
|
this.surplusFee = response.surplusFee;
|
|
91
|
+
this.source = response.source;
|
|
90
92
|
this.integratorFeeParams = this.parseIntegratorFee(response);
|
|
91
93
|
}
|
|
92
94
|
_create_class(Quote, [
|
|
@@ -132,7 +134,7 @@ export var Quote = /*#__PURE__*/ function() {
|
|
|
132
134
|
allowPartialFills: allowPartialFills,
|
|
133
135
|
allowMultipleFills: allowMultipleFills,
|
|
134
136
|
orderExpirationDelay: paramsData === null || paramsData === void 0 ? void 0 : paramsData.orderExpirationDelay,
|
|
135
|
-
source: this.params.source,
|
|
137
|
+
source: this.source || this.params.source,
|
|
136
138
|
enablePermit2: params.isPermit2,
|
|
137
139
|
fees: buildFees(this.resolverFeePreset, this.integratorFeeParams, this.surplusFee)
|
|
138
140
|
};
|
|
@@ -497,6 +497,44 @@ describe('Quoter API', function() {
|
|
|
497
497
|
}
|
|
498
498
|
});
|
|
499
499
|
}));
|
|
500
|
+
describe('source from response', function() {
|
|
501
|
+
it('should store source from response', function() {
|
|
502
|
+
var responseWithSource = _object_spread_props(_object_spread({}, ResponseMock), {
|
|
503
|
+
source: '0xabcdef01'
|
|
504
|
+
});
|
|
505
|
+
var quote = new Quote(params, responseWithSource);
|
|
506
|
+
expect(quote.source).toBe('0xabcdef01');
|
|
507
|
+
});
|
|
508
|
+
it('should be undefined when response has no source', function() {
|
|
509
|
+
var quote = new Quote(params, ResponseMock);
|
|
510
|
+
expect(quote.source).toBeUndefined();
|
|
511
|
+
});
|
|
512
|
+
it('should prefer response source over request source', function() {
|
|
513
|
+
var paramsWithSource = QuoterRequest.new({
|
|
514
|
+
fromTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
515
|
+
toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
516
|
+
amount: '1000000000000000000000',
|
|
517
|
+
walletAddress: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
518
|
+
source: 'user-provided-source'
|
|
519
|
+
});
|
|
520
|
+
var responseWithSource = _object_spread_props(_object_spread({}, ResponseMock), {
|
|
521
|
+
source: '0xabcdef01'
|
|
522
|
+
});
|
|
523
|
+
var quote = new Quote(paramsWithSource, responseWithSource);
|
|
524
|
+
expect(quote.source).toBe('0xabcdef01');
|
|
525
|
+
});
|
|
526
|
+
it('should fall back to request source when response source is absent', function() {
|
|
527
|
+
var paramsWithSource = QuoterRequest.new({
|
|
528
|
+
fromTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
|
529
|
+
toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
530
|
+
amount: '1000000000000000000000',
|
|
531
|
+
walletAddress: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
532
|
+
source: 'user-provided-source'
|
|
533
|
+
});
|
|
534
|
+
var quote = new Quote(paramsWithSource, ResponseMock);
|
|
535
|
+
expect(quote.source).toBeUndefined();
|
|
536
|
+
});
|
|
537
|
+
});
|
|
500
538
|
describe('parseIntegratorFee', function() {
|
|
501
539
|
it('should use response receiver when provided', function() {
|
|
502
540
|
var _quote_integratorFeeParams, _quote_integratorFeeParams1, _quote_integratorFeeParams2;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* In bps
|
|
8
8
|
*/ /**
|
|
9
9
|
* Percentage of the integrator fee that will be shared with the integrator.
|
|
10
|
+
*/ /**
|
|
11
|
+
* Resolved source tracking code
|
|
10
12
|
*/ export var PresetEnum = /*#__PURE__*/ function(PresetEnum) {
|
|
11
13
|
PresetEnum["fast"] = "fast";
|
|
12
14
|
PresetEnum["medium"] = "medium";
|
|
@@ -57,12 +57,15 @@ export var FusionExtension = /*#__PURE__*/ function() {
|
|
|
57
57
|
{
|
|
58
58
|
key: "build",
|
|
59
59
|
value: function build() {
|
|
60
|
-
var _this_extra;
|
|
60
|
+
var _this_extra, _this_extra1;
|
|
61
61
|
var amountData = this.buildAmountGetterData(true);
|
|
62
62
|
var builder = new ExtensionBuilder().withMakingAmountData(this.address, amountData).withTakingAmountData(this.address, amountData).withPostInteraction(new Interaction(this.address, this.buildInteractionData()));
|
|
63
63
|
if ((_this_extra = this.extra) === null || _this_extra === void 0 ? void 0 : _this_extra.makerPermit) {
|
|
64
|
-
var
|
|
65
|
-
builder.withMakerPermit((
|
|
64
|
+
var _this_extra2, _this_extra3;
|
|
65
|
+
builder.withMakerPermit((_this_extra2 = this.extra) === null || _this_extra2 === void 0 ? void 0 : _this_extra2.makerPermit.target, (_this_extra3 = this.extra) === null || _this_extra3 === void 0 ? void 0 : _this_extra3.makerPermit.data);
|
|
66
|
+
}
|
|
67
|
+
if ((_this_extra1 = this.extra) === null || _this_extra1 === void 0 ? void 0 : _this_extra1.preInteraction) {
|
|
68
|
+
builder.withPreInteraction(this.extra.preInteraction);
|
|
66
69
|
}
|
|
67
70
|
return builder.build();
|
|
68
71
|
}
|
|
@@ -213,6 +216,7 @@ export var FusionExtension = /*#__PURE__*/ function() {
|
|
|
213
216
|
}
|
|
214
217
|
//endregion Parse amount data
|
|
215
218
|
var makerPermit = extension.hasMakerPermit ? Interaction.decode(extension.makerPermit) : undefined;
|
|
219
|
+
var preInteraction = extension.hasPreInteraction ? Interaction.decode(extension.preInteraction) : undefined;
|
|
216
220
|
assert(amountData.fees.integratorFee.value === interactionData.fees.integratorFee.value, "invalid extension: integrator fee must be same in interaction data and in amount data");
|
|
217
221
|
assert(amountData.fees.resolverFee.value === interactionData.fees.resolverFee.value, "invalid extension: resolver fee must be same in interaction data and in amount data");
|
|
218
222
|
assert(amountData.fees.whitelistDiscount.equal(interactionData.fees.whitelistDiscount), "invalid extension: whitelistDiscount must be same in interaction data and in amount data");
|
|
@@ -225,6 +229,7 @@ export var FusionExtension = /*#__PURE__*/ function() {
|
|
|
225
229
|
if (!hasFees) {
|
|
226
230
|
return new FusionExtension(settlementContract, auctionDetails, whitelist, surplusParams, {
|
|
227
231
|
makerPermit: makerPermit,
|
|
232
|
+
preInteraction: preInteraction,
|
|
228
233
|
customReceiver: customReceiver,
|
|
229
234
|
fees: undefined
|
|
230
235
|
});
|
|
@@ -232,6 +237,7 @@ export var FusionExtension = /*#__PURE__*/ function() {
|
|
|
232
237
|
var fees = new Fees(new ResolverFee(protocolFeeRecipient, interactionData.fees.resolverFee, interactionData.fees.whitelistDiscount), interactionData.fees.integratorFee.isZero() ? IntegratorFee.ZERO : new IntegratorFee(integratorFeeRecipient, protocolFeeRecipient, interactionData.fees.integratorFee, interactionData.fees.integratorShare));
|
|
233
238
|
return new FusionExtension(settlementContract, auctionDetails, whitelist, surplusParams, {
|
|
234
239
|
makerPermit: makerPermit,
|
|
240
|
+
preInteraction: preInteraction,
|
|
235
241
|
fees: fees,
|
|
236
242
|
customReceiver: customReceiver
|
|
237
243
|
});
|
|
@@ -87,6 +87,7 @@ export var FusionOrder = /*#__PURE__*/ function() {
|
|
|
87
87
|
*/ settlementExtensionContract, orderInfo, auctionDetails, whitelist) {
|
|
88
88
|
var surplusParams = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : SurplusParams.NO_FEE, extra = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : FusionOrder.defaultExtra, extension = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : new FusionExtension(settlementExtensionContract, auctionDetails, whitelist, surplusParams, {
|
|
89
89
|
makerPermit: extra.permit ? new Interaction(orderInfo.makerAsset, extra.permit) : undefined,
|
|
90
|
+
preInteraction: extra.preInteraction ? Interaction.decode(extra.preInteraction) : undefined,
|
|
90
91
|
customReceiver: orderInfo.receiver,
|
|
91
92
|
fees: extra === null || extra === void 0 ? void 0 : extra.fees
|
|
92
93
|
});
|
|
@@ -116,6 +117,9 @@ export var FusionOrder = /*#__PURE__*/ function() {
|
|
|
116
117
|
if (enablePermit2) {
|
|
117
118
|
makerTraits.enablePermit2();
|
|
118
119
|
}
|
|
120
|
+
if (extra.preInteraction) {
|
|
121
|
+
makerTraits.enablePreInteraction();
|
|
122
|
+
}
|
|
119
123
|
if (extra.nonce !== undefined) {
|
|
120
124
|
makerTraits.withNonce(extra.nonce);
|
|
121
125
|
}
|
|
@@ -527,6 +531,7 @@ export var FusionOrder = /*#__PURE__*/ function() {
|
|
|
527
531
|
enablePermit2: makerTraits.isPermit2(),
|
|
528
532
|
nonce: makerTraits.nonceOrEpoch(),
|
|
529
533
|
permit: extension.makerPermit === ZX ? undefined : Interaction.decode(extension.makerPermit).data,
|
|
534
|
+
preInteraction: extension.preInteraction === ZX ? undefined : extension.preInteraction,
|
|
530
535
|
unwrapWETH: makerTraits.isNativeUnwrapEnabled(),
|
|
531
536
|
orderExpirationDelay: orderExpirationDelay,
|
|
532
537
|
fees: extra === null || extra === void 0 ? void 0 : extra.fees,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Bps, MakerTraits, Extension, ProxyFactory } from '@1inch/limit-order-sdk';
|
|
1
|
+
import { Address, Bps, MakerTraits, Extension, Interaction, ProxyFactory } from '@1inch/limit-order-sdk';
|
|
2
2
|
import { parseEther, parseUnits } from 'ethers';
|
|
3
3
|
import { FusionOrder } from './fusion-order.js';
|
|
4
4
|
import { AuctionDetails } from './auction-details/index.js';
|
|
@@ -462,3 +462,134 @@ describe('FusionOrder Native', function() {
|
|
|
462
462
|
expect(nativeOrder.build().receiver).toEqual(settlementExt.toString());
|
|
463
463
|
});
|
|
464
464
|
});
|
|
465
|
+
describe('FusionOrder preInteraction', function() {
|
|
466
|
+
it('should create order with preInteraction and set PRE_INTERACTION_CALL_FLAG in makerTraits', function() {
|
|
467
|
+
var extensionContract = new Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
468
|
+
var preInteraction = new Interaction(new Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1'), '0xdeadbeef01020304');
|
|
469
|
+
var order = FusionOrder.new(extensionContract, {
|
|
470
|
+
makerAsset: new Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
471
|
+
takerAsset: new Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
472
|
+
makingAmount: 1983000000000000n,
|
|
473
|
+
takingAmount: 79052953622246027n,
|
|
474
|
+
maker: new Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
475
|
+
}, {
|
|
476
|
+
auction: new AuctionDetails({
|
|
477
|
+
duration: 180n,
|
|
478
|
+
startTime: 1673548149n,
|
|
479
|
+
initialRateBump: 50000,
|
|
480
|
+
points: [
|
|
481
|
+
{
|
|
482
|
+
coefficient: 20000,
|
|
483
|
+
delay: 12
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
}),
|
|
487
|
+
whitelist: Whitelist.new(1673548139n, [
|
|
488
|
+
{
|
|
489
|
+
address: new Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
490
|
+
allowFrom: 0n
|
|
491
|
+
}
|
|
492
|
+
]),
|
|
493
|
+
surplus: SurplusParams.NO_FEE
|
|
494
|
+
}, {
|
|
495
|
+
preInteraction: preInteraction.encode()
|
|
496
|
+
});
|
|
497
|
+
var makerTraits = new MakerTraits(BigInt(order.build().makerTraits));
|
|
498
|
+
expect(makerTraits.hasPreInteraction()).toBe(true);
|
|
499
|
+
});
|
|
500
|
+
it('should not set PRE_INTERACTION_CALL_FLAG when no preInteraction', function() {
|
|
501
|
+
var extensionContract = new Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
502
|
+
var order = FusionOrder.new(extensionContract, {
|
|
503
|
+
makerAsset: new Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
504
|
+
takerAsset: new Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
505
|
+
makingAmount: 1983000000000000n,
|
|
506
|
+
takingAmount: 79052953622246027n,
|
|
507
|
+
maker: new Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
508
|
+
}, {
|
|
509
|
+
auction: new AuctionDetails({
|
|
510
|
+
duration: 180n,
|
|
511
|
+
startTime: 1673548149n,
|
|
512
|
+
initialRateBump: 50000,
|
|
513
|
+
points: [
|
|
514
|
+
{
|
|
515
|
+
coefficient: 20000,
|
|
516
|
+
delay: 12
|
|
517
|
+
}
|
|
518
|
+
]
|
|
519
|
+
}),
|
|
520
|
+
whitelist: Whitelist.new(1673548139n, [
|
|
521
|
+
{
|
|
522
|
+
address: new Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
523
|
+
allowFrom: 0n
|
|
524
|
+
}
|
|
525
|
+
]),
|
|
526
|
+
surplus: SurplusParams.NO_FEE
|
|
527
|
+
});
|
|
528
|
+
var makerTraits = new MakerTraits(BigInt(order.build().makerTraits));
|
|
529
|
+
expect(makerTraits.hasPreInteraction()).toBe(false);
|
|
530
|
+
});
|
|
531
|
+
it('should round-trip order with preInteraction via fromDataAndExtension', function() {
|
|
532
|
+
var extensionContract = new Address('0x2ad5004c60e16e54d5007c80ce329adde5b51ef5');
|
|
533
|
+
var preInteractionTarget = new Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1');
|
|
534
|
+
var preInteractionCalldata = '0x0599a1fd1975848548e5b765925a935093a96ecc6f2ca216f77dcfd328b8a491';
|
|
535
|
+
var preInteraction = new Interaction(preInteractionTarget, preInteractionCalldata);
|
|
536
|
+
var order = FusionOrder.new(extensionContract, {
|
|
537
|
+
makerAsset: new Address('0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'),
|
|
538
|
+
takerAsset: new Address('0xda7ad9dea9397cffddae2f8a052b82f1484252b3'),
|
|
539
|
+
makingAmount: 1983000000000000n,
|
|
540
|
+
takingAmount: 79052953622246027n,
|
|
541
|
+
maker: new Address('0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1')
|
|
542
|
+
}, {
|
|
543
|
+
auction: new AuctionDetails({
|
|
544
|
+
duration: 180n,
|
|
545
|
+
startTime: 1673548149n,
|
|
546
|
+
initialRateBump: 50000,
|
|
547
|
+
points: [
|
|
548
|
+
{
|
|
549
|
+
coefficient: 20000,
|
|
550
|
+
delay: 12
|
|
551
|
+
}
|
|
552
|
+
]
|
|
553
|
+
}),
|
|
554
|
+
whitelist: Whitelist.new(1673548139n, [
|
|
555
|
+
{
|
|
556
|
+
address: new Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
|
|
557
|
+
allowFrom: 0n
|
|
558
|
+
}
|
|
559
|
+
]),
|
|
560
|
+
surplus: SurplusParams.NO_FEE
|
|
561
|
+
}, {
|
|
562
|
+
preInteraction: preInteraction.encode()
|
|
563
|
+
});
|
|
564
|
+
var built = order.build();
|
|
565
|
+
var extension = order.extension;
|
|
566
|
+
var restored = FusionOrder.fromDataAndExtension({
|
|
567
|
+
salt: built.salt,
|
|
568
|
+
maker: built.maker,
|
|
569
|
+
receiver: built.receiver,
|
|
570
|
+
makerAsset: built.makerAsset,
|
|
571
|
+
takerAsset: built.takerAsset,
|
|
572
|
+
makerTraits: built.makerTraits,
|
|
573
|
+
makingAmount: built.makingAmount,
|
|
574
|
+
takingAmount: built.takingAmount
|
|
575
|
+
}, extension);
|
|
576
|
+
expect(restored.build().salt).toEqual(built.salt);
|
|
577
|
+
expect(restored.extension.encode()).toEqual(extension.encode());
|
|
578
|
+
});
|
|
579
|
+
it('should validate OKX order with preInteraction (real customer data)', function() {
|
|
580
|
+
var extensionHex = '0x000002b800000207000000d2000000d2000000d20000006900000000000000002ad5004c60e16e54d5007c80ce329adde5b51ef50000000000000069c930cb0000b403e4e400000000000064062324dfe7924cb4f3257d000000000000000000006ea9a11ae13b29f5c555d18bd45f0b94f54a968faa848f727be12534f24895770895ad27ad6b0d952ad5004c60e16e54d5007c80ce329adde5b51ef50000000000000069c930cb0000b403e4e400000000000064062324dfe7924cb4f3257d000000000000000000006ea9a11ae13b29f5c555d18bd45f0b94f54a968faa848f727be12534f24895770895ad27ad6b0d953a617c2fbaf8d7c58c793fbbd2d14eb4927876c10100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070b872a96f0000000000000000000000000000000000000000000000000006715eae5b898683d0000000000000000000000000000000000000000000000000000000069c931e800000000000000000000000000000000000000000000000000000000000000410599a1fd1975848548e5b765925a935093a96ecc6f2ca216f77dcfd328b8a4917028648ec3e33d048184f9877d4892fb829ddc5d75a19c1c2ef064d2a38c012b1b000000000000000000000000000000000000000000000000000000000000002ad5004c60e16e54d5007c80ce329adde5b51ef500000000000000000000000000000000000000000090cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000006469c930cb062324dfe7924cb4f3257d000c0000000000000000000000006ea9a11ae13b29f5c5550000d18bd45f0b94f54a968f0000aa848f727be12534f248000095770895ad27ad6b0d950000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00';
|
|
581
|
+
var extension = Extension.decode(extensionHex);
|
|
582
|
+
expect(function() {
|
|
583
|
+
FusionOrder.fromDataAndExtension({
|
|
584
|
+
maker: '0x3a617c2fbaf8d7c58c793fbbd2d14eb4927876c1',
|
|
585
|
+
makerAsset: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
586
|
+
makerTraits: '69656178681823023809491920669288819567982727296017585526061607372909138935808',
|
|
587
|
+
makingAmount: '1983000000000000',
|
|
588
|
+
receiver: '0xb698362cc878094c406115efeeb13089b544e6c8',
|
|
589
|
+
salt: '1084071965642925953405739669729447852001208220133',
|
|
590
|
+
takerAsset: '0xda7ad9dea9397cffddae2f8a052b82f1484252b3',
|
|
591
|
+
takingAmount: '79052953622246027'
|
|
592
|
+
}, extension);
|
|
593
|
+
}).not.toThrow();
|
|
594
|
+
});
|
|
595
|
+
});
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Required if `allowPartialFills` or `allowMultipleFills` is false
|
|
3
3
|
* Max size is 40bit
|
|
4
4
|
*/ /**
|
|
5
|
+
* Encoded pre-interaction: target address (20 bytes) followed by calldata.
|
|
6
|
+
* Format matches `Interaction.encode()`: `0x{target}{calldata}`.
|
|
7
|
+
* When set, the PRE_INTERACTION_CALL_FLAG is enabled in makerTraits
|
|
8
|
+
* and the LOP contract calls IPreInteraction on the target before the swap.
|
|
9
|
+
*/ /**
|
|
5
10
|
* Default is true
|
|
6
11
|
*/ /**
|
|
7
12
|
* Default is true
|
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@1inch/fusion-sdk","version":"2.4.
|
|
1
|
+
{"name":"@1inch/fusion-sdk","version":"2.4.8-rc.1","type":"module"}
|
|
@@ -26,6 +26,7 @@ export declare class Quote {
|
|
|
26
26
|
readonly resolverFeePreset: ResolverFeePreset;
|
|
27
27
|
readonly surplusFee?: number;
|
|
28
28
|
readonly integratorFeeParams?: IntegratorFeeResponse;
|
|
29
|
+
readonly source?: string;
|
|
29
30
|
constructor(params: QuoterRequest, response: QuoterResponse);
|
|
30
31
|
createFusionOrder(paramsData: Omit<FusionOrderParamsData, 'permit' | 'isPermit2'>): FusionOrder;
|
|
31
32
|
getPreset(type?: PresetEnum): Preset;
|
|
@@ -10,12 +10,14 @@ export declare class FusionExtension {
|
|
|
10
10
|
readonly surplus: SurplusParams;
|
|
11
11
|
readonly extra?: {
|
|
12
12
|
makerPermit?: Interaction;
|
|
13
|
+
preInteraction?: Interaction;
|
|
13
14
|
customReceiver?: Address;
|
|
14
15
|
fees?: Fees;
|
|
15
16
|
} | undefined;
|
|
16
17
|
private static CUSTOM_RECEIVER_FLAG_BIT;
|
|
17
18
|
constructor(address: Address, auctionDetails: AuctionDetails, whitelist: Whitelist, surplus: SurplusParams, extra?: {
|
|
18
19
|
makerPermit?: Interaction;
|
|
20
|
+
preInteraction?: Interaction;
|
|
19
21
|
customReceiver?: Address;
|
|
20
22
|
fees?: Fees;
|
|
21
23
|
} | undefined);
|