@velora-dex/sdk 9.5.2-dev.0 → 9.5.3-dev.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velora-dex/sdk",
3
- "version": "9.5.2-dev.0",
3
+ "version": "9.5.3-dev.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/sdk.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,11 +13,9 @@ import type {
13
13
  TWAPDeltaOrder,
14
14
  TWAPBuyDeltaOrder,
15
15
  } from './helpers/types';
16
- import { DEFAULT_BRIDGE } from './constants';
17
16
 
18
17
  export type CancelAndWithdrawDeltaOrderParams = {
19
18
  order: DeltaAuctionOrder;
20
- signature: string;
21
19
  /** @description A boolean indicating whether the order is a fillable order. False by default */
22
20
  isFillable?: boolean;
23
21
  };
@@ -91,129 +89,100 @@ const DeltaTokenModuleAbi = [
91
89
  name: 'cancelAndWithdraw',
92
90
  inputs: [
93
91
  {
94
- name: 'orderWithSig',
92
+ name: 'order',
95
93
  type: 'tuple',
96
- internalType: 'struct OrderWithSig',
94
+ internalType: 'struct Order',
97
95
  components: [
98
96
  {
99
- name: 'order',
100
- type: 'tuple',
101
- internalType: 'struct Order',
102
- components: [
103
- {
104
- name: 'owner',
105
- type: 'address',
106
- internalType: 'address',
107
- },
108
- {
109
- name: 'beneficiary',
110
- type: 'address',
111
- internalType: 'address',
112
- },
113
- {
114
- name: 'srcToken',
115
- type: 'address',
116
- internalType: 'address',
117
- },
118
- {
119
- name: 'destToken',
120
- type: 'address',
121
- internalType: 'address',
122
- },
123
- {
124
- name: 'srcAmount',
125
- type: 'uint256',
126
- internalType: 'uint256',
127
- },
128
- {
129
- name: 'destAmount',
130
- type: 'uint256',
131
- internalType: 'uint256',
132
- },
133
- {
134
- name: 'expectedAmount',
135
- type: 'uint256',
136
- internalType: 'uint256',
137
- },
138
- {
139
- name: 'deadline',
140
- type: 'uint256',
141
- internalType: 'uint256',
142
- },
143
- {
144
- name: 'kind',
145
- type: 'uint8',
146
- internalType: 'enum OrderKind',
147
- },
148
- {
149
- name: 'nonce',
150
- type: 'uint256',
151
- internalType: 'uint256',
152
- },
153
- {
154
- name: 'partnerAndFee',
155
- type: 'uint256',
156
- internalType: 'uint256',
157
- },
158
- {
159
- name: 'permit',
160
- type: 'bytes',
161
- internalType: 'bytes',
162
- },
163
- {
164
- name: 'metadata',
165
- type: 'bytes',
166
- internalType: 'bytes',
167
- },
168
- {
169
- name: 'bridge',
170
- type: 'tuple',
171
- internalType: 'struct Bridge',
172
- components: [
173
- {
174
- name: 'protocolSelector',
175
- type: 'bytes4',
176
- internalType: 'bytes4',
177
- },
178
- {
179
- name: 'destinationChainId',
180
- type: 'uint256',
181
- internalType: 'uint256',
182
- },
183
- {
184
- name: 'outputToken',
185
- type: 'address',
186
- internalType: 'address',
187
- },
188
- {
189
- name: 'scalingFactor',
190
- type: 'int8',
191
- internalType: 'int8',
192
- },
193
- {
194
- name: 'protocolData',
195
- type: 'bytes',
196
- internalType: 'bytes',
197
- },
198
- ],
199
- },
200
- ],
97
+ name: 'owner',
98
+ type: 'address',
99
+ internalType: 'address',
100
+ },
101
+ {
102
+ name: 'beneficiary',
103
+ type: 'address',
104
+ internalType: 'address',
105
+ },
106
+ {
107
+ name: 'srcToken',
108
+ type: 'address',
109
+ internalType: 'address',
110
+ },
111
+ {
112
+ name: 'destToken',
113
+ type: 'address',
114
+ internalType: 'address',
115
+ },
116
+ {
117
+ name: 'srcAmount',
118
+ type: 'uint256',
119
+ internalType: 'uint256',
120
+ },
121
+ {
122
+ name: 'destAmount',
123
+ type: 'uint256',
124
+ internalType: 'uint256',
125
+ },
126
+ {
127
+ name: 'expectedAmount',
128
+ type: 'uint256',
129
+ internalType: 'uint256',
130
+ },
131
+ {
132
+ name: 'deadline',
133
+ type: 'uint256',
134
+ internalType: 'uint256',
135
+ },
136
+ {
137
+ name: 'kind',
138
+ type: 'uint8',
139
+ internalType: 'enum OrderKind',
140
+ },
141
+ {
142
+ name: 'nonce',
143
+ type: 'uint256',
144
+ internalType: 'uint256',
145
+ },
146
+ {
147
+ name: 'partnerAndFee',
148
+ type: 'uint256',
149
+ internalType: 'uint256',
150
+ },
151
+ {
152
+ name: 'permit',
153
+ type: 'bytes',
154
+ internalType: 'bytes',
201
155
  },
202
156
  {
203
- name: 'signature',
157
+ name: 'metadata',
204
158
  type: 'bytes',
205
159
  internalType: 'bytes',
206
160
  },
207
161
  {
208
- name: 'bridgeOverride',
162
+ name: 'bridge',
209
163
  type: 'tuple',
210
- internalType: 'struct BridgeOverride',
164
+ internalType: 'struct Bridge',
211
165
  components: [
212
166
  {
213
167
  name: 'protocolSelector',
214
168
  type: 'bytes4',
215
169
  internalType: 'bytes4',
216
170
  },
171
+ {
172
+ name: 'destinationChainId',
173
+ type: 'uint256',
174
+ internalType: 'uint256',
175
+ },
176
+ {
177
+ name: 'outputToken',
178
+ type: 'address',
179
+ internalType: 'address',
180
+ },
181
+ {
182
+ name: 'scalingFactor',
183
+ type: 'int8',
184
+ internalType: 'int8',
185
+ },
217
186
  {
218
187
  name: 'protocolData',
219
188
  type: 'bytes',
@@ -221,11 +190,6 @@ const DeltaTokenModuleAbi = [
221
190
  },
222
191
  ],
223
192
  },
224
- {
225
- name: 'cosignature',
226
- type: 'bytes',
227
- internalType: 'bytes',
228
- },
229
193
  ],
230
194
  },
231
195
  {
@@ -447,7 +411,7 @@ export const constructDeltaTokenModule = <T>(
447
411
  const { getDeltaContract } = constructGetDeltaContract(options);
448
412
 
449
413
  const cancelAndWithdrawDeltaOrder: CancelAndWithdrawDeltaOrder<T> = async (
450
- { order, signature, isFillable = false },
414
+ { order, isFillable = false },
451
415
  overrides = {},
452
416
  requestParams
453
417
  ) => {
@@ -456,23 +420,11 @@ export const constructDeltaTokenModule = <T>(
456
420
  throw new Error(`Delta is not available on chain ${options.chainId}`);
457
421
  }
458
422
 
459
- const orderWithSig = {
460
- order: sanitizeDeltaOrderData(order),
461
- signature,
462
- // bridgeOverride and cosignature are not used by the contract,
463
- // can always provide defaults
464
- bridgeOverride: {
465
- protocolData: DEFAULT_BRIDGE.protocolData,
466
- protocolSelector: DEFAULT_BRIDGE.protocolSelector,
467
- },
468
- cosignature: '0x',
469
- };
470
-
471
423
  const res = await options.contractCaller.transactCall<AvailableMethods>({
472
424
  address: ParaswapDelta,
473
425
  abi: DeltaTokenModuleAbi,
474
426
  contractMethod: 'cancelAndWithdraw',
475
- args: [orderWithSig, isFillable],
427
+ args: [sanitizeDeltaOrderData(order), isFillable],
476
428
  overrides,
477
429
  });
478
430