@velora-dex/sdk 9.5.1 → 9.5.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.
- package/dist/methods/delta/deltaTokenModule.d.ts +0 -1
- package/dist/methods/delta/deltaTokenModule.d.ts.map +1 -1
- package/dist/sdk.cjs.development.js +70 -107
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +70 -107
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/methods/delta/deltaTokenModule.ts +80 -128
|
@@ -3,7 +3,6 @@ import { SignableDeltaOrderData } from './helpers/buildDeltaOrderData';
|
|
|
3
3
|
import type { DeltaAuctionOrder, TWAPDeltaOrder, TWAPBuyDeltaOrder } from './helpers/types';
|
|
4
4
|
export type CancelAndWithdrawDeltaOrderParams = {
|
|
5
5
|
order: DeltaAuctionOrder;
|
|
6
|
-
signature: string;
|
|
7
6
|
/** @description A boolean indicating whether the order is a fillable order. False by default */
|
|
8
7
|
isFillable?: boolean;
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaTokenModule.d.ts","sourceRoot":"","sources":["../../../src/methods/delta/deltaTokenModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"deltaTokenModule.d.ts","sourceRoot":"","sources":["../../../src/methods/delta/deltaTokenModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,MAAM,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: 'order',
|
|
5633
5633
|
type: 'tuple',
|
|
5634
|
-
internalType: 'struct
|
|
5634
|
+
internalType: 'struct Order',
|
|
5635
5635
|
components: [{
|
|
5636
|
-
name: '
|
|
5637
|
-
type: '
|
|
5638
|
-
internalType: '
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
}, {
|
|
5644
|
-
name: 'beneficiary',
|
|
5645
|
-
type: 'address',
|
|
5646
|
-
internalType: 'address'
|
|
5647
|
-
}, {
|
|
5648
|
-
name: 'srcToken',
|
|
5649
|
-
type: 'address',
|
|
5650
|
-
internalType: 'address'
|
|
5651
|
-
}, {
|
|
5652
|
-
name: 'destToken',
|
|
5653
|
-
type: 'address',
|
|
5654
|
-
internalType: 'address'
|
|
5655
|
-
}, {
|
|
5656
|
-
name: 'srcAmount',
|
|
5657
|
-
type: 'uint256',
|
|
5658
|
-
internalType: 'uint256'
|
|
5659
|
-
}, {
|
|
5660
|
-
name: 'destAmount',
|
|
5661
|
-
type: 'uint256',
|
|
5662
|
-
internalType: 'uint256'
|
|
5663
|
-
}, {
|
|
5664
|
-
name: 'expectedAmount',
|
|
5665
|
-
type: 'uint256',
|
|
5666
|
-
internalType: 'uint256'
|
|
5667
|
-
}, {
|
|
5668
|
-
name: 'deadline',
|
|
5669
|
-
type: 'uint256',
|
|
5670
|
-
internalType: 'uint256'
|
|
5671
|
-
}, {
|
|
5672
|
-
name: 'kind',
|
|
5673
|
-
type: 'uint8',
|
|
5674
|
-
internalType: 'enum OrderKind'
|
|
5675
|
-
}, {
|
|
5676
|
-
name: 'nonce',
|
|
5677
|
-
type: 'uint256',
|
|
5678
|
-
internalType: 'uint256'
|
|
5679
|
-
}, {
|
|
5680
|
-
name: 'partnerAndFee',
|
|
5681
|
-
type: 'uint256',
|
|
5682
|
-
internalType: 'uint256'
|
|
5683
|
-
}, {
|
|
5684
|
-
name: 'permit',
|
|
5685
|
-
type: 'bytes',
|
|
5686
|
-
internalType: 'bytes'
|
|
5687
|
-
}, {
|
|
5688
|
-
name: 'metadata',
|
|
5689
|
-
type: 'bytes',
|
|
5690
|
-
internalType: 'bytes'
|
|
5691
|
-
}, {
|
|
5692
|
-
name: 'bridge',
|
|
5693
|
-
type: 'tuple',
|
|
5694
|
-
internalType: 'struct Bridge',
|
|
5695
|
-
components: [{
|
|
5696
|
-
name: 'protocolSelector',
|
|
5697
|
-
type: 'bytes4',
|
|
5698
|
-
internalType: 'bytes4'
|
|
5699
|
-
}, {
|
|
5700
|
-
name: 'destinationChainId',
|
|
5701
|
-
type: 'uint256',
|
|
5702
|
-
internalType: 'uint256'
|
|
5703
|
-
}, {
|
|
5704
|
-
name: 'outputToken',
|
|
5705
|
-
type: 'address',
|
|
5706
|
-
internalType: 'address'
|
|
5707
|
-
}, {
|
|
5708
|
-
name: 'scalingFactor',
|
|
5709
|
-
type: 'int8',
|
|
5710
|
-
internalType: 'int8'
|
|
5711
|
-
}, {
|
|
5712
|
-
name: 'protocolData',
|
|
5713
|
-
type: 'bytes',
|
|
5714
|
-
internalType: 'bytes'
|
|
5715
|
-
}]
|
|
5716
|
-
}]
|
|
5636
|
+
name: 'owner',
|
|
5637
|
+
type: 'address',
|
|
5638
|
+
internalType: 'address'
|
|
5639
|
+
}, {
|
|
5640
|
+
name: 'beneficiary',
|
|
5641
|
+
type: 'address',
|
|
5642
|
+
internalType: 'address'
|
|
5717
5643
|
}, {
|
|
5718
|
-
name: '
|
|
5644
|
+
name: 'srcToken',
|
|
5645
|
+
type: 'address',
|
|
5646
|
+
internalType: 'address'
|
|
5647
|
+
}, {
|
|
5648
|
+
name: 'destToken',
|
|
5649
|
+
type: 'address',
|
|
5650
|
+
internalType: 'address'
|
|
5651
|
+
}, {
|
|
5652
|
+
name: 'srcAmount',
|
|
5653
|
+
type: 'uint256',
|
|
5654
|
+
internalType: 'uint256'
|
|
5655
|
+
}, {
|
|
5656
|
+
name: 'destAmount',
|
|
5657
|
+
type: 'uint256',
|
|
5658
|
+
internalType: 'uint256'
|
|
5659
|
+
}, {
|
|
5660
|
+
name: 'expectedAmount',
|
|
5661
|
+
type: 'uint256',
|
|
5662
|
+
internalType: 'uint256'
|
|
5663
|
+
}, {
|
|
5664
|
+
name: 'deadline',
|
|
5665
|
+
type: 'uint256',
|
|
5666
|
+
internalType: 'uint256'
|
|
5667
|
+
}, {
|
|
5668
|
+
name: 'kind',
|
|
5669
|
+
type: 'uint8',
|
|
5670
|
+
internalType: 'enum OrderKind'
|
|
5671
|
+
}, {
|
|
5672
|
+
name: 'nonce',
|
|
5673
|
+
type: 'uint256',
|
|
5674
|
+
internalType: 'uint256'
|
|
5675
|
+
}, {
|
|
5676
|
+
name: 'partnerAndFee',
|
|
5677
|
+
type: 'uint256',
|
|
5678
|
+
internalType: 'uint256'
|
|
5679
|
+
}, {
|
|
5680
|
+
name: 'permit',
|
|
5681
|
+
type: 'bytes',
|
|
5682
|
+
internalType: 'bytes'
|
|
5683
|
+
}, {
|
|
5684
|
+
name: 'metadata',
|
|
5719
5685
|
type: 'bytes',
|
|
5720
5686
|
internalType: 'bytes'
|
|
5721
5687
|
}, {
|
|
5722
|
-
name: '
|
|
5688
|
+
name: 'bridge',
|
|
5723
5689
|
type: 'tuple',
|
|
5724
|
-
internalType: 'struct
|
|
5690
|
+
internalType: 'struct Bridge',
|
|
5725
5691
|
components: [{
|
|
5726
5692
|
name: 'protocolSelector',
|
|
5727
5693
|
type: 'bytes4',
|
|
5728
5694
|
internalType: 'bytes4'
|
|
5695
|
+
}, {
|
|
5696
|
+
name: 'destinationChainId',
|
|
5697
|
+
type: 'uint256',
|
|
5698
|
+
internalType: 'uint256'
|
|
5699
|
+
}, {
|
|
5700
|
+
name: 'outputToken',
|
|
5701
|
+
type: 'address',
|
|
5702
|
+
internalType: 'address'
|
|
5703
|
+
}, {
|
|
5704
|
+
name: 'scalingFactor',
|
|
5705
|
+
type: 'int8',
|
|
5706
|
+
internalType: 'int8'
|
|
5729
5707
|
}, {
|
|
5730
5708
|
name: 'protocolData',
|
|
5731
5709
|
type: 'bytes',
|
|
5732
5710
|
internalType: 'bytes'
|
|
5733
5711
|
}]
|
|
5734
|
-
}, {
|
|
5735
|
-
name: 'cosignature',
|
|
5736
|
-
type: 'bytes',
|
|
5737
|
-
internalType: 'bytes'
|
|
5738
5712
|
}]
|
|
5739
5713
|
}, {
|
|
5740
5714
|
name: 'isFillable',
|
|
@@ -5948,11 +5922,11 @@ var constructDeltaTokenModule = function constructDeltaTokenModule(options) {
|
|
|
5948
5922
|
getDeltaContract = _constructGetDeltaCon.getDeltaContract;
|
|
5949
5923
|
var cancelAndWithdrawDeltaOrder = /*#__PURE__*/function () {
|
|
5950
5924
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, overrides, requestParams) {
|
|
5951
|
-
var order,
|
|
5925
|
+
var order, _ref$isFillable, isFillable, ParaswapDelta, res;
|
|
5952
5926
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5953
5927
|
while (1) switch (_context.prev = _context.next) {
|
|
5954
5928
|
case 0:
|
|
5955
|
-
order = _ref.order,
|
|
5929
|
+
order = _ref.order, _ref$isFillable = _ref.isFillable, isFillable = _ref$isFillable === void 0 ? false : _ref$isFillable;
|
|
5956
5930
|
if (overrides === void 0) {
|
|
5957
5931
|
overrides = {};
|
|
5958
5932
|
}
|
|
@@ -5966,29 +5940,18 @@ var constructDeltaTokenModule = function constructDeltaTokenModule(options) {
|
|
|
5966
5940
|
}
|
|
5967
5941
|
throw new Error("Delta is not available on chain " + options.chainId);
|
|
5968
5942
|
case 7:
|
|
5969
|
-
|
|
5970
|
-
order: sanitizeDeltaOrderData(order),
|
|
5971
|
-
signature: signature,
|
|
5972
|
-
// bridgeOverride and cosignature are not used by the contract,
|
|
5973
|
-
// can always provide defaults
|
|
5974
|
-
bridgeOverride: {
|
|
5975
|
-
protocolData: DEFAULT_BRIDGE.protocolData,
|
|
5976
|
-
protocolSelector: DEFAULT_BRIDGE.protocolSelector
|
|
5977
|
-
},
|
|
5978
|
-
cosignature: '0x'
|
|
5979
|
-
};
|
|
5980
|
-
_context.next = 10;
|
|
5943
|
+
_context.next = 9;
|
|
5981
5944
|
return options.contractCaller.transactCall({
|
|
5982
5945
|
address: ParaswapDelta,
|
|
5983
5946
|
abi: DeltaTokenModuleAbi,
|
|
5984
5947
|
contractMethod: 'cancelAndWithdraw',
|
|
5985
|
-
args: [
|
|
5948
|
+
args: [sanitizeDeltaOrderData(order), isFillable],
|
|
5986
5949
|
overrides: overrides
|
|
5987
5950
|
});
|
|
5988
|
-
case
|
|
5951
|
+
case 9:
|
|
5989
5952
|
res = _context.sent;
|
|
5990
5953
|
return _context.abrupt("return", res);
|
|
5991
|
-
case
|
|
5954
|
+
case 11:
|
|
5992
5955
|
case "end":
|
|
5993
5956
|
return _context.stop();
|
|
5994
5957
|
}
|