@velora-dex/sdk 9.5.4-dev.2 → 9.5.4
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 +0 -156
- package/dist/examples/helpers/delta.d.ts +1 -1
- package/dist/examples/helpers/delta.d.ts.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/methods/delta/cancelDeltaOrder.d.ts.map +1 -1
- package/dist/methods/delta/getDeltaOrders.d.ts +4 -4
- package/dist/methods/delta/getDeltaOrders.d.ts.map +1 -1
- package/dist/methods/delta/getDeltaPrice.d.ts +1 -1
- package/dist/methods/delta/getDeltaPrice.d.ts.map +1 -1
- package/dist/methods/delta/helpers/orders.d.ts +17 -16
- package/dist/methods/delta/helpers/orders.d.ts.map +1 -1
- package/dist/methods/delta/helpers/types.d.ts +11 -56
- package/dist/methods/delta/helpers/types.d.ts.map +1 -1
- package/dist/methods/delta/postDeltaOrder.d.ts +3 -3
- package/dist/methods/delta/postDeltaOrder.d.ts.map +1 -1
- package/dist/sdk/full.d.ts +0 -2
- package/dist/sdk/full.d.ts.map +1 -1
- package/dist/sdk/simple.d.ts +0 -4
- package/dist/sdk/simple.d.ts.map +1 -1
- package/dist/sdk.cjs.development.js +402 -1539
- 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 +387 -1523
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types.d.ts +0 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/examples/helpers/delta.ts +1 -6
- package/src/index.js +0 -55
- package/src/index.ts +0 -37
- package/src/methods/delta/cancelDeltaOrder.ts +1 -4
- package/src/methods/delta/getDeltaOrders.ts +5 -6
- package/src/methods/delta/getDeltaPrice.ts +1 -1
- package/src/methods/delta/helpers/orders.ts +20 -32
- package/src/methods/delta/helpers/types.ts +15 -60
- package/src/methods/delta/postDeltaOrder.ts +4 -4
- package/src/methods/delta/postTWAPDeltaOrder.ts +1 -1
- package/src/sdk/full.ts +0 -8
- package/src/sdk/simple.ts +0 -30
- package/src/types.ts +0 -9
- package/dist/examples/deltaV2.d.ts +0 -2
- package/dist/examples/deltaV2.d.ts.map +0 -1
- package/dist/examples/helpers/deltaV2.d.ts +0 -5
- package/dist/examples/helpers/deltaV2.d.ts.map +0 -1
- package/dist/methods/deltaV2/buildDeltaOrder.d.ts +0 -45
- package/dist/methods/deltaV2/buildDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/buildExternalDeltaOrder.d.ts +0 -49
- package/dist/methods/deltaV2/buildExternalDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/buildTWAPDeltaOrder.d.ts +0 -60
- package/dist/methods/deltaV2/buildTWAPDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/cancelDeltaOrder.d.ts +0 -21
- package/dist/methods/deltaV2/cancelDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/getAgentsList.d.ts +0 -10
- package/dist/methods/deltaV2/getAgentsList.d.ts.map +0 -1
- package/dist/methods/deltaV2/getBridgeRoutes.d.ts +0 -20
- package/dist/methods/deltaV2/getBridgeRoutes.d.ts.map +0 -1
- package/dist/methods/deltaV2/getDeltaOrders.d.ts +0 -40
- package/dist/methods/deltaV2/getDeltaOrders.d.ts.map +0 -1
- package/dist/methods/deltaV2/getDeltaPrice.d.ts +0 -46
- package/dist/methods/deltaV2/getDeltaPrice.d.ts.map +0 -1
- package/dist/methods/deltaV2/helpers/orders.d.ts +0 -191
- package/dist/methods/deltaV2/helpers/orders.d.ts.map +0 -1
- package/dist/methods/deltaV2/index.d.ts +0 -72
- package/dist/methods/deltaV2/index.d.ts.map +0 -1
- package/dist/methods/deltaV2/isTokenSupportedInDelta.d.ts +0 -8
- package/dist/methods/deltaV2/isTokenSupportedInDelta.d.ts.map +0 -1
- package/dist/methods/deltaV2/postDeltaOrder.d.ts +0 -29
- package/dist/methods/deltaV2/postDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/postExternalDeltaOrder.d.ts +0 -11
- package/dist/methods/deltaV2/postExternalDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/postTWAPDeltaOrder.d.ts +0 -17
- package/dist/methods/deltaV2/postTWAPDeltaOrder.d.ts.map +0 -1
- package/dist/methods/deltaV2/types.d.ts +0 -169
- package/dist/methods/deltaV2/types.d.ts.map +0 -1
- package/src/examples/deltaV2.ts +0 -196
- package/src/examples/helpers/deltaV2.ts +0 -34
- package/src/methods/deltaV2/buildDeltaOrder.ts +0 -86
- package/src/methods/deltaV2/buildExternalDeltaOrder.ts +0 -95
- package/src/methods/deltaV2/buildTWAPDeltaOrder.ts +0 -131
- package/src/methods/deltaV2/cancelDeltaOrder.ts +0 -100
- package/src/methods/deltaV2/getAgentsList.ts +0 -32
- package/src/methods/deltaV2/getBridgeRoutes.ts +0 -82
- package/src/methods/deltaV2/getDeltaOrders.ts +0 -149
- package/src/methods/deltaV2/getDeltaPrice.ts +0 -108
- package/src/methods/deltaV2/helpers/orders.ts +0 -363
- package/src/methods/deltaV2/index.ts +0 -312
- package/src/methods/deltaV2/isTokenSupportedInDelta.ts +0 -52
- package/src/methods/deltaV2/postDeltaOrder.ts +0 -62
- package/src/methods/deltaV2/postExternalDeltaOrder.ts +0 -45
- package/src/methods/deltaV2/postTWAPDeltaOrder.ts +0 -58
- package/src/methods/deltaV2/types.ts +0 -202
package/dist/types.d.ts
CHANGED
|
@@ -159,12 +159,4 @@ export interface JsonFragment {
|
|
|
159
159
|
*/
|
|
160
160
|
readonly gas?: string;
|
|
161
161
|
}
|
|
162
|
-
/** @description Standard pagination envelope returned by paginated API endpoints. */
|
|
163
|
-
export type PaginatedResponse<T> = {
|
|
164
|
-
data: T[];
|
|
165
|
-
total: number;
|
|
166
|
-
page: number;
|
|
167
|
-
limit: number;
|
|
168
|
-
hasMore: boolean;
|
|
169
|
-
};
|
|
170
162
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,WAAW,EACX,KAAK,EACL,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,YAAY,EACV,OAAO,EACP,eAAe,EACf,WAAW,EACX,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,GACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KAC3D,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK;CACtD,CAAC,MAAM,CAAC,CAAC,CAAC;AAKX,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,eAAe,CAAC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uIAAuI;AACvI,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAE3E,UAAU,gBAAgB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACpD,GAAG,EAAE,GAA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AAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -37,10 +37,5 @@ function fetchOrderPeriodically(getDeltaOrder: GetDeltaOrderFn) {
|
|
|
37
37
|
|
|
38
38
|
export function startStatusCheck(getDeltaOrder: GetDeltaOrderFn) {
|
|
39
39
|
const intervalId = fetchOrderPeriodically(getDeltaOrder);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return () => {
|
|
43
|
-
clearInterval(intervalId);
|
|
44
|
-
clearTimeout(timeoutId);
|
|
45
|
-
};
|
|
40
|
+
setTimeout(() => clearInterval(intervalId), 60000 * 5); // Stop after 5 minutes
|
|
46
41
|
}
|
package/src/index.js
CHANGED
|
@@ -46,30 +46,9 @@ import { constructApproveTokenForDelta } from './methods/delta/approveForDelta';
|
|
|
46
46
|
import { constructGetPartnerFee } from './methods/delta/getPartnerFee';
|
|
47
47
|
import { constructGetBridgeInfo } from './methods/delta/getBridgeInfo';
|
|
48
48
|
import { constructIsTokenSupportedInDelta } from './methods/delta/isTokenSupportedInDelta';
|
|
49
|
-
import { constructBuildExternalDeltaOrder } from './methods/delta/buildExternalDeltaOrder';
|
|
50
|
-
import { constructSignExternalDeltaOrder } from './methods/delta/signExternalDeltaOrder';
|
|
51
|
-
import { constructPostExternalDeltaOrder } from './methods/delta/postExternalDeltaOrder';
|
|
52
|
-
import { constructPreSignExternalDeltaOrder } from './methods/delta/preSignExternalDeltaOrder';
|
|
53
|
-
import { constructBuildTWAPDeltaOrder } from './methods/delta/buildTWAPDeltaOrder';
|
|
54
|
-
import { constructSignTWAPDeltaOrder } from './methods/delta/signTWAPDeltaOrder';
|
|
55
|
-
import { constructPostTWAPDeltaOrder } from './methods/delta/postTWAPDeltaOrder';
|
|
56
|
-
import { constructPreSignTWAPDeltaOrder } from './methods/delta/preSignTWAPDeltaOrder';
|
|
57
49
|
import { constructGetQuote } from './methods/quote/getQuote';
|
|
58
50
|
import { constructCancelDeltaOrder } from './methods/delta/cancelDeltaOrder';
|
|
59
51
|
import { constructDeltaTokenModule } from './methods/delta/deltaTokenModule';
|
|
60
|
-
// Delta v2 modules
|
|
61
|
-
import { constructBuildDeltaOrderV2 } from './methods/deltaV2/buildDeltaOrderV2';
|
|
62
|
-
import { constructBuildExternalDeltaOrderV2 } from './methods/deltaV2/buildExternalDeltaOrderV2';
|
|
63
|
-
import { constructBuildTWAPDeltaOrderV2 } from './methods/deltaV2/buildTWAPDeltaOrderV2';
|
|
64
|
-
import { constructPostDeltaOrderV2 } from './methods/deltaV2/postDeltaOrderV2';
|
|
65
|
-
import { constructPostExternalDeltaOrderV2 } from './methods/deltaV2/postExternalDeltaOrderV2';
|
|
66
|
-
import { constructPostTWAPDeltaOrderV2 } from './methods/deltaV2/postTWAPDeltaOrderV2';
|
|
67
|
-
import { constructGetDeltaPriceV2 } from './methods/deltaV2/getDeltaPriceV2';
|
|
68
|
-
import { constructGetDeltaOrdersV2 } from './methods/deltaV2/getDeltaOrdersV2';
|
|
69
|
-
import { constructGetBridgeRoutes } from './methods/deltaV2/getBridgeRoutes';
|
|
70
|
-
import { constructIsTokenSupportedInDeltaV2 } from './methods/deltaV2/isTokenSupportedInDeltaV2';
|
|
71
|
-
import { constructCancelDeltaOrderV2 } from './methods/deltaV2/cancelDeltaOrderV2';
|
|
72
|
-
import { constructGetAgentsListV2 } from './methods/deltaV2/getAgentsListV2';
|
|
73
52
|
export { constructSwapSDK } from './methods/swap';
|
|
74
53
|
export {
|
|
75
54
|
constructAllLimitOrdersHandlers,
|
|
@@ -78,16 +57,7 @@ export {
|
|
|
78
57
|
export {
|
|
79
58
|
constructAllDeltaOrdersHandlers,
|
|
80
59
|
constructSubmitDeltaOrder,
|
|
81
|
-
constructSubmitExternalDeltaOrder,
|
|
82
|
-
constructSubmitTWAPDeltaOrder,
|
|
83
60
|
} from './methods/delta';
|
|
84
|
-
export {
|
|
85
|
-
constructAllDeltaV2OrdersHandlers,
|
|
86
|
-
constructSubmitDeltaOrderV2,
|
|
87
|
-
constructSubmitExternalDeltaOrderV2,
|
|
88
|
-
constructSubmitTWAPDeltaOrderV2,
|
|
89
|
-
constructSignDeltaOrderV2,
|
|
90
|
-
} from './methods/deltaV2';
|
|
91
61
|
export * from './constants';
|
|
92
62
|
// can import these individually
|
|
93
63
|
// and use in constructPartialSDK only what you need
|
|
@@ -132,31 +102,8 @@ export {
|
|
|
132
102
|
constructCancelDeltaOrder,
|
|
133
103
|
constructDeltaTokenModule,
|
|
134
104
|
constructApproveTokenForDelta,
|
|
135
|
-
// External Delta methods
|
|
136
|
-
constructBuildExternalDeltaOrder,
|
|
137
|
-
constructSignExternalDeltaOrder,
|
|
138
|
-
constructPostExternalDeltaOrder,
|
|
139
|
-
constructPreSignExternalDeltaOrder,
|
|
140
|
-
// TWAP Delta methods
|
|
141
|
-
constructBuildTWAPDeltaOrder,
|
|
142
|
-
constructSignTWAPDeltaOrder,
|
|
143
|
-
constructPostTWAPDeltaOrder,
|
|
144
|
-
constructPreSignTWAPDeltaOrder,
|
|
145
105
|
// Quote methods
|
|
146
106
|
constructGetQuote,
|
|
147
|
-
// Delta V2 methods
|
|
148
|
-
constructBuildDeltaOrderV2,
|
|
149
|
-
constructBuildExternalDeltaOrderV2,
|
|
150
|
-
constructBuildTWAPDeltaOrderV2,
|
|
151
|
-
constructPostDeltaOrderV2,
|
|
152
|
-
constructPostExternalDeltaOrderV2,
|
|
153
|
-
constructPostTWAPDeltaOrderV2,
|
|
154
|
-
constructGetDeltaPriceV2,
|
|
155
|
-
constructGetDeltaOrdersV2,
|
|
156
|
-
constructGetBridgeRoutes,
|
|
157
|
-
constructIsTokenSupportedInDeltaV2,
|
|
158
|
-
constructCancelDeltaOrderV2,
|
|
159
|
-
constructGetAgentsListV2,
|
|
160
107
|
// different helpers
|
|
161
108
|
constructGetPartnerFee,
|
|
162
109
|
constructGetBridgeInfo,
|
|
@@ -183,5 +130,3 @@ export * from './methods/limitOrders/helpers/types';
|
|
|
183
130
|
export * from './methods/nftOrders';
|
|
184
131
|
export * from './methods/nftOrders/helpers/types';
|
|
185
132
|
export { AssetType } from './methods/nftOrders/helpers/misc';
|
|
186
|
-
// helpers for Delta Orders
|
|
187
|
-
export { OrderHelpers } from './methods/delta/helpers/orders';
|
package/src/index.ts
CHANGED
|
@@ -135,7 +135,6 @@ import type {
|
|
|
135
135
|
OptionalRate,
|
|
136
136
|
APIVersion,
|
|
137
137
|
ExtraFetchParams,
|
|
138
|
-
PaginatedResponse,
|
|
139
138
|
} from './types';
|
|
140
139
|
|
|
141
140
|
import type {
|
|
@@ -147,23 +146,19 @@ import type {
|
|
|
147
146
|
BridgeStatus,
|
|
148
147
|
Bridge,
|
|
149
148
|
ExternalDeltaOrder,
|
|
150
|
-
ProductiveDeltaOrder,
|
|
151
149
|
TWAPDeltaOrder,
|
|
152
150
|
TWAPBuyDeltaOrder,
|
|
153
151
|
TWAPOnChainOrderType,
|
|
154
152
|
OnChainOrderType,
|
|
155
|
-
DeltaOrderType,
|
|
156
153
|
SwapSideUnion,
|
|
157
154
|
DeltaAmountsWithSlippage,
|
|
158
155
|
DeltaAmountsSellSlippage,
|
|
159
156
|
DeltaAmountsBuySlippage,
|
|
160
157
|
DeltaAmountsExplicit,
|
|
161
158
|
DeltaAuctionDelta,
|
|
162
|
-
DeltaAuctionFillable,
|
|
163
159
|
DeltaAuctionTWAP,
|
|
164
160
|
DeltaAuctionTWAPBuy,
|
|
165
161
|
DeltaAuctionExternal,
|
|
166
|
-
DeltaAuctionProductive,
|
|
167
162
|
DeltaOrderUnion,
|
|
168
163
|
DeltaAuctionUnion,
|
|
169
164
|
UnifiedDeltaOrderData,
|
|
@@ -311,32 +306,6 @@ export {
|
|
|
311
306
|
SubmitTWAPDeltaOrderParams,
|
|
312
307
|
} from './methods/delta';
|
|
313
308
|
|
|
314
|
-
// Delta v2 is exposed as a single namespace so it can ship alongside v1 without
|
|
315
|
-
// colliding at the top level. v2 source uses unsuffixed names internally
|
|
316
|
-
// (constructBuildDeltaOrder, BuiltDeltaOrder, DeltaPrice, ...); consumers reach
|
|
317
|
-
// them via `DeltaV2.constructBuildDeltaOrder` etc.
|
|
318
|
-
//
|
|
319
|
-
// Migration plan when deprecating v1 (breaking change):
|
|
320
|
-
// 1. Replace the bare `export { ... } from './methods/delta'` block above with
|
|
321
|
-
// `export * from './methods/deltaV2'` (or named re-exports of v2 symbols).
|
|
322
|
-
// Top-level `constructPostDeltaOrder` now resolves to v2.
|
|
323
|
-
// 2. Move v1 behind its own namespace for backcompat:
|
|
324
|
-
// `export * as DeltaV1 from './methods/delta'`.
|
|
325
|
-
// 3. Keep `export * as DeltaV2 from './methods/deltaV2'` as a redundant alias
|
|
326
|
-
// so code written against the v2 namespace today keeps compiling.
|
|
327
|
-
// 4. Mirror this on the bundled SDKs in sdk/full.ts and sdk/simple.ts:
|
|
328
|
-
// `sdk.delta.*` flips to v2 (use `constructAllDeltaOrdersHandlers` from
|
|
329
|
-
// './methods/deltaV2'), and add `sdk.deltaV1.*` for backcompat.
|
|
330
|
-
//
|
|
331
|
-
// Migration plan when dropping v1 entirely:
|
|
332
|
-
// - Delete the `DeltaV1` namespace export and `sdk.deltaV1` field.
|
|
333
|
-
// - Delete `src/methods/delta/`.
|
|
334
|
-
// - Delete the `DeltaV2` re-export alias (consumers can move to bare names).
|
|
335
|
-
// - The `methods/deltaV2/` folder can be renamed to `methods/delta/` (and the
|
|
336
|
-
// `/delta/v2/` URL prefix in the leaf modules updated if the server has by
|
|
337
|
-
// then collapsed v1 and v2 endpoints).
|
|
338
|
-
export * as DeltaV2 from './methods/deltaV2';
|
|
339
|
-
|
|
340
309
|
export type {
|
|
341
310
|
TransactionParams,
|
|
342
311
|
BuildOptions,
|
|
@@ -489,11 +458,9 @@ export type {
|
|
|
489
458
|
DeltaAuctionOrder,
|
|
490
459
|
DeltaAuction,
|
|
491
460
|
DeltaAuctionDelta,
|
|
492
|
-
DeltaAuctionFillable,
|
|
493
461
|
DeltaAuctionTWAP,
|
|
494
462
|
DeltaAuctionTWAPBuy,
|
|
495
463
|
DeltaAuctionExternal,
|
|
496
|
-
DeltaAuctionProductive,
|
|
497
464
|
DeltaOrderUnion,
|
|
498
465
|
DeltaAuctionUnion,
|
|
499
466
|
UnifiedDeltaOrderData,
|
|
@@ -529,13 +496,10 @@ export type {
|
|
|
529
496
|
DepositNativeAndPreSignDeltaOrderParams,
|
|
530
497
|
// External Delta types
|
|
531
498
|
ExternalDeltaOrder,
|
|
532
|
-
// Productive Delta types
|
|
533
|
-
ProductiveDeltaOrder,
|
|
534
499
|
TWAPDeltaOrder,
|
|
535
500
|
TWAPBuyDeltaOrder,
|
|
536
501
|
TWAPOnChainOrderType,
|
|
537
502
|
OnChainOrderType,
|
|
538
|
-
DeltaOrderType,
|
|
539
503
|
DeltaAmountsWithSlippage,
|
|
540
504
|
DeltaAmountsSellSlippage,
|
|
541
505
|
DeltaAmountsBuySlippage,
|
|
@@ -584,7 +548,6 @@ export type {
|
|
|
584
548
|
APIVersion,
|
|
585
549
|
SwapSideUnion,
|
|
586
550
|
ExtraFetchParams,
|
|
587
|
-
PaginatedResponse,
|
|
588
551
|
};
|
|
589
552
|
|
|
590
553
|
export { SDKConfig, constructPartialSDK } from './sdk/partial';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { API_URL } from '../../constants';
|
|
2
1
|
import type {
|
|
3
2
|
ConstructProviderFetchInput,
|
|
4
3
|
RequestParameters,
|
|
@@ -44,8 +43,6 @@ export const constructCancelDeltaOrder = (
|
|
|
44
43
|
'contractCaller' | 'fetcher' | 'apiURL' | 'chainId'
|
|
45
44
|
>
|
|
46
45
|
): CancelDeltaOrderFunctions => {
|
|
47
|
-
const apiURL = options.apiURL ?? API_URL;
|
|
48
|
-
|
|
49
46
|
// cached internally
|
|
50
47
|
const { getDeltaContract } = constructGetDeltaContract(options);
|
|
51
48
|
|
|
@@ -72,7 +69,7 @@ export const constructCancelDeltaOrder = (
|
|
|
72
69
|
params,
|
|
73
70
|
requestParams
|
|
74
71
|
) => {
|
|
75
|
-
const cancelUrl = `${apiURL}/delta/orders/cancel` as const;
|
|
72
|
+
const cancelUrl = `${options.apiURL}/delta/orders/cancel` as const;
|
|
76
73
|
|
|
77
74
|
const res = await options.fetcher<SuccessResponse>({
|
|
78
75
|
url: cancelUrl,
|
|
@@ -8,8 +8,7 @@ import type {
|
|
|
8
8
|
import type {
|
|
9
9
|
DeltaAuction,
|
|
10
10
|
DeltaAuctionStatus,
|
|
11
|
-
|
|
12
|
-
OnChainOrderMap,
|
|
11
|
+
OnChainOrderType,
|
|
13
12
|
} from './helpers/types';
|
|
14
13
|
|
|
15
14
|
/** @deprecated Use DeltaAuction directly */
|
|
@@ -33,7 +32,7 @@ type GetDeltaOrderByHash = (
|
|
|
33
32
|
requestParams?: RequestParameters
|
|
34
33
|
) => Promise<DeltaAuction>;
|
|
35
34
|
|
|
36
|
-
type OrdersFilter<T extends
|
|
35
|
+
type OrdersFilter<T extends OnChainOrderType = OnChainOrderType> = {
|
|
37
36
|
/** @description Order.owner to fetch Delta Order for */
|
|
38
37
|
userAddress: Address;
|
|
39
38
|
/** @description Pagination option, page. Default 1 */
|
|
@@ -53,7 +52,7 @@ type OrdersFilter<T extends keyof OnChainOrderMap = keyof OnChainOrderMap> = {
|
|
|
53
52
|
*/
|
|
54
53
|
status?: DeltaOrderFilterByStatus[];
|
|
55
54
|
/** @description Filter by type. MARKET, LIMIT. Orders with both types are returned if not specified */
|
|
56
|
-
type?:
|
|
55
|
+
type?: 'MARKET' | 'LIMIT';
|
|
57
56
|
/** @description Filter by on-chain order type. Order, ExternalOrder. Orders of all types are returned if not specified */
|
|
58
57
|
onChainOrderType?: T;
|
|
59
58
|
};
|
|
@@ -63,7 +62,7 @@ type OrderFiltersQuery = Omit<OrdersFilter, 'chainId' | 'status'> & {
|
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
type GetDeltaOrders = {
|
|
66
|
-
<T extends
|
|
65
|
+
<T extends OnChainOrderType>(
|
|
67
66
|
options: OrdersFilter<T> & { onChainOrderType: T },
|
|
68
67
|
requestParams?: RequestParameters
|
|
69
68
|
): Promise<DeltaAuction<T>[]>;
|
|
@@ -127,7 +126,7 @@ export const constructGetDeltaOrders = ({
|
|
|
127
126
|
};
|
|
128
127
|
|
|
129
128
|
const getDeltaOrders: GetDeltaOrders = async <
|
|
130
|
-
T extends
|
|
129
|
+
T extends OnChainOrderType = OnChainOrderType
|
|
131
130
|
>(
|
|
132
131
|
options: OrdersFilter<T>,
|
|
133
132
|
requestParams?: RequestParameters
|
|
@@ -12,7 +12,7 @@ import { BridgePriceInfo } from './helpers/types';
|
|
|
12
12
|
type SwapSideUnion = EnumerateLiteral<typeof SwapSide>;
|
|
13
13
|
|
|
14
14
|
export type DeltaPriceParams = {
|
|
15
|
-
/** @description Source Token Address */
|
|
15
|
+
/** @description Source Token Address. Not Native Token */
|
|
16
16
|
srcToken: string;
|
|
17
17
|
/** @description Destination Token Address */
|
|
18
18
|
destToken: string;
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
ExternalDeltaOrder,
|
|
12
12
|
OnChainOrderType,
|
|
13
13
|
OrderKind,
|
|
14
|
-
ProductiveDeltaOrder,
|
|
15
14
|
SwapSideUnion,
|
|
16
15
|
TWAPBuyDeltaOrder,
|
|
17
16
|
TWAPDeltaOrder,
|
|
@@ -66,16 +65,6 @@ function isDeltaOrder(order: DeltaOrderUnion): order is DeltaAuctionOrder {
|
|
|
66
65
|
);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
/**
|
|
70
|
-
* @description Checks whether an order is a Productive Delta order
|
|
71
|
-
* (strategy-routed order without an explicit OrderKind).
|
|
72
|
-
*/
|
|
73
|
-
function isProductiveOrder(
|
|
74
|
-
order: DeltaOrderUnion
|
|
75
|
-
): order is ProductiveDeltaOrder {
|
|
76
|
-
return 'strategy' in order && typeof order.strategy === 'string';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
68
|
/**
|
|
80
69
|
* @description Checks whether an auction is a TWAP auction.
|
|
81
70
|
*/
|
|
@@ -121,28 +110,17 @@ function isExternalAuction<T extends OnChainOrderType>(auction: {
|
|
|
121
110
|
return auction.onChainOrderType === 'ExternalOrder';
|
|
122
111
|
}
|
|
123
112
|
|
|
124
|
-
/**
|
|
125
|
-
* @description Checks whether an auction is a Productive auction.
|
|
126
|
-
*/
|
|
127
|
-
function isProductiveAuction<T extends OnChainOrderType>(auction: {
|
|
128
|
-
onChainOrderType: T;
|
|
129
|
-
}): auction is { onChainOrderType: 'ProductiveOrder' & T } {
|
|
130
|
-
return auction.onChainOrderType === 'ProductiveOrder';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
113
|
const checks = {
|
|
134
114
|
isTWAPOrder,
|
|
135
115
|
isTWAPSellOrder,
|
|
136
116
|
isTWAPBuyOrder,
|
|
137
117
|
isExternalOrder,
|
|
138
118
|
isDeltaOrder,
|
|
139
|
-
isProductiveOrder,
|
|
140
119
|
isTWAPAuction,
|
|
141
120
|
isTWAPSellAuction,
|
|
142
121
|
isTWAPBuyAuction,
|
|
143
122
|
isDeltaAuction,
|
|
144
123
|
isExternalAuction,
|
|
145
|
-
isProductiveAuction,
|
|
146
124
|
isOrderCrosschain,
|
|
147
125
|
isExecutedAuction,
|
|
148
126
|
isPartiallyExecutedAuction,
|
|
@@ -217,10 +195,12 @@ function getTwapAuctionAmounts(
|
|
|
217
195
|
return {
|
|
218
196
|
final,
|
|
219
197
|
expected,
|
|
198
|
+
minimal: expected, // TWAP orders don't have more detailed amounts
|
|
220
199
|
};
|
|
221
200
|
}
|
|
222
201
|
return {
|
|
223
202
|
expected,
|
|
203
|
+
minimal: expected, // TWAP orders don't have more detailed amounts
|
|
224
204
|
};
|
|
225
205
|
}
|
|
226
206
|
|
|
@@ -293,10 +273,6 @@ function getAuctionSwapSide(auction: DeltaAuction): SwapSideUnion {
|
|
|
293
273
|
// TWAP orders have onChainOrderType instead of kind
|
|
294
274
|
return getSwapSideFromTwapOrderType(auction.onChainOrderType);
|
|
295
275
|
}
|
|
296
|
-
if (isProductiveAuction(auction)) {
|
|
297
|
-
// ProductiveOrders don't carry an explicit OrderKind; treated as SELL.
|
|
298
|
-
return 'SELL';
|
|
299
|
-
}
|
|
300
276
|
return getSwapSideFromDeltaOrder(auction.order);
|
|
301
277
|
}
|
|
302
278
|
|
|
@@ -309,7 +285,7 @@ function getUnifiedDeltaOrderData(
|
|
|
309
285
|
const { order, chainId } = auction;
|
|
310
286
|
|
|
311
287
|
const { srcToken, destToken } = getOrderTokenAddresses(order);
|
|
312
|
-
const { expected, final } = getAuctionAmounts(auction);
|
|
288
|
+
const { expected, final, minimal } = getAuctionAmounts(auction);
|
|
313
289
|
|
|
314
290
|
const srcChainId = chainId;
|
|
315
291
|
const destChainId = getAuctionDestChainId({ order, chainId });
|
|
@@ -326,6 +302,7 @@ function getUnifiedDeltaOrderData(
|
|
|
326
302
|
amounts: {
|
|
327
303
|
expected,
|
|
328
304
|
final,
|
|
305
|
+
minimal,
|
|
329
306
|
},
|
|
330
307
|
srcToken,
|
|
331
308
|
destToken,
|
|
@@ -358,11 +335,7 @@ function getTransactionAmounts(transactions: DeltaAuctionTransaction[]) {
|
|
|
358
335
|
srcAmount: acc.srcAmount + BigInt(spentAmount),
|
|
359
336
|
destAmount:
|
|
360
337
|
acc.destAmount +
|
|
361
|
-
BigInt(
|
|
362
|
-
bridgeMetadata?.outputAmount
|
|
363
|
-
? bridgeMetadata.outputAmount
|
|
364
|
-
: receivedAmount
|
|
365
|
-
),
|
|
338
|
+
BigInt(bridgeMetadata ? bridgeMetadata.outputAmount : receivedAmount),
|
|
366
339
|
};
|
|
367
340
|
},
|
|
368
341
|
{
|
|
@@ -392,6 +365,11 @@ function getAuctionAmounts(auction: DeltaAuction) {
|
|
|
392
365
|
destAmount: auction.order.expectedAmount || auction.order.destAmount,
|
|
393
366
|
};
|
|
394
367
|
|
|
368
|
+
let minimal = {
|
|
369
|
+
srcAmount: auction.order.srcAmount,
|
|
370
|
+
destAmount: auction.order.destAmount,
|
|
371
|
+
};
|
|
372
|
+
|
|
395
373
|
const order = auction.order;
|
|
396
374
|
|
|
397
375
|
if (isOrderCrosschain(order)) {
|
|
@@ -402,6 +380,14 @@ function getAuctionAmounts(auction: DeltaAuction) {
|
|
|
402
380
|
order.bridge.scalingFactor
|
|
403
381
|
).toString(),
|
|
404
382
|
};
|
|
383
|
+
|
|
384
|
+
minimal = {
|
|
385
|
+
srcAmount: minimal.srcAmount,
|
|
386
|
+
destAmount: scaleByFactor(
|
|
387
|
+
BigInt(minimal.destAmount),
|
|
388
|
+
order.bridge.scalingFactor
|
|
389
|
+
).toString(),
|
|
390
|
+
};
|
|
405
391
|
}
|
|
406
392
|
|
|
407
393
|
const isExecuted = isExecutedAuction(auction);
|
|
@@ -410,10 +396,12 @@ function getAuctionAmounts(auction: DeltaAuction) {
|
|
|
410
396
|
return {
|
|
411
397
|
final,
|
|
412
398
|
expected,
|
|
399
|
+
minimal,
|
|
413
400
|
};
|
|
414
401
|
}
|
|
415
402
|
return {
|
|
416
403
|
expected,
|
|
404
|
+
minimal,
|
|
417
405
|
};
|
|
418
406
|
}
|
|
419
407
|
|
|
@@ -123,41 +123,6 @@ export type ExternalDeltaOrder = {
|
|
|
123
123
|
data: string;
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
export type ProductiveDeltaOrder = {
|
|
127
|
-
/** @description The address of the order owner */
|
|
128
|
-
owner: string;
|
|
129
|
-
/** @description The address of the order beneficiary */
|
|
130
|
-
beneficiary: string;
|
|
131
|
-
/** @description The address of the src token */
|
|
132
|
-
srcToken: string;
|
|
133
|
-
/** @description The address of the dest token */
|
|
134
|
-
destToken: string;
|
|
135
|
-
/** @description The amount of src token to swap */
|
|
136
|
-
srcAmount: string;
|
|
137
|
-
/** @description The minimum amount of dest token to receive */
|
|
138
|
-
destAmount: string;
|
|
139
|
-
/** @description The expected amount of token to receive */
|
|
140
|
-
expectedAmount: string;
|
|
141
|
-
/** @description The deadline for the order */
|
|
142
|
-
deadline: number;
|
|
143
|
-
/** @description The nonce of the order */
|
|
144
|
-
nonce: string;
|
|
145
|
-
/** @description Metadata for the order, hex string */
|
|
146
|
-
metadata: string;
|
|
147
|
-
/** @description Encoded partner address, fee bps, and flags for the order. partnerAndFee = (partner << 96) | (partnerTakesSurplus << 8) | fee in bps (max fee is 2%) */
|
|
148
|
-
partnerAndFee: string;
|
|
149
|
-
/** @description Optional permit signature for the src token */
|
|
150
|
-
permit: string;
|
|
151
|
-
/** @description The strategy address. */
|
|
152
|
-
strategy: string;
|
|
153
|
-
/** @description The number of shares to execute for this order. */
|
|
154
|
-
shares: string;
|
|
155
|
-
/** @description Whether the order uses shares or raw amounts. */
|
|
156
|
-
useShares: boolean;
|
|
157
|
-
/** @description The bridge input */
|
|
158
|
-
bridge: Bridge;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
126
|
type TWAPDeltaOrderBase = {
|
|
162
127
|
/** @description The address of the order owner */
|
|
163
128
|
owner: string;
|
|
@@ -248,11 +213,9 @@ export type DeltaAuctionTransaction = {
|
|
|
248
213
|
|
|
249
214
|
export type OnChainOrderMap = {
|
|
250
215
|
Order: DeltaAuctionOrder;
|
|
251
|
-
FillableOrder: DeltaAuctionOrder;
|
|
252
216
|
ExternalOrder: ExternalDeltaOrder;
|
|
253
217
|
TWAPOrder: TWAPDeltaOrder;
|
|
254
218
|
TWAPBuyOrder: TWAPBuyDeltaOrder;
|
|
255
|
-
ProductiveOrder: ProductiveDeltaOrder;
|
|
256
219
|
};
|
|
257
220
|
|
|
258
221
|
type BaseBridgeAuctionFields = Pick<
|
|
@@ -262,11 +225,9 @@ type BaseBridgeAuctionFields = Pick<
|
|
|
262
225
|
|
|
263
226
|
type BridgeAuctionFiledsMap = {
|
|
264
227
|
Order: BaseBridgeAuctionFields;
|
|
265
|
-
FillableOrder: BaseBridgeAuctionFields;
|
|
266
228
|
ExternalOrder: BaseBridgeAuctionFields;
|
|
267
229
|
TWAPOrder: Record<keyof BaseBridgeAuctionFields, null>;
|
|
268
230
|
TWAPBuyOrder: Record<keyof BaseBridgeAuctionFields, null>;
|
|
269
|
-
ProductiveOrder: BaseBridgeAuctionFields;
|
|
270
231
|
};
|
|
271
232
|
|
|
272
233
|
type DeltaAuctionBase = {
|
|
@@ -291,7 +252,7 @@ type DeltaAuctionBase = {
|
|
|
291
252
|
bridgeMetadata: BridgeMetadata | null;
|
|
292
253
|
bridgeStatus: BridgeStatus | null;
|
|
293
254
|
|
|
294
|
-
type:
|
|
255
|
+
type: 'MARKET' | 'LIMIT';
|
|
295
256
|
};
|
|
296
257
|
|
|
297
258
|
export type DeltaAuction<T extends OnChainOrderType = OnChainOrderType> =
|
|
@@ -305,33 +266,21 @@ export type DeltaAuction<T extends OnChainOrderType = OnChainOrderType> =
|
|
|
305
266
|
: never;
|
|
306
267
|
|
|
307
268
|
export type DeltaAuctionDelta = DeltaAuction<'Order'>;
|
|
308
|
-
export type DeltaAuctionFillable = DeltaAuction<'FillableOrder'>;
|
|
309
269
|
export type DeltaAuctionExternal = DeltaAuction<'ExternalOrder'>;
|
|
310
270
|
export type DeltaAuctionTWAP = DeltaAuction<'TWAPOrder'>;
|
|
311
271
|
export type DeltaAuctionTWAPBuy = DeltaAuction<'TWAPBuyOrder'>;
|
|
312
|
-
export type DeltaAuctionProductive = DeltaAuction<'ProductiveOrder'>;
|
|
313
272
|
|
|
314
273
|
export type DeltaAuctionUnion =
|
|
315
274
|
| DeltaAuctionDelta
|
|
316
|
-
| DeltaAuctionFillable
|
|
317
275
|
| DeltaAuctionExternal
|
|
318
276
|
| DeltaAuctionTWAP
|
|
319
|
-
| DeltaAuctionTWAPBuy
|
|
320
|
-
| DeltaAuctionProductive;
|
|
277
|
+
| DeltaAuctionTWAPBuy;
|
|
321
278
|
|
|
322
279
|
export type DeltaOrderUnion = OnChainOrderMap[keyof OnChainOrderMap];
|
|
323
280
|
|
|
324
281
|
export type BridgeMetadata = {
|
|
325
|
-
/** @description
|
|
326
|
-
|
|
327
|
-
* from the expectedOutputAmount due to bridge slippage or other factors.
|
|
328
|
-
* */
|
|
329
|
-
outputAmount?: string;
|
|
330
|
-
/** @description Field is present iff: order was built via POST /v2/orders/build,
|
|
331
|
-
* the route is cross-chain (route.bridge !== null and not an external handler),
|
|
332
|
-
* and the order is posted before the per-order cache entry expires.
|
|
333
|
-
*/
|
|
334
|
-
expectedOutputAmount?: string;
|
|
282
|
+
/** @description The amount that user should expect to get */
|
|
283
|
+
outputAmount: string;
|
|
335
284
|
/** @description The cross-chain deadline. If deadline passes, the bridgeStatus would be expired */
|
|
336
285
|
fillDeadline?: number; // available for Across protocol
|
|
337
286
|
/** @description The deposit id */
|
|
@@ -345,13 +294,14 @@ export type BridgeMetadata = {
|
|
|
345
294
|
// refunded is basically failed
|
|
346
295
|
export type BridgeStatus = 'pending' | 'filled' | 'expired' | 'refunded';
|
|
347
296
|
|
|
348
|
-
export type OnChainOrderType =
|
|
297
|
+
export type OnChainOrderType =
|
|
298
|
+
| 'Order'
|
|
299
|
+
| 'ExternalOrder'
|
|
300
|
+
| 'TWAPOrder'
|
|
301
|
+
| 'TWAPBuyOrder';
|
|
349
302
|
|
|
350
303
|
export type TWAPOnChainOrderType = 'TWAPOrder' | 'TWAPBuyOrder';
|
|
351
304
|
|
|
352
|
-
/** @description Order kind: MARKET (immediate) vs LIMIT (rate-pegged). */
|
|
353
|
-
export type DeltaOrderType = 'MARKET' | 'LIMIT';
|
|
354
|
-
|
|
355
305
|
//// available on BridgePrice ////
|
|
356
306
|
|
|
357
307
|
type BridgeQuoteFee = {
|
|
@@ -380,7 +330,12 @@ export type UnifiedDeltaOrderData = {
|
|
|
380
330
|
srcAmount: string;
|
|
381
331
|
destAmount: string;
|
|
382
332
|
};
|
|
383
|
-
/** @description
|
|
333
|
+
/** @description minimal amounts that user should receive if the order is filled, known at the start of Order execution */
|
|
334
|
+
minimal: {
|
|
335
|
+
srcAmount: string;
|
|
336
|
+
destAmount: string;
|
|
337
|
+
};
|
|
338
|
+
/** @description final amounts after Order execution. May be less than expected if there is slippage or only partial execution was achieved */
|
|
384
339
|
final?: {
|
|
385
340
|
srcAmount: string;
|
|
386
341
|
destAmount: string;
|
|
@@ -3,11 +3,11 @@ import { constructSearchString } from '../../helpers/misc';
|
|
|
3
3
|
import type { ConstructFetchInput, RequestParameters } from '../../types';
|
|
4
4
|
import type {
|
|
5
5
|
DeltaAuction,
|
|
6
|
-
DeltaOrderType,
|
|
7
6
|
OnChainOrderMap,
|
|
7
|
+
OnChainOrderType,
|
|
8
8
|
} from './helpers/types';
|
|
9
9
|
|
|
10
|
-
export type DeltaOrderToPost<T extends
|
|
10
|
+
export type DeltaOrderToPost<T extends OnChainOrderType = 'Order'> = {
|
|
11
11
|
/** @description Partner string */
|
|
12
12
|
partner?: string;
|
|
13
13
|
/** @description Referrer address */
|
|
@@ -20,7 +20,7 @@ export type DeltaOrderToPost<T extends keyof OnChainOrderMap = 'Order'> = {
|
|
|
20
20
|
partiallyFillable?: boolean;
|
|
21
21
|
|
|
22
22
|
/** @description Type of the order. MARKET or LIMIT. Default is MARKET */
|
|
23
|
-
type?:
|
|
23
|
+
type?: 'MARKET' | 'LIMIT';
|
|
24
24
|
|
|
25
25
|
includeAgents?: string[];
|
|
26
26
|
excludeAgents?: string[];
|
|
@@ -53,7 +53,7 @@ export const constructPostDeltaOrder = ({
|
|
|
53
53
|
const search = constructSearchString<{ degenMode?: boolean }>({
|
|
54
54
|
degenMode,
|
|
55
55
|
});
|
|
56
|
-
const fetchURL = `${postOrderUrl}
|
|
56
|
+
const fetchURL = `${postOrderUrl}/${search}` as const;
|
|
57
57
|
|
|
58
58
|
return fetcher<DeltaAuction<'Order'>>({
|
|
59
59
|
url: fetchURL,
|
|
@@ -43,7 +43,7 @@ export const constructPostTWAPDeltaOrder = ({
|
|
|
43
43
|
degenMode,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const fetchURL = `${postOrderUrl}
|
|
46
|
+
const fetchURL = `${postOrderUrl}/${search}` as const;
|
|
47
47
|
|
|
48
48
|
return fetcher<DeltaAuction<'TWAPOrder'> | DeltaAuction<'TWAPBuyOrder'>>({
|
|
49
49
|
url: fetchURL,
|