@orbs-network/spot-react 2.1.21 → 2.1.23
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/README.md +6 -2
- package/dist/spot-react/src/context/create-spot-store.d.ts +2 -2
- package/dist/spot-react/src/context/create-spot-store.d.ts.map +1 -1
- package/dist/spot-react/src/hooks/use-execution.d.ts +2 -0
- package/dist/spot-react/src/hooks/use-execution.d.ts.map +1 -1
- package/dist/spot-react/src/hooks/use-swap-execution.d.ts.map +1 -1
- package/dist/spot-react.js +431 -428
- package/dist/spot-react.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/spot-react.js
CHANGED
|
@@ -3,17 +3,17 @@ var qe = Object.defineProperty;
|
|
|
3
3
|
var be = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var oe = (e, t, n) => be(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
5
|
import { OrderSettlementError as we, SpotError as ve, OrderStatus as M, Module as Q, createClient as We, analytics as je, calculateOrder as Ve, isNativeAddress as $, eqIgnoreCase as he, toAmountRaw as k, toAmountUI as ne, isTxRejected as Ce, getOrderLimitPriceRate as Qe, getTriggerPriceRate as Je, getOrderExecutionRate as Ae, getOrderFillDelayMillis as ze, getTwapConfig as $e, invertPriceInput as Ee, watchOrder as Ye, executeOrder as Xe, getOrders as Ze, setUIVersion as ke } from "@orbs-network/spot-ui";
|
|
6
|
-
import { DISCLAIMER_URL as wr, InputErrors as vr, Module as Cr, ORBS_LOGO as Ar, ORBS_SLTP_FAQ_URL as Tr, ORBS_TWAP_FAQ_URL as Rr, ORBS_WEBSITE_URL as Nr, OrderFilter as Lr, OrderSettlementError as
|
|
7
|
-
import { jsx as D, jsxs as
|
|
8
|
-
import { createContext as de, useContext as ue, useState as tt, useCallback as
|
|
6
|
+
import { DISCLAIMER_URL as wr, InputErrors as vr, Module as Cr, ORBS_LOGO as Ar, ORBS_SLTP_FAQ_URL as Tr, ORBS_TWAP_FAQ_URL as Rr, ORBS_WEBSITE_URL as Nr, OrderFilter as Lr, OrderSettlementError as xr, OrderStatus as Fr, OrderType as Ur, Partners as Dr, QuoteError as Mr, SWAP_CAPABILITIES as Gr, SpotError as Br, TimeUnit as Kr, analytics as _r, calculateOrder as Hr, calculateOrderForm as qr, createClient as br, eqIgnoreCase as Wr, executeOrder as jr, getOrderExecutionRate as Vr, getOrderFillDelayMillis as Qr, getOrderLimitPriceRate as Jr, getOrders as zr, getQuote as $r, getTriggerPriceRate as Yr, getTwapConfig as Xr, invertPriceInput as Zr, isNativeAddress as kr, isQuoteFresh as en, isSwapSupported as tn, isTxRejected as rn, setUIVersion as nn, submitSwap as on, toAmountRaw as sn, toAmountUI as cn, waitForOrder as an, watchOrder as dn } from "@orbs-network/spot-ui";
|
|
7
|
+
import { jsx as D, jsxs as ae, Fragment as et } from "react/jsx-runtime";
|
|
8
|
+
import { createContext as de, useContext as ue, useState as tt, useCallback as v, useMemo as R, useEffect as Y, Component as rt, useRef as le } from "react";
|
|
9
9
|
import { useStore as nt } from "zustand";
|
|
10
10
|
import { createStore as it } from "zustand/vanilla";
|
|
11
|
-
const ot = "2.1.
|
|
11
|
+
const ot = "2.1.23", st = {
|
|
12
12
|
version: ot
|
|
13
|
-
}, Te = de(null),
|
|
13
|
+
}, Te = de(null), ct = ({
|
|
14
14
|
children: e,
|
|
15
15
|
value: t
|
|
16
|
-
}) => /* @__PURE__ */ D(Te.Provider, { value: t, children: e }),
|
|
16
|
+
}) => /* @__PURE__ */ D(Te.Provider, { value: t, children: e }), x = () => {
|
|
17
17
|
const e = ue(Te);
|
|
18
18
|
if (e === null)
|
|
19
19
|
throw new Error("useSpotTrading must be used within SpotProvider");
|
|
@@ -57,7 +57,7 @@ const me = (e) => {
|
|
|
57
57
|
message: i || "Unknown error",
|
|
58
58
|
code: Re(e) || (Number.isFinite(r) ? r : 0)
|
|
59
59
|
};
|
|
60
|
-
},
|
|
60
|
+
}, at = /* @__PURE__ */ new Set([
|
|
61
61
|
d.PREPARING,
|
|
62
62
|
d.WRAPPING,
|
|
63
63
|
d.APPROVING,
|
|
@@ -117,7 +117,7 @@ const me = (e) => {
|
|
|
117
117
|
}, re = (e) => ({
|
|
118
118
|
phase: d.IDLE,
|
|
119
119
|
completedWrap: e
|
|
120
|
-
}), ie = (e) =>
|
|
120
|
+
}), ie = (e) => at.has(e), Z = (e) => ie(e) || e === d.UNCONFIRMED, Le = (e) => e === d.IDLE || e === d.FAILED || e === d.REJECTED, xe = (e, t) => t === d.SETTLING ? !(e instanceof we && (e.reason === "cancelled" || e.reason === "expired")) : !(t !== d.SUBMITTING || e instanceof ve && e.code === "SUBMISSION_FAILED" && e.status !== void 0 && e.status < 500 && e.status !== 408 && !e.cause), ut = (e, t) => dt[e].has(t), lt = (e) => {
|
|
121
121
|
if (ie(e)) return q.LOADING;
|
|
122
122
|
if (e === d.SUCCESS) return q.SUCCESS;
|
|
123
123
|
if (e === d.FAILED || e === d.REJECTED || e === d.UNCONFIRMED)
|
|
@@ -151,8 +151,8 @@ const me = (e) => {
|
|
|
151
151
|
} catch {
|
|
152
152
|
return !1;
|
|
153
153
|
}
|
|
154
|
-
}, ht = 2e4,
|
|
155
|
-
const t =
|
|
154
|
+
}, ht = 2e4, Ie = /* @__PURE__ */ new WeakMap(), Se = (e) => {
|
|
155
|
+
const t = Ie.get(e);
|
|
156
156
|
if (t) return t;
|
|
157
157
|
const n = {
|
|
158
158
|
all: [...e].sort((r, i) => i.createdAt - r.createdAt),
|
|
@@ -176,37 +176,37 @@ const me = (e) => {
|
|
|
176
176
|
n.expired.push(r);
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return Ie.set(e, n), n;
|
|
180
180
|
}, Et = (e, t) => {
|
|
181
181
|
const n = new Set(e.map((i) => i.historyKey)), r = (t == null ? void 0 : t.filter(
|
|
182
182
|
(i) => i.version === 1 && !n.has(i.historyKey)
|
|
183
183
|
)) ?? [];
|
|
184
184
|
return [...e, ...r];
|
|
185
|
-
},
|
|
185
|
+
}, It = (e, t) => {
|
|
186
186
|
if (!e) return t;
|
|
187
187
|
const n = new Map(e.map((o) => [o.historyKey, o])), r = new Set(t.map((o) => o.historyKey));
|
|
188
188
|
return [...t.map((o) => {
|
|
189
189
|
const s = n.get(o.historyKey);
|
|
190
190
|
return s && (s.status === M.Completed && o.status !== M.Completed || s.status !== M.Open && o.status === M.Open) ? s : o;
|
|
191
191
|
}), ...e.filter((o) => !r.has(o.historyKey))];
|
|
192
|
-
},
|
|
192
|
+
}, St = (e, t, n, r, i) => {
|
|
193
193
|
const o = r ?? /* @__PURE__ */ new Set(), s = (m) => o.has(m.historyKey) ? !1 : (o.add(m.historyKey), w(() => {
|
|
194
194
|
var E;
|
|
195
195
|
return (E = n == null ? void 0 : n.onOrderFilled) == null ? void 0 : E.call(n, m);
|
|
196
|
-
}), !0),
|
|
196
|
+
}), !0), a = new Map(
|
|
197
197
|
t.map((m) => [m.historyKey, m])
|
|
198
|
-
),
|
|
198
|
+
), c = [];
|
|
199
199
|
for (const m of e ?? []) {
|
|
200
200
|
if (m.version !== 2) continue;
|
|
201
|
-
const E =
|
|
202
|
-
!E || E.progress === m.progress && E.status === m.status || (
|
|
201
|
+
const E = a.get(m.historyKey);
|
|
202
|
+
!E || E.progress === m.progress && E.status === m.status || (c.push(E), E.status === M.Completed && m.status !== M.Completed && s(E));
|
|
203
203
|
}
|
|
204
|
-
(i == null ? void 0 : i.status) === M.Completed && s(i) && !
|
|
204
|
+
(i == null ? void 0 : i.status) === M.Completed && s(i) && !c.some((m) => m.historyKey === i.historyKey) && c.push(i);
|
|
205
205
|
for (const m of t)
|
|
206
206
|
m.status === M.Completed && o.add(m.historyKey);
|
|
207
|
-
|
|
207
|
+
c.length > 0 && w(() => {
|
|
208
208
|
var m;
|
|
209
|
-
return (m = n == null ? void 0 : n.onOrdersProgressUpdate) == null ? void 0 : m.call(n,
|
|
209
|
+
return (m = n == null ? void 0 : n.onOrdersProgressUpdate) == null ? void 0 : m.call(n, c);
|
|
210
210
|
});
|
|
211
211
|
}, Oe = (e) => {
|
|
212
212
|
if (e === null || typeof e != "object") return !1;
|
|
@@ -225,8 +225,8 @@ const me = (e) => {
|
|
|
225
225
|
let o = n.length === r.length;
|
|
226
226
|
for (const s of r) {
|
|
227
227
|
Object.prototype.hasOwnProperty.call(e, s) || (o = !1);
|
|
228
|
-
const
|
|
229
|
-
i[s] =
|
|
228
|
+
const a = se(e[s], t[s]);
|
|
229
|
+
i[s] = a, a !== e[s] && (o = !1);
|
|
230
230
|
}
|
|
231
231
|
return o ? e : i;
|
|
232
232
|
}
|
|
@@ -249,7 +249,7 @@ const me = (e) => {
|
|
|
249
249
|
orders: r && !s.legacyLoaded ? Et(s.orders, i) : s.orders,
|
|
250
250
|
legacyLoaded: o || s.legacyLoaded
|
|
251
251
|
};
|
|
252
|
-
},
|
|
252
|
+
}, ce = (e) => ({
|
|
253
253
|
tradeCount: e.tradeCount,
|
|
254
254
|
tradeInterval: e.tradeInterval,
|
|
255
255
|
orderDuration: e.orderDuration,
|
|
@@ -260,79 +260,79 @@ const me = (e) => {
|
|
|
260
260
|
isMarketOrder: e.isMarketOrder,
|
|
261
261
|
isPriceInverted: void 0
|
|
262
262
|
}), pt = (e) => ({
|
|
263
|
-
...
|
|
263
|
+
...ce(e),
|
|
264
264
|
cancelOrders: {},
|
|
265
265
|
currentExecution: re()
|
|
266
266
|
}), Pe = { isFetching: !1 }, pe = { isFetching: !1 }, yt = (e) => new Promise((t) => setTimeout(t, e)), wt = (e) => {
|
|
267
|
-
let t = 0, n, r, i = 0, o, s,
|
|
267
|
+
let t = 0, n, r, i = 0, o, s, a, c;
|
|
268
268
|
const m = /* @__PURE__ */ new Set();
|
|
269
|
-
let E = !1, u = 0,
|
|
270
|
-
return it((
|
|
271
|
-
const j = (
|
|
272
|
-
const y = s,
|
|
273
|
-
return
|
|
269
|
+
let E = !1, u = 0, I = 0, g, P, p;
|
|
270
|
+
return it((O, T) => {
|
|
271
|
+
const j = (h, l = c, S = T().orders.isFetching, N) => {
|
|
272
|
+
const y = s, C = T().orders.data, f = Ot(C, It(C, h));
|
|
273
|
+
return O((L) => ({ orders: { ...L.orders, data: f, isFetching: S } })), s === y && St(C, f, l, m, N), f;
|
|
274
274
|
}, V = async () => {
|
|
275
275
|
if (!n || !r) return;
|
|
276
276
|
if (o) return o;
|
|
277
|
-
const
|
|
278
|
-
|
|
277
|
+
const h = ++i, l = r;
|
|
278
|
+
O((N) => ({
|
|
279
279
|
client: {
|
|
280
280
|
key: n,
|
|
281
|
-
data:
|
|
281
|
+
data: N.client.data,
|
|
282
282
|
error: void 0,
|
|
283
283
|
isFetching: !0
|
|
284
284
|
}
|
|
285
285
|
}));
|
|
286
|
-
const
|
|
287
|
-
let
|
|
286
|
+
const S = (async () => {
|
|
287
|
+
let N;
|
|
288
288
|
for (let y = 0; y < 3; y++) {
|
|
289
|
-
if (
|
|
289
|
+
if (h !== i) return;
|
|
290
290
|
try {
|
|
291
|
-
const
|
|
292
|
-
return
|
|
293
|
-
client: { key: n, data:
|
|
294
|
-
}),
|
|
295
|
-
} catch (
|
|
296
|
-
if (
|
|
291
|
+
const C = await l();
|
|
292
|
+
return h !== i ? void 0 : (O({
|
|
293
|
+
client: { key: n, data: C, isFetching: !1 }
|
|
294
|
+
}), C);
|
|
295
|
+
} catch (C) {
|
|
296
|
+
if (N = C instanceof Error ? C : new Error(String(C)), h !== i) return;
|
|
297
297
|
y < 2 && await yt(2 ** y * 1e3);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
client: { key: n, error:
|
|
300
|
+
h === i && O({
|
|
301
|
+
client: { key: n, error: N, isFetching: !1 }
|
|
302
302
|
});
|
|
303
303
|
})();
|
|
304
|
-
return o =
|
|
305
|
-
o ===
|
|
306
|
-
}),
|
|
307
|
-
}, F = async (
|
|
308
|
-
if (!
|
|
304
|
+
return o = S, S.finally(() => {
|
|
305
|
+
o === S && (o = void 0);
|
|
306
|
+
}), S;
|
|
307
|
+
}, F = async (h = !1, l = !1) => {
|
|
308
|
+
if (!h && u === 0 || !s || !a)
|
|
309
309
|
return T().orders.data;
|
|
310
|
-
if (
|
|
311
|
-
if (!l) return
|
|
312
|
-
const
|
|
313
|
-
return await
|
|
310
|
+
if (g) {
|
|
311
|
+
if (!l) return g;
|
|
312
|
+
const L = s;
|
|
313
|
+
return await g, s !== L ? void 0 : F(h, l);
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
|
|
315
|
+
const S = ++I, N = a, y = T().orders.data, C = new AbortController();
|
|
316
|
+
P = C, O((L) => ({
|
|
317
317
|
orders: {
|
|
318
318
|
key: s,
|
|
319
|
-
data:
|
|
319
|
+
data: L.orders.data,
|
|
320
320
|
error: void 0,
|
|
321
321
|
isFetching: !0
|
|
322
322
|
}
|
|
323
323
|
}));
|
|
324
|
-
const f =
|
|
324
|
+
const f = N(
|
|
325
325
|
y,
|
|
326
326
|
l ? !1 : E,
|
|
327
|
-
|
|
328
|
-
).then(({ orders:
|
|
329
|
-
if (
|
|
330
|
-
return E = _, j(
|
|
331
|
-
}).catch((
|
|
332
|
-
if (
|
|
327
|
+
C.signal
|
|
328
|
+
).then(({ orders: L, legacyLoaded: _ }) => {
|
|
329
|
+
if (S === I)
|
|
330
|
+
return E = _, j(L, c, !1);
|
|
331
|
+
}).catch((L) => {
|
|
332
|
+
if (S !== I || C.signal.aborted)
|
|
333
333
|
return;
|
|
334
|
-
const _ =
|
|
335
|
-
|
|
334
|
+
const _ = L instanceof Error ? L : new Error(String(L));
|
|
335
|
+
O((U) => ({
|
|
336
336
|
orders: {
|
|
337
337
|
key: s,
|
|
338
338
|
data: U.orders.data,
|
|
@@ -341,17 +341,17 @@ const me = (e) => {
|
|
|
341
341
|
}
|
|
342
342
|
}));
|
|
343
343
|
});
|
|
344
|
-
return
|
|
345
|
-
|
|
344
|
+
return g = f, f.finally(() => {
|
|
345
|
+
g === f && (g = void 0), P === C && (P = void 0);
|
|
346
346
|
}), f;
|
|
347
347
|
}, B = () => {
|
|
348
348
|
F();
|
|
349
349
|
}, G = () => {
|
|
350
|
-
p && (clearInterval(p), p = void 0), typeof window < "u" && window.removeEventListener("focus", B),
|
|
351
|
-
orders: { ...
|
|
350
|
+
p && (clearInterval(p), p = void 0), typeof window < "u" && window.removeEventListener("focus", B), P == null || P.abort(), P = void 0, g = void 0, I++, O((h) => ({
|
|
351
|
+
orders: { ...h.orders, isFetching: !1 }
|
|
352
352
|
}));
|
|
353
353
|
}, K = () => {
|
|
354
|
-
!s || !
|
|
354
|
+
!s || !a || p || (F(!0), p = setInterval(() => {
|
|
355
355
|
F();
|
|
356
356
|
}, ht), typeof window < "u" && window.addEventListener("focus", B));
|
|
357
357
|
};
|
|
@@ -359,114 +359,114 @@ const me = (e) => {
|
|
|
359
359
|
client: Pe,
|
|
360
360
|
orders: pe,
|
|
361
361
|
state: pt(e),
|
|
362
|
-
configureClient: (
|
|
363
|
-
if (n ===
|
|
362
|
+
configureClient: (h, l) => {
|
|
363
|
+
if (n === h) {
|
|
364
364
|
r = l;
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
n =
|
|
368
|
-
client:
|
|
369
|
-
}),
|
|
367
|
+
n = h, r = l, i++, o = void 0, O({
|
|
368
|
+
client: h ? { key: h, isFetching: !1 } : Pe
|
|
369
|
+
}), h && l && V();
|
|
370
370
|
},
|
|
371
371
|
refetchClient: V,
|
|
372
|
-
configureOrders: (
|
|
373
|
-
if (
|
|
374
|
-
|
|
372
|
+
configureOrders: (h, l, S) => {
|
|
373
|
+
if (c = S, s === h) {
|
|
374
|
+
a = l;
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
|
-
G(), s =
|
|
378
|
-
orders:
|
|
377
|
+
G(), s = h, a = l, E = !1, m.clear(), O({
|
|
378
|
+
orders: h ? { key: h, isFetching: !1 } : pe
|
|
379
379
|
}), u > 0 && K();
|
|
380
380
|
},
|
|
381
381
|
registerOrdersConsumer: () => (u++, u === 1 && K(), () => {
|
|
382
382
|
u = Math.max(0, u - 1), u === 0 && G();
|
|
383
383
|
}),
|
|
384
384
|
refetchOrders: F,
|
|
385
|
-
addOrder: (
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
return
|
|
389
|
-
(
|
|
385
|
+
addOrder: (h) => {
|
|
386
|
+
O((l) => {
|
|
387
|
+
const S = l.orders.data;
|
|
388
|
+
return S != null && S.some(
|
|
389
|
+
(N) => N.historyKey === h.historyKey
|
|
390
390
|
) ? l : {
|
|
391
391
|
orders: {
|
|
392
392
|
...l.orders,
|
|
393
|
-
data: [
|
|
393
|
+
data: [h, ...S ?? []]
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
396
|
});
|
|
397
397
|
},
|
|
398
|
-
updateOrder: (
|
|
399
|
-
const
|
|
400
|
-
j(
|
|
398
|
+
updateOrder: (h, l) => {
|
|
399
|
+
const S = T().orders.data ?? [], N = S.some((y) => y.historyKey === h.historyKey);
|
|
400
|
+
j(N ? S.map((y) => y.historyKey === h.historyKey ? h : y) : [h, ...S], c ?? l, T().orders.isFetching, h);
|
|
401
401
|
},
|
|
402
|
-
setCancelOrder: (
|
|
403
|
-
|
|
402
|
+
setCancelOrder: (h, l) => {
|
|
403
|
+
O((S) => ({
|
|
404
404
|
state: {
|
|
405
|
-
...
|
|
406
|
-
cancelOrders: { ...
|
|
405
|
+
...S.state,
|
|
406
|
+
cancelOrders: { ...S.state.cancelOrders, [h]: l }
|
|
407
407
|
}
|
|
408
408
|
}));
|
|
409
409
|
},
|
|
410
|
-
clearCancelOrder: (
|
|
411
|
-
|
|
412
|
-
if (!(
|
|
413
|
-
const
|
|
414
|
-
return delete
|
|
410
|
+
clearCancelOrder: (h) => {
|
|
411
|
+
O((l) => {
|
|
412
|
+
if (!(h in l.state.cancelOrders)) return l;
|
|
413
|
+
const S = { ...l.state.cancelOrders };
|
|
414
|
+
return delete S[h], { state: { ...l.state, cancelOrders: S } };
|
|
415
415
|
});
|
|
416
416
|
},
|
|
417
|
-
updateState: (
|
|
418
|
-
beginExecution: (
|
|
417
|
+
updateState: (h) => O((l) => ({ state: { ...l.state, ...h } })),
|
|
418
|
+
beginExecution: (h) => {
|
|
419
419
|
let l;
|
|
420
|
-
return
|
|
421
|
-
...
|
|
420
|
+
return O((S) => Le(S.state.currentExecution.phase) ? (l = {
|
|
421
|
+
...h,
|
|
422
422
|
executionId: ++t,
|
|
423
423
|
phase: d.PREPARING
|
|
424
424
|
}, {
|
|
425
425
|
state: {
|
|
426
|
-
...
|
|
426
|
+
...S.state,
|
|
427
427
|
currentExecution: l
|
|
428
428
|
}
|
|
429
|
-
}) :
|
|
429
|
+
}) : S), l;
|
|
430
430
|
},
|
|
431
|
-
replaceExecution: (
|
|
432
|
-
let
|
|
433
|
-
return
|
|
434
|
-
const y =
|
|
435
|
-
return y.executionId !==
|
|
436
|
-
state: { ...
|
|
431
|
+
replaceExecution: (h, l) => {
|
|
432
|
+
let S = !1;
|
|
433
|
+
return O((N) => {
|
|
434
|
+
const y = N.state.currentExecution;
|
|
435
|
+
return y.executionId !== h || l.executionId !== h || !ut(y.phase, l.phase) ? N : (S = !0, {
|
|
436
|
+
state: { ...N.state, currentExecution: l }
|
|
437
437
|
});
|
|
438
|
-
}),
|
|
438
|
+
}), S;
|
|
439
439
|
},
|
|
440
|
-
returnToOrderForm: () => {
|
|
441
|
-
const
|
|
442
|
-
return Z(
|
|
440
|
+
returnToOrderForm: (h) => {
|
|
441
|
+
const l = T().state.currentExecution;
|
|
442
|
+
return l.executionId !== h || Z(l.phase) || l.phase === d.SUCCESS ? !1 : (O((S) => ({
|
|
443
443
|
state: {
|
|
444
|
-
...
|
|
445
|
-
currentExecution: re(
|
|
444
|
+
...S.state,
|
|
445
|
+
currentExecution: re(l.completedWrap)
|
|
446
446
|
}
|
|
447
447
|
})), !0);
|
|
448
448
|
},
|
|
449
|
-
syncFormDefaults: (
|
|
449
|
+
syncFormDefaults: (h) => Z(T().state.currentExecution.phase) ? !1 : (O((l) => ({
|
|
450
450
|
state: {
|
|
451
451
|
...l.state,
|
|
452
|
-
...
|
|
452
|
+
...ce(h),
|
|
453
453
|
currentExecution: re()
|
|
454
454
|
}
|
|
455
455
|
})), !0),
|
|
456
|
-
startNewOrder: (
|
|
457
|
-
const { state:
|
|
458
|
-
return Z(
|
|
456
|
+
startNewOrder: (h, l) => {
|
|
457
|
+
const { state: S } = T();
|
|
458
|
+
return S.currentExecution.executionId !== l || Z(S.currentExecution.phase) ? !1 : (O((N) => ({
|
|
459
459
|
state: {
|
|
460
|
-
...
|
|
461
|
-
...
|
|
462
|
-
isMarketOrder:
|
|
460
|
+
...N.state,
|
|
461
|
+
...ce(h),
|
|
462
|
+
isMarketOrder: S.isMarketOrder,
|
|
463
463
|
currentExecution: re()
|
|
464
464
|
}
|
|
465
465
|
})), !0);
|
|
466
466
|
}
|
|
467
467
|
};
|
|
468
468
|
});
|
|
469
|
-
},
|
|
469
|
+
}, Fe = (e) => {
|
|
470
470
|
var n;
|
|
471
471
|
const t = (n = e.overrides) == null ? void 0 : n.state;
|
|
472
472
|
return {
|
|
@@ -494,27 +494,27 @@ const me = (e) => {
|
|
|
494
494
|
const t = b();
|
|
495
495
|
return nt(t, e);
|
|
496
496
|
}, Ct = { isFetching: !1 }, At = () => {
|
|
497
|
-
const { partner: e, chainId: t, hasChainId: n } =
|
|
497
|
+
const { partner: e, chainId: t, hasChainId: n } = x(), r = b(), i = !!(t && n), o = i ? `${e}:${t}` : void 0, s = v(() => t ? We(e, t) : Promise.reject(
|
|
498
498
|
new Error("Spot is unavailable on the connected chain")
|
|
499
499
|
), [t, e]);
|
|
500
500
|
Y(() => {
|
|
501
501
|
r.getState().configureClient(o, i ? s : void 0);
|
|
502
502
|
}, [i, o, s, r]);
|
|
503
503
|
}, J = () => {
|
|
504
|
-
const { partner: e, chainId: t, hasChainId: n } =
|
|
504
|
+
const { partner: e, chainId: t, hasChainId: n } = x(), r = b(), i = A((m) => m.client), o = !!(t && n), s = o ? `${e}:${t}` : void 0, a = i.key === s ? i : Ct, c = v(() => {
|
|
505
505
|
if (!o || !s) return Promise.resolve(void 0);
|
|
506
506
|
const m = r.getState();
|
|
507
507
|
return m.client.key !== s ? Promise.resolve(void 0) : m.refetchClient();
|
|
508
508
|
}, [o, s, r]);
|
|
509
509
|
return R(
|
|
510
510
|
() => ({
|
|
511
|
-
data:
|
|
512
|
-
error:
|
|
513
|
-
isLoading: o && !
|
|
514
|
-
isFetching:
|
|
515
|
-
refetch:
|
|
511
|
+
data: a.data,
|
|
512
|
+
error: a.error,
|
|
513
|
+
isLoading: o && !a.data && a.error === void 0,
|
|
514
|
+
isFetching: a.isFetching,
|
|
515
|
+
refetch: c
|
|
516
516
|
}),
|
|
517
|
-
[
|
|
517
|
+
[a, o, c]
|
|
518
518
|
);
|
|
519
519
|
}, Tt = { isFetching: !1 }, fe = (e, t, n) => e && t ? JSON.stringify([
|
|
520
520
|
e,
|
|
@@ -523,26 +523,26 @@ const me = (e) => {
|
|
|
523
523
|
t.chainId,
|
|
524
524
|
n
|
|
525
525
|
]) : void 0, Rt = () => {
|
|
526
|
-
const { account: e, supportLegacyOrders: t, callbacks: n } =
|
|
527
|
-
async (
|
|
526
|
+
const { account: e, supportLegacyOrders: t, callbacks: n } = x(), { data: r } = J(), i = b(), o = fe(e, r, t), s = !!o, a = v(
|
|
527
|
+
async (c, m, E) => !e || !r ? { orders: [], legacyLoaded: !1 } : Pt({
|
|
528
528
|
client: r,
|
|
529
529
|
account: e,
|
|
530
530
|
signal: E,
|
|
531
531
|
supportLegacyOrders: t,
|
|
532
|
-
previousOrders:
|
|
532
|
+
previousOrders: c,
|
|
533
533
|
legacyLoaded: m
|
|
534
534
|
}),
|
|
535
535
|
[e, r, t]
|
|
536
536
|
);
|
|
537
537
|
Y(() => {
|
|
538
|
-
i.getState().configureOrders(o, s ?
|
|
539
|
-
}, [n, s, o,
|
|
538
|
+
i.getState().configureOrders(o, s ? a : void 0, n);
|
|
539
|
+
}, [n, s, o, a, i]);
|
|
540
540
|
}, De = () => {
|
|
541
|
-
const { account: e, supportLegacyOrders: t } =
|
|
541
|
+
const { account: e, supportLegacyOrders: t } = x(), { data: n } = J(), r = b(), i = fe(e, n, t), o = !!i, s = v((a = !1) => !o || !i || r.getState().orders.key !== i ? Promise.resolve(void 0) : r.getState().refetchOrders(!0, a), [o, i, r]);
|
|
542
542
|
return { enabled: o, key: i, refetch: s };
|
|
543
543
|
}, Nt = () => {
|
|
544
|
-
const e = b(), { account: t, supportLegacyOrders: n } =
|
|
545
|
-
return
|
|
544
|
+
const e = b(), { account: t, supportLegacyOrders: n } = x(), { data: r } = J(), i = fe(t, r, n);
|
|
545
|
+
return v(
|
|
546
546
|
(o) => {
|
|
547
547
|
!i || e.getState().orders.key !== i || e.getState().addOrder(o);
|
|
548
548
|
},
|
|
@@ -550,21 +550,21 @@ const me = (e) => {
|
|
|
550
550
|
);
|
|
551
551
|
}, Lt = () => {
|
|
552
552
|
const e = b();
|
|
553
|
-
return
|
|
553
|
+
return v(
|
|
554
554
|
() => e.getState().refetchOrders(),
|
|
555
555
|
[e]
|
|
556
556
|
);
|
|
557
557
|
}, or = () => {
|
|
558
|
-
const e = A((
|
|
559
|
-
(
|
|
558
|
+
const e = A((c) => c.orders), t = A(
|
|
559
|
+
(c) => c.registerOrdersConsumer
|
|
560
560
|
), { enabled: n, key: r, refetch: i } = De(), o = e.key === r ? e : Tt;
|
|
561
561
|
Y(() => t(), [t]);
|
|
562
562
|
const s = R(
|
|
563
|
-
() => o.data === void 0 ? void 0 :
|
|
563
|
+
() => o.data === void 0 ? void 0 : Se(o.data),
|
|
564
564
|
[o.data]
|
|
565
|
-
),
|
|
566
|
-
const
|
|
567
|
-
return
|
|
565
|
+
), a = v(async () => {
|
|
566
|
+
const c = await i();
|
|
567
|
+
return c === void 0 ? void 0 : Se(c);
|
|
568
568
|
}, [i]);
|
|
569
569
|
return R(
|
|
570
570
|
() => ({
|
|
@@ -573,15 +573,15 @@ const me = (e) => {
|
|
|
573
573
|
isLoading: n && s === void 0 && o.error === void 0,
|
|
574
574
|
isFetching: o.isFetching,
|
|
575
575
|
isRefetching: o.isFetching && s !== void 0,
|
|
576
|
-
refetch:
|
|
576
|
+
refetch: a
|
|
577
577
|
}),
|
|
578
|
-
[o, s, n,
|
|
578
|
+
[o, s, n, a]
|
|
579
579
|
);
|
|
580
|
-
},
|
|
580
|
+
}, xt = ({ children: e }) => (At(), Rt(), e), Ft = ({
|
|
581
581
|
error: e,
|
|
582
582
|
retry: t,
|
|
583
583
|
isRetrying: n
|
|
584
|
-
}) => /* @__PURE__ */
|
|
584
|
+
}) => /* @__PURE__ */ ae("div", { className: "spot-client-error-fallback", role: "alert", children: [
|
|
585
585
|
/* @__PURE__ */ D("p", { children: e.message || "Unable to load Spot configuration." }),
|
|
586
586
|
/* @__PURE__ */ D(
|
|
587
587
|
"button",
|
|
@@ -595,32 +595,32 @@ const me = (e) => {
|
|
|
595
595
|
)
|
|
596
596
|
] }), Ut = ({
|
|
597
597
|
children: e,
|
|
598
|
-
fallback: t =
|
|
598
|
+
fallback: t = Ft
|
|
599
599
|
}) => {
|
|
600
|
-
const { hasChainId: n } =
|
|
600
|
+
const { hasChainId: n } = x(), { data: r, error: i, isFetching: o, refetch: s } = J(), a = v(async () => {
|
|
601
601
|
await s();
|
|
602
602
|
}, [s]);
|
|
603
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ ae(et, { children: [
|
|
604
604
|
e,
|
|
605
605
|
!r && i && n ? /* @__PURE__ */ D(
|
|
606
606
|
t,
|
|
607
607
|
{
|
|
608
608
|
error: i,
|
|
609
|
-
retry:
|
|
609
|
+
retry: a,
|
|
610
610
|
isRetrying: o
|
|
611
611
|
}
|
|
612
612
|
) : null
|
|
613
613
|
] });
|
|
614
614
|
}, Dt = ({
|
|
615
615
|
resetErrorBoundary: e
|
|
616
|
-
}) => /* @__PURE__ */
|
|
616
|
+
}) => /* @__PURE__ */ ae("div", { className: "twap-error-fallback", role: "alert", children: [
|
|
617
617
|
/* @__PURE__ */ D("p", { children: "Something went wrong" }),
|
|
618
618
|
/* @__PURE__ */ D("button", { type: "button", onClick: e, children: "Retry" })
|
|
619
619
|
] }), Mt = ({
|
|
620
620
|
children: e,
|
|
621
621
|
fallback: t = Dt
|
|
622
622
|
}) => {
|
|
623
|
-
const n = b(), r =
|
|
623
|
+
const n = b(), r = v((i) => {
|
|
624
624
|
var s;
|
|
625
625
|
(((s = n.getState().client.data) == null ? void 0 : s.analytics) ?? je).onCrash(i);
|
|
626
626
|
}, [n]);
|
|
@@ -674,13 +674,13 @@ const Bt = ({
|
|
|
674
674
|
quotedOutputAmountRaw: i,
|
|
675
675
|
minimumOutputAmountRaw: o,
|
|
676
676
|
inputTokenUsdPrice: s,
|
|
677
|
-
outputTokenUsdPrice:
|
|
678
|
-
minTradeSizeUsd:
|
|
677
|
+
outputTokenUsdPrice: a,
|
|
678
|
+
minTradeSizeUsd: c,
|
|
679
679
|
inputBalanceRaw: m,
|
|
680
680
|
displayFeePercent: E,
|
|
681
681
|
priceProtectionPercent: u,
|
|
682
|
-
module:
|
|
683
|
-
} =
|
|
682
|
+
module: I
|
|
683
|
+
} = x(), g = A((l) => l.state.tradeCount), P = A((l) => l.state.tradeInterval), p = A((l) => l.state.orderDuration), O = A(
|
|
684
684
|
(l) => l.state.limitPriceUi
|
|
685
685
|
), T = A(
|
|
686
686
|
(l) => l.state.triggerPriceUi
|
|
@@ -691,28 +691,28 @@ const Bt = ({
|
|
|
691
691
|
), F = A(
|
|
692
692
|
(l) => l.state.isPriceInverted
|
|
693
693
|
), B = A((l) => l.state.isMarketOrder), G = A((l) => {
|
|
694
|
-
const
|
|
695
|
-
return
|
|
694
|
+
const S = l.state.currentExecution;
|
|
695
|
+
return S.phase !== d.IDLE ? S.form : void 0;
|
|
696
696
|
}), K = R(
|
|
697
697
|
() => ({
|
|
698
|
-
module:
|
|
698
|
+
module: I,
|
|
699
699
|
inputTokenDecimals: (t == null ? void 0 : t.decimals) ?? 0,
|
|
700
700
|
outputTokenDecimals: (n == null ? void 0 : n.decimals) ?? 0,
|
|
701
701
|
quotedOutputAmountRaw: i,
|
|
702
702
|
minimumOutputAmountRaw: o,
|
|
703
703
|
inputTokenUsdPrice: s,
|
|
704
|
-
outputTokenUsdPrice:
|
|
705
|
-
minTradeSizeUsd:
|
|
704
|
+
outputTokenUsdPrice: a,
|
|
705
|
+
minTradeSizeUsd: c,
|
|
706
706
|
priceProtectionPercent: u,
|
|
707
707
|
displayFeePercent: E,
|
|
708
708
|
inputBalanceRaw: m,
|
|
709
709
|
userInput: {
|
|
710
710
|
inputAmountUi: r,
|
|
711
711
|
isMarketOrder: !!B,
|
|
712
|
-
tradeCount:
|
|
713
|
-
tradeInterval:
|
|
712
|
+
tradeCount: g,
|
|
713
|
+
tradeInterval: P,
|
|
714
714
|
orderDuration: p,
|
|
715
|
-
limitPriceUi:
|
|
715
|
+
limitPriceUi: O,
|
|
716
716
|
limitPricePercent: j,
|
|
717
717
|
triggerPriceUi: T,
|
|
718
718
|
triggerPricePercent: V,
|
|
@@ -722,11 +722,11 @@ const Bt = ({
|
|
|
722
722
|
[
|
|
723
723
|
o,
|
|
724
724
|
n == null ? void 0 : n.decimals,
|
|
725
|
-
|
|
725
|
+
a,
|
|
726
726
|
E,
|
|
727
727
|
i,
|
|
728
|
-
|
|
729
|
-
|
|
728
|
+
c,
|
|
729
|
+
I,
|
|
730
730
|
u,
|
|
731
731
|
m,
|
|
732
732
|
t == null ? void 0 : t.decimals,
|
|
@@ -735,14 +735,14 @@ const Bt = ({
|
|
|
735
735
|
B,
|
|
736
736
|
j,
|
|
737
737
|
V,
|
|
738
|
-
|
|
738
|
+
g,
|
|
739
739
|
p,
|
|
740
|
+
P,
|
|
740
741
|
O,
|
|
741
|
-
I,
|
|
742
742
|
r,
|
|
743
743
|
T
|
|
744
744
|
]
|
|
745
|
-
),
|
|
745
|
+
), h = R(() => {
|
|
746
746
|
if (G) return G;
|
|
747
747
|
const l = Ve(K);
|
|
748
748
|
return t && n ? l : {
|
|
@@ -751,31 +751,31 @@ const Bt = ({
|
|
|
751
751
|
canSubmit: !1
|
|
752
752
|
};
|
|
753
753
|
}, [G, t, n, K]);
|
|
754
|
-
return /* @__PURE__ */ D(Me.Provider, { value:
|
|
754
|
+
return /* @__PURE__ */ D(Me.Provider, { value: h, children: e });
|
|
755
755
|
}, W = () => {
|
|
756
756
|
const e = ue(Me);
|
|
757
757
|
if (!e)
|
|
758
758
|
throw new Error("useOrderForm must be used within OrderFormProvider");
|
|
759
759
|
return e;
|
|
760
760
|
}, _t = (e) => {
|
|
761
|
-
var E, u,
|
|
762
|
-
const t = Number.isSafeInteger(e.chainId) && Number(e.chainId) > 0, n = (E = e.wrappedNativeToken) == null ? void 0 : E.address, r = !!(n && ($((u = e.inputToken) == null ? void 0 : u.address) && he(((
|
|
763
|
-
() =>
|
|
761
|
+
var E, u, I, g, P, p, O, T, j, V, F, B;
|
|
762
|
+
const t = Number.isSafeInteger(e.chainId) && Number(e.chainId) > 0, n = (E = e.wrappedNativeToken) == null ? void 0 : E.address, r = !!(n && ($((u = e.inputToken) == null ? void 0 : u.address) && he(((I = e.outputToken) == null ? void 0 : I.address) || "", n) || he(((g = e.inputToken) == null ? void 0 : g.address) || "", n) && $((P = e.outputToken) == null ? void 0 : P.address))), i = r ? k(e.inputAmountUi, (p = e.outputToken) == null ? void 0 : p.decimals) : e.marketQuote.isLoading ? void 0 : e.marketQuote.quotedOutputAmountRaw, o = r ? !1 : e.marketQuote.isLoading, s = r ? !1 : e.marketQuote.noLiquidity, a = R(
|
|
763
|
+
() => Fe({
|
|
764
764
|
module: e.module,
|
|
765
765
|
overrides: e.overrides
|
|
766
766
|
}),
|
|
767
767
|
[e.module, e.overrides]
|
|
768
|
-
),
|
|
768
|
+
), c = JSON.stringify([
|
|
769
769
|
e.partner,
|
|
770
770
|
e.chainId,
|
|
771
771
|
e.module,
|
|
772
|
-
(
|
|
772
|
+
(O = e.inputToken) == null ? void 0 : O.address,
|
|
773
773
|
(T = e.inputToken) == null ? void 0 : T.decimals,
|
|
774
774
|
(j = e.outputToken) == null ? void 0 : j.address,
|
|
775
775
|
(V = e.outputToken) == null ? void 0 : V.decimals,
|
|
776
776
|
(F = e.wrappedNativeToken) == null ? void 0 : F.address,
|
|
777
777
|
(B = e.wrappedNativeToken) == null ? void 0 : B.decimals,
|
|
778
|
-
|
|
778
|
+
a
|
|
779
779
|
]), m = R(
|
|
780
780
|
() => ({
|
|
781
781
|
inputAmountUi: e.inputAmountUi,
|
|
@@ -829,10 +829,10 @@ const Bt = ({
|
|
|
829
829
|
i
|
|
830
830
|
]
|
|
831
831
|
);
|
|
832
|
-
return { initialState:
|
|
832
|
+
return { initialState: a, formScopeKey: c, trading: m };
|
|
833
833
|
}, sr = (e) => {
|
|
834
834
|
const { initialState: t, formScopeKey: n, trading: r } = _t(e);
|
|
835
|
-
return /* @__PURE__ */ D(
|
|
835
|
+
return /* @__PURE__ */ D(ct, { value: r, children: /* @__PURE__ */ D(vt, { initialState: t, children: /* @__PURE__ */ D(Mt, { fallback: e.errorFallback, children: /* @__PURE__ */ D(xt, { children: /* @__PURE__ */ D(
|
|
836
836
|
Bt,
|
|
837
837
|
{
|
|
838
838
|
defaults: t,
|
|
@@ -840,9 +840,9 @@ const Bt = ({
|
|
|
840
840
|
children: /* @__PURE__ */ D(Ut, { fallback: e.clientErrorFallback, children: /* @__PURE__ */ D(Kt, { children: e.children }) })
|
|
841
841
|
}
|
|
842
842
|
) }) }) }) });
|
|
843
|
-
},
|
|
843
|
+
}, cr = (e, t) => R(() => ne(t, e), [e, t]), Ht = 60, qt = () => {
|
|
844
844
|
const { refetch: e } = De();
|
|
845
|
-
return
|
|
845
|
+
return v(
|
|
846
846
|
async (t, n = !1) => {
|
|
847
847
|
for (let r = 0; r < Ht; r++) {
|
|
848
848
|
const i = await e(n);
|
|
@@ -864,59 +864,59 @@ const Bt = ({
|
|
|
864
864
|
}, bt = (e) => ({
|
|
865
865
|
...e,
|
|
866
866
|
status: M.Cancelled
|
|
867
|
-
}),
|
|
868
|
-
const { account: t, walletInteractions: n, callbacks: r } =
|
|
867
|
+
}), ar = (e) => {
|
|
868
|
+
const { account: t, walletInteractions: n, callbacks: r } = x(), { data: i } = J(), o = qt(), s = A((u) => u.state.cancelOrders[(e == null ? void 0 : e.historyKey) ?? ""]), a = A((u) => u.setCancelOrder), c = A((u) => u.clearCancelOrder), m = v(async () => {
|
|
869
869
|
const u = e == null ? void 0 : e.historyKey;
|
|
870
870
|
try {
|
|
871
871
|
if (!t) throw new Error("missing account");
|
|
872
872
|
if (!e) throw new Error("order is required");
|
|
873
873
|
if (!i) throw new Error("Spot client is unavailable");
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
var
|
|
877
|
-
return (
|
|
874
|
+
const I = e.historyKey;
|
|
875
|
+
a(I, { status: q.LOADING }), w(() => {
|
|
876
|
+
var O;
|
|
877
|
+
return (O = r == null ? void 0 : r.onCancelOrderRequest) == null ? void 0 : O.call(r, e);
|
|
878
878
|
}), w(
|
|
879
879
|
() => i.analytics.onCancelOrderRequest(
|
|
880
880
|
[e.version === 1 ? e.id.toString() : e.hash],
|
|
881
881
|
e.version
|
|
882
882
|
)
|
|
883
883
|
);
|
|
884
|
-
const
|
|
885
|
-
if (!
|
|
886
|
-
w(() => i.analytics.onCancelOrderSuccess(
|
|
884
|
+
const g = i.getCancelOrderRequest(e), P = await n.cancelOrder(g);
|
|
885
|
+
if (!P) throw new Error("failed to cancel order");
|
|
886
|
+
w(() => i.analytics.onCancelOrderSuccess(P)), a(I, {
|
|
887
887
|
status: q.LOADING,
|
|
888
|
-
txHash:
|
|
889
|
-
}), await o(
|
|
888
|
+
txHash: P
|
|
889
|
+
}), await o(I, e.version === 1);
|
|
890
890
|
const p = bt(e);
|
|
891
|
-
return
|
|
891
|
+
return a(I, {
|
|
892
892
|
status: q.SUCCESS,
|
|
893
|
-
txHash:
|
|
893
|
+
txHash: P
|
|
894
894
|
}), w(
|
|
895
895
|
() => {
|
|
896
|
-
var
|
|
897
|
-
return (
|
|
896
|
+
var O;
|
|
897
|
+
return (O = r == null ? void 0 : r.onCancelOrderSuccess) == null ? void 0 : O.call(r, {
|
|
898
898
|
order: p,
|
|
899
|
-
txHash:
|
|
899
|
+
txHash: P
|
|
900
900
|
});
|
|
901
901
|
}
|
|
902
|
-
),
|
|
903
|
-
} catch (
|
|
904
|
-
Ce(
|
|
902
|
+
), P;
|
|
903
|
+
} catch (I) {
|
|
904
|
+
Ce(I) ? u && c(u) : (u && a(u, {
|
|
905
905
|
status: q.FAILED,
|
|
906
|
-
error: me(
|
|
907
|
-
}), w(() => i == null ? void 0 : i.analytics.onCancelOrderError(
|
|
908
|
-
var
|
|
909
|
-
return (
|
|
906
|
+
error: me(I)
|
|
907
|
+
}), w(() => i == null ? void 0 : i.analytics.onCancelOrderError(I))), w(() => {
|
|
908
|
+
var g;
|
|
909
|
+
return (g = r == null ? void 0 : r.onCancelOrderFailed) == null ? void 0 : g.call(r, X(I));
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
}, [
|
|
913
913
|
t,
|
|
914
914
|
r,
|
|
915
|
-
|
|
915
|
+
c,
|
|
916
916
|
i,
|
|
917
917
|
e,
|
|
918
918
|
o,
|
|
919
|
-
|
|
919
|
+
a,
|
|
920
920
|
n
|
|
921
921
|
]), E = R(() => {
|
|
922
922
|
const u = s;
|
|
@@ -937,23 +937,23 @@ const Bt = ({
|
|
|
937
937
|
if (e === Q.LIMIT || e === Q.TWAP)
|
|
938
938
|
return t.isMarketOrder ? ee.MARKET_PRICE : ee.LIMIT_PRICE;
|
|
939
939
|
}, ur = () => {
|
|
940
|
-
const { callbacks: e } =
|
|
941
|
-
(
|
|
942
|
-
t({ orderDuration:
|
|
943
|
-
var
|
|
944
|
-
return (
|
|
940
|
+
const { callbacks: e } = x(), t = A((a) => a.updateState), { schedule: n } = W(), { duration: r } = n, i = v(
|
|
941
|
+
(a) => {
|
|
942
|
+
t({ orderDuration: a }), w(() => {
|
|
943
|
+
var c;
|
|
944
|
+
return (c = e == null ? void 0 : e.onOrderDurationChange) == null ? void 0 : c.call(e, a);
|
|
945
945
|
});
|
|
946
946
|
},
|
|
947
947
|
[e, t]
|
|
948
|
-
), o =
|
|
949
|
-
(
|
|
950
|
-
const
|
|
951
|
-
Number.isFinite(
|
|
948
|
+
), o = v(
|
|
949
|
+
(a) => {
|
|
950
|
+
const c = Number(a);
|
|
951
|
+
Number.isFinite(c) && i({ unit: r.unit, value: c });
|
|
952
952
|
},
|
|
953
953
|
[r.unit, i]
|
|
954
|
-
), s =
|
|
955
|
-
(
|
|
956
|
-
i({ unit:
|
|
954
|
+
), s = v(
|
|
955
|
+
(a) => {
|
|
956
|
+
i({ unit: a, value: r.value });
|
|
957
957
|
},
|
|
958
958
|
[r.value, i]
|
|
959
959
|
);
|
|
@@ -969,22 +969,22 @@ const Bt = ({
|
|
|
969
969
|
[r, i, o, s, n]
|
|
970
970
|
);
|
|
971
971
|
}, lr = () => {
|
|
972
|
-
const { callbacks: e } =
|
|
973
|
-
(
|
|
974
|
-
t({ tradeInterval:
|
|
975
|
-
var
|
|
976
|
-
return (
|
|
972
|
+
const { callbacks: e } = x(), t = A((a) => a.updateState), { schedule: n } = W(), { fillDelay: r } = n, i = v(
|
|
973
|
+
(a) => {
|
|
974
|
+
t({ tradeInterval: a }), w(() => {
|
|
975
|
+
var c;
|
|
976
|
+
return (c = e == null ? void 0 : e.onTradeIntervalChange) == null ? void 0 : c.call(e, a);
|
|
977
977
|
});
|
|
978
978
|
},
|
|
979
979
|
[e, t]
|
|
980
|
-
), o =
|
|
981
|
-
(
|
|
982
|
-
const
|
|
983
|
-
Number.isFinite(
|
|
980
|
+
), o = v(
|
|
981
|
+
(a) => {
|
|
982
|
+
const c = Number(a);
|
|
983
|
+
Number.isFinite(c) && i({ unit: r.unit, value: c });
|
|
984
984
|
},
|
|
985
985
|
[r.unit, i]
|
|
986
|
-
), s =
|
|
987
|
-
(
|
|
986
|
+
), s = v(
|
|
987
|
+
(a) => i({ unit: a, value: r.value }),
|
|
988
988
|
[r.value, i]
|
|
989
989
|
);
|
|
990
990
|
return R(
|
|
@@ -1016,7 +1016,7 @@ const Bt = ({
|
|
|
1016
1016
|
n.decimals
|
|
1017
1017
|
)
|
|
1018
1018
|
})), [e, t, n]), mr = (e, t, n) => {
|
|
1019
|
-
const { chainId: r, partner: i } =
|
|
1019
|
+
const { chainId: r, partner: i } = x(), o = R(() => {
|
|
1020
1020
|
if (!(!t || !n || !e || e.isMarketPrice))
|
|
1021
1021
|
return Qe(
|
|
1022
1022
|
e,
|
|
@@ -1030,7 +1030,7 @@ const Bt = ({
|
|
|
1030
1030
|
t.decimals,
|
|
1031
1031
|
n.decimals
|
|
1032
1032
|
);
|
|
1033
|
-
}, [t, e, n]),
|
|
1033
|
+
}, [t, e, n]), a = R(() => {
|
|
1034
1034
|
if (!(!t || !n || !e))
|
|
1035
1035
|
return Ae(
|
|
1036
1036
|
e.srcAmountFilled,
|
|
@@ -1038,7 +1038,7 @@ const Bt = ({
|
|
|
1038
1038
|
t.decimals,
|
|
1039
1039
|
n.decimals
|
|
1040
1040
|
);
|
|
1041
|
-
}, [t, e, n]),
|
|
1041
|
+
}, [t, e, n]), c = R(() => e ? ze(
|
|
1042
1042
|
e,
|
|
1043
1043
|
r ? $e(i, r) : void 0
|
|
1044
1044
|
) : 0, [e, i, r]), m = Wt(e == null ? void 0 : e.fills, t, n);
|
|
@@ -1053,7 +1053,7 @@ const Bt = ({
|
|
|
1053
1053
|
createdAt: e.createdAt,
|
|
1054
1054
|
deadline: e.deadline || 0,
|
|
1055
1055
|
totalTrades: e.totalTradesAmount || 0,
|
|
1056
|
-
tradeInterval:
|
|
1056
|
+
tradeInterval: c,
|
|
1057
1057
|
recipient: e.maker || "",
|
|
1058
1058
|
inputAmount: H(e.srcAmount, t == null ? void 0 : t.decimals),
|
|
1059
1059
|
limitPrice: H(
|
|
@@ -1087,7 +1087,7 @@ const Bt = ({
|
|
|
1087
1087
|
),
|
|
1088
1088
|
progress: e.progress,
|
|
1089
1089
|
executionPrice: H(
|
|
1090
|
-
k(
|
|
1090
|
+
k(a, n == null ? void 0 : n.decimals),
|
|
1091
1091
|
n == null ? void 0 : n.decimals
|
|
1092
1092
|
),
|
|
1093
1093
|
version: e.version
|
|
@@ -1097,52 +1097,52 @@ const Bt = ({
|
|
|
1097
1097
|
m,
|
|
1098
1098
|
t,
|
|
1099
1099
|
n,
|
|
1100
|
-
|
|
1100
|
+
c,
|
|
1101
1101
|
o,
|
|
1102
1102
|
s,
|
|
1103
|
-
|
|
1103
|
+
a
|
|
1104
1104
|
]);
|
|
1105
1105
|
}, fr = () => {
|
|
1106
|
-
const { marketPriceLoading: e } =
|
|
1106
|
+
const { marketPriceLoading: e } = x(), t = W().errors.primary;
|
|
1107
1107
|
return e ? void 0 : t;
|
|
1108
1108
|
}, gr = () => {
|
|
1109
|
-
const { marketPriceLoading: e, inputToken: t, outputToken: n, callbacks: r } =
|
|
1110
|
-
(
|
|
1111
|
-
|
|
1109
|
+
const { marketPriceLoading: e, inputToken: t, outputToken: n, callbacks: r } = x(), { limitPrice: i, values: o, module: s, isInverted: a } = W(), c = A((P) => P.updateState), m = v(
|
|
1110
|
+
(P) => {
|
|
1111
|
+
c({ limitPriceUi: P, limitPricePercent: null }), w(() => {
|
|
1112
1112
|
var p;
|
|
1113
|
-
return (p = r == null ? void 0 : r.onLimitPriceChange) == null ? void 0 : p.call(r,
|
|
1113
|
+
return (p = r == null ? void 0 : r.onLimitPriceChange) == null ? void 0 : p.call(r, P || "");
|
|
1114
1114
|
}), w(() => {
|
|
1115
1115
|
var p;
|
|
1116
1116
|
return (p = r == null ? void 0 : r.onLimitPricePercentChange) == null ? void 0 : p.call(r, "");
|
|
1117
1117
|
});
|
|
1118
1118
|
},
|
|
1119
|
-
[r,
|
|
1120
|
-
), E =
|
|
1121
|
-
(
|
|
1122
|
-
|
|
1119
|
+
[r, c]
|
|
1120
|
+
), E = v(
|
|
1121
|
+
(P) => {
|
|
1122
|
+
c({
|
|
1123
1123
|
limitPriceUi: void 0,
|
|
1124
|
-
limitPricePercent:
|
|
1124
|
+
limitPricePercent: P
|
|
1125
1125
|
}), w(() => {
|
|
1126
1126
|
var p;
|
|
1127
1127
|
return (p = r == null ? void 0 : r.onLimitPriceChange) == null ? void 0 : p.call(r, "");
|
|
1128
1128
|
}), w(() => {
|
|
1129
1129
|
var p;
|
|
1130
|
-
return (p = r == null ? void 0 : r.onLimitPricePercentChange) == null ? void 0 : p.call(r,
|
|
1130
|
+
return (p = r == null ? void 0 : r.onLimitPricePercentChange) == null ? void 0 : p.call(r, P || "");
|
|
1131
1131
|
});
|
|
1132
1132
|
},
|
|
1133
|
-
[r,
|
|
1134
|
-
), u =
|
|
1135
|
-
|
|
1133
|
+
[r, c]
|
|
1134
|
+
), u = v(() => {
|
|
1135
|
+
c({
|
|
1136
1136
|
limitPriceUi: void 0,
|
|
1137
1137
|
limitPricePercent: void 0
|
|
1138
1138
|
});
|
|
1139
|
-
}, [
|
|
1140
|
-
|
|
1139
|
+
}, [c]), I = !o.isMarketOrder, g = v(() => {
|
|
1140
|
+
c({
|
|
1141
1141
|
isMarketOrder: !o.isMarketOrder,
|
|
1142
1142
|
...o.isMarketOrder ? {} : { isPriceInverted: !1 },
|
|
1143
1143
|
...!o.isMarketOrder && s === Q.STOP_LOSS ? { limitPricePercent: void 0 } : {}
|
|
1144
1144
|
});
|
|
1145
|
-
}, [s,
|
|
1145
|
+
}, [s, c, o.isMarketOrder]);
|
|
1146
1146
|
return R(
|
|
1147
1147
|
() => ({
|
|
1148
1148
|
price: i.display,
|
|
@@ -1153,29 +1153,29 @@ const Bt = ({
|
|
|
1153
1153
|
onReset: u,
|
|
1154
1154
|
inputToken: t,
|
|
1155
1155
|
outputToken: n,
|
|
1156
|
-
displayInputToken:
|
|
1157
|
-
displayOutputToken:
|
|
1156
|
+
displayInputToken: a ? n : t,
|
|
1157
|
+
displayOutputToken: a ? t : n,
|
|
1158
1158
|
percentage: i.percentage,
|
|
1159
1159
|
isLoading: !!e,
|
|
1160
|
-
isEnabled:
|
|
1161
|
-
toggle:
|
|
1160
|
+
isEnabled: I,
|
|
1161
|
+
toggle: g,
|
|
1162
1162
|
isTypedValue: i.isTypedValue
|
|
1163
1163
|
}),
|
|
1164
1164
|
[
|
|
1165
1165
|
t,
|
|
1166
|
-
|
|
1167
|
-
|
|
1166
|
+
a,
|
|
1167
|
+
I,
|
|
1168
1168
|
i,
|
|
1169
1169
|
e,
|
|
1170
1170
|
m,
|
|
1171
1171
|
E,
|
|
1172
1172
|
u,
|
|
1173
1173
|
n,
|
|
1174
|
-
|
|
1174
|
+
g
|
|
1175
1175
|
]
|
|
1176
1176
|
);
|
|
1177
1177
|
}, hr = () => {
|
|
1178
|
-
const { marketPriceLoading: e } =
|
|
1178
|
+
const { marketPriceLoading: e } = x(), { outputAmount: t } = W();
|
|
1179
1179
|
return R(
|
|
1180
1180
|
() => ({
|
|
1181
1181
|
amount: t,
|
|
@@ -1184,7 +1184,7 @@ const Bt = ({
|
|
|
1184
1184
|
[e, t]
|
|
1185
1185
|
);
|
|
1186
1186
|
}, Er = () => {
|
|
1187
|
-
const { inputToken: e, outputToken: t } =
|
|
1187
|
+
const { inputToken: e, outputToken: t } = x(), n = A((c) => c.updateState), { isInverted: r, values: i } = W(), o = A((c) => c.state.triggerPriceUi), s = A((c) => c.state.limitPriceUi), a = v(() => {
|
|
1188
1188
|
n({
|
|
1189
1189
|
isPriceInverted: !r,
|
|
1190
1190
|
...o !== void 0 ? { triggerPriceUi: Ee(o) } : {},
|
|
@@ -1193,7 +1193,7 @@ const Bt = ({
|
|
|
1193
1193
|
}, [n, r, o, s]);
|
|
1194
1194
|
return R(
|
|
1195
1195
|
() => ({
|
|
1196
|
-
onInvert:
|
|
1196
|
+
onInvert: a,
|
|
1197
1197
|
isInverted: r,
|
|
1198
1198
|
inputToken: e,
|
|
1199
1199
|
outputToken: t,
|
|
@@ -1201,7 +1201,7 @@ const Bt = ({
|
|
|
1201
1201
|
displayOutputToken: r ? e : t,
|
|
1202
1202
|
isMarketOrder: i.isMarketOrder
|
|
1203
1203
|
}),
|
|
1204
|
-
[e, r,
|
|
1204
|
+
[e, r, a, t, i.isMarketOrder]
|
|
1205
1205
|
);
|
|
1206
1206
|
}, Ge = (e, t, n) => {
|
|
1207
1207
|
if (!e || typeof t.maker != "string" || !n || !t.rawOrder || !("order" in t.rawOrder)) return !1;
|
|
@@ -1221,19 +1221,19 @@ const Bt = ({
|
|
|
1221
1221
|
(i.aborted || e.getState().state.currentExecution.executionId !== r) && o.abort();
|
|
1222
1222
|
};
|
|
1223
1223
|
i.addEventListener("abort", s, { once: !0 });
|
|
1224
|
-
const
|
|
1224
|
+
const a = e.subscribe(s);
|
|
1225
1225
|
s();
|
|
1226
1226
|
try {
|
|
1227
|
-
let
|
|
1227
|
+
let c = n;
|
|
1228
1228
|
o.signal.aborted || w(() => Be(e, n));
|
|
1229
1229
|
for await (const m of Ye({ order: n, signal: o.signal }))
|
|
1230
1230
|
o.signal.aborted || (w(() => {
|
|
1231
1231
|
const E = e.getState();
|
|
1232
1232
|
Ge(E.orders.key, n, E.state.currentExecution.partner) && E.updateOrder(m, t);
|
|
1233
|
-
}),
|
|
1234
|
-
return
|
|
1233
|
+
}), c = m);
|
|
1234
|
+
return c;
|
|
1235
1235
|
} finally {
|
|
1236
|
-
|
|
1236
|
+
a(), i.removeEventListener("abort", s), o.abort();
|
|
1237
1237
|
}
|
|
1238
1238
|
}, jt = (e) => new Promise((t) => setTimeout(t, e)), _e = (e, t) => {
|
|
1239
1239
|
if (!/^\d+$/.test(e))
|
|
@@ -1273,7 +1273,7 @@ const Bt = ({
|
|
|
1273
1273
|
outputToken: i,
|
|
1274
1274
|
preparedOrder: o
|
|
1275
1275
|
}) => {
|
|
1276
|
-
const { form: s, values:
|
|
1276
|
+
const { form: s, values: a } = o;
|
|
1277
1277
|
w(
|
|
1278
1278
|
() => e.onRequestOrder({
|
|
1279
1279
|
account: t,
|
|
@@ -1281,19 +1281,19 @@ const Bt = ({
|
|
|
1281
1281
|
module: s.module,
|
|
1282
1282
|
srcToken: r,
|
|
1283
1283
|
dstToken: i,
|
|
1284
|
-
fromTokenAmount:
|
|
1285
|
-
srcChunkAmount:
|
|
1286
|
-
triggerPricePerTrade:
|
|
1287
|
-
deadline:
|
|
1288
|
-
fillDelay:
|
|
1289
|
-
minDstAmountOutPerTrade:
|
|
1284
|
+
fromTokenAmount: a.inputAmount,
|
|
1285
|
+
srcChunkAmount: a.inputAmountPerTrade,
|
|
1286
|
+
triggerPricePerTrade: a.triggerOutputAmountPerTrade,
|
|
1287
|
+
deadline: a.deadlineMillis,
|
|
1288
|
+
fillDelay: a.fillDelayMillis,
|
|
1289
|
+
minDstAmountOutPerTrade: a.minOutputAmountPerTrade,
|
|
1290
1290
|
slippage: s.values.slippageBps / 100,
|
|
1291
|
-
isMarketOrder:
|
|
1292
|
-
chunksAmount:
|
|
1291
|
+
isMarketOrder: a.isMarketOrder,
|
|
1292
|
+
chunksAmount: a.totalTrades
|
|
1293
1293
|
})
|
|
1294
1294
|
);
|
|
1295
1295
|
}, Jt = async (e) => {
|
|
1296
|
-
var
|
|
1296
|
+
var S, N;
|
|
1297
1297
|
const {
|
|
1298
1298
|
form: t,
|
|
1299
1299
|
walletInteractions: n,
|
|
@@ -1301,87 +1301,87 @@ const Bt = ({
|
|
|
1301
1301
|
addNewOrder: i,
|
|
1302
1302
|
refetchActiveOrders: o,
|
|
1303
1303
|
getCurrentExecution: s,
|
|
1304
|
-
beginExecution:
|
|
1305
|
-
replaceExecution:
|
|
1304
|
+
beginExecution: a,
|
|
1305
|
+
replaceExecution: c,
|
|
1306
1306
|
wait: m = jt
|
|
1307
1307
|
} = e;
|
|
1308
1308
|
let E;
|
|
1309
1309
|
try {
|
|
1310
1310
|
E = Vt(e);
|
|
1311
1311
|
} catch (y) {
|
|
1312
|
-
const
|
|
1312
|
+
const C = X(y), f = te(y), L = a({
|
|
1313
1313
|
account: e.account,
|
|
1314
|
-
partner: (
|
|
1314
|
+
partner: (S = e.client) == null ? void 0 : S.partner,
|
|
1315
1315
|
form: t,
|
|
1316
1316
|
inputToken: e.inputToken,
|
|
1317
1317
|
outputToken: e.outputToken,
|
|
1318
1318
|
chainId: e.chainId
|
|
1319
1319
|
});
|
|
1320
|
-
throw
|
|
1321
|
-
...
|
|
1320
|
+
throw L && c(L.executionId, {
|
|
1321
|
+
...L,
|
|
1322
1322
|
phase: d.FAILED,
|
|
1323
|
-
error:
|
|
1323
|
+
error: C,
|
|
1324
1324
|
parsedError: f
|
|
1325
1325
|
}), w(
|
|
1326
1326
|
() => {
|
|
1327
1327
|
var _;
|
|
1328
1328
|
return (_ = r == null ? void 0 : r.onSubmitOrderFailed) == null ? void 0 : _.call(r, f);
|
|
1329
1329
|
}
|
|
1330
|
-
),
|
|
1330
|
+
), C;
|
|
1331
1331
|
}
|
|
1332
1332
|
const {
|
|
1333
1333
|
account: u,
|
|
1334
|
-
chainId:
|
|
1335
|
-
inputToken:
|
|
1336
|
-
orderInputToken:
|
|
1334
|
+
chainId: I,
|
|
1335
|
+
inputToken: g,
|
|
1336
|
+
orderInputToken: P,
|
|
1337
1337
|
outputToken: p,
|
|
1338
|
-
client:
|
|
1338
|
+
client: O,
|
|
1339
1339
|
inputAmountRaw: T
|
|
1340
|
-
} = E, { analytics: j } =
|
|
1340
|
+
} = E, { analytics: j } = O, V = s(), F = ft({
|
|
1341
1341
|
execution: V,
|
|
1342
1342
|
account: u,
|
|
1343
|
-
chainId:
|
|
1344
|
-
inputTokenAddress:
|
|
1343
|
+
chainId: I,
|
|
1344
|
+
inputTokenAddress: g.address,
|
|
1345
1345
|
inputAmountRaw: T
|
|
1346
|
-
}), B =
|
|
1346
|
+
}), B = a({
|
|
1347
1347
|
account: u,
|
|
1348
|
-
partner:
|
|
1348
|
+
partner: O.partner,
|
|
1349
1349
|
form: t,
|
|
1350
|
-
inputToken:
|
|
1350
|
+
inputToken: g,
|
|
1351
1351
|
outputToken: p,
|
|
1352
|
-
chainId:
|
|
1352
|
+
chainId: I,
|
|
1353
1353
|
completedWrap: F,
|
|
1354
1354
|
wrapTxHash: F == null ? void 0 : F.txHash
|
|
1355
1355
|
});
|
|
1356
1356
|
if (!B) return;
|
|
1357
1357
|
const G = B.executionId;
|
|
1358
1358
|
let K = B;
|
|
1359
|
-
const
|
|
1359
|
+
const h = (y, C = {}) => {
|
|
1360
1360
|
const f = {
|
|
1361
1361
|
...K,
|
|
1362
|
-
...
|
|
1362
|
+
...C,
|
|
1363
1363
|
executionId: G,
|
|
1364
1364
|
phase: y
|
|
1365
1365
|
};
|
|
1366
|
-
if (!
|
|
1366
|
+
if (!c(G, f))
|
|
1367
1367
|
throw new Error("Execution is no longer current");
|
|
1368
1368
|
K = f;
|
|
1369
|
-
}, l = (y,
|
|
1369
|
+
}, l = (y, C = {}) => {
|
|
1370
1370
|
const f = {
|
|
1371
1371
|
...K,
|
|
1372
|
-
...
|
|
1372
|
+
...C,
|
|
1373
1373
|
executionId: G,
|
|
1374
1374
|
phase: y
|
|
1375
1375
|
};
|
|
1376
|
-
return
|
|
1376
|
+
return c(G, f) ? (K = f, !0) : !1;
|
|
1377
1377
|
};
|
|
1378
1378
|
try {
|
|
1379
1379
|
const { order: y } = await Xe({
|
|
1380
|
-
client:
|
|
1380
|
+
client: O,
|
|
1381
1381
|
account: u,
|
|
1382
|
-
inputTokenAddress:
|
|
1382
|
+
inputTokenAddress: P.address,
|
|
1383
1383
|
inputAmountRaw: T,
|
|
1384
|
-
nativeInput: $(
|
|
1384
|
+
nativeInput: $(g.address),
|
|
1385
1385
|
completedWrapTxHash: F == null ? void 0 : F.txHash,
|
|
1386
1386
|
walletInteractions: n,
|
|
1387
1387
|
wait: m,
|
|
@@ -1389,8 +1389,8 @@ const Bt = ({
|
|
|
1389
1389
|
prepareOrder: async () => {
|
|
1390
1390
|
var f;
|
|
1391
1391
|
if (t.module === Q.SWAP) {
|
|
1392
|
-
const
|
|
1393
|
-
inToken:
|
|
1392
|
+
const L = await O.getQuote({
|
|
1393
|
+
inToken: P.address,
|
|
1394
1394
|
outToken: p.address,
|
|
1395
1395
|
inAmount: T,
|
|
1396
1396
|
user: u,
|
|
@@ -1398,12 +1398,12 @@ const Bt = ({
|
|
|
1398
1398
|
dexMinAmountOut: "-1",
|
|
1399
1399
|
signal: e.signal
|
|
1400
1400
|
});
|
|
1401
|
-
if ((f = e.signal) == null || f.throwIfAborted(), BigInt(
|
|
1401
|
+
if ((f = e.signal) == null || f.throwIfAborted(), BigInt(L.netAmountOut) < _e(t.values.minOutputAmountPerTrade, "Minimum output"))
|
|
1402
1402
|
throw new ve("INVALID_QUOTE", "Swap price changed. Review a fresh quote before signing.");
|
|
1403
1403
|
}
|
|
1404
|
-
return
|
|
1404
|
+
return O.prepareOrder({
|
|
1405
1405
|
form: t,
|
|
1406
|
-
inputTokenAddress:
|
|
1406
|
+
inputTokenAddress: P.address,
|
|
1407
1407
|
outputTokenAddress: p.address,
|
|
1408
1408
|
swapperAddress: u
|
|
1409
1409
|
});
|
|
@@ -1412,25 +1412,25 @@ const Bt = ({
|
|
|
1412
1412
|
if (s().executionId !== G) throw new Error("Execution is no longer current");
|
|
1413
1413
|
},
|
|
1414
1414
|
onUpdate: (f) => {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
pendingSteps:
|
|
1418
|
-
totalSteps:
|
|
1415
|
+
const L = f.steps.map((U) => ({ wrap: z.WRAP, approve: z.APPROVE, create: z.CREATE })[U]), _ = f.phase;
|
|
1416
|
+
h(_, {
|
|
1417
|
+
pendingSteps: L,
|
|
1418
|
+
totalSteps: L.length,
|
|
1419
1419
|
stepIndex: f.stepIndex,
|
|
1420
1420
|
hasApproval: f.hasApproval,
|
|
1421
1421
|
wrapTxHash: f.wrapTxHash,
|
|
1422
1422
|
approveTxHash: f.approvalTxHash,
|
|
1423
1423
|
...f.preparedOrder ? { preparedOrder: f.preparedOrder } : {},
|
|
1424
1424
|
...f.phase === "wrapping" && f.event === "success" && f.wrapTxHash ? {
|
|
1425
|
-
completedWrap: { account: u, chainId:
|
|
1425
|
+
completedWrap: { account: u, chainId: I, inputTokenAddress: g.address, inputAmountRaw: T, txHash: f.wrapTxHash }
|
|
1426
1426
|
} : {}
|
|
1427
1427
|
}), f.phase === "wrapping" && (f.event === "request" && w(r == null ? void 0 : r.onWrapRequest), f.event === "success" && f.wrapTxHash && w(() => {
|
|
1428
1428
|
var U;
|
|
1429
|
-
return (U = r == null ? void 0 : r.onWrapSuccess) == null ? void 0 : U.call(r, { txHash: f.wrapTxHash, amount: ne(f.wrapAmountRaw ?? T,
|
|
1429
|
+
return (U = r == null ? void 0 : r.onWrapSuccess) == null ? void 0 : U.call(r, { txHash: f.wrapTxHash, amount: ne(f.wrapAmountRaw ?? T, P.decimals) });
|
|
1430
1430
|
})), f.phase === "approving" && (f.event === "request" && w(r == null ? void 0 : r.onApproveRequest), f.event === "success" && f.approvalTxHash && w(() => {
|
|
1431
1431
|
var U;
|
|
1432
|
-
return (U = r == null ? void 0 : r.onApproveSuccess) == null ? void 0 : U.call(r, { txHash: f.approvalTxHash, token:
|
|
1433
|
-
})), f.phase === "signing" && (f.event === "prepared" && f.preparedOrder && (Qt({ analytics: j, account: u, chainId:
|
|
1432
|
+
return (U = r == null ? void 0 : r.onApproveSuccess) == null ? void 0 : U.call(r, { txHash: f.approvalTxHash, token: P, amount: ne(T, P.decimals) });
|
|
1433
|
+
})), f.phase === "signing" && (f.event === "prepared" && f.preparedOrder && (Qt({ analytics: j, account: u, chainId: I, inputToken: g, outputToken: p, preparedOrder: f.preparedOrder }), w(r == null ? void 0 : r.onSignOrderRequest)), f.event === "success" && f.signature && w(() => {
|
|
1434
1434
|
var U;
|
|
1435
1435
|
return (U = r == null ? void 0 : r.onSignOrderSuccess) == null ? void 0 : U.call(r, f.signature);
|
|
1436
1436
|
}), f.event === "error" && w(() => {
|
|
@@ -1438,27 +1438,27 @@ const Bt = ({
|
|
|
1438
1438
|
return (U = r == null ? void 0 : r.onSignOrderError) == null ? void 0 : U.call(r, X(f.error));
|
|
1439
1439
|
}));
|
|
1440
1440
|
}
|
|
1441
|
-
}),
|
|
1442
|
-
if (
|
|
1441
|
+
}), C = t.module === Q.SWAP;
|
|
1442
|
+
if (h(C ? d.SETTLING : d.SUCCESS, {
|
|
1443
1443
|
orderId: y.id.toString(),
|
|
1444
1444
|
order: y
|
|
1445
|
-
}), w(() => i(y)),
|
|
1445
|
+
}), w(() => i(y)), C || w(() => o()), w(() => {
|
|
1446
1446
|
var f;
|
|
1447
1447
|
return (f = r == null ? void 0 : r.onOrderCreated) == null ? void 0 : f.call(r, y);
|
|
1448
|
-
}),
|
|
1448
|
+
}), C) {
|
|
1449
1449
|
const f = await e.waitForOrderFill(y, G);
|
|
1450
|
-
return
|
|
1450
|
+
return h(d.SUCCESS, { order: f }), f;
|
|
1451
1451
|
}
|
|
1452
1452
|
return y;
|
|
1453
1453
|
} catch (y) {
|
|
1454
|
-
const
|
|
1454
|
+
const C = K.phase, f = X(y), _ = !(C === d.SUBMITTING && ((N = e.signal) == null ? void 0 : N.aborted) && y === e.signal.reason) && xe(y, C), U = !_ && Ce(y);
|
|
1455
1455
|
throw l(
|
|
1456
1456
|
_ ? d.UNCONFIRMED : U ? d.REJECTED : d.FAILED,
|
|
1457
1457
|
{
|
|
1458
1458
|
error: f,
|
|
1459
1459
|
parsedError: te(y)
|
|
1460
1460
|
}
|
|
1461
|
-
), U ? w(r == null ? void 0 : r.onSubmitOrderRejected) :
|
|
1461
|
+
), U ? w(r == null ? void 0 : r.onSubmitOrderRejected) : C !== d.SETTLING && w(() => {
|
|
1462
1462
|
var ge;
|
|
1463
1463
|
return (ge = r == null ? void 0 : r.onSubmitOrderFailed) == null ? void 0 : ge.call(r, te(y));
|
|
1464
1464
|
}), f;
|
|
@@ -1471,16 +1471,16 @@ const Bt = ({
|
|
|
1471
1471
|
chainId: i,
|
|
1472
1472
|
callbacks: o,
|
|
1473
1473
|
account: s,
|
|
1474
|
-
walletInteractions:
|
|
1475
|
-
} =
|
|
1474
|
+
walletInteractions: a
|
|
1475
|
+
} = x(), c = Nt(), m = Lt(), E = W(), u = b(), I = le(void 0);
|
|
1476
1476
|
return Y(() => () => {
|
|
1477
|
-
var
|
|
1478
|
-
return (
|
|
1479
|
-
}, [s, i, e]),
|
|
1477
|
+
var g;
|
|
1478
|
+
return (g = I.current) == null ? void 0 : g.abort();
|
|
1479
|
+
}, [s, i, e]), v(() => {
|
|
1480
1480
|
if (!Le(u.getState().state.currentExecution.phase)) return;
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
signal:
|
|
1481
|
+
const g = new AbortController();
|
|
1482
|
+
I.current = g, Jt({
|
|
1483
|
+
signal: g.signal,
|
|
1484
1484
|
account: s,
|
|
1485
1485
|
chainId: i,
|
|
1486
1486
|
inputToken: t,
|
|
@@ -1488,21 +1488,21 @@ const Bt = ({
|
|
|
1488
1488
|
wrappedNativeToken: r,
|
|
1489
1489
|
form: E,
|
|
1490
1490
|
client: e,
|
|
1491
|
-
walletInteractions:
|
|
1491
|
+
walletInteractions: a,
|
|
1492
1492
|
callbacks: o,
|
|
1493
|
-
addNewOrder:
|
|
1493
|
+
addNewOrder: c,
|
|
1494
1494
|
refetchActiveOrders: m,
|
|
1495
|
-
waitForOrderFill: (
|
|
1495
|
+
waitForOrderFill: (P, p) => Ke({ store: u, callbacks: o, order: P, executionId: p, signal: g.signal }),
|
|
1496
1496
|
getCurrentExecution: () => u.getState().state.currentExecution,
|
|
1497
1497
|
beginExecution: u.getState().beginExecution,
|
|
1498
1498
|
replaceExecution: u.getState().replaceExecution
|
|
1499
1499
|
}).catch(() => {
|
|
1500
1500
|
}).finally(() => {
|
|
1501
|
-
|
|
1501
|
+
I.current === g && (I.current = void 0);
|
|
1502
1502
|
});
|
|
1503
1503
|
}, [
|
|
1504
1504
|
s,
|
|
1505
|
-
|
|
1505
|
+
c,
|
|
1506
1506
|
o,
|
|
1507
1507
|
i,
|
|
1508
1508
|
e,
|
|
@@ -1512,15 +1512,18 @@ const Bt = ({
|
|
|
1512
1512
|
r,
|
|
1513
1513
|
m,
|
|
1514
1514
|
u,
|
|
1515
|
-
|
|
1515
|
+
a
|
|
1516
1516
|
]);
|
|
1517
1517
|
}, $t = () => {
|
|
1518
|
-
const e = A((
|
|
1519
|
-
(
|
|
1518
|
+
const e = A((r) => r.state.currentExecution), t = A(
|
|
1519
|
+
(r) => r.returnToOrderForm
|
|
1520
|
+
), n = v(
|
|
1521
|
+
() => t(e.executionId),
|
|
1522
|
+
[e.executionId, t]
|
|
1520
1523
|
);
|
|
1521
1524
|
return R(
|
|
1522
|
-
() => ({ ...e, returnToOrderForm:
|
|
1523
|
-
[e,
|
|
1525
|
+
() => ({ ...e, returnToOrderForm: n }),
|
|
1526
|
+
[e, n]
|
|
1524
1527
|
);
|
|
1525
1528
|
}, ye = (e) => {
|
|
1526
1529
|
if (typeof e == "number" && Number.isSafeInteger(e) && e >= 0 || typeof e == "string" && /^\d+$/.test(e)) return BigInt(e);
|
|
@@ -1535,7 +1538,7 @@ const Bt = ({
|
|
|
1535
1538
|
(n) => n.version === 2 && "order" in n.rawOrder && He(t, n.rawOrder.order)
|
|
1536
1539
|
);
|
|
1537
1540
|
async function Xt({ store: e, callbacks: t, signal: n }) {
|
|
1538
|
-
var
|
|
1541
|
+
var a;
|
|
1539
1542
|
const r = e.getState().state.currentExecution;
|
|
1540
1543
|
if (r.phase !== d.UNCONFIRMED || r.executionId === void 0) return;
|
|
1541
1544
|
const i = r.executionId;
|
|
@@ -1546,50 +1549,50 @@ async function Xt({ store: e, callbacks: t, signal: n }) {
|
|
|
1546
1549
|
parsedError: void 0
|
|
1547
1550
|
};
|
|
1548
1551
|
if (!e.getState().replaceExecution(i, o)) return;
|
|
1549
|
-
const s = (
|
|
1550
|
-
const E = { ...o, ...m, phase:
|
|
1552
|
+
const s = (c, m = {}) => {
|
|
1553
|
+
const E = { ...o, ...m, phase: c };
|
|
1551
1554
|
return e.getState().replaceExecution(i, E) ? (o = E, !0) : !1;
|
|
1552
1555
|
};
|
|
1553
1556
|
try {
|
|
1554
1557
|
n.throwIfAborted();
|
|
1555
|
-
let
|
|
1556
|
-
const m = !
|
|
1557
|
-
if (!
|
|
1558
|
-
if (!o.account || !o.chainId || !
|
|
1558
|
+
let c = o.order;
|
|
1559
|
+
const m = !c;
|
|
1560
|
+
if (!c || c.status === M.Open && c.deadline + 6e4 <= Date.now()) {
|
|
1561
|
+
if (!o.account || !o.chainId || !c && !o.preparedOrder)
|
|
1559
1562
|
throw new Error("The original swap status is still unknown. Check its account history before starting another swap.");
|
|
1560
1563
|
const u = await Ze({
|
|
1561
1564
|
swapper: o.account,
|
|
1562
1565
|
chainId: o.chainId,
|
|
1563
1566
|
getv1orders: !1,
|
|
1564
1567
|
signal: n
|
|
1565
|
-
}),
|
|
1566
|
-
if (
|
|
1568
|
+
}), I = c;
|
|
1569
|
+
if (c = I ? u.find((g) => g.id.toLowerCase() === I.id.toLowerCase() && g.chainId === I.chainId && g.historyKey === I.historyKey) : o.preparedOrder && Yt(u, o.preparedOrder.order), !c)
|
|
1567
1570
|
throw new we(
|
|
1568
1571
|
"The original order has not appeared in history yet. Check its status again before starting another swap.",
|
|
1569
1572
|
"unconfirmed",
|
|
1570
1573
|
o.orderId ?? ""
|
|
1571
1574
|
);
|
|
1572
1575
|
}
|
|
1573
|
-
if (n.throwIfAborted(), !s(d.SETTLING, { order:
|
|
1574
|
-
w(() => Be(e,
|
|
1576
|
+
if (n.throwIfAborted(), !s(d.SETTLING, { order: c, orderId: c.id })) return;
|
|
1577
|
+
w(() => Be(e, c)), m && w(() => {
|
|
1575
1578
|
var u;
|
|
1576
|
-
return (u = t == null ? void 0 : t.onOrderCreated) == null ? void 0 : u.call(t,
|
|
1579
|
+
return (u = t == null ? void 0 : t.onOrderCreated) == null ? void 0 : u.call(t, c);
|
|
1577
1580
|
});
|
|
1578
|
-
const E = ((
|
|
1581
|
+
const E = ((a = o.form) == null ? void 0 : a.module) === Q.SWAP ? await Ke({ store: e, callbacks: t, order: c, executionId: i, signal: n }) : c;
|
|
1579
1582
|
return s(d.SUCCESS, { order: E, orderId: E.id }), E;
|
|
1580
|
-
} catch (
|
|
1581
|
-
throw s(
|
|
1582
|
-
error: X(
|
|
1583
|
-
parsedError: te(
|
|
1584
|
-
}),
|
|
1583
|
+
} catch (c) {
|
|
1584
|
+
throw s(xe(c, d.SETTLING) ? d.UNCONFIRMED : d.FAILED, {
|
|
1585
|
+
error: X(c),
|
|
1586
|
+
parsedError: te(c)
|
|
1587
|
+
}), c;
|
|
1585
1588
|
}
|
|
1586
1589
|
}
|
|
1587
1590
|
const Zt = () => {
|
|
1588
|
-
const e = b(), { callbacks: t } =
|
|
1591
|
+
const e = b(), { callbacks: t } = x(), n = le(void 0);
|
|
1589
1592
|
return Y(() => () => {
|
|
1590
1593
|
var r;
|
|
1591
1594
|
return (r = n.current) == null ? void 0 : r.abort();
|
|
1592
|
-
}, []),
|
|
1595
|
+
}, []), v(() => {
|
|
1593
1596
|
if (n.current) return;
|
|
1594
1597
|
const r = new AbortController();
|
|
1595
1598
|
n.current = r, Xt({ store: e, callbacks: t, signal: r.signal }).catch(() => {
|
|
@@ -1597,7 +1600,7 @@ const Zt = () => {
|
|
|
1597
1600
|
n.current === r && (n.current = void 0);
|
|
1598
1601
|
});
|
|
1599
1602
|
}, [t, e]);
|
|
1600
|
-
},
|
|
1603
|
+
}, Ir = () => {
|
|
1601
1604
|
const e = $t(), {
|
|
1602
1605
|
inputToken: t,
|
|
1603
1606
|
outputToken: n,
|
|
@@ -1605,13 +1608,13 @@ const Zt = () => {
|
|
|
1605
1608
|
hasChainId: i,
|
|
1606
1609
|
module: o,
|
|
1607
1610
|
overrides: s
|
|
1608
|
-
} =
|
|
1609
|
-
() => u(
|
|
1610
|
-
[o, s, u]
|
|
1611
|
-
),
|
|
1611
|
+
} = x(), { data: a, isLoading: c } = J(), m = zt(), E = Zt(), u = A((T) => T.startNewOrder), I = v(() => m(), [m]), g = v(
|
|
1612
|
+
() => u(Fe({ module: o, overrides: s }), e.executionId),
|
|
1613
|
+
[o, s, u, e.executionId]
|
|
1614
|
+
), P = lt(e.phase), p = mt(e.phase), O = ie(e.phase);
|
|
1612
1615
|
return R(() => ({
|
|
1613
1616
|
phase: e.phase,
|
|
1614
|
-
status:
|
|
1617
|
+
status: P,
|
|
1615
1618
|
error: e.parsedError,
|
|
1616
1619
|
currentStep: p,
|
|
1617
1620
|
currentStepIndex: e.stepIndex,
|
|
@@ -1625,33 +1628,33 @@ const Zt = () => {
|
|
|
1625
1628
|
account: e.account,
|
|
1626
1629
|
orderId: e.orderId,
|
|
1627
1630
|
order: e.order,
|
|
1628
|
-
submitOrder:
|
|
1631
|
+
submitOrder: I,
|
|
1629
1632
|
resumeTracking: E,
|
|
1630
|
-
startNewOrder:
|
|
1633
|
+
startNewOrder: g,
|
|
1631
1634
|
returnToOrderForm: e.returnToOrderForm,
|
|
1632
|
-
isExecuting:
|
|
1635
|
+
isExecuting: O,
|
|
1633
1636
|
isSuccess: e.phase === d.SUCCESS,
|
|
1634
1637
|
isFailed: e.phase === d.FAILED,
|
|
1635
1638
|
isRejected: e.phase === d.REJECTED,
|
|
1636
1639
|
isUnconfirmed: e.phase === d.UNCONFIRMED,
|
|
1637
|
-
isPreparingOrder: e.phase === d.PREPARING || i &&
|
|
1638
|
-
canDismiss: !
|
|
1640
|
+
isPreparingOrder: e.phase === d.PREPARING || i && c && !a,
|
|
1641
|
+
canDismiss: !O
|
|
1639
1642
|
}), [
|
|
1640
|
-
|
|
1643
|
+
a,
|
|
1641
1644
|
p,
|
|
1642
1645
|
t,
|
|
1643
1646
|
n,
|
|
1644
1647
|
r,
|
|
1645
|
-
|
|
1646
|
-
|
|
1648
|
+
c,
|
|
1649
|
+
O,
|
|
1647
1650
|
i,
|
|
1648
|
-
|
|
1649
|
-
|
|
1651
|
+
g,
|
|
1652
|
+
I,
|
|
1650
1653
|
E,
|
|
1651
|
-
|
|
1654
|
+
P,
|
|
1652
1655
|
e
|
|
1653
1656
|
]);
|
|
1654
|
-
},
|
|
1657
|
+
}, Sr = () => {
|
|
1655
1658
|
const {
|
|
1656
1659
|
inputToken: e,
|
|
1657
1660
|
outputToken: t,
|
|
@@ -1660,20 +1663,20 @@ const Zt = () => {
|
|
|
1660
1663
|
noLiquidity: i,
|
|
1661
1664
|
inputAmountUi: o,
|
|
1662
1665
|
marketPriceLoading: s,
|
|
1663
|
-
hasChainId:
|
|
1664
|
-
} =
|
|
1666
|
+
hasChainId: a
|
|
1667
|
+
} = x(), c = W(), { data: m, isLoading: E } = J(), u = A(
|
|
1665
1668
|
(T) => T.state.currentExecution.phase
|
|
1666
|
-
),
|
|
1669
|
+
), I = ie(u), g = !!(e && $(e.address) && (!n || $(n.address))), P = s || !c.isReady && !c.errors.primary || r === void 0, p = I || a && E && !m || !!(e && t && o && P), O = !!(!c.canSubmit || Z(u) || !a || !m || i || p || !e || !t || g);
|
|
1667
1670
|
return R(() => ({
|
|
1668
|
-
disabled:
|
|
1671
|
+
disabled: O,
|
|
1669
1672
|
loading: p
|
|
1670
|
-
}), [
|
|
1673
|
+
}), [O, p]);
|
|
1671
1674
|
}, Or = () => {
|
|
1672
|
-
const { inputToken: e, outputToken: t, callbacks: n } =
|
|
1675
|
+
const { inputToken: e, outputToken: t, callbacks: n } = x(), r = A((s) => s.updateState), { trades: i } = W(), o = v(
|
|
1673
1676
|
(s) => {
|
|
1674
1677
|
r({ tradeCount: s }), w(() => {
|
|
1675
|
-
var
|
|
1676
|
-
return (
|
|
1678
|
+
var a;
|
|
1679
|
+
return (a = n == null ? void 0 : n.onTradeCountChange) == null ? void 0 : a.call(n, s);
|
|
1677
1680
|
});
|
|
1678
1681
|
},
|
|
1679
1682
|
[n, r]
|
|
@@ -1693,37 +1696,37 @@ const Zt = () => {
|
|
|
1693
1696
|
[e, o, t, i]
|
|
1694
1697
|
);
|
|
1695
1698
|
}, Pr = () => {
|
|
1696
|
-
const { marketPriceLoading: e, inputToken: t, outputToken: n, callbacks: r } =
|
|
1697
|
-
(
|
|
1698
|
-
|
|
1699
|
-
var
|
|
1700
|
-
return (
|
|
1699
|
+
const { marketPriceLoading: e, inputToken: t, outputToken: n, callbacks: r } = x(), { marketPrice: i, trades: o, triggerPrice: s, isInverted: a } = W(), c = A((I) => I.updateState), m = v(
|
|
1700
|
+
(I) => {
|
|
1701
|
+
c({ triggerPriceUi: I, triggerPricePercent: null }), w(() => {
|
|
1702
|
+
var g;
|
|
1703
|
+
return (g = r == null ? void 0 : r.onTriggerPriceChange) == null ? void 0 : g.call(r, I || "");
|
|
1701
1704
|
}), w(() => {
|
|
1702
|
-
var
|
|
1703
|
-
return (
|
|
1705
|
+
var g;
|
|
1706
|
+
return (g = r == null ? void 0 : r.onTriggerPricePercentChange) == null ? void 0 : g.call(r, "");
|
|
1704
1707
|
});
|
|
1705
1708
|
},
|
|
1706
|
-
[r,
|
|
1707
|
-
), E =
|
|
1708
|
-
(
|
|
1709
|
-
|
|
1709
|
+
[r, c]
|
|
1710
|
+
), E = v(
|
|
1711
|
+
(I) => {
|
|
1712
|
+
c({
|
|
1710
1713
|
triggerPriceUi: void 0,
|
|
1711
|
-
triggerPricePercent:
|
|
1714
|
+
triggerPricePercent: I
|
|
1712
1715
|
}), w(() => {
|
|
1713
|
-
var
|
|
1714
|
-
return (
|
|
1716
|
+
var g;
|
|
1717
|
+
return (g = r == null ? void 0 : r.onTriggerPriceChange) == null ? void 0 : g.call(r, "");
|
|
1715
1718
|
}), w(() => {
|
|
1716
|
-
var
|
|
1717
|
-
return (
|
|
1719
|
+
var g;
|
|
1720
|
+
return (g = r == null ? void 0 : r.onTriggerPricePercentChange) == null ? void 0 : g.call(r, I || "");
|
|
1718
1721
|
});
|
|
1719
1722
|
},
|
|
1720
|
-
[r,
|
|
1721
|
-
), u =
|
|
1722
|
-
|
|
1723
|
+
[r, c]
|
|
1724
|
+
), u = v(() => {
|
|
1725
|
+
c({
|
|
1723
1726
|
triggerPricePercent: void 0,
|
|
1724
1727
|
triggerPriceUi: void 0
|
|
1725
1728
|
});
|
|
1726
|
-
}, [
|
|
1729
|
+
}, [c]);
|
|
1727
1730
|
return R(
|
|
1728
1731
|
() => ({
|
|
1729
1732
|
price: s.display,
|
|
@@ -1736,14 +1739,14 @@ const Zt = () => {
|
|
|
1736
1739
|
onReset: u,
|
|
1737
1740
|
inputToken: t,
|
|
1738
1741
|
outputToken: n,
|
|
1739
|
-
displayInputToken:
|
|
1740
|
-
displayOutputToken:
|
|
1742
|
+
displayInputToken: a ? n : t,
|
|
1743
|
+
displayOutputToken: a ? t : n,
|
|
1741
1744
|
isLoading: !!(e || !i.raw),
|
|
1742
1745
|
isTypedValue: s.isTypedValue
|
|
1743
1746
|
}),
|
|
1744
1747
|
[
|
|
1745
1748
|
t,
|
|
1746
|
-
|
|
1749
|
+
a,
|
|
1747
1750
|
i.raw,
|
|
1748
1751
|
e,
|
|
1749
1752
|
m,
|
|
@@ -1768,8 +1771,8 @@ export {
|
|
|
1768
1771
|
Rr as ORBS_TWAP_FAQ_URL,
|
|
1769
1772
|
Nr as ORBS_WEBSITE_URL,
|
|
1770
1773
|
Lr as OrderFilter,
|
|
1771
|
-
|
|
1772
|
-
|
|
1774
|
+
xr as OrderSettlementError,
|
|
1775
|
+
Fr as OrderStatus,
|
|
1773
1776
|
Ur as OrderType,
|
|
1774
1777
|
Dr as Partners,
|
|
1775
1778
|
Mr as QuoteError,
|
|
@@ -1799,13 +1802,13 @@ export {
|
|
|
1799
1802
|
nn as setUIVersion,
|
|
1800
1803
|
on as submitSwap,
|
|
1801
1804
|
sn as toAmountRaw,
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
+
cn as toAmountUI,
|
|
1806
|
+
cr as useAmountUi,
|
|
1807
|
+
ar as useCancelOrder,
|
|
1805
1808
|
J as useClient,
|
|
1806
1809
|
dr as useDisclaimer,
|
|
1807
1810
|
ur as useDuration,
|
|
1808
|
-
|
|
1811
|
+
Ir as useExecution,
|
|
1809
1812
|
lr as useFillDelay,
|
|
1810
1813
|
mr as useHistoryOrder,
|
|
1811
1814
|
fr as useInputErrors,
|
|
@@ -1814,9 +1817,9 @@ export {
|
|
|
1814
1817
|
or as useOrders,
|
|
1815
1818
|
hr as useOutputAmount,
|
|
1816
1819
|
Er as usePriceDisplay,
|
|
1817
|
-
|
|
1820
|
+
Sr as useSubmitButton,
|
|
1818
1821
|
Or as useTrades,
|
|
1819
1822
|
Pr as useTriggerPrice,
|
|
1820
|
-
|
|
1823
|
+
an as waitForOrder,
|
|
1821
1824
|
dn as watchOrder
|
|
1822
1825
|
};
|