@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.
Files changed (93) hide show
  1. package/README.md +0 -156
  2. package/dist/examples/helpers/delta.d.ts +1 -1
  3. package/dist/examples/helpers/delta.d.ts.map +1 -1
  4. package/dist/index.d.ts +3 -4
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/methods/delta/cancelDeltaOrder.d.ts.map +1 -1
  7. package/dist/methods/delta/getDeltaOrders.d.ts +4 -4
  8. package/dist/methods/delta/getDeltaOrders.d.ts.map +1 -1
  9. package/dist/methods/delta/getDeltaPrice.d.ts +1 -1
  10. package/dist/methods/delta/getDeltaPrice.d.ts.map +1 -1
  11. package/dist/methods/delta/helpers/orders.d.ts +17 -16
  12. package/dist/methods/delta/helpers/orders.d.ts.map +1 -1
  13. package/dist/methods/delta/helpers/types.d.ts +11 -56
  14. package/dist/methods/delta/helpers/types.d.ts.map +1 -1
  15. package/dist/methods/delta/postDeltaOrder.d.ts +3 -3
  16. package/dist/methods/delta/postDeltaOrder.d.ts.map +1 -1
  17. package/dist/sdk/full.d.ts +0 -2
  18. package/dist/sdk/full.d.ts.map +1 -1
  19. package/dist/sdk/simple.d.ts +0 -4
  20. package/dist/sdk/simple.d.ts.map +1 -1
  21. package/dist/sdk.cjs.development.js +402 -1539
  22. package/dist/sdk.cjs.development.js.map +1 -1
  23. package/dist/sdk.cjs.production.min.js +1 -1
  24. package/dist/sdk.cjs.production.min.js.map +1 -1
  25. package/dist/sdk.esm.js +387 -1523
  26. package/dist/sdk.esm.js.map +1 -1
  27. package/dist/types.d.ts +0 -8
  28. package/dist/types.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/examples/helpers/delta.ts +1 -6
  31. package/src/index.js +0 -55
  32. package/src/index.ts +0 -37
  33. package/src/methods/delta/cancelDeltaOrder.ts +1 -4
  34. package/src/methods/delta/getDeltaOrders.ts +5 -6
  35. package/src/methods/delta/getDeltaPrice.ts +1 -1
  36. package/src/methods/delta/helpers/orders.ts +20 -32
  37. package/src/methods/delta/helpers/types.ts +15 -60
  38. package/src/methods/delta/postDeltaOrder.ts +4 -4
  39. package/src/methods/delta/postTWAPDeltaOrder.ts +1 -1
  40. package/src/sdk/full.ts +0 -8
  41. package/src/sdk/simple.ts +0 -30
  42. package/src/types.ts +0 -9
  43. package/dist/examples/deltaV2.d.ts +0 -2
  44. package/dist/examples/deltaV2.d.ts.map +0 -1
  45. package/dist/examples/helpers/deltaV2.d.ts +0 -5
  46. package/dist/examples/helpers/deltaV2.d.ts.map +0 -1
  47. package/dist/methods/deltaV2/buildDeltaOrder.d.ts +0 -45
  48. package/dist/methods/deltaV2/buildDeltaOrder.d.ts.map +0 -1
  49. package/dist/methods/deltaV2/buildExternalDeltaOrder.d.ts +0 -49
  50. package/dist/methods/deltaV2/buildExternalDeltaOrder.d.ts.map +0 -1
  51. package/dist/methods/deltaV2/buildTWAPDeltaOrder.d.ts +0 -60
  52. package/dist/methods/deltaV2/buildTWAPDeltaOrder.d.ts.map +0 -1
  53. package/dist/methods/deltaV2/cancelDeltaOrder.d.ts +0 -21
  54. package/dist/methods/deltaV2/cancelDeltaOrder.d.ts.map +0 -1
  55. package/dist/methods/deltaV2/getAgentsList.d.ts +0 -10
  56. package/dist/methods/deltaV2/getAgentsList.d.ts.map +0 -1
  57. package/dist/methods/deltaV2/getBridgeRoutes.d.ts +0 -20
  58. package/dist/methods/deltaV2/getBridgeRoutes.d.ts.map +0 -1
  59. package/dist/methods/deltaV2/getDeltaOrders.d.ts +0 -40
  60. package/dist/methods/deltaV2/getDeltaOrders.d.ts.map +0 -1
  61. package/dist/methods/deltaV2/getDeltaPrice.d.ts +0 -46
  62. package/dist/methods/deltaV2/getDeltaPrice.d.ts.map +0 -1
  63. package/dist/methods/deltaV2/helpers/orders.d.ts +0 -191
  64. package/dist/methods/deltaV2/helpers/orders.d.ts.map +0 -1
  65. package/dist/methods/deltaV2/index.d.ts +0 -72
  66. package/dist/methods/deltaV2/index.d.ts.map +0 -1
  67. package/dist/methods/deltaV2/isTokenSupportedInDelta.d.ts +0 -8
  68. package/dist/methods/deltaV2/isTokenSupportedInDelta.d.ts.map +0 -1
  69. package/dist/methods/deltaV2/postDeltaOrder.d.ts +0 -29
  70. package/dist/methods/deltaV2/postDeltaOrder.d.ts.map +0 -1
  71. package/dist/methods/deltaV2/postExternalDeltaOrder.d.ts +0 -11
  72. package/dist/methods/deltaV2/postExternalDeltaOrder.d.ts.map +0 -1
  73. package/dist/methods/deltaV2/postTWAPDeltaOrder.d.ts +0 -17
  74. package/dist/methods/deltaV2/postTWAPDeltaOrder.d.ts.map +0 -1
  75. package/dist/methods/deltaV2/types.d.ts +0 -169
  76. package/dist/methods/deltaV2/types.d.ts.map +0 -1
  77. package/src/examples/deltaV2.ts +0 -196
  78. package/src/examples/helpers/deltaV2.ts +0 -34
  79. package/src/methods/deltaV2/buildDeltaOrder.ts +0 -86
  80. package/src/methods/deltaV2/buildExternalDeltaOrder.ts +0 -95
  81. package/src/methods/deltaV2/buildTWAPDeltaOrder.ts +0 -131
  82. package/src/methods/deltaV2/cancelDeltaOrder.ts +0 -100
  83. package/src/methods/deltaV2/getAgentsList.ts +0 -32
  84. package/src/methods/deltaV2/getBridgeRoutes.ts +0 -82
  85. package/src/methods/deltaV2/getDeltaOrders.ts +0 -149
  86. package/src/methods/deltaV2/getDeltaPrice.ts +0 -108
  87. package/src/methods/deltaV2/helpers/orders.ts +0 -363
  88. package/src/methods/deltaV2/index.ts +0 -312
  89. package/src/methods/deltaV2/isTokenSupportedInDelta.ts +0 -52
  90. package/src/methods/deltaV2/postDeltaOrder.ts +0 -62
  91. package/src/methods/deltaV2/postExternalDeltaOrder.ts +0 -45
  92. package/src/methods/deltaV2/postTWAPDeltaOrder.ts +0 -58
  93. package/src/methods/deltaV2/types.ts +0 -202
