@1inch/fusion-sdk 2.4.0 → 2.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.
@@ -503,6 +503,7 @@ var FusionOrder = /*#__PURE__*/ function() {
503
503
  optimizeReceiverAddress: false
504
504
  }));
505
505
  _order.inner = _limitordersdk.LimitOrder.fromNative(chainId, ethOrdersFactory, _object_spread_props(_object_spread({}, _orderInfo), {
506
+ receiver: _order.receiver,
506
507
  salt: _order.salt
507
508
  }), _order.inner.makerTraits, _order.inner.extension);
508
509
  return _order;
@@ -400,4 +400,37 @@ describe('FusionOrder Native', function() {
400
400
  expect(nativeOrder.isNative(chainId, ethOrderFactory, nativeOrder.nativeSignature(maker))).toEqual(false);
401
401
  expect(_fusionorder.FusionOrder.fromDataAndExtension(nativeOrder.build(), nativeOrder.extension).isNative(chainId, ethOrderFactory, nativeOrder.nativeSignature(maker))).toEqual(false);
402
402
  });
403
+ it('should have extension address in receiver if surplus passed', function() {
404
+ var ethOrderFactory = new _limitordersdk.ProxyFactory(_limitordersdk.Address.fromBigInt(1n), _limitordersdk.Address.fromBigInt(2n));
405
+ var chainId = _constants.NetworkEnum.ETHEREUM;
406
+ var settlementExt = _limitordersdk.Address.fromBigInt(3n);
407
+ var maker = new _limitordersdk.Address('0x00000000219ab540356cbb839cbe05303d7705fa');
408
+ var nativeOrder = _fusionorder.FusionOrder.fromNative(chainId, ethOrderFactory, settlementExt, {
409
+ takerAsset: new _limitordersdk.Address('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'),
410
+ makingAmount: 1000000000000000000n,
411
+ takingAmount: 1420000000n,
412
+ maker: maker,
413
+ salt: 10n
414
+ }, {
415
+ auction: new _index.AuctionDetails({
416
+ duration: 180n,
417
+ startTime: 1673548149n,
418
+ initialRateBump: 50000,
419
+ points: [
420
+ {
421
+ coefficient: 20000,
422
+ delay: 12
423
+ }
424
+ ]
425
+ }),
426
+ whitelist: _index1.Whitelist.new(1673548139n, [
427
+ {
428
+ address: new _limitordersdk.Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
429
+ allowFrom: 0n
430
+ }
431
+ ]),
432
+ surplus: new _surplusparams.SurplusParams(10n, new _limitordersdk.Bps(10000n))
433
+ });
434
+ expect(nativeOrder.build().receiver).toEqual(settlementExt.toString());
435
+ });
403
436
  });
@@ -488,6 +488,7 @@ export var FusionOrder = /*#__PURE__*/ function() {
488
488
  optimizeReceiverAddress: false
489
489
  }));
490
490
  _order.inner = LimitOrder.fromNative(chainId, ethOrdersFactory, _object_spread_props(_object_spread({}, _orderInfo), {
491
+ receiver: _order.receiver,
491
492
  salt: _order.salt
492
493
  }), _order.inner.makerTraits, _order.inner.extension);
493
494
  return _order;
@@ -396,4 +396,37 @@ describe('FusionOrder Native', function() {
396
396
  expect(nativeOrder.isNative(chainId, ethOrderFactory, nativeOrder.nativeSignature(maker))).toEqual(false);
397
397
  expect(FusionOrder.fromDataAndExtension(nativeOrder.build(), nativeOrder.extension).isNative(chainId, ethOrderFactory, nativeOrder.nativeSignature(maker))).toEqual(false);
398
398
  });
399
+ it('should have extension address in receiver if surplus passed', function() {
400
+ var ethOrderFactory = new ProxyFactory(Address.fromBigInt(1n), Address.fromBigInt(2n));
401
+ var chainId = NetworkEnum.ETHEREUM;
402
+ var settlementExt = Address.fromBigInt(3n);
403
+ var maker = new Address('0x00000000219ab540356cbb839cbe05303d7705fa');
404
+ var nativeOrder = FusionOrder.fromNative(chainId, ethOrderFactory, settlementExt, {
405
+ takerAsset: new Address('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'),
406
+ makingAmount: 1000000000000000000n,
407
+ takingAmount: 1420000000n,
408
+ maker: maker,
409
+ salt: 10n
410
+ }, {
411
+ auction: new AuctionDetails({
412
+ duration: 180n,
413
+ startTime: 1673548149n,
414
+ initialRateBump: 50000,
415
+ points: [
416
+ {
417
+ coefficient: 20000,
418
+ delay: 12
419
+ }
420
+ ]
421
+ }),
422
+ whitelist: Whitelist.new(1673548139n, [
423
+ {
424
+ address: new Address('0x00000000219ab540356cbb839cbe05303d7705fa'),
425
+ allowFrom: 0n
426
+ }
427
+ ]),
428
+ surplus: new SurplusParams(10n, new Bps(10000n))
429
+ });
430
+ expect(nativeOrder.build().receiver).toEqual(settlementExt.toString());
431
+ });
399
432
  });
@@ -1 +1 @@
1
- {"name":"@1inch/fusion-sdk","version":"2.4.0","type":"module"}
1
+ {"name":"@1inch/fusion-sdk","version":"2.4.1","type":"module"}