@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
package/package.json
CHANGED
|
@@ -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: '
|
|
92
|
+
name: 'order',
|
|
95
93
|
type: 'tuple',
|
|
96
|
-
internalType: 'struct
|
|
94
|
+
internalType: 'struct Order',
|
|
97
95
|
components: [
|
|
98
96
|
{
|
|
99
|
-
name: '
|
|
100
|
-
type: '
|
|
101
|
-
internalType: '
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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: '
|
|
157
|
+
name: 'metadata',
|
|
204
158
|
type: 'bytes',
|
|
205
159
|
internalType: 'bytes',
|
|
206
160
|
},
|
|
207
161
|
{
|
|
208
|
-
name: '
|
|
162
|
+
name: 'bridge',
|
|
209
163
|
type: 'tuple',
|
|
210
|
-
internalType: 'struct
|
|
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,
|
|
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: [
|
|
427
|
+
args: [sanitizeDeltaOrderData(order), isFillable],
|
|
476
428
|
overrides,
|
|
477
429
|
});
|
|
478
430
|
|