@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,191 +0,0 @@
1
- import type { NonEmptyArray } from 'ts-essentials';
2
- import type { SwapSideUnion, UnifiedDeltaOrderData } from '../../delta/helpers/types';
3
- import type { DeltaAuction, DeltaTransaction } from '../types';
4
- /**
5
- * @description Checks whether an auction is fully executed (settled on every chain).
6
- */
7
- declare function isCompletedAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
8
- status: 'COMPLETED';
9
- };
10
- declare const failedAuctionStatuses: readonly ["FAILED", "EXPIRED", "CANCELLED", "REFUNDED"];
11
- /**
12
- * @description Checks whether an auction is in a terminal failure state
13
- * (failed, expired, cancelled, or refunded).
14
- */
15
- declare function isFailedAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
16
- status: (typeof failedAuctionStatuses)[number];
17
- };
18
- /**
19
- * @description Checks whether an auction status is cancelled.
20
- */
21
- declare function isCanceledAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
22
- status: 'CANCELLED';
23
- };
24
- /**
25
- * @description Checks whether an auction status is expired.
26
- */
27
- declare function isExpiredAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
28
- status: 'EXPIRED';
29
- };
30
- declare const pendingAuctionStatuses: readonly ["PENDING", "AWAITING_SIGNATURE", "ACTIVE", "BRIDGING"];
31
- /**
32
- * @description Checks whether an auction is still in flight (not yet settled
33
- * and not failed): awaiting signature, pending, actively executing, or bridging.
34
- */
35
- declare function isPendingAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
36
- status: (typeof pendingAuctionStatuses)[number];
37
- };
38
- /**
39
- * @description Checks whether an auction is a Fillable auction.
40
- * `FillableOrder` is the `onChainOrderType` the server reports for a
41
- * `partiallyFillable` Standard order; it carries the same order struct as
42
- * `Order`. Consumers that don't distinguish the two should treat
43
- * `isDeltaAuction(a) || isFillableAuction(a)` as "is a standard order".
44
- */
45
- declare function isFillableAuction<T extends Pick<DeltaAuction, 'onChainOrderType'>>(auction: T): auction is T & {
46
- onChainOrderType: 'FillableOrder';
47
- };
48
- /**
49
- * @description Checks whether an auction has been partially executed:
50
- * it has at least one transaction and an overall filled percent strictly
51
- * between 0 and 100.
52
- */
53
- declare function isPartiallyExecutedAuction<T extends Pick<DeltaAuction, 'order' | 'transactions'>>(auction: T): auction is T & {
54
- transactions: NonEmptyArray<DeltaTransaction>;
55
- };
56
- /**
57
- * @description Returns the source chain id for the auction (the input side's chain).
58
- */
59
- declare function getAuctionSrcChainId(auction: Pick<DeltaAuction, 'input'>): number;
60
- /**
61
- * @description Returns the destination chain id for the auction (the output side's chain).
62
- * Equals the source chain id for same-chain orders.
63
- */
64
- declare function getAuctionDestChainId(auction: Pick<DeltaAuction, 'output'>): number;
65
- /**
66
- * @description Returns the swap side for any auction. v2 carries `side` on the
67
- * auction directly, so no order introspection is needed.
68
- */
69
- declare function getAuctionSwapSide(auction: Pick<DeltaAuction, 'side'>): SwapSideUnion;
70
- /**
71
- * @description Returns source and destination token addresses for the auction,
72
- * read from the input/output sides (already resolved to the dest-chain token
73
- * for cross-chain orders).
74
- */
75
- declare function getAuctionTokenAddresses(auction: Pick<DeltaAuction, 'input' | 'output'>): {
76
- srcToken: string;
77
- destToken: string;
78
- };
79
- /**
80
- * @description Aggregates transaction amounts into total spent (src) and
81
- * received (dest) values.
82
- */
83
- declare function getTransactionAmounts(transactions: DeltaTransaction[]): {
84
- srcAmount: string;
85
- destAmount: string;
86
- };
87
- /**
88
- * @description Calculates the overall filled percent (0–100) from the
89
- * per-transaction `filledPercent` values. For TWAP orders each transaction is
90
- * a slice (0–100 of that slice), so the slice values are averaged across
91
- * `numSlices`; for single-fill orders the values sum directly.
92
- */
93
- declare function getFilledPercent(auction: Pick<DeltaAuction, 'order' | 'transactions'>): number;
94
- /**
95
- * @description Returns expected amounts and, once the auction is completed,
96
- * executed amounts. Executed amounts prefer the `executedAmount` baked onto the
97
- * token sides and fall back to summing transactions.
98
- */
99
- declare function getAuctionAmounts(auction: Pick<DeltaAuction, 'status' | 'order' | 'input' | 'output' | 'transactions'>): {
100
- expected: {
101
- srcAmount: string;
102
- destAmount: string;
103
- };
104
- executed?: undefined;
105
- } | {
106
- expected: {
107
- srcAmount: string;
108
- destAmount: string;
109
- };
110
- executed: {
111
- srcAmount: string;
112
- destAmount: string;
113
- };
114
- };
115
- /**
116
- * @description Returns unified order data with normalized amounts, tokens,
117
- * chain ids, and side — the v2 counterpart of v1's `getUnifiedDeltaOrderData`,
118
- * built from the v2 auction envelope.
119
- */
120
- declare function getUnifiedDeltaOrderData(auction: DeltaAuction): UnifiedDeltaOrderData;
121
- export declare const OrderHelpers: {
122
- checks: {
123
- isTWAPOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").TWAPDeltaOrder | import("../../delta/helpers/types").TWAPBuyDeltaOrder;
124
- isTWAPSellOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").TWAPDeltaOrder;
125
- isTWAPBuyOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").TWAPBuyDeltaOrder;
126
- isExternalOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").ExternalDeltaOrder;
127
- isDeltaOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").DeltaAuctionOrder;
128
- isProductiveOrder: (order: import("../../delta/helpers/types").DeltaOrderUnion) => order is import("../../delta/helpers/types").ProductiveDeltaOrder;
129
- isTWAPAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
130
- onChainOrderType: T;
131
- }) => auction is {
132
- onChainOrderType: ("TWAPOrder" | "TWAPBuyOrder") & T;
133
- };
134
- isTWAPSellAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
135
- onChainOrderType: T;
136
- }) => auction is {
137
- onChainOrderType: "TWAPOrder" & T;
138
- };
139
- isTWAPBuyAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
140
- onChainOrderType: T;
141
- }) => auction is {
142
- onChainOrderType: "TWAPBuyOrder" & T;
143
- };
144
- isDeltaAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
145
- onChainOrderType: T;
146
- }) => auction is {
147
- onChainOrderType: "Order" & T;
148
- };
149
- isExternalAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
150
- onChainOrderType: T;
151
- }) => auction is {
152
- onChainOrderType: "ExternalOrder" & T;
153
- };
154
- isProductiveAuction: <T extends import("../../delta/helpers/types").OnChainOrderType>(auction: {
155
- onChainOrderType: T;
156
- }) => auction is {
157
- onChainOrderType: "ProductiveOrder" & T;
158
- };
159
- isFillableAuction: typeof isFillableAuction;
160
- isCompletedAuction: typeof isCompletedAuction;
161
- isFailedAuction: typeof isFailedAuction;
162
- isCanceledAuction: typeof isCanceledAuction;
163
- isExpiredAuction: typeof isExpiredAuction;
164
- isPendingAuction: typeof isPendingAuction;
165
- isPartiallyExecutedAuction: typeof isPartiallyExecutedAuction;
166
- };
167
- getters: {
168
- getUnifiedDeltaOrderData: typeof getUnifiedDeltaOrderData;
169
- getAuctionTokenAddresses: typeof getAuctionTokenAddresses;
170
- getAuctionSrcChainId: typeof getAuctionSrcChainId;
171
- getAuctionDestChainId: typeof getAuctionDestChainId;
172
- getAuctionSwapSide: typeof getAuctionSwapSide;
173
- getTransactionAmounts: typeof getTransactionAmounts;
174
- getAuctionAmounts: typeof getAuctionAmounts;
175
- getFilledPercent: typeof getFilledPercent;
176
- getOrderTokenAddresses: (order: import("../../delta/helpers/types").DeltaAuction["order"]) => {
177
- srcToken: string;
178
- destToken: string;
179
- };
180
- getSwapSideFromDeltaOrder: (order: import("../../delta/helpers/types").DeltaAuctionOrder | import("../../delta/helpers/types").ExternalDeltaOrder) => SwapSideUnion;
181
- getSwapSideFromTwapOrderType: (onChainOrderType: "TWAPOrder" | "TWAPBuyOrder") => SwapSideUnion;
182
- getExpectedTwapSrcAmount: (order: Pick<import("../../delta/helpers/types").TWAPDeltaOrder, "totalSrcAmount"> | Pick<import("../../delta/helpers/types").TWAPBuyDeltaOrder, "maxSrcAmount">) => string;
183
- getExpectedTwapDestAmount: (order: Pick<import("../../delta/helpers/types").TWAPDeltaOrder, "destAmountPerSlice" | "numSlices" | "bridge"> | Pick<import("../../delta/helpers/types").TWAPBuyDeltaOrder, "totalDestAmount" | "bridge">) => string;
184
- getExpectedTwapOrderAmounts: (order: import("../../delta/helpers/types").TWAPDeltaOrder | import("../../delta/helpers/types").TWAPBuyDeltaOrder) => {
185
- srcAmount: string;
186
- destAmount: string;
187
- };
188
- };
189
- };
190
- export {};
191
- //# sourceMappingURL=orders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/methods/deltaV2/helpers/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,YAAY,EAGZ,gBAAgB,EACjB,MAAM,UAAU,CAAC;AA0BlB;;GAEG;AACH,iBAAS,kBAAkB,CAAC,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAChE,OAAO,EAAE,CAAC,GACT,OAAO,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAExC;AAED,QAAA,MAAM,qBAAqB,yDAKjB,CAAC;AAMX;;;GAGG;AACH,iBAAS,eAAe,CAAC,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAC7D,OAAO,EAAE,CAAC,GACT,OAAO,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAA;CAAE,CAEnE;AAED;;GAEG;AACH,iBAAS,iBAAiB,CAAC,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAC/D,OAAO,EAAE,CA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AM,CAAC,GAClC,aAAa,CAEf;AAED;;;;GAIG;AACH,iBAAS,wBAAwB,CAC/B,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC;;;EAMhD;AAED;;;GAGG;AACH,iBAAS,qBAAqB,CAAC,YAAY,EAAE,gBAAgB,EAAE;;;EAa9D;AAED;;;;;GAKG;AACH,iBAAS,gBAAgB,CACvB,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAAC,GACpD,MAAM,CAaR;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CACxB,OAAO,EAAE,IAAI,CACX,YAAY,EACZ,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,CACzD;;;;;;;;;;;;;;;EAmBF;AAcD;;;;GAIG;AACH,iBAAS,wBAAwB,CAC/B,OAAO,EAAE,YAAY,GACpB,qBAAqB,CAuBvB;AAuBD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxB,CAAC"}
@@ -1,72 +0,0 @@
1
- import type { ConstructProviderFetchInput } from '../../types';
2
- import type { DeltaAuction } from './types';
3
- import { GetDeltaContractFunctions } from '../delta/getDeltaContract';
4
- import { GetPartnerFeeFunctions } from '../delta/getPartnerFee';
5
- import { ApproveTokenForDeltaFunctions } from '../delta/approveForDelta';
6
- import { PreSignDeltaOrderFunctions } from '../delta/preSignDeltaOrder';
7
- import { PreSignExternalDeltaOrderFunctions } from '../delta/preSignExternalDeltaOrder';
8
- import { PreSignTWAPDeltaOrderFunctions } from '../delta/preSignTWAPDeltaOrder';
9
- import { DeltaTokenModuleFunctions } from '../delta/deltaTokenModule';
10
- import { BuildDeltaOrderFunctions, BuildDeltaOrderParams, BuiltDeltaOrder } from './buildDeltaOrder';
11
- import { BuildExternalDeltaOrderFunctions, BuildExternalDeltaOrderParams } from './buildExternalDeltaOrder';
12
- import { BuildTWAPDeltaOrderFunctions, BuildTWAPDeltaOrderParams } from './buildTWAPDeltaOrder';
13
- import { DeltaOrderToPost, PostDeltaOrderFunctions } from './postDeltaOrder';
14
- import { PostExternalDeltaOrderFunctions } from './postExternalDeltaOrder';
15
- import { PostTWAPDeltaOrderFunctions } from './postTWAPDeltaOrder';
16
- import { GetDeltaPriceFunctions } from './getDeltaPrice';
17
- import { GetDeltaOrdersFunctions } from './getDeltaOrders';
18
- import { GetBridgeRoutesFunctions } from './getBridgeRoutes';
19
- import { IsTokenSupportedInDeltaFunctions } from './isTokenSupportedInDelta';
20
- import { CancelDeltaOrderFunctions } from './cancelDeltaOrder';
21
- import { GetAgentsListFunctions } from './getAgentsList';
22
- export * from './types';
23
- export * from './buildDeltaOrder';
24
- export * from './buildExternalDeltaOrder';
25
- export * from './buildTWAPDeltaOrder';
26
- export * from './postDeltaOrder';
27
- export * from './postExternalDeltaOrder';
28
- export * from './postTWAPDeltaOrder';
29
- export * from './getDeltaPrice';
30
- export * from './getDeltaOrders';
31
- export * from './getBridgeRoutes';
32
- export * from './isTokenSupportedInDelta';
33
- export * from './cancelDeltaOrder';
34
- export * from './getAgentsList';
35
- export { OrderHelpers } from './helpers/orders';
36
- type SignDeltaOrder = (builtOrder: BuiltDeltaOrder) => Promise<string>;
37
- export type SignDeltaOrderFunctions = {
38
- /** @description Sign a BuiltDeltaOrder (any order type) using EIP-712 typed data. */
39
- signDeltaOrder: SignDeltaOrder;
40
- };
41
- export declare const constructSignDeltaOrder: (options: Pick<ConstructProviderFetchInput<any, "signTypedDataCall">, "contractCaller">) => SignDeltaOrderFunctions;
42
- export type SubmitDeltaOrderParams = BuildDeltaOrderParams & {
43
- /** @description Referrer address */
44
- referrerAddress?: string;
45
- degenMode?: boolean;
46
- } & Pick<DeltaOrderToPost, 'type' | 'includeAgents' | 'excludeAgents'>;
47
- type SubmitDeltaOrder = (orderParams: SubmitDeltaOrderParams) => Promise<DeltaAuction<'Order'>>;
48
- export type SubmitDeltaOrderFuncs = {
49
- submitDeltaOrder: SubmitDeltaOrder;
50
- };
51
- export declare const constructSubmitDeltaOrder: (options: ConstructProviderFetchInput<any, "signTypedDataCall">) => SubmitDeltaOrderFuncs;
52
- export type SubmitExternalDeltaOrderParams = BuildExternalDeltaOrderParams & {
53
- referrerAddress?: string;
54
- } & Pick<DeltaOrderToPost, 'type' | 'includeAgents' | 'excludeAgents'>;
55
- type SubmitExternalDeltaOrder = (orderParams: SubmitExternalDeltaOrderParams) => Promise<DeltaAuction<'ExternalOrder'>>;
56
- export type SubmitExternalDeltaOrderFuncs = {
57
- submitExternalDeltaOrder: SubmitExternalDeltaOrder;
58
- };
59
- export declare const constructSubmitExternalDeltaOrder: (options: ConstructProviderFetchInput<any, "signTypedDataCall">) => SubmitExternalDeltaOrderFuncs;
60
- export type SubmitTWAPDeltaOrderParams = BuildTWAPDeltaOrderParams & {
61
- referrerAddress?: string;
62
- degenMode?: boolean;
63
- } & Pick<DeltaOrderToPost, 'type' | 'includeAgents' | 'excludeAgents'>;
64
- type SubmitTWAPDeltaOrder = (orderParams: SubmitTWAPDeltaOrderParams) => Promise<DeltaAuction<'TWAPOrder'> | DeltaAuction<'TWAPBuyOrder'>>;
65
- export type SubmitTWAPDeltaOrderFuncs = {
66
- submitTWAPDeltaOrder: SubmitTWAPDeltaOrder;
67
- };
68
- export declare const constructSubmitTWAPDeltaOrder: (options: ConstructProviderFetchInput<any, "signTypedDataCall">) => SubmitTWAPDeltaOrderFuncs;
69
- export type DeltaOrderHandlers<TxResponse> = SubmitDeltaOrderFuncs & SubmitExternalDeltaOrderFuncs & SubmitTWAPDeltaOrderFuncs & BuildDeltaOrderFunctions & BuildExternalDeltaOrderFunctions & BuildTWAPDeltaOrderFunctions & PostDeltaOrderFunctions & PostExternalDeltaOrderFunctions & PostTWAPDeltaOrderFunctions & SignDeltaOrderFunctions & PreSignDeltaOrderFunctions<TxResponse> & PreSignExternalDeltaOrderFunctions<TxResponse> & PreSignTWAPDeltaOrderFunctions<TxResponse> & GetDeltaPriceFunctions & GetDeltaOrdersFunctions & GetBridgeRoutesFunctions & IsTokenSupportedInDeltaFunctions & GetAgentsListFunctions & GetDeltaContractFunctions & GetPartnerFeeFunctions & ApproveTokenForDeltaFunctions<TxResponse> & DeltaTokenModuleFunctions<TxResponse> & CancelDeltaOrderFunctions;
70
- /** @description Construct an SDK bundle exposing every Delta v2 method (queries, build/sign/post, on-chain helpers). */
71
- export declare const constructAllDeltaOrdersHandlers: <TxResponse>(options: ConstructProviderFetchInput<TxResponse, "signTypedDataCall" | "transactCall">) => DeltaOrderHandlers<TxResponse>;
72
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/methods/deltaV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EACL,yBAAyB,EAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAE9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,kCAAkC,EACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,8BAA8B,EAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,yBAAyB,EAE1B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAE9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAA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AC,CAAC;AAEvE,MAAM,MAAM,yBAAyB,GAAG;IACtC,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,YAC/B,2BAA2B,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAC7D,yBAwBF,CAAC;AAIF,MAAM,MAAM,kBAAkB,CAAC,UAAU,IAAI,qBAAqB,GAChE,6BAA6B,GAC7B,yBAAyB,GACzB,wBAAwB,GACxB,gCAAgC,GAChC,4BAA4B,GAC5B,uBAAuB,GACvB,+BAA+B,GAC/B,2BAA2B,GAC3B,uBAAuB,GACvB,0BAA0B,CAAC,UAAU,CAAC,GACtC,kCAAkC,CAAC,UAAU,CAAC,GAC9C,8BAA8B,CAAC,UAAU,CAAC,GAC1C,sBAAsB,GACtB,uBAAuB,GACvB,wBAAwB,GACxB,gCAAgC,GAChC,sBAAsB,GACtB,yBAAyB,GACzB,sBAAsB,GACtB,6BAA6B,CAAC,UAAU,CAAC,GACzC,yBAAyB,CAAC,UAAU,CAAC,GACrC,yBAAyB,CAAC;AAE5B,wHAAwH;AACxH,eAAO,MAAM,+BAA+B,GAAI,UAAU,WAC/C,2BAA2B,CAClC,UAAU,EACV,mBAAmB,GAAG,cAAc,CACrC,KACA,kBAAkB,CAAC,UAAU,CA0B/B,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { Address, ConstructFetchInput, RequestParameters } from '../../types';
2
- type IsTokenSupportedInDelta = (token: Address, requestParams?: RequestParameters) => Promise<boolean>;
3
- export type IsTokenSupportedInDeltaFunctions = {
4
- isTokenSupportedInDelta: IsTokenSupportedInDelta;
5
- };
6
- export declare const constructIsTokenSupportedInDelta: ({ apiURL, chainId, fetcher, }: ConstructFetchInput) => IsTokenSupportedInDeltaFunctions;
7
- export {};
8
- //# sourceMappingURL=isTokenSupportedInDelta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isTokenSupportedInDelta.d.ts","sourceRoot":"","sources":["../../../src/methods/deltaV2/isTokenSupportedInDelta.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAQrB,KAAK,uBAAuB,GAAG,CAC7B,KAAK,EAAE,OAAO,EACd,aAAa,CAAC,EAAE,iBAAiB,KAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,MAAM,gCAAgC,GAAG;IAC7C,uBAAuB,EAAE,uBAAuB,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,gCAAgC,kCAI1C,mBAAmB,KAAG,gCAwBxB,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { ConstructFetchInput, RequestParameters } from '../../types';
2
- import type { DeltaOrderType, OnChainOrderMap } from '../delta/helpers/types';
3
- import type { DeltaAuction } from './types';
4
- export type DeltaOrderToPost<T extends keyof OnChainOrderMap = 'Order'> = {
5
- /** @description Partner string */
6
- partner?: string;
7
- /** @description Referrer address */
8
- referrerAddress?: string;
9
- order: OnChainOrderMap[T];
10
- /** @description Signature of the order from order.owner address. EOA signatures must be submitted in ERC-2098 Compact Representation. */
11
- signature: string;
12
- chainId: number;
13
- /** @description Designates the Order as being able to be partially filled, as opposed to fill-or-kill */
14
- partiallyFillable?: boolean;
15
- /** @description Type of the order. MARKET or LIMIT. Default is MARKET */
16
- type?: DeltaOrderType;
17
- includeAgents?: string[];
18
- excludeAgents?: string[];
19
- };
20
- export type PostDeltaOrderParams = Omit<DeltaOrderToPost, 'chainId'> & {
21
- degenMode?: boolean;
22
- };
23
- type PostDeltaOrder = (postData: PostDeltaOrderParams, requestParams?: RequestParameters) => Promise<DeltaAuction<'Order'>>;
24
- export type PostDeltaOrderFunctions = {
25
- postDeltaOrder: PostDeltaOrder;
26
- };
27
- export declare const constructPostDeltaOrder: ({ apiURL, chainId, fetcher, }: ConstructFetchInput) => PostDeltaOrderFunctions;
28
- export {};
29
- //# sourceMappingURL=postDeltaOrder.d.ts.map
@@ -1 +0,0 @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ConstructFetchInput, RequestParameters } from '../../types';
2
- import type { DeltaOrderToPost } from './postDeltaOrder';
3
- import type { DeltaAuction } from './types';
4
- export type PostExternalDeltaOrderParams = Omit<DeltaOrderToPost<'ExternalOrder'>, 'chainId'>;
5
- type PostExternalDeltaOrder = (postData: PostExternalDeltaOrderParams, requestParams?: RequestParameters) => Promise<DeltaAuction<'ExternalOrder'>>;
6
- export type PostExternalDeltaOrderFunctions = {
7
- postExternalDeltaOrder: PostExternalDeltaOrder;
8
- };
9
- export declare const constructPostExternalDeltaOrder: ({ apiURL, chainId, fetcher, }: ConstructFetchInput) => PostExternalDeltaOrderFunctions;
10
- export {};
11
- //# sourceMappingURL=postExternalDeltaOrder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postExternalDeltaOrder.d.ts","sourceRoot":"","sources":["../../../src/methods/deltaV2/postExternalDeltaOrder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,gBAAgB,CAAC,eAAe,CAAC,EACjC,SAAS,CACV,CAAC;AAEF,KAAK,sBAAsB,GAAG,CAC5B,QAAQ,EAAE,4BAA4B,EACtC,aAAa,CAAC,EAAE,iBAAiB,KAC9B,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC;AAE5C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,+BAA+B,kCAIzC,mBAAmB,KAAG,+BAqBxB,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { Prettify } from 'ts-essentials';
2
- import type { ConstructFetchInput, RequestParameters } from '../../types';
3
- import type { TWAPOnChainOrderType } from '../delta/helpers/types';
4
- import type { DeltaOrderToPost } from './postDeltaOrder';
5
- import type { DeltaAuction } from './types';
6
- export type PostTWAPDeltaOrderParams = Prettify<Omit<DeltaOrderToPost<'TWAPOrder'> | DeltaOrderToPost<'TWAPBuyOrder'>, 'chainId'> & {
7
- /** @description Must be "TWAPOrder" or "TWAPBuyOrder" */
8
- onChainOrderType: TWAPOnChainOrderType;
9
- degenMode?: boolean;
10
- }>;
11
- type PostTWAPDeltaOrder = (postData: PostTWAPDeltaOrderParams, requestParams?: RequestParameters) => Promise<DeltaAuction<'TWAPOrder'> | DeltaAuction<'TWAPBuyOrder'>>;
12
- export type PostTWAPDeltaOrderFunctions = {
13
- postTWAPDeltaOrder: PostTWAPDeltaOrder;
14
- };
15
- export declare const constructPostTWAPDeltaOrder: ({ apiURL, chainId, fetcher, }: ConstructFetchInput) => PostTWAPDeltaOrderFunctions;
16
- export {};
17
- //# sourceMappingURL=postTWAPDeltaOrder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postTWAPDeltaOrder.d.ts","sourceRoot":"","sources":["../../../src/methods/deltaV2/postTWAPDeltaOrder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAC7C,IAAI,CACF,gBAAgB,CAAC,WAAW,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC,EAChE,SAAS,CACV,GAAG;IACF,yDAAyD;IACzD,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CACF,CAAC;AAEF,KAAK,kBAAkB,GAAG,CACxB,QAAQ,EAAE,wBAAwB,EAClC,aAAa,CAAC,EAAE,iBAAiB,KAC9B,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,2BAA2B,GAAG;IACxC,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,2BAA2B,kCAIrC,mBAAmB,KAAG,2BAyBxB,CAAC"}
@@ -1,169 +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 { Bridge, DeltaOrderType, DeltaOrderUnion, OnChainOrderMap, OnChainOrderType } from '../delta/helpers/types';
5
- /** @description Response from POST /delta/v2/orders/build — EIP-712 typed data ready to sign. */
6
- export type BuiltDeltaOrder<T extends DeltaOrderUnion = DeltaOrderUnion> = {
7
- toSign: {
8
- domain: {
9
- name: string;
10
- version: string;
11
- chainId: number;
12
- verifyingContract: string;
13
- };
14
- /** EIP-712 type definitions keyed by type name. */
15
- types: Record<string, TypedDataField[]>;
16
- /** The on-chain order struct value to sign. */
17
- value: T;
18
- };
19
- /** EIP-712 order hash. */
20
- orderHash: string;
21
- };
22
- /** @description Token identity used across v2 endpoints. */
23
- export type DeltaPriceToken = {
24
- chainId: number;
25
- address: Address;
26
- };
27
- /** @description A token amount with its USD value, used uniformly for inputs, outputs, and fees. */
28
- export type DeltaTokenAmount = {
29
- token: DeltaPriceToken;
30
- /** @description Amount in wei. */
31
- amount: string;
32
- /** @description USD value of the amount. */
33
- amountUSD: string;
34
- };
35
- /** @description Bridge tag used to mark routes as recommended / fastest / best-return. */
36
- export type BridgeTag = 'recommended' | 'fastest' | 'best-return';
37
- /** @description Subset of the on-chain Bridge struct returned in v2 price responses.
38
- * (the full `route` object is passed to the server when building an order). */
39
- export type DeltaRouteBridgeContractParams = Omit<Bridge, 'destinationChainId'>;
40
- /** @description Bridge details on a route. Same-chain routes carry `null` for `route.bridge`. */
41
- export type DeltaRouteBridge = {
42
- /** @description Bridge protocol identifier (e.g. "Across", "Relay", "Mayan"). */
43
- protocol: string;
44
- /** @description Estimated bridging time in milliseconds. */
45
- estimatedTimeMs: number;
46
- /** @description Tags for this route ("recommended", "fastest", "best-return"). May be empty. */
47
- tags: BridgeTag[];
48
- /** @description Bridge contract parameters as returned by the server. */
49
- contractParams: DeltaRouteBridgeContractParams;
50
- };
51
- /** @description A single step of a route (origin chain or destination chain). */
52
- export type DeltaRouteStep = {
53
- /** @description The token amount entering this step (before any per-step swap). */
54
- input: DeltaTokenAmount;
55
- /** @description The token amount exiting this step (after any per-step swap). */
56
- output: DeltaTokenAmount;
57
- };
58
- /** @description A route describes how the swap flows from origin chain to destination chain. */
59
- export type DeltaRoute = {
60
- /** @description Source-chain step. The on-chain Delta order's amounts come from `origin.input` and `origin.output`. */
61
- origin: DeltaRouteStep;
62
- /** @description Destination-chain step. For same-chain routes this mirrors `origin`. */
63
- destination: DeltaRouteStep;
64
- /** @description Bridge details. `null` for same-chain routes. */
65
- bridge: DeltaRouteBridge | null;
66
- /** @description Fee breakdown for this route. */
67
- fees: {
68
- /** @description Gas fee (single DeltaTokenAmount on the source chain). */
69
- gas: DeltaTokenAmount;
70
- /** @description Bridge fees (empty array for same-chain). */
71
- bridge: DeltaTokenAmount[];
72
- };
73
- };
74
- /** @description v2 price response: route-based, cross-chain first. */
75
- export type DeltaPrice = {
76
- /** @description Unique request ID for tracing. */
77
- id: string;
78
- /** @description Order side. */
79
- side: 'SELL' | 'BUY';
80
- /** @description Token the user trades (identity only — amounts live in route.origin.input). */
81
- inputToken: DeltaPriceToken;
82
- /** @description Token the user receives (identity only — amounts live in route.destination.output). */
83
- outputToken: DeltaPriceToken;
84
- /** @description Recommended route with full amounts and bridge details. */
85
- route: DeltaRoute;
86
- /** @description Partner info attached to this price. */
87
- partner: {
88
- name: string;
89
- /** @description Partner fee in percent (e.g. 0.12 = 0.12%). */
90
- feePercent: number;
91
- };
92
- /** @description Address to approve for spending the input token. */
93
- spender: Address;
94
- /** @description Alternative routes (other bridges). Each is a full DeltaRoute. */
95
- alternatives: DeltaRoute[];
96
- };
97
- /** @description
98
- * A flat bridge-routes entry returned by GET /delta/v2/prices/bridge-routes (better version of v1 prices/bridge-info).
99
- * 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.
100
- * */
101
- export type BridgeRoute = {
102
- srcChainId: number;
103
- destChainId: number;
104
- /** @description Output tokens supported on the dest chain for this src→dest pair. */
105
- tokens: Address[];
106
- };
107
- /** @description Integrator-facing order status returned by v2 order endpoints. */
108
- declare const DeltaOrderStatusMap: {
109
- readonly Pending: "PENDING";
110
- readonly AwaitingSignature: "AWAITING_SIGNATURE";
111
- readonly Active: "ACTIVE";
112
- readonly Suspended: "SUSPENDED";
113
- readonly Cancelling: "CANCELLING";
114
- readonly Bridging: "BRIDGING";
115
- readonly Completed: "COMPLETED";
116
- readonly Failed: "FAILED";
117
- readonly Expired: "EXPIRED";
118
- readonly Cancelled: "CANCELLED";
119
- readonly Refunded: "REFUNDED";
120
- };
121
- export type DeltaOrderStatus = (typeof DeltaOrderStatusMap)[keyof typeof DeltaOrderStatusMap];
122
- /** @description Token side on an order. SELL provides an explicit `amount`; BUY provides expected/executed amounts. */
123
- export type DeltaTokenSide = {
124
- chainId: number;
125
- token: Address;
126
- amount: string;
127
- } | {
128
- chainId: number;
129
- token: Address;
130
- expectedAmount: string | null;
131
- executedAmount: string | null;
132
- };
133
- /** @description A single transaction entry on a v2 order. */
134
- export type DeltaTransaction = {
135
- originTx: string;
136
- destinationTx: string | null;
137
- /** @description Filled percent of the slice (0–100). */
138
- filledPercent: number;
139
- spentAmount: string | null;
140
- receivedAmount: string | null;
141
- };
142
- type DeltaAuctionBase = {
143
- id: string;
144
- status: DeltaOrderStatus;
145
- side: 'SELL' | 'BUY';
146
- type: DeltaOrderType;
147
- input: DeltaTokenSide;
148
- output: DeltaTokenSide;
149
- owner: Address;
150
- beneficiary: Address;
151
- orderHash: string;
152
- partner: string;
153
- transactions: DeltaTransaction[];
154
- /** @description ISO datetime string. */
155
- createdAt: string;
156
- /** @description ISO datetime string. */
157
- updatedAt: string;
158
- /** @description ISO datetime string. */
159
- expiresAt: string;
160
- };
161
- /** @description Order shape returned by GET /v2/orders, /v2/orders/:id, /v2/orders/hash/:hash.
162
- * Generic over `onChainOrderType` like v1's `DeltaAuction`: the type distributes over the
163
- * union so that `order` narrows to the matching family (`OnChainOrderMap[T]`). */
164
- export type DeltaAuction<T extends OnChainOrderType = OnChainOrderType> = T extends T ? Prettify<DeltaAuctionBase & {
165
- onChainOrderType: T;
166
- order: OnChainOrderMap[T];
167
- }> : never;
168
- export {};
169
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/methods/deltaV2/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,iGAAiG;AACjG,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI;IACzE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,MAAM,CAAC;SAC3B,CAAC;QACF,mDAAmD;QACnD,KAAK,EAAE,MAAM,CAAC,MAAM,EAA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