@velora-dex/sdk 9.5.2-dev.0 → 9.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/methods/delta/deltaTokenModule.d.ts +0 -1
- package/dist/methods/delta/deltaTokenModule.d.ts.map +1 -1
- package/dist/methods/delta/helpers/types.d.ts +5 -54
- package/dist/methods/delta/helpers/types.d.ts.map +1 -1
- package/dist/sdk.cjs.development.js +70 -569
- 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 +71 -569
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +0 -17
- package/src/methods/delta/deltaTokenModule.ts +80 -128
- package/src/methods/delta/helpers/types.ts +7 -73
- package/dist/methods/delta/helpers/orders.d.ts +0 -248
- package/dist/methods/delta/helpers/orders.d.ts.map +0 -1
- package/src/constants.js +0 -3
- package/src/gas.js +0 -1
- package/src/index.js +0 -73
- package/src/methods/delta/helpers/orders.ts +0 -648
- package/src/types.js +0 -1
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import type { NonEmptyArray, Prettify } from 'ts-essentials';
|
|
2
|
-
import { Bridge, DeltaAuction, DeltaAuctionOrder, DeltaAuctionTransaction, DeltaAuctionTWAP, DeltaAuctionTWAPBuy, DeltaOrderUnion, ExternalDeltaOrder, OnChainOrderType, SwapSideUnion, TWAPBuyDeltaOrder, TWAPDeltaOrder, UnifiedDeltaOrderData } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* @description Checks whether an order is a TWAP Sell or TWAP Buy order.
|
|
5
|
-
*/
|
|
6
|
-
declare function isTWAPOrder(order: DeltaOrderUnion): order is TWAPDeltaOrder | TWAPBuyDeltaOrder;
|
|
7
|
-
/**
|
|
8
|
-
* @description Checks whether an order is a TWAP Sell order.
|
|
9
|
-
*/
|
|
10
|
-
declare function isTWAPSellOrder(order: DeltaOrderUnion): order is TWAPDeltaOrder;
|
|
11
|
-
/**
|
|
12
|
-
* @description Checks whether an order is a TWAP Buy order.
|
|
13
|
-
*/
|
|
14
|
-
declare function isTWAPBuyOrder(order: DeltaOrderUnion): order is TWAPBuyDeltaOrder;
|
|
15
|
-
/**
|
|
16
|
-
* @description Checks whether an order is an External order.
|
|
17
|
-
*/
|
|
18
|
-
declare function isExternalOrder(order: DeltaOrderUnion): order is ExternalDeltaOrder;
|
|
19
|
-
/**
|
|
20
|
-
* @description Checks whether an order is a regular Delta auction order.
|
|
21
|
-
*/
|
|
22
|
-
declare function isDeltaOrder(order: DeltaOrderUnion): order is DeltaAuctionOrder;
|
|
23
|
-
/**
|
|
24
|
-
* @description Checks whether an auction is a TWAP auction.
|
|
25
|
-
*/
|
|
26
|
-
declare function isTWAPAuction<T extends OnChainOrderType>(auction: {
|
|
27
|
-
onChainOrderType: T;
|
|
28
|
-
}): auction is {
|
|
29
|
-
onChainOrderType: ('TWAPOrder' | 'TWAPBuyOrder') & T;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @description Checks whether an auction is a TWAP Sell auction.
|
|
33
|
-
*/
|
|
34
|
-
declare function isTWAPSellAuction<T extends OnChainOrderType>(auction: {
|
|
35
|
-
onChainOrderType: T;
|
|
36
|
-
}): auction is {
|
|
37
|
-
onChainOrderType: 'TWAPOrder' & T;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @description Checks whether an auction is a TWAP Buy auction.
|
|
41
|
-
*/
|
|
42
|
-
declare function isTWAPBuyAuction<T extends OnChainOrderType>(auction: {
|
|
43
|
-
onChainOrderType: T;
|
|
44
|
-
}): auction is {
|
|
45
|
-
onChainOrderType: 'TWAPBuyOrder' & T;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* @description Checks whether an auction is a Delta auction.
|
|
49
|
-
*/
|
|
50
|
-
declare function isDeltaAuction<T extends OnChainOrderType>(auction: {
|
|
51
|
-
onChainOrderType: T;
|
|
52
|
-
}): auction is {
|
|
53
|
-
onChainOrderType: 'Order' & T;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* @description Checks whether an auction is an External auction.
|
|
57
|
-
*/
|
|
58
|
-
declare function isExternalAuction<T extends OnChainOrderType>(auction: {
|
|
59
|
-
onChainOrderType: T;
|
|
60
|
-
}): auction is {
|
|
61
|
-
onChainOrderType: 'ExternalOrder' & T;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* @description Returns the expected source amount for a TWAP order.
|
|
65
|
-
*/
|
|
66
|
-
declare function getExpectedTwapSrcAmount(order: Pick<TWAPDeltaOrder, 'totalSrcAmount'> | Pick<TWAPBuyDeltaOrder, 'maxSrcAmount'>): string;
|
|
67
|
-
/**
|
|
68
|
-
* @description Returns the expected destination amount for a TWAP order.
|
|
69
|
-
*/
|
|
70
|
-
declare function getExpectedTwapDestAmount(order: Pick<TWAPDeltaOrder, 'destAmountPerSlice' | 'numSlices' | 'bridge'> | Pick<TWAPBuyDeltaOrder, 'totalDestAmount' | 'bridge'>): string;
|
|
71
|
-
/**
|
|
72
|
-
* @description Returns expected source and destination amounts for a TWAP order.
|
|
73
|
-
*/
|
|
74
|
-
declare function getExpectedTwapOrderAmounts(order: TWAPDeltaOrder | TWAPBuyDeltaOrder): {
|
|
75
|
-
srcAmount: string;
|
|
76
|
-
destAmount: string;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* @description Returns expected and, when available, final amounts for a TWAP auction.
|
|
80
|
-
*/
|
|
81
|
-
declare function getTwapAuctionAmounts(twapAuction: Pick<DeltaAuctionTWAP, 'status' | 'transactions' | 'order'> | Pick<DeltaAuctionTWAPBuy, 'status' | 'transactions' | 'order'>): {
|
|
82
|
-
final: {
|
|
83
|
-
srcAmount: string;
|
|
84
|
-
destAmount: string;
|
|
85
|
-
};
|
|
86
|
-
expected: {
|
|
87
|
-
srcAmount: string;
|
|
88
|
-
destAmount: string;
|
|
89
|
-
};
|
|
90
|
-
} | {
|
|
91
|
-
expected: {
|
|
92
|
-
srcAmount: string;
|
|
93
|
-
destAmount: string;
|
|
94
|
-
};
|
|
95
|
-
final?: undefined;
|
|
96
|
-
};
|
|
97
|
-
export declare const OrderHelpers: {
|
|
98
|
-
checks: {
|
|
99
|
-
isTWAPOrder: typeof isTWAPOrder;
|
|
100
|
-
isTWAPSellOrder: typeof isTWAPSellOrder;
|
|
101
|
-
isTWAPBuyOrder: typeof isTWAPBuyOrder;
|
|
102
|
-
isExternalOrder: typeof isExternalOrder;
|
|
103
|
-
isDeltaOrder: typeof isDeltaOrder;
|
|
104
|
-
isTWAPAuction: typeof isTWAPAuction;
|
|
105
|
-
isTWAPSellAuction: typeof isTWAPSellAuction;
|
|
106
|
-
isTWAPBuyAuction: typeof isTWAPBuyAuction;
|
|
107
|
-
isDeltaAuction: typeof isDeltaAuction;
|
|
108
|
-
isExternalAuction: typeof isExternalAuction;
|
|
109
|
-
isOrderCrosschain: typeof isOrderCrosschain;
|
|
110
|
-
isExecutedAuction: typeof isExecutedAuction;
|
|
111
|
-
isPartiallyExecutedAuction: typeof isPartiallyExecutedAuction;
|
|
112
|
-
isFailedAuction: typeof isFailedAuction;
|
|
113
|
-
isCanceledAuction: typeof isCanceledAuction;
|
|
114
|
-
isExpiredAuction: typeof isExpiredAuction;
|
|
115
|
-
isPendingAuction: typeof isPendingAuction;
|
|
116
|
-
};
|
|
117
|
-
getters: {
|
|
118
|
-
getUnifiedDeltaOrderData: typeof getUnifiedDeltaOrderData;
|
|
119
|
-
getExpectedTwapSrcAmount: typeof getExpectedTwapSrcAmount;
|
|
120
|
-
getExpectedTwapDestAmount: typeof getExpectedTwapDestAmount;
|
|
121
|
-
getExpectedTwapOrderAmounts: typeof getExpectedTwapOrderAmounts;
|
|
122
|
-
getTwapAuctionAmounts: typeof getTwapAuctionAmounts;
|
|
123
|
-
getAuctionDestChainId: typeof getAuctionDestChainId;
|
|
124
|
-
getSwapSideFromDeltaOrder: typeof getSwapSideFromDeltaOrder;
|
|
125
|
-
getSwapSideFromTwapOrderType: typeof getSwapSideFromTwapOrderType;
|
|
126
|
-
getAuctionSwapSide: typeof getAuctionSwapSide;
|
|
127
|
-
getOrderTokenAddresses: typeof getOrderTokenAddresses;
|
|
128
|
-
getTransactionAmounts: typeof getTransactionAmounts;
|
|
129
|
-
getAuctionAmounts: typeof getAuctionAmounts;
|
|
130
|
-
getFilledPercent: typeof getFilledPercent;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* @description Returns the destination chain id for the auction.
|
|
135
|
-
*/
|
|
136
|
-
declare function getAuctionDestChainId({ order, chainId, }: Pick<DeltaAuction, 'order' | 'chainId'>): number;
|
|
137
|
-
/**
|
|
138
|
-
* @description Returns swap side from a Delta or External order kind.
|
|
139
|
-
*/
|
|
140
|
-
declare function getSwapSideFromDeltaOrder(order: DeltaAuctionOrder | ExternalDeltaOrder): SwapSideUnion;
|
|
141
|
-
/**
|
|
142
|
-
* @description Returns swap side from TWAP on-chain order type.
|
|
143
|
-
*/
|
|
144
|
-
declare function getSwapSideFromTwapOrderType(onChainOrderType: 'TWAPOrder' | 'TWAPBuyOrder'): SwapSideUnion;
|
|
145
|
-
/**
|
|
146
|
-
* @description Returns swap side for any auction type.
|
|
147
|
-
*/
|
|
148
|
-
declare function getAuctionSwapSide(auction: DeltaAuction): SwapSideUnion;
|
|
149
|
-
/**
|
|
150
|
-
* @description Returns unified order data with normalized amounts, tokens, and side.
|
|
151
|
-
*/
|
|
152
|
-
declare function getUnifiedDeltaOrderData(auction: DeltaAuction): UnifiedDeltaOrderData;
|
|
153
|
-
/**
|
|
154
|
-
* @description Returns source and destination token addresses for an order.
|
|
155
|
-
*/
|
|
156
|
-
declare function getOrderTokenAddresses(order: DeltaAuction['order']): {
|
|
157
|
-
srcToken: string;
|
|
158
|
-
destToken: string;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* @description Aggregates transaction amounts into total source and destination values.
|
|
162
|
-
*/
|
|
163
|
-
declare function getTransactionAmounts(transactions: DeltaAuctionTransaction[]): {
|
|
164
|
-
srcAmount: string;
|
|
165
|
-
destAmount: string;
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* @description Returns expected and, when available, final amounts for an auction.
|
|
169
|
-
*/
|
|
170
|
-
declare function getAuctionAmounts(auction: DeltaAuction): {
|
|
171
|
-
final: {
|
|
172
|
-
srcAmount: string;
|
|
173
|
-
destAmount: string;
|
|
174
|
-
};
|
|
175
|
-
expected: {
|
|
176
|
-
srcAmount: string;
|
|
177
|
-
destAmount: string;
|
|
178
|
-
};
|
|
179
|
-
} | {
|
|
180
|
-
expected: {
|
|
181
|
-
srcAmount: string;
|
|
182
|
-
destAmount: string;
|
|
183
|
-
};
|
|
184
|
-
final?: undefined;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* @description Checks whether an order includes valid cross-chain bridge details.
|
|
188
|
-
*/
|
|
189
|
-
declare function isOrderCrosschain<T extends {
|
|
190
|
-
bridge?: Bridge;
|
|
191
|
-
} | object>(order: T): order is Prettify<Extract<T, {
|
|
192
|
-
bridge?: Bridge;
|
|
193
|
-
}> & {
|
|
194
|
-
bridge: Bridge;
|
|
195
|
-
}>;
|
|
196
|
-
type ExecutedDeltaAuctionProps = {
|
|
197
|
-
status: 'EXECUTED';
|
|
198
|
-
transactions: NonEmptyArray<DeltaAuctionTransaction>;
|
|
199
|
-
};
|
|
200
|
-
/**
|
|
201
|
-
* @description Checks whether an auction is fully executed.
|
|
202
|
-
*/
|
|
203
|
-
declare function isExecutedAuction<T extends Pick<DeltaAuction, 'order' | 'status' | 'transactions'>>(auction: T): auction is T & ExecutedDeltaAuctionProps;
|
|
204
|
-
declare const failedAuctionStatuses: readonly ["FAILED", "EXPIRED", "CANCELLED", "REFUNDED"];
|
|
205
|
-
type FailedDeltaAuctionProps = {
|
|
206
|
-
status: (typeof failedAuctionStatuses)[number];
|
|
207
|
-
} | {
|
|
208
|
-
status: 'EXECUTED';
|
|
209
|
-
bridgeStatus: 'expired' | 'refunded';
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* @description Checks whether an auction is failed on source or destination chain.
|
|
213
|
-
*/
|
|
214
|
-
declare function isFailedAuction<T extends Pick<DeltaAuction, 'status' | 'order' | 'bridgeStatus'>>(auction: T): auction is T & FailedDeltaAuctionProps;
|
|
215
|
-
/**
|
|
216
|
-
* @description Checks whether an auction status is cancelled.
|
|
217
|
-
*/
|
|
218
|
-
declare function isCanceledAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
|
|
219
|
-
status: 'CANCELLED';
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* @description Checks whether an auction status is expired.
|
|
223
|
-
*/
|
|
224
|
-
declare function isExpiredAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
|
|
225
|
-
status: 'EXPIRED';
|
|
226
|
-
};
|
|
227
|
-
declare const pendingAuctionStatuses: readonly ["NOT_STARTED", "AWAITING_PRE_SIGNATURE", "RUNNING", "EXECUTING"];
|
|
228
|
-
/**
|
|
229
|
-
* @description Checks whether an auction status is in pending execution states.
|
|
230
|
-
*/
|
|
231
|
-
declare function isPendingAuction<T extends Pick<DeltaAuction, 'status'>>(auction: T): auction is T & {
|
|
232
|
-
status: (typeof pendingAuctionStatuses)[number];
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* @description Auction can be cancelled in the middle of execution,
|
|
236
|
-
* or crosschain-TWAP slices may not all be bridged,
|
|
237
|
-
* or order can be suspended if it runs out of user balance/allowance.
|
|
238
|
-
* Orders in the middle of normal execution can also be considered partially executed if they have any transactions.
|
|
239
|
-
*/
|
|
240
|
-
declare function isPartiallyExecutedAuction<T extends Pick<DeltaAuction, 'order' | 'transactions'>>(auction: T): auction is T & {
|
|
241
|
-
transactions: NonEmptyArray<DeltaAuctionTransaction>;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* @description Calculates filled percentage from auction transaction filled bps values.
|
|
245
|
-
*/
|
|
246
|
-
declare function getFilledPercent(auction: Pick<DeltaAuction, 'order' | 'transactions'>): number;
|
|
247
|
-
export {};
|
|
248
|
-
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/methods/delta/helpers/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,MAAM,EACN,YAAY,EACZ,iBAAiB,EAEjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EAEnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAEhB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,cAAc,GAAG,iBAAiB,CAE7C;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,cAAc,CAMxE;AACD;;GAEG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,iBAAiB,CAM1E;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,kBAAkB,CAE5E;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,iBAAiB,CAIxE;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,CAAC,SAAS,gBAAgB,EAAE,OAAO,EAAE;IAC1D,gBAAgB,EAAE,CAAC,CAAC;CACrB,GAAG,OAAO,IAAI;IAAE,gBAAgB,EAAE,CAAC,WAAW,GA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,EAAE,QAAQ,CAAC,EAC9D,OAAO,EAAE,CAAC,GACT,OAAO,IAAI,CAAC,GAAG;IAChB,MAAM,EAAE,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;CACjD,CAEA;AAED;;;;;GAKG;AACH,iBAAS,0BAA0B,CACjC,CAAC,SAAS,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAAC,EAEtD,OAAO,EAAE,CAAC,GACT,OAAO,IAAI,CAAC,GAAG;IAAE,YAAY,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAA;CAAE,CAMzE;AAED;;GAEG;AACH,iBAAS,gBAAgB,CACvB,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAAC,GACpD,MAAM,CAaR"}
|
package/src/constants.js
DELETED
package/src/gas.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { constructApproveToken, } from './methods/swap/approve';
|
|
2
|
-
import { constructGetBalances, isAllowance, } from './methods/swap/balance';
|
|
3
|
-
import { constructGetSpender, } from './methods/swap/spender';
|
|
4
|
-
import { constructGetAdapters, } from './methods/swap/adapters';
|
|
5
|
-
import { constructGetRate, } from './methods/swap/rates';
|
|
6
|
-
import { constructSwapTx } from './methods/swap/swapTx';
|
|
7
|
-
import { constructGetTokens } from './methods/swap/token';
|
|
8
|
-
import { constructBuildTx } from './methods/swap/transaction';
|
|
9
|
-
import { constructBuildLimitOrder, } from './methods/limitOrders/buildOrder';
|
|
10
|
-
import { constructSignLimitOrder, } from './methods/limitOrders/signOrder';
|
|
11
|
-
import { constructCancelLimitOrder, } from './methods/limitOrders/cancelOrder';
|
|
12
|
-
import { constructFillOrderDirectly, } from './methods/limitOrders/fillOrderDirectly';
|
|
13
|
-
import { constructGetLimitOrders, } from './methods/limitOrders/getOrders';
|
|
14
|
-
import { constructPostLimitOrder, } from './methods/limitOrders/postOrder';
|
|
15
|
-
import { constructApproveTokenForLimitOrder, } from './methods/limitOrders/approveForOrder';
|
|
16
|
-
import { constructGetLimitOrdersContract, } from './methods/limitOrders/getOrdersContract';
|
|
17
|
-
import { constructBuildLimitOrderTx, } from './methods/limitOrders/transaction';
|
|
18
|
-
import { constructBuildNFTOrder, } from './methods/nftOrders/buildOrder';
|
|
19
|
-
import { constructSignNFTOrder, } from './methods/nftOrders/signOrder';
|
|
20
|
-
import { constructCancelNFTOrder, } from './methods/nftOrders/cancelOrder';
|
|
21
|
-
import { constructGetNFTOrders, } from './methods/nftOrders/getOrders';
|
|
22
|
-
import { constructPostNFTOrder, } from './methods/nftOrders/postOrder';
|
|
23
|
-
import { constructApproveTokenForNFTOrder, } from './methods/nftOrders/approveForOrder';
|
|
24
|
-
import { constructGetNFTOrdersContract, } from './methods/nftOrders/getOrdersContract';
|
|
25
|
-
import { constructBuildNFTOrderTx, } from './methods/nftOrders/transaction';
|
|
26
|
-
import { constructEthersContractCaller, constructEthersV5ContractCaller, constructEthersV6ContractCaller, constructWeb3ContractCaller, constructViemContractCaller, txParamsToViemTxParams, constructAxiosFetcher, constructFetchFetcher, isFetcherError, constructToken, } from './helpers';
|
|
27
|
-
import { constructBuildDeltaOrder, } from './methods/delta/buildDeltaOrder';
|
|
28
|
-
import { constructPostDeltaOrder, } from './methods/delta/postDeltaOrder';
|
|
29
|
-
import { constructSignDeltaOrder, } from './methods/delta/signDeltaOrder';
|
|
30
|
-
import { constructPreSignDeltaOrder, } from './methods/delta/preSignDeltaOrder';
|
|
31
|
-
import { constructGetDeltaContract, } from './methods/delta/getDeltaContract';
|
|
32
|
-
import { constructGetDeltaPrice, } from './methods/delta/getDeltaPrice';
|
|
33
|
-
import { constructGetDeltaOrders, } from './methods/delta/getDeltaOrders';
|
|
34
|
-
import { constructApproveTokenForDelta, } from './methods/delta/approveForDelta';
|
|
35
|
-
import { constructGetPartnerFee, } from './methods/delta/getPartnerFee';
|
|
36
|
-
import { constructGetBridgeInfo, } from './methods/delta/getBridgeInfo';
|
|
37
|
-
import { constructIsTokenSupportedInDelta, } from './methods/delta/isTokenSupportedInDelta';
|
|
38
|
-
import { constructGetQuote, } from './methods/quote/getQuote';
|
|
39
|
-
import { constructCancelDeltaOrder, } from './methods/delta/cancelDeltaOrder';
|
|
40
|
-
import { constructDeltaTokenModule, } from './methods/delta/deltaTokenModule';
|
|
41
|
-
export { constructSwapSDK } from './methods/swap';
|
|
42
|
-
export { constructAllLimitOrdersHandlers, constructSubmitLimitOrder, } from './methods/limitOrders';
|
|
43
|
-
export { constructAllDeltaOrdersHandlers, constructSubmitDeltaOrder, } from './methods/delta';
|
|
44
|
-
export * from './constants';
|
|
45
|
-
// can import these individually
|
|
46
|
-
// and use in constructPartialSDK only what you need
|
|
47
|
-
// unused should tree-shake
|
|
48
|
-
export {
|
|
49
|
-
// swap methods:
|
|
50
|
-
constructApproveToken, constructGetBalances, // getAllowances is inside
|
|
51
|
-
constructGetSpender, // this was getTokenTransferProxy
|
|
52
|
-
constructGetTokens, constructBuildTx, constructGetAdapters, constructGetRate, constructSwapTx,
|
|
53
|
-
// limitOrders methods:
|
|
54
|
-
constructBuildLimitOrder, constructSignLimitOrder, constructCancelLimitOrder, constructFillOrderDirectly, constructGetLimitOrders, constructPostLimitOrder, constructApproveTokenForLimitOrder, constructGetLimitOrdersContract, constructBuildLimitOrderTx,
|
|
55
|
-
// nftOrders methods
|
|
56
|
-
constructBuildNFTOrder, constructSignNFTOrder, constructCancelNFTOrder, constructGetNFTOrders, constructPostNFTOrder, constructApproveTokenForNFTOrder, constructGetNFTOrdersContract, constructBuildNFTOrderTx,
|
|
57
|
-
// Delta methods
|
|
58
|
-
constructBuildDeltaOrder, constructPostDeltaOrder, constructSignDeltaOrder, constructPreSignDeltaOrder, constructGetDeltaContract, constructGetDeltaPrice, constructGetDeltaOrders, constructCancelDeltaOrder, constructDeltaTokenModule, constructApproveTokenForDelta,
|
|
59
|
-
// Quote methods
|
|
60
|
-
constructGetQuote,
|
|
61
|
-
// different helpers
|
|
62
|
-
constructGetPartnerFee, constructGetBridgeInfo, constructIsTokenSupportedInDelta, constructEthersContractCaller, // same as constructEthersV5ContractCaller for backwards compatibility
|
|
63
|
-
constructEthersV5ContractCaller, constructEthersV6ContractCaller, constructWeb3ContractCaller, constructViemContractCaller, txParamsToViemTxParams, constructAxiosFetcher, constructFetchFetcher, isFetcherError, isAllowance, constructToken, };
|
|
64
|
-
export { constructPartialSDK } from './sdk/partial';
|
|
65
|
-
export { constructFullSDK } from './sdk/full';
|
|
66
|
-
export { constructSimpleSDK, } from './sdk/simple';
|
|
67
|
-
// bundled methods for limitOrders
|
|
68
|
-
export * from './methods/limitOrders';
|
|
69
|
-
export * from './methods/limitOrders/helpers/types';
|
|
70
|
-
// bundled methods for nftOrders
|
|
71
|
-
export * from './methods/nftOrders';
|
|
72
|
-
export * from './methods/nftOrders/helpers/types';
|
|
73
|
-
export { AssetType } from './methods/nftOrders/helpers/misc';
|