@@ -1,202 +0,0 @@
1
- import type { Prettify } from 'ts-essentials';
2
- import type { Address } from '../../types';
3
- import type { TypedDataField } from '../common/orders/buildOrderData';
4
- import type {
5
- Bridge,
6
- DeltaOrderType,
7
- DeltaOrderUnion,
8
- OnChainOrderMap,
9
- OnChainOrderType,
10
- } from '../delta/helpers/types';
11
-
12
- /** @description Response from POST /delta/v2/orders/build — EIP-712 typed data ready to sign. */
13
- export type BuiltDeltaOrder<T extends DeltaOrderUnion = DeltaOrderUnion> = {
14
- toSign: {
15
- domain: {
16
- name: string;
17
- version: string;
18
- chainId: number;
19
- verifyingContract: string;
20
- };
21
- /** EIP-712 type definitions keyed by type name. */
22
- types: Record<string, TypedDataField[]>;
23
- /** The on-chain order struct value to sign. */
24
- value: T;
25
- };
26
- /** EIP-712 order hash. */
27
- orderHash: string;
28
- };
29
-
30
- /** @description Token identity used across v2 endpoints. */
31
- export type DeltaPriceToken = {
32
- chainId: number;
33
- address: Address;
34
- };
35
-
36
- /** @description A token amount with its USD value, used uniformly for inputs, outputs, and fees. */
37
- export type DeltaTokenAmount = {
38
- token: DeltaPriceToken;
39
- /** @description Amount in wei. */
40
- amount: string;
41
- /** @description USD value of the amount. */
42
- amountUSD: string;
43
- };
44
-
45
- /** @description Bridge tag used to mark routes as recommended / fastest / best-return. */
46
- export type BridgeTag = 'recommended' | 'fastest' | 'best-return';
47
-
48
- /** @description Subset of the on-chain Bridge struct returned in v2 price responses.
49
- * (the full `route` object is passed to the server when building an order). */
50
- export type DeltaRouteBridgeContractParams = Omit<Bridge, 'destinationChainId'>;
51
-
52
- /** @description Bridge details on a route. Same-chain routes carry `null` for `route.bridge`. */
53
- export type DeltaRouteBridge = {
54
- /** @description Bridge protocol identifier (e.g. "Across", "Relay", "Mayan"). */
55
- protocol: string;
56
- /** @description Estimated bridging time in milliseconds. */
57
- estimatedTimeMs: number;
58
- /** @description Tags for this route ("recommended", "fastest", "best-return"). May be empty. */
59
- tags: BridgeTag[];
60
- /** @description Bridge contract parameters as returned by the server. */
61
- contractParams: DeltaRouteBridgeContractParams;
62
- };
63
-
64
- /** @description A single step of a route (origin chain or destination chain). */
65
- export type DeltaRouteStep = {
66
- /** @description The token amount entering this step (before any per-step swap). */
67
- input: DeltaTokenAmount;
68
- /** @description The token amount exiting this step (after any per-step swap). */
69
- output: DeltaTokenAmount;
70
- };
71
-
72
- /** @description A route describes how the swap flows from origin chain to destination chain. */
73
- export type DeltaRoute = {
74
- /** @description Source-chain step. The on-chain Delta order's amounts come from `origin.input` and `origin.output`. */
75
- origin: DeltaRouteStep;
76
- /** @description Destination-chain step. For same-chain routes this mirrors `origin`. */
77
- destination: DeltaRouteStep;
78
- /** @description Bridge details. `null` for same-chain routes. */
79
- bridge: DeltaRouteBridge | null;
80
- /** @description Fee breakdown for this route. */
81
- fees: {
82
- /** @description Gas fee (single DeltaTokenAmount on the source chain). */
83
- gas: DeltaTokenAmount;
84
- /** @description Bridge fees (empty array for same-chain). */
85
- bridge: DeltaTokenAmount[];
86
- };
87
- };
88
-
89
- /** @description v2 price response: route-based, cross-chain first. */
90
- export type DeltaPrice = {
91
- /** @description Unique request ID for tracing. */
92
- id: string;
93
- /** @description Order side. */
94
- side: 'SELL' | 'BUY';
95
- /** @description Token the user trades (identity only — amounts live in route.origin.input). */
96
- inputToken: DeltaPriceToken;
97
- /** @description Token the user receives (identity only — amounts live in route.destination.output). */
98
- outputToken: DeltaPriceToken;
99
- /** @description Recommended route with full amounts and bridge details. */
100
- route: DeltaRoute;
101
- /** @description Partner info attached to this price. */
102
- partner: {
103
- name: string;
104
- /** @description Partner fee in percent (e.g. 0.12 = 0.12%). */
105
- feePercent: number;
106
- };
107
- /** @description Address to approve for spending the input token. */
108
- spender: Address;
109
- /** @description Alternative routes (other bridges). Each is a full DeltaRoute. */
110
- alternatives: DeltaRoute[];
111
- };
112
-
113
- /** @description
114
- * A flat bridge-routes entry returned by GET /delta/v2/prices/bridge-routes (better version of v1 prices/bridge-info).
115
- * Can be used to populate bridge selection UIs and to validate that bridge is possible for a given src/dest pair before calling GET /delta/v2/prices.
116
- * */
117
- export type BridgeRoute = {
118
- srcChainId: number;
119
- destChainId: number;
120
- /** @description Output tokens supported on the dest chain for this src→dest pair. */
121
- tokens: Address[];
122
- };
123
-
124
- /* ------------------------------------------------------------------ */
125
- /* Orders v2 response shape: DeltaAuction<T>, same generic shape as */
126
- /* v1's DeltaAuction but with v2 base fields. */
127
- /* ------------------------------------------------------------------ */
128
-
129
- /** @description Integrator-facing order status returned by v2 order endpoints. */
130
- const DeltaOrderStatusMap = {
131
- Pending: 'PENDING',
132
- AwaitingSignature: 'AWAITING_SIGNATURE',
133
- Active: 'ACTIVE',
134
- Suspended: 'SUSPENDED',
135
- Cancelling: 'CANCELLING',
136
- Bridging: 'BRIDGING',
137
- Completed: 'COMPLETED',
138
- Failed: 'FAILED',
139
- Expired: 'EXPIRED',
140
- Cancelled: 'CANCELLED',
141
- Refunded: 'REFUNDED',
142
- } as const;
143
-
144
- export type DeltaOrderStatus =
145
- (typeof DeltaOrderStatusMap)[keyof typeof DeltaOrderStatusMap];
146
-
147
- /** @description Token side on an order. SELL provides an explicit `amount`; BUY provides expected/executed amounts. */
148
- export type DeltaTokenSide =
149
- | {
150
- chainId: number;
151
- token: Address;
152
- amount: string;
153
- }
154
- | {
155
- chainId: number;
156
- token: Address;
157
- expectedAmount: string | null;
158
- executedAmount: string | null;
159
- };
160
-
161
- /** @description A single transaction entry on a v2 order. */
162
- export type DeltaTransaction = {
163
- originTx: string;
164
- destinationTx: string | null;
165
- /** @description Filled percent of the slice (0–100). */
166
- filledPercent: number;
167
- spentAmount: string | null;
168
- receivedAmount: string | null;
169
- };
170
-
171
- type DeltaAuctionBase = {
172
- id: string;
173
- status: DeltaOrderStatus;
174
- side: 'SELL' | 'BUY';
175
- type: DeltaOrderType;
176
- input: DeltaTokenSide;
177
- output: DeltaTokenSide;
178
- owner: Address;
179
- beneficiary: Address;
180
- orderHash: string;
181
- partner: string;
182
- transactions: DeltaTransaction[];
183
- /** @description ISO datetime string. */
184
- createdAt: string;
185
- /** @description ISO datetime string. */
186
- updatedAt: string;
187
- /** @description ISO datetime string. */
188
- expiresAt: string;
189
- };
190
-
191
- /** @description Order shape returned by GET /v2/orders, /v2/orders/:id, /v2/orders/hash/:hash.
192
- * Generic over `onChainOrderType` like v1's `DeltaAuction`: the type distributes over the
193
- * union so that `order` narrows to the matching family (`OnChainOrderMap[T]`). */
194
- export type DeltaAuction<T extends OnChainOrderType = OnChainOrderType> =
195
- T extends T
196
- ? Prettify<
197
- DeltaAuctionBase & {
198
- onChainOrderType: T;
199
- order: OnChainOrderMap[T];
200
- }
201
- >
202
- : never;