@riftresearch/sdk 0.4.3 → 0.5.0
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 +1 -1
- package/dist/index.d.ts +1343 -245
- package/dist/index.js +16 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,240 +1,1332 @@
|
|
|
1
|
+
import { BtcTransferKind, BtcTransferStep, Currencies, createCurrency, EvmCallKind, EvmCallStep, ExecutionAction, ExecutionStep, SwapResponse as SwapResponse2 } from "@riftresearch/common";
|
|
2
|
+
import { Treaty } from "@elysiajs/eden";
|
|
3
|
+
import { ErrorResponse } from "@riftresearch/common";
|
|
4
|
+
import { Elysia } from "elysia";
|
|
5
|
+
import { RiftOtcApi } from "../lib";
|
|
6
|
+
import { SwapResponse, SwapStatusResponse } from "@riftresearch/common";
|
|
7
|
+
import { SwapRequest } from "../../../common/types";
|
|
8
|
+
import { CachedQuote, ISwapMappingStore } from "../../../lib/cache";
|
|
9
|
+
import { OtcClient as OtcClient2 } from "../../../lib/rift-otc-api";
|
|
10
|
+
import { SwapperClient } from "../../../lib/rift-swapper-api";
|
|
1
11
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
type Address = string;
|
|
6
|
-
type TxHash = string;
|
|
7
|
-
type U256 = string;
|
|
8
|
-
type BitcoinChain = {
|
|
9
|
-
kind: "BITCOIN";
|
|
10
|
-
};
|
|
11
|
-
type EvmChain = {
|
|
12
|
-
kind: "EVM";
|
|
13
|
-
chainId: number;
|
|
14
|
-
};
|
|
15
|
-
type Chain = BitcoinChain | EvmChain;
|
|
16
|
-
type NativeToken = {
|
|
17
|
-
kind: "NATIVE";
|
|
18
|
-
decimals: number;
|
|
19
|
-
};
|
|
20
|
-
type Erc20Token = {
|
|
21
|
-
kind: "TOKEN";
|
|
22
|
-
address: string;
|
|
23
|
-
decimals: number;
|
|
24
|
-
};
|
|
25
|
-
type TokenIdentifier = NativeToken | Erc20Token;
|
|
26
|
-
interface Currency {
|
|
27
|
-
chain: Chain;
|
|
28
|
-
token: TokenIdentifier;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A currency amount that was specified by the user (exact).
|
|
32
|
-
*/
|
|
33
|
-
interface SpecifiedAmount {
|
|
34
|
-
currency: Currency;
|
|
35
|
-
amount: U256;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* A calculated output amount for exact_input mode.
|
|
39
|
-
* The user specifies exact input, and this represents the expected output.
|
|
40
|
-
*/
|
|
41
|
-
interface CalculatedOutputAmount {
|
|
42
|
-
currency: Currency;
|
|
43
|
-
/** Expected output based on current market conditions */
|
|
44
|
-
amount: U256;
|
|
45
|
-
/** Minimum guaranteed output after slippage (optional - not all routes provide this) */
|
|
46
|
-
minimum?: U256;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* A calculated input amount for exact_output mode.
|
|
50
|
-
* The user specifies exact output, and this represents the expected input.
|
|
51
|
-
*/
|
|
52
|
-
interface CalculatedInputAmount {
|
|
53
|
-
currency: Currency;
|
|
54
|
-
/** Expected input based on current market conditions */
|
|
55
|
-
amount: U256;
|
|
56
|
-
/** Maximum input required after slippage (optional - not all routes provide this) */
|
|
57
|
-
maximum?: U256;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* A single fee component with amount in native currency and USD equivalent.
|
|
61
|
-
*/
|
|
62
|
-
interface FeeComponent {
|
|
63
|
-
/** Amount in the smallest unit of the currency */
|
|
64
|
-
amount: U256;
|
|
65
|
-
/** The currency this fee is denominated in */
|
|
66
|
-
currency: Currency;
|
|
67
|
-
/** USD equivalent of the fee */
|
|
68
|
-
usd: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Rift protocol fees broken down by type.
|
|
72
|
-
*/
|
|
73
|
-
interface RiftFees {
|
|
74
|
-
/** Bitcoin network transaction fee */
|
|
75
|
-
network: FeeComponent;
|
|
76
|
-
/** Fee paid to liquidity providers */
|
|
77
|
-
liquidity: FeeComponent;
|
|
78
|
-
/** Rift protocol fee */
|
|
79
|
-
protocol: FeeComponent;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Complete fee breakdown for a swap quote.
|
|
83
|
-
* Shows fees from each leg of the swap in their native currencies.
|
|
84
|
-
*/
|
|
85
|
-
interface FeeBreakdown {
|
|
86
|
-
/** Fees from DEX swap BEFORE Rift (e.g., 1inch USDC → cbBTC) */
|
|
87
|
-
preswap?: FeeComponent;
|
|
88
|
-
/** Fees from the Rift protocol (optional for mono-chain swaps) */
|
|
89
|
-
rift?: RiftFees;
|
|
90
|
-
/** Fees from DEX swap AFTER Rift (e.g., Swapper cbBTC → USDC) */
|
|
91
|
-
postswap?: FeeComponent;
|
|
92
|
-
/** Total fees in USD across all legs */
|
|
93
|
-
totalUsd: number;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Base fields shared by all quote responses.
|
|
97
|
-
*/
|
|
98
|
-
interface QuoteResponseBase {
|
|
99
|
-
id: string;
|
|
100
|
-
fees: FeeBreakdown;
|
|
101
|
-
expiresAt: string;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Quote response for exact_input mode.
|
|
105
|
-
* User specifies exact input amount, output is calculated with slippage bound.
|
|
106
|
-
*/
|
|
107
|
-
interface ExactInputQuoteResponse extends QuoteResponseBase {
|
|
108
|
-
mode: "exact_input";
|
|
109
|
-
/** The exact input amount specified by the user */
|
|
110
|
-
from: SpecifiedAmount;
|
|
111
|
-
/** The calculated output amount with slippage bound */
|
|
112
|
-
to: CalculatedOutputAmount;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Quote response for exact_output mode.
|
|
116
|
-
* User specifies exact output amount, input is calculated with slippage bound.
|
|
117
|
-
*/
|
|
118
|
-
interface ExactOutputQuoteResponse extends QuoteResponseBase {
|
|
119
|
-
mode: "exact_output";
|
|
120
|
-
/** The calculated input amount with slippage bound */
|
|
121
|
-
from: CalculatedInputAmount;
|
|
122
|
-
/** The exact output amount specified by the user */
|
|
123
|
-
to: SpecifiedAmount;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Discriminated union of quote responses.
|
|
127
|
-
* Use `mode` to determine which fields are specified vs calculated.
|
|
128
|
-
*/
|
|
129
|
-
type QuoteResponse = ExactInputQuoteResponse | ExactOutputQuoteResponse;
|
|
130
|
-
declare const SWAP_STATUSES: readonly ["waiting_for_deposit", "deposit_confirming", "initiating_payout", "confirming_payout", "swap_complete", "refunding_user", "failed"];
|
|
131
|
-
type SwapStatus = (typeof SWAP_STATUSES)[number];
|
|
132
|
-
interface SwapStatusResponse {
|
|
133
|
-
status: SwapStatus;
|
|
134
|
-
destinationAddress: Address;
|
|
135
|
-
payoutTransaction?: TxHash;
|
|
136
|
-
depositTransaction?: TxHash;
|
|
137
|
-
quote: QuoteResponse;
|
|
138
|
-
}
|
|
139
|
-
interface ErrorResponse {
|
|
140
|
-
error: string;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Execution actions - the mechanism by which a step is executed.
|
|
144
|
-
*/
|
|
145
|
-
type ExecutionAction = "evm_call" | "btc_transfer";
|
|
146
|
-
/**
|
|
147
|
-
* Step kinds grouped by action type.
|
|
148
|
-
*/
|
|
149
|
-
type EvmCallKind = "approval" | "transfer_erc20" | "oneinch_swap";
|
|
150
|
-
type BtcTransferKind = "transfer_btc";
|
|
151
|
-
/**
|
|
152
|
-
* EVM Call step - execute calldata on an EVM chain.
|
|
153
|
-
* Used for: token approvals, ERC20 transfers, 1inch swaps.
|
|
154
|
-
*/
|
|
155
|
-
interface EvmCallStep {
|
|
156
|
-
/** Step ID for tracking */
|
|
157
|
-
id: string;
|
|
158
|
-
/** Execution mechanism */
|
|
159
|
-
action: "evm_call";
|
|
160
|
-
/** Specific step type */
|
|
161
|
-
kind: EvmCallKind;
|
|
162
|
-
/** Chain ID for the transaction */
|
|
163
|
-
chainId: number;
|
|
164
|
-
/** Contract address to call */
|
|
165
|
-
to: string;
|
|
166
|
-
/** Encoded calldata */
|
|
167
|
-
calldata: string;
|
|
168
|
-
/** Native ETH value to send (for oneinch_swap) */
|
|
169
|
-
value?: U256;
|
|
170
|
-
/** Token address (for approval, transfer_evm) */
|
|
171
|
-
tokenAddress?: string;
|
|
172
|
-
/** Spender address (for approval) */
|
|
173
|
-
spenderAddress?: string;
|
|
174
|
-
/** Amount for display/verification (for approval, transfer_evm) */
|
|
175
|
-
amount?: U256;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* BTC Transfer step - send Bitcoin to an address.
|
|
179
|
-
* Used for: depositing BTC to Rift vault.
|
|
12
|
+
* Pure order service - no framework dependencies.
|
|
13
|
+
* Handles order creation and retrieval via OTC client.
|
|
14
|
+
* Returns execution steps that the client must execute.
|
|
180
15
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
16
|
+
declare class OrderService {
|
|
17
|
+
private readonly otcClient;
|
|
18
|
+
private readonly swapperClient;
|
|
19
|
+
private readonly swapMappingStore;
|
|
20
|
+
constructor(otcClient: OtcClient2, swapperClient: SwapperClient | null, swapMappingStore: ISwapMappingStore);
|
|
21
|
+
/**
|
|
22
|
+
* Create a swap using the cached quote with raw JSON.
|
|
23
|
+
* Returns SwapResponse with execution steps the client must execute.
|
|
24
|
+
*/
|
|
25
|
+
createSwap(request: SwapRequest, cachedQuote: CachedQuote): Promise<SwapResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a direct cbBTC ↔ BTC swap order.
|
|
28
|
+
* Returns execution steps: either DepositBtc (for BTC → cbBTC) or Approval + DepositEvm (for cbBTC → BTC)
|
|
29
|
+
*/
|
|
30
|
+
private createDirectSwapOrder;
|
|
31
|
+
/**
|
|
32
|
+
* Create a chained swap order: BTC → cbBTC → ERC20.
|
|
33
|
+
* Returns execution steps: DepositBtc (server handles the rest)
|
|
34
|
+
*/
|
|
35
|
+
private createChainedSwapOrder;
|
|
36
|
+
/**
|
|
37
|
+
* Create a 1inch preswap order: ERC20 → cbBTC → BTC.
|
|
38
|
+
* Returns execution steps: Approval + 1inch swap tx.
|
|
39
|
+
*/
|
|
40
|
+
private createOneInchPreswapOrder;
|
|
41
|
+
/**
|
|
42
|
+
* Create a mono-chain swap order: EVM → EVM via 1inch.
|
|
43
|
+
* Returns execution steps: Approval (if needed) + 1inch swap tx.
|
|
44
|
+
*/
|
|
45
|
+
private createOneInchMonochainOrder;
|
|
46
|
+
/**
|
|
47
|
+
* Build steps for BTC transfer (BTC → cbBTC or BTC → ERC20).
|
|
48
|
+
*/
|
|
49
|
+
private buildBtcTransferSteps;
|
|
50
|
+
/**
|
|
51
|
+
* Build steps for cbBTC transfer (cbBTC → BTC).
|
|
52
|
+
* No approval needed - just a direct ERC20 transfer.
|
|
53
|
+
*/
|
|
54
|
+
private buildCbbtcTransferSteps;
|
|
55
|
+
private buildOneInchSwapStep;
|
|
56
|
+
/**
|
|
57
|
+
* Build steps for 1inch preswap (ERC20/ETH → cbBTC → BTC).
|
|
58
|
+
*/
|
|
59
|
+
private buildOneInchPreswapSteps;
|
|
60
|
+
/**
|
|
61
|
+
* Build steps for mono-chain 1inch swap (EVM → EVM).
|
|
62
|
+
*/
|
|
63
|
+
private buildOneInchMonochainSteps;
|
|
64
|
+
private resolveEvmSenderAddress;
|
|
65
|
+
private isEvmAddress;
|
|
66
|
+
private extractExpectedOneInchSwap;
|
|
67
|
+
private isNativeToken;
|
|
68
|
+
private getTxConfirmationStatus;
|
|
69
|
+
/**
|
|
70
|
+
* Update a swap with step execution result (best-effort tx hash tracking).
|
|
71
|
+
*/
|
|
72
|
+
updateStepResult(swapId: string, _stepId: string, result: {
|
|
73
|
+
txHash?: string;
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Get user-facing order status without exposing internal swap details.
|
|
77
|
+
*/
|
|
78
|
+
getSwapStatus(swapId: string): Promise<SwapStatusResponse>;
|
|
79
|
+
private resolveOrderStatusMetadata;
|
|
80
|
+
private getOtcDepositTx;
|
|
81
|
+
private getOtcSettlementTx;
|
|
82
|
+
private getOtcPayoutTx;
|
|
83
|
+
private normalizeTxHash;
|
|
84
|
+
private isEvmChain;
|
|
192
85
|
}
|
|
86
|
+
import { QuoteRequest, QuoteResponse } from "../../../common/types";
|
|
87
|
+
import { CachedQuote as CachedQuote2, IQuoteCache } from "../../../lib/cache";
|
|
88
|
+
import { RfqClient as RfqClient2 } from "../../../lib/rift-otc-api";
|
|
89
|
+
import { SwapperClient as SwapperClient2 } from "../../../lib/rift-swapper-api";
|
|
193
90
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*/
|
|
197
|
-
type ExecutionStep = EvmCallStep | BtcTransferStep;
|
|
198
|
-
/**
|
|
199
|
-
* Swap response with execution steps that the client must execute.
|
|
91
|
+
* Pure quote service - no framework dependencies.
|
|
92
|
+
* Handles quote generation and caching.
|
|
200
93
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
94
|
+
declare class QuoteService {
|
|
95
|
+
private readonly quoteCache;
|
|
96
|
+
private readonly rfqClient;
|
|
97
|
+
private readonly swapperClient;
|
|
98
|
+
private readonly priceOracle;
|
|
99
|
+
private readonly oneinchProvider;
|
|
100
|
+
constructor(quoteCache: IQuoteCache, rfqClient: RfqClient2, swapperClient: SwapperClient2 | null);
|
|
101
|
+
getQuote(request: QuoteRequest): Promise<QuoteResponse>;
|
|
102
|
+
/** Get the cached quote with raw JSON for order creation */
|
|
103
|
+
getCachedQuoteById(id: string): Promise<CachedQuote2 | null>;
|
|
104
|
+
/** Atomically consume a cached quote to prevent reuse */
|
|
105
|
+
consumeCachedQuoteById(id: string): Promise<CachedQuote2 | null>;
|
|
106
|
+
private generateQuote;
|
|
107
|
+
/**
|
|
108
|
+
* Quote a direct BTC <-> cbBTC swap via Rift OTC.
|
|
109
|
+
*/
|
|
110
|
+
private quoteDirectOtcSwap;
|
|
111
|
+
/**
|
|
112
|
+
* Quote a chained swap: BTC -> cbBTC (OTC) -> target ERC-20 (Swapper).
|
|
113
|
+
*
|
|
114
|
+
* 1. Get OTC quote for BTC -> cbBTC on target chain
|
|
115
|
+
* 2. Get Swapper quote for cbBTC -> target token
|
|
116
|
+
* 3. Cache both quotes linked together
|
|
117
|
+
* 4. Return combined quote showing BTC -> target token
|
|
118
|
+
*/
|
|
119
|
+
private quoteChainedSwap;
|
|
120
|
+
/**
|
|
121
|
+
* Quote a mono-chain EVM → EVM swap via 1inch.
|
|
122
|
+
*/
|
|
123
|
+
private quoteOneInchMonochain;
|
|
124
|
+
/**
|
|
125
|
+
* Quote a 1inch preswap: non-cbBTC ERC20 -> cbBTC (1inch) -> BTC (Rift OTC).
|
|
126
|
+
*
|
|
127
|
+
* 1. Get 1inch quote for ERC20 -> cbBTC
|
|
128
|
+
* 2. Get OTC quote for cbBTC -> BTC
|
|
129
|
+
* 3. Cache both quotes linked together
|
|
130
|
+
* 4. Return combined quote showing ERC20 -> BTC
|
|
131
|
+
*/
|
|
132
|
+
private quoteOneInchThenRift;
|
|
133
|
+
/**
|
|
134
|
+
* exact_input: ERC20 (known) -> cbBTC -> BTC (calculated)
|
|
135
|
+
*/
|
|
136
|
+
private quoteOneInchThenRiftExactInput;
|
|
208
137
|
}
|
|
209
|
-
|
|
210
|
-
declare
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
138
|
+
import { TModule as TModule_7fcqhs } from "@sinclair/typebox";
|
|
139
|
+
declare const app: Elysia<"", {
|
|
140
|
+
decorator: {
|
|
141
|
+
quoteService: QuoteService;
|
|
142
|
+
} & {
|
|
143
|
+
orderService: OrderService;
|
|
144
|
+
} & {
|
|
145
|
+
rfqClient: RiftOtcApi.RfqClient;
|
|
146
|
+
} & {
|
|
147
|
+
otcClient: RiftOtcApi.OtcClient;
|
|
218
148
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
149
|
+
store: {};
|
|
150
|
+
derive: {};
|
|
151
|
+
resolve: {};
|
|
152
|
+
}, {
|
|
153
|
+
typebox: {};
|
|
154
|
+
error: {};
|
|
155
|
+
} & {
|
|
156
|
+
typebox: {};
|
|
157
|
+
error: {};
|
|
158
|
+
} & {
|
|
159
|
+
error: {};
|
|
160
|
+
typebox: TModule_7fcqhs<{}, {}>;
|
|
161
|
+
} & {
|
|
162
|
+
typebox: {};
|
|
163
|
+
error: {};
|
|
164
|
+
}, {
|
|
165
|
+
schema: {};
|
|
166
|
+
standaloneSchema: {};
|
|
167
|
+
macro: {};
|
|
168
|
+
macroFn: {};
|
|
169
|
+
parser: {};
|
|
170
|
+
response: {};
|
|
171
|
+
} & {
|
|
172
|
+
schema: {};
|
|
173
|
+
standaloneSchema: {};
|
|
174
|
+
macro: {};
|
|
175
|
+
macroFn: {};
|
|
176
|
+
parser: {};
|
|
177
|
+
response: {};
|
|
178
|
+
} & {
|
|
179
|
+
schema: {};
|
|
180
|
+
macro: {};
|
|
181
|
+
macroFn: {};
|
|
182
|
+
parser: {};
|
|
183
|
+
} & {
|
|
184
|
+
schema: {};
|
|
185
|
+
standaloneSchema: {};
|
|
186
|
+
macro: {};
|
|
187
|
+
macroFn: {};
|
|
188
|
+
parser: {};
|
|
189
|
+
}, {
|
|
190
|
+
health: {
|
|
191
|
+
get: {
|
|
192
|
+
body: unknown;
|
|
193
|
+
params: {};
|
|
194
|
+
query: unknown;
|
|
195
|
+
headers: unknown;
|
|
196
|
+
response: {
|
|
197
|
+
200: {
|
|
198
|
+
status: "ok";
|
|
199
|
+
timestamp: string;
|
|
200
|
+
};
|
|
201
|
+
422: {
|
|
202
|
+
type: "validation";
|
|
203
|
+
on: string;
|
|
204
|
+
summary?: string;
|
|
205
|
+
message?: string;
|
|
206
|
+
found?: unknown;
|
|
207
|
+
property?: string;
|
|
208
|
+
expected?: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
226
212
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
213
|
+
} & {
|
|
214
|
+
status: {
|
|
215
|
+
get: {
|
|
216
|
+
body: unknown;
|
|
217
|
+
params: {};
|
|
218
|
+
query: unknown;
|
|
219
|
+
headers: unknown;
|
|
220
|
+
response: {
|
|
221
|
+
200: {
|
|
222
|
+
status: "ok" | "offline" | "degraded";
|
|
223
|
+
timestamp: string;
|
|
224
|
+
services: {
|
|
225
|
+
rfq: {
|
|
226
|
+
error?: string | undefined;
|
|
227
|
+
version?: string | undefined;
|
|
228
|
+
status: "ok" | "offline" | "degraded";
|
|
229
|
+
connectedMarketMakers: number;
|
|
230
|
+
};
|
|
231
|
+
otc: {
|
|
232
|
+
error?: string | undefined;
|
|
233
|
+
version?: string | undefined;
|
|
234
|
+
status: "ok" | "offline" | "degraded";
|
|
235
|
+
connectedMarketMakers: number;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
422: {
|
|
240
|
+
type: "validation";
|
|
241
|
+
on: string;
|
|
242
|
+
summary?: string;
|
|
243
|
+
message?: string;
|
|
244
|
+
found?: unknown;
|
|
245
|
+
property?: string;
|
|
246
|
+
expected?: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|
|
232
250
|
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
251
|
+
} & {
|
|
252
|
+
quote: {
|
|
253
|
+
post: {
|
|
254
|
+
body: {
|
|
255
|
+
amount: string;
|
|
256
|
+
type: string;
|
|
257
|
+
from: {
|
|
258
|
+
chain: {
|
|
259
|
+
kind: "BITCOIN";
|
|
260
|
+
} | {
|
|
261
|
+
kind: "EVM";
|
|
262
|
+
chainId: number;
|
|
263
|
+
};
|
|
264
|
+
token: {
|
|
265
|
+
kind: "NATIVE";
|
|
266
|
+
decimals: number;
|
|
267
|
+
} | {
|
|
268
|
+
kind: "TOKEN";
|
|
269
|
+
decimals: number;
|
|
270
|
+
address: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
to: {
|
|
274
|
+
chain: {
|
|
275
|
+
kind: "BITCOIN";
|
|
276
|
+
} | {
|
|
277
|
+
kind: "EVM";
|
|
278
|
+
chainId: number;
|
|
279
|
+
};
|
|
280
|
+
token: {
|
|
281
|
+
kind: "NATIVE";
|
|
282
|
+
decimals: number;
|
|
283
|
+
} | {
|
|
284
|
+
kind: "TOKEN";
|
|
285
|
+
decimals: number;
|
|
286
|
+
address: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
params: {};
|
|
291
|
+
query: unknown;
|
|
292
|
+
headers: unknown;
|
|
293
|
+
response: {
|
|
294
|
+
200: {
|
|
295
|
+
from: {
|
|
296
|
+
currency: {
|
|
297
|
+
chain: {
|
|
298
|
+
kind: "BITCOIN";
|
|
299
|
+
} | {
|
|
300
|
+
kind: "EVM";
|
|
301
|
+
chainId: number;
|
|
302
|
+
};
|
|
303
|
+
token: {
|
|
304
|
+
kind: "NATIVE";
|
|
305
|
+
decimals: number;
|
|
306
|
+
} | {
|
|
307
|
+
kind: "TOKEN";
|
|
308
|
+
decimals: number;
|
|
309
|
+
address: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
amount: string;
|
|
313
|
+
};
|
|
314
|
+
to: {
|
|
315
|
+
minimum?: string | undefined;
|
|
316
|
+
currency: {
|
|
317
|
+
chain: {
|
|
318
|
+
kind: "BITCOIN";
|
|
319
|
+
} | {
|
|
320
|
+
kind: "EVM";
|
|
321
|
+
chainId: number;
|
|
322
|
+
};
|
|
323
|
+
token: {
|
|
324
|
+
kind: "NATIVE";
|
|
325
|
+
decimals: number;
|
|
326
|
+
} | {
|
|
327
|
+
kind: "TOKEN";
|
|
328
|
+
decimals: number;
|
|
329
|
+
address: string;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
amount: string;
|
|
333
|
+
};
|
|
334
|
+
mode: "exact_input";
|
|
335
|
+
id: string;
|
|
336
|
+
fees: {
|
|
337
|
+
preswap?: {
|
|
338
|
+
currency: {
|
|
339
|
+
chain: {
|
|
340
|
+
kind: "BITCOIN";
|
|
341
|
+
} | {
|
|
342
|
+
kind: "EVM";
|
|
343
|
+
chainId: number;
|
|
344
|
+
};
|
|
345
|
+
token: {
|
|
346
|
+
kind: "NATIVE";
|
|
347
|
+
decimals: number;
|
|
348
|
+
} | {
|
|
349
|
+
kind: "TOKEN";
|
|
350
|
+
decimals: number;
|
|
351
|
+
address: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
amount: string;
|
|
355
|
+
usd: number;
|
|
356
|
+
} | undefined;
|
|
357
|
+
rift?: {
|
|
358
|
+
network: {
|
|
359
|
+
currency: {
|
|
360
|
+
chain: {
|
|
361
|
+
kind: "BITCOIN";
|
|
362
|
+
} | {
|
|
363
|
+
kind: "EVM";
|
|
364
|
+
chainId: number;
|
|
365
|
+
};
|
|
366
|
+
token: {
|
|
367
|
+
kind: "NATIVE";
|
|
368
|
+
decimals: number;
|
|
369
|
+
} | {
|
|
370
|
+
kind: "TOKEN";
|
|
371
|
+
decimals: number;
|
|
372
|
+
address: string;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
amount: string;
|
|
376
|
+
usd: number;
|
|
377
|
+
};
|
|
378
|
+
liquidity: {
|
|
379
|
+
currency: {
|
|
380
|
+
chain: {
|
|
381
|
+
kind: "BITCOIN";
|
|
382
|
+
} | {
|
|
383
|
+
kind: "EVM";
|
|
384
|
+
chainId: number;
|
|
385
|
+
};
|
|
386
|
+
token: {
|
|
387
|
+
kind: "NATIVE";
|
|
388
|
+
decimals: number;
|
|
389
|
+
} | {
|
|
390
|
+
kind: "TOKEN";
|
|
391
|
+
decimals: number;
|
|
392
|
+
address: string;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
amount: string;
|
|
396
|
+
usd: number;
|
|
397
|
+
};
|
|
398
|
+
protocol: {
|
|
399
|
+
currency: {
|
|
400
|
+
chain: {
|
|
401
|
+
kind: "BITCOIN";
|
|
402
|
+
} | {
|
|
403
|
+
kind: "EVM";
|
|
404
|
+
chainId: number;
|
|
405
|
+
};
|
|
406
|
+
token: {
|
|
407
|
+
kind: "NATIVE";
|
|
408
|
+
decimals: number;
|
|
409
|
+
} | {
|
|
410
|
+
kind: "TOKEN";
|
|
411
|
+
decimals: number;
|
|
412
|
+
address: string;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
amount: string;
|
|
416
|
+
usd: number;
|
|
417
|
+
};
|
|
418
|
+
} | undefined;
|
|
419
|
+
postswap?: {
|
|
420
|
+
currency: {
|
|
421
|
+
chain: {
|
|
422
|
+
kind: "BITCOIN";
|
|
423
|
+
} | {
|
|
424
|
+
kind: "EVM";
|
|
425
|
+
chainId: number;
|
|
426
|
+
};
|
|
427
|
+
token: {
|
|
428
|
+
kind: "NATIVE";
|
|
429
|
+
decimals: number;
|
|
430
|
+
} | {
|
|
431
|
+
kind: "TOKEN";
|
|
432
|
+
decimals: number;
|
|
433
|
+
address: string;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
amount: string;
|
|
437
|
+
usd: number;
|
|
438
|
+
} | undefined;
|
|
439
|
+
totalUsd: number;
|
|
440
|
+
};
|
|
441
|
+
expiresAt: string;
|
|
442
|
+
} | {
|
|
443
|
+
from: {
|
|
444
|
+
maximum?: string | undefined;
|
|
445
|
+
currency: {
|
|
446
|
+
chain: {
|
|
447
|
+
kind: "BITCOIN";
|
|
448
|
+
} | {
|
|
449
|
+
kind: "EVM";
|
|
450
|
+
chainId: number;
|
|
451
|
+
};
|
|
452
|
+
token: {
|
|
453
|
+
kind: "NATIVE";
|
|
454
|
+
decimals: number;
|
|
455
|
+
} | {
|
|
456
|
+
kind: "TOKEN";
|
|
457
|
+
decimals: number;
|
|
458
|
+
address: string;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
amount: string;
|
|
462
|
+
};
|
|
463
|
+
to: {
|
|
464
|
+
currency: {
|
|
465
|
+
chain: {
|
|
466
|
+
kind: "BITCOIN";
|
|
467
|
+
} | {
|
|
468
|
+
kind: "EVM";
|
|
469
|
+
chainId: number;
|
|
470
|
+
};
|
|
471
|
+
token: {
|
|
472
|
+
kind: "NATIVE";
|
|
473
|
+
decimals: number;
|
|
474
|
+
} | {
|
|
475
|
+
kind: "TOKEN";
|
|
476
|
+
decimals: number;
|
|
477
|
+
address: string;
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
amount: string;
|
|
481
|
+
};
|
|
482
|
+
mode: "exact_output";
|
|
483
|
+
id: string;
|
|
484
|
+
fees: {
|
|
485
|
+
preswap?: {
|
|
486
|
+
currency: {
|
|
487
|
+
chain: {
|
|
488
|
+
kind: "BITCOIN";
|
|
489
|
+
} | {
|
|
490
|
+
kind: "EVM";
|
|
491
|
+
chainId: number;
|
|
492
|
+
};
|
|
493
|
+
token: {
|
|
494
|
+
kind: "NATIVE";
|
|
495
|
+
decimals: number;
|
|
496
|
+
} | {
|
|
497
|
+
kind: "TOKEN";
|
|
498
|
+
decimals: number;
|
|
499
|
+
address: string;
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
amount: string;
|
|
503
|
+
usd: number;
|
|
504
|
+
} | undefined;
|
|
505
|
+
rift?: {
|
|
506
|
+
network: {
|
|
507
|
+
currency: {
|
|
508
|
+
chain: {
|
|
509
|
+
kind: "BITCOIN";
|
|
510
|
+
} | {
|
|
511
|
+
kind: "EVM";
|
|
512
|
+
chainId: number;
|
|
513
|
+
};
|
|
514
|
+
token: {
|
|
515
|
+
kind: "NATIVE";
|
|
516
|
+
decimals: number;
|
|
517
|
+
} | {
|
|
518
|
+
kind: "TOKEN";
|
|
519
|
+
decimals: number;
|
|
520
|
+
address: string;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
amount: string;
|
|
524
|
+
usd: number;
|
|
525
|
+
};
|
|
526
|
+
liquidity: {
|
|
527
|
+
currency: {
|
|
528
|
+
chain: {
|
|
529
|
+
kind: "BITCOIN";
|
|
530
|
+
} | {
|
|
531
|
+
kind: "EVM";
|
|
532
|
+
chainId: number;
|
|
533
|
+
};
|
|
534
|
+
token: {
|
|
535
|
+
kind: "NATIVE";
|
|
536
|
+
decimals: number;
|
|
537
|
+
} | {
|
|
538
|
+
kind: "TOKEN";
|
|
539
|
+
decimals: number;
|
|
540
|
+
address: string;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
amount: string;
|
|
544
|
+
usd: number;
|
|
545
|
+
};
|
|
546
|
+
protocol: {
|
|
547
|
+
currency: {
|
|
548
|
+
chain: {
|
|
549
|
+
kind: "BITCOIN";
|
|
550
|
+
} | {
|
|
551
|
+
kind: "EVM";
|
|
552
|
+
chainId: number;
|
|
553
|
+
};
|
|
554
|
+
token: {
|
|
555
|
+
kind: "NATIVE";
|
|
556
|
+
decimals: number;
|
|
557
|
+
} | {
|
|
558
|
+
kind: "TOKEN";
|
|
559
|
+
decimals: number;
|
|
560
|
+
address: string;
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
amount: string;
|
|
564
|
+
usd: number;
|
|
565
|
+
};
|
|
566
|
+
} | undefined;
|
|
567
|
+
postswap?: {
|
|
568
|
+
currency: {
|
|
569
|
+
chain: {
|
|
570
|
+
kind: "BITCOIN";
|
|
571
|
+
} | {
|
|
572
|
+
kind: "EVM";
|
|
573
|
+
chainId: number;
|
|
574
|
+
};
|
|
575
|
+
token: {
|
|
576
|
+
kind: "NATIVE";
|
|
577
|
+
decimals: number;
|
|
578
|
+
} | {
|
|
579
|
+
kind: "TOKEN";
|
|
580
|
+
decimals: number;
|
|
581
|
+
address: string;
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
amount: string;
|
|
585
|
+
usd: number;
|
|
586
|
+
} | undefined;
|
|
587
|
+
totalUsd: number;
|
|
588
|
+
};
|
|
589
|
+
expiresAt: string;
|
|
590
|
+
};
|
|
591
|
+
422: {
|
|
592
|
+
type: "validation";
|
|
593
|
+
on: string;
|
|
594
|
+
summary?: string;
|
|
595
|
+
message?: string;
|
|
596
|
+
found?: unknown;
|
|
597
|
+
property?: string;
|
|
598
|
+
expected?: string;
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
} & {
|
|
604
|
+
swap: {
|
|
605
|
+
post: {
|
|
606
|
+
body: {
|
|
607
|
+
integratorName?: string | undefined;
|
|
608
|
+
approvalMode?: string | undefined;
|
|
609
|
+
id: string;
|
|
610
|
+
destinationAddress: string;
|
|
611
|
+
refundAddress: string;
|
|
612
|
+
};
|
|
613
|
+
params: {};
|
|
614
|
+
query: unknown;
|
|
615
|
+
headers: unknown;
|
|
616
|
+
response: {
|
|
617
|
+
200: {
|
|
618
|
+
quote: {
|
|
619
|
+
from: {
|
|
620
|
+
currency: {
|
|
621
|
+
chain: {
|
|
622
|
+
kind: "BITCOIN";
|
|
623
|
+
} | {
|
|
624
|
+
kind: "EVM";
|
|
625
|
+
chainId: number;
|
|
626
|
+
};
|
|
627
|
+
token: {
|
|
628
|
+
kind: "NATIVE";
|
|
629
|
+
decimals: number;
|
|
630
|
+
} | {
|
|
631
|
+
kind: "TOKEN";
|
|
632
|
+
decimals: number;
|
|
633
|
+
address: string;
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
amount: string;
|
|
637
|
+
};
|
|
638
|
+
to: {
|
|
639
|
+
minimum?: string | undefined;
|
|
640
|
+
currency: {
|
|
641
|
+
chain: {
|
|
642
|
+
kind: "BITCOIN";
|
|
643
|
+
} | {
|
|
644
|
+
kind: "EVM";
|
|
645
|
+
chainId: number;
|
|
646
|
+
};
|
|
647
|
+
token: {
|
|
648
|
+
kind: "NATIVE";
|
|
649
|
+
decimals: number;
|
|
650
|
+
} | {
|
|
651
|
+
kind: "TOKEN";
|
|
652
|
+
decimals: number;
|
|
653
|
+
address: string;
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
amount: string;
|
|
657
|
+
};
|
|
658
|
+
mode: "exact_input";
|
|
659
|
+
id: string;
|
|
660
|
+
fees: {
|
|
661
|
+
preswap?: {
|
|
662
|
+
currency: {
|
|
663
|
+
chain: {
|
|
664
|
+
kind: "BITCOIN";
|
|
665
|
+
} | {
|
|
666
|
+
kind: "EVM";
|
|
667
|
+
chainId: number;
|
|
668
|
+
};
|
|
669
|
+
token: {
|
|
670
|
+
kind: "NATIVE";
|
|
671
|
+
decimals: number;
|
|
672
|
+
} | {
|
|
673
|
+
kind: "TOKEN";
|
|
674
|
+
decimals: number;
|
|
675
|
+
address: string;
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
amount: string;
|
|
679
|
+
usd: number;
|
|
680
|
+
} | undefined;
|
|
681
|
+
rift?: {
|
|
682
|
+
network: {
|
|
683
|
+
currency: {
|
|
684
|
+
chain: {
|
|
685
|
+
kind: "BITCOIN";
|
|
686
|
+
} | {
|
|
687
|
+
kind: "EVM";
|
|
688
|
+
chainId: number;
|
|
689
|
+
};
|
|
690
|
+
token: {
|
|
691
|
+
kind: "NATIVE";
|
|
692
|
+
decimals: number;
|
|
693
|
+
} | {
|
|
694
|
+
kind: "TOKEN";
|
|
695
|
+
decimals: number;
|
|
696
|
+
address: string;
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
amount: string;
|
|
700
|
+
usd: number;
|
|
701
|
+
};
|
|
702
|
+
liquidity: {
|
|
703
|
+
currency: {
|
|
704
|
+
chain: {
|
|
705
|
+
kind: "BITCOIN";
|
|
706
|
+
} | {
|
|
707
|
+
kind: "EVM";
|
|
708
|
+
chainId: number;
|
|
709
|
+
};
|
|
710
|
+
token: {
|
|
711
|
+
kind: "NATIVE";
|
|
712
|
+
decimals: number;
|
|
713
|
+
} | {
|
|
714
|
+
kind: "TOKEN";
|
|
715
|
+
decimals: number;
|
|
716
|
+
address: string;
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
amount: string;
|
|
720
|
+
usd: number;
|
|
721
|
+
};
|
|
722
|
+
protocol: {
|
|
723
|
+
currency: {
|
|
724
|
+
chain: {
|
|
725
|
+
kind: "BITCOIN";
|
|
726
|
+
} | {
|
|
727
|
+
kind: "EVM";
|
|
728
|
+
chainId: number;
|
|
729
|
+
};
|
|
730
|
+
token: {
|
|
731
|
+
kind: "NATIVE";
|
|
732
|
+
decimals: number;
|
|
733
|
+
} | {
|
|
734
|
+
kind: "TOKEN";
|
|
735
|
+
decimals: number;
|
|
736
|
+
address: string;
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
amount: string;
|
|
740
|
+
usd: number;
|
|
741
|
+
};
|
|
742
|
+
} | undefined;
|
|
743
|
+
postswap?: {
|
|
744
|
+
currency: {
|
|
745
|
+
chain: {
|
|
746
|
+
kind: "BITCOIN";
|
|
747
|
+
} | {
|
|
748
|
+
kind: "EVM";
|
|
749
|
+
chainId: number;
|
|
750
|
+
};
|
|
751
|
+
token: {
|
|
752
|
+
kind: "NATIVE";
|
|
753
|
+
decimals: number;
|
|
754
|
+
} | {
|
|
755
|
+
kind: "TOKEN";
|
|
756
|
+
decimals: number;
|
|
757
|
+
address: string;
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
amount: string;
|
|
761
|
+
usd: number;
|
|
762
|
+
} | undefined;
|
|
763
|
+
totalUsd: number;
|
|
764
|
+
};
|
|
765
|
+
expiresAt: string;
|
|
766
|
+
} | {
|
|
767
|
+
from: {
|
|
768
|
+
maximum?: string | undefined;
|
|
769
|
+
currency: {
|
|
770
|
+
chain: {
|
|
771
|
+
kind: "BITCOIN";
|
|
772
|
+
} | {
|
|
773
|
+
kind: "EVM";
|
|
774
|
+
chainId: number;
|
|
775
|
+
};
|
|
776
|
+
token: {
|
|
777
|
+
kind: "NATIVE";
|
|
778
|
+
decimals: number;
|
|
779
|
+
} | {
|
|
780
|
+
kind: "TOKEN";
|
|
781
|
+
decimals: number;
|
|
782
|
+
address: string;
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
amount: string;
|
|
786
|
+
};
|
|
787
|
+
to: {
|
|
788
|
+
currency: {
|
|
789
|
+
chain: {
|
|
790
|
+
kind: "BITCOIN";
|
|
791
|
+
} | {
|
|
792
|
+
kind: "EVM";
|
|
793
|
+
chainId: number;
|
|
794
|
+
};
|
|
795
|
+
token: {
|
|
796
|
+
kind: "NATIVE";
|
|
797
|
+
decimals: number;
|
|
798
|
+
} | {
|
|
799
|
+
kind: "TOKEN";
|
|
800
|
+
decimals: number;
|
|
801
|
+
address: string;
|
|
802
|
+
};
|
|
803
|
+
};
|
|
804
|
+
amount: string;
|
|
805
|
+
};
|
|
806
|
+
mode: "exact_output";
|
|
807
|
+
id: string;
|
|
808
|
+
fees: {
|
|
809
|
+
preswap?: {
|
|
810
|
+
currency: {
|
|
811
|
+
chain: {
|
|
812
|
+
kind: "BITCOIN";
|
|
813
|
+
} | {
|
|
814
|
+
kind: "EVM";
|
|
815
|
+
chainId: number;
|
|
816
|
+
};
|
|
817
|
+
token: {
|
|
818
|
+
kind: "NATIVE";
|
|
819
|
+
decimals: number;
|
|
820
|
+
} | {
|
|
821
|
+
kind: "TOKEN";
|
|
822
|
+
decimals: number;
|
|
823
|
+
address: string;
|
|
824
|
+
};
|
|
825
|
+
};
|
|
826
|
+
amount: string;
|
|
827
|
+
usd: number;
|
|
828
|
+
} | undefined;
|
|
829
|
+
rift?: {
|
|
830
|
+
network: {
|
|
831
|
+
currency: {
|
|
832
|
+
chain: {
|
|
833
|
+
kind: "BITCOIN";
|
|
834
|
+
} | {
|
|
835
|
+
kind: "EVM";
|
|
836
|
+
chainId: number;
|
|
837
|
+
};
|
|
838
|
+
token: {
|
|
839
|
+
kind: "NATIVE";
|
|
840
|
+
decimals: number;
|
|
841
|
+
} | {
|
|
842
|
+
kind: "TOKEN";
|
|
843
|
+
decimals: number;
|
|
844
|
+
address: string;
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
amount: string;
|
|
848
|
+
usd: number;
|
|
849
|
+
};
|
|
850
|
+
liquidity: {
|
|
851
|
+
currency: {
|
|
852
|
+
chain: {
|
|
853
|
+
kind: "BITCOIN";
|
|
854
|
+
} | {
|
|
855
|
+
kind: "EVM";
|
|
856
|
+
chainId: number;
|
|
857
|
+
};
|
|
858
|
+
token: {
|
|
859
|
+
kind: "NATIVE";
|
|
860
|
+
decimals: number;
|
|
861
|
+
} | {
|
|
862
|
+
kind: "TOKEN";
|
|
863
|
+
decimals: number;
|
|
864
|
+
address: string;
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
amount: string;
|
|
868
|
+
usd: number;
|
|
869
|
+
};
|
|
870
|
+
protocol: {
|
|
871
|
+
currency: {
|
|
872
|
+
chain: {
|
|
873
|
+
kind: "BITCOIN";
|
|
874
|
+
} | {
|
|
875
|
+
kind: "EVM";
|
|
876
|
+
chainId: number;
|
|
877
|
+
};
|
|
878
|
+
token: {
|
|
879
|
+
kind: "NATIVE";
|
|
880
|
+
decimals: number;
|
|
881
|
+
} | {
|
|
882
|
+
kind: "TOKEN";
|
|
883
|
+
decimals: number;
|
|
884
|
+
address: string;
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
amount: string;
|
|
888
|
+
usd: number;
|
|
889
|
+
};
|
|
890
|
+
} | undefined;
|
|
891
|
+
postswap?: {
|
|
892
|
+
currency: {
|
|
893
|
+
chain: {
|
|
894
|
+
kind: "BITCOIN";
|
|
895
|
+
} | {
|
|
896
|
+
kind: "EVM";
|
|
897
|
+
chainId: number;
|
|
898
|
+
};
|
|
899
|
+
token: {
|
|
900
|
+
kind: "NATIVE";
|
|
901
|
+
decimals: number;
|
|
902
|
+
} | {
|
|
903
|
+
kind: "TOKEN";
|
|
904
|
+
decimals: number;
|
|
905
|
+
address: string;
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
amount: string;
|
|
909
|
+
usd: number;
|
|
910
|
+
} | undefined;
|
|
911
|
+
totalUsd: number;
|
|
912
|
+
};
|
|
913
|
+
expiresAt: string;
|
|
914
|
+
};
|
|
915
|
+
swapId: string;
|
|
916
|
+
executionSteps: ({
|
|
917
|
+
amount?: string | undefined;
|
|
918
|
+
value?: string | undefined;
|
|
919
|
+
tokenAddress?: string | undefined;
|
|
920
|
+
spenderAddress?: string | undefined;
|
|
921
|
+
kind: "approval" | "transfer_erc20" | "oneinch_swap";
|
|
922
|
+
chainId: number;
|
|
923
|
+
to: string;
|
|
924
|
+
id: string;
|
|
925
|
+
action: "evm_call";
|
|
926
|
+
calldata: string;
|
|
927
|
+
} | {
|
|
928
|
+
kind: "transfer_btc";
|
|
929
|
+
id: string;
|
|
930
|
+
action: "btc_transfer";
|
|
931
|
+
toAddress: string;
|
|
932
|
+
amountSats: string;
|
|
933
|
+
})[];
|
|
934
|
+
};
|
|
935
|
+
404: {
|
|
936
|
+
error: string;
|
|
937
|
+
};
|
|
938
|
+
410: {
|
|
939
|
+
error: string;
|
|
940
|
+
};
|
|
941
|
+
422: {
|
|
942
|
+
type: "validation";
|
|
943
|
+
on: string;
|
|
944
|
+
summary?: string;
|
|
945
|
+
message?: string;
|
|
946
|
+
found?: unknown;
|
|
947
|
+
property?: string;
|
|
948
|
+
expected?: string;
|
|
949
|
+
};
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
};
|
|
953
|
+
} & {
|
|
954
|
+
swap: {
|
|
955
|
+
":swapId": {
|
|
956
|
+
get: {
|
|
957
|
+
body: unknown;
|
|
958
|
+
params: {
|
|
959
|
+
swapId: string;
|
|
960
|
+
};
|
|
961
|
+
query: unknown;
|
|
962
|
+
headers: unknown;
|
|
963
|
+
response: {
|
|
964
|
+
200: {
|
|
965
|
+
payoutTransaction?: string | undefined;
|
|
966
|
+
depositTransaction?: string | undefined;
|
|
967
|
+
destinationAddress: string;
|
|
968
|
+
status: string;
|
|
969
|
+
quote: {
|
|
970
|
+
from: {
|
|
971
|
+
currency: {
|
|
972
|
+
chain: {
|
|
973
|
+
kind: "BITCOIN";
|
|
974
|
+
} | {
|
|
975
|
+
kind: "EVM";
|
|
976
|
+
chainId: number;
|
|
977
|
+
};
|
|
978
|
+
token: {
|
|
979
|
+
kind: "NATIVE";
|
|
980
|
+
decimals: number;
|
|
981
|
+
} | {
|
|
982
|
+
kind: "TOKEN";
|
|
983
|
+
decimals: number;
|
|
984
|
+
address: string;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
amount: string;
|
|
988
|
+
};
|
|
989
|
+
to: {
|
|
990
|
+
minimum?: string | undefined;
|
|
991
|
+
currency: {
|
|
992
|
+
chain: {
|
|
993
|
+
kind: "BITCOIN";
|
|
994
|
+
} | {
|
|
995
|
+
kind: "EVM";
|
|
996
|
+
chainId: number;
|
|
997
|
+
};
|
|
998
|
+
token: {
|
|
999
|
+
kind: "NATIVE";
|
|
1000
|
+
decimals: number;
|
|
1001
|
+
} | {
|
|
1002
|
+
kind: "TOKEN";
|
|
1003
|
+
decimals: number;
|
|
1004
|
+
address: string;
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
1007
|
+
amount: string;
|
|
1008
|
+
};
|
|
1009
|
+
mode: "exact_input";
|
|
1010
|
+
id: string;
|
|
1011
|
+
fees: {
|
|
1012
|
+
preswap?: {
|
|
1013
|
+
currency: {
|
|
1014
|
+
chain: {
|
|
1015
|
+
kind: "BITCOIN";
|
|
1016
|
+
} | {
|
|
1017
|
+
kind: "EVM";
|
|
1018
|
+
chainId: number;
|
|
1019
|
+
};
|
|
1020
|
+
token: {
|
|
1021
|
+
kind: "NATIVE";
|
|
1022
|
+
decimals: number;
|
|
1023
|
+
} | {
|
|
1024
|
+
kind: "TOKEN";
|
|
1025
|
+
decimals: number;
|
|
1026
|
+
address: string;
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
amount: string;
|
|
1030
|
+
usd: number;
|
|
1031
|
+
} | undefined;
|
|
1032
|
+
rift?: {
|
|
1033
|
+
network: {
|
|
1034
|
+
currency: {
|
|
1035
|
+
chain: {
|
|
1036
|
+
kind: "BITCOIN";
|
|
1037
|
+
} | {
|
|
1038
|
+
kind: "EVM";
|
|
1039
|
+
chainId: number;
|
|
1040
|
+
};
|
|
1041
|
+
token: {
|
|
1042
|
+
kind: "NATIVE";
|
|
1043
|
+
decimals: number;
|
|
1044
|
+
} | {
|
|
1045
|
+
kind: "TOKEN";
|
|
1046
|
+
decimals: number;
|
|
1047
|
+
address: string;
|
|
1048
|
+
};
|
|
1049
|
+
};
|
|
1050
|
+
amount: string;
|
|
1051
|
+
usd: number;
|
|
1052
|
+
};
|
|
1053
|
+
liquidity: {
|
|
1054
|
+
currency: {
|
|
1055
|
+
chain: {
|
|
1056
|
+
kind: "BITCOIN";
|
|
1057
|
+
} | {
|
|
1058
|
+
kind: "EVM";
|
|
1059
|
+
chainId: number;
|
|
1060
|
+
};
|
|
1061
|
+
token: {
|
|
1062
|
+
kind: "NATIVE";
|
|
1063
|
+
decimals: number;
|
|
1064
|
+
} | {
|
|
1065
|
+
kind: "TOKEN";
|
|
1066
|
+
decimals: number;
|
|
1067
|
+
address: string;
|
|
1068
|
+
};
|
|
1069
|
+
};
|
|
1070
|
+
amount: string;
|
|
1071
|
+
usd: number;
|
|
1072
|
+
};
|
|
1073
|
+
protocol: {
|
|
1074
|
+
currency: {
|
|
1075
|
+
chain: {
|
|
1076
|
+
kind: "BITCOIN";
|
|
1077
|
+
} | {
|
|
1078
|
+
kind: "EVM";
|
|
1079
|
+
chainId: number;
|
|
1080
|
+
};
|
|
1081
|
+
token: {
|
|
1082
|
+
kind: "NATIVE";
|
|
1083
|
+
decimals: number;
|
|
1084
|
+
} | {
|
|
1085
|
+
kind: "TOKEN";
|
|
1086
|
+
decimals: number;
|
|
1087
|
+
address: string;
|
|
1088
|
+
};
|
|
1089
|
+
};
|
|
1090
|
+
amount: string;
|
|
1091
|
+
usd: number;
|
|
1092
|
+
};
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
postswap?: {
|
|
1095
|
+
currency: {
|
|
1096
|
+
chain: {
|
|
1097
|
+
kind: "BITCOIN";
|
|
1098
|
+
} | {
|
|
1099
|
+
kind: "EVM";
|
|
1100
|
+
chainId: number;
|
|
1101
|
+
};
|
|
1102
|
+
token: {
|
|
1103
|
+
kind: "NATIVE";
|
|
1104
|
+
decimals: number;
|
|
1105
|
+
} | {
|
|
1106
|
+
kind: "TOKEN";
|
|
1107
|
+
decimals: number;
|
|
1108
|
+
address: string;
|
|
1109
|
+
};
|
|
1110
|
+
};
|
|
1111
|
+
amount: string;
|
|
1112
|
+
usd: number;
|
|
1113
|
+
} | undefined;
|
|
1114
|
+
totalUsd: number;
|
|
1115
|
+
};
|
|
1116
|
+
expiresAt: string;
|
|
1117
|
+
} | {
|
|
1118
|
+
from: {
|
|
1119
|
+
maximum?: string | undefined;
|
|
1120
|
+
currency: {
|
|
1121
|
+
chain: {
|
|
1122
|
+
kind: "BITCOIN";
|
|
1123
|
+
} | {
|
|
1124
|
+
kind: "EVM";
|
|
1125
|
+
chainId: number;
|
|
1126
|
+
};
|
|
1127
|
+
token: {
|
|
1128
|
+
kind: "NATIVE";
|
|
1129
|
+
decimals: number;
|
|
1130
|
+
} | {
|
|
1131
|
+
kind: "TOKEN";
|
|
1132
|
+
decimals: number;
|
|
1133
|
+
address: string;
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
amount: string;
|
|
1137
|
+
};
|
|
1138
|
+
to: {
|
|
1139
|
+
currency: {
|
|
1140
|
+
chain: {
|
|
1141
|
+
kind: "BITCOIN";
|
|
1142
|
+
} | {
|
|
1143
|
+
kind: "EVM";
|
|
1144
|
+
chainId: number;
|
|
1145
|
+
};
|
|
1146
|
+
token: {
|
|
1147
|
+
kind: "NATIVE";
|
|
1148
|
+
decimals: number;
|
|
1149
|
+
} | {
|
|
1150
|
+
kind: "TOKEN";
|
|
1151
|
+
decimals: number;
|
|
1152
|
+
address: string;
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
amount: string;
|
|
1156
|
+
};
|
|
1157
|
+
mode: "exact_output";
|
|
1158
|
+
id: string;
|
|
1159
|
+
fees: {
|
|
1160
|
+
preswap?: {
|
|
1161
|
+
currency: {
|
|
1162
|
+
chain: {
|
|
1163
|
+
kind: "BITCOIN";
|
|
1164
|
+
} | {
|
|
1165
|
+
kind: "EVM";
|
|
1166
|
+
chainId: number;
|
|
1167
|
+
};
|
|
1168
|
+
token: {
|
|
1169
|
+
kind: "NATIVE";
|
|
1170
|
+
decimals: number;
|
|
1171
|
+
} | {
|
|
1172
|
+
kind: "TOKEN";
|
|
1173
|
+
decimals: number;
|
|
1174
|
+
address: string;
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
amount: string;
|
|
1178
|
+
usd: number;
|
|
1179
|
+
} | undefined;
|
|
1180
|
+
rift?: {
|
|
1181
|
+
network: {
|
|
1182
|
+
currency: {
|
|
1183
|
+
chain: {
|
|
1184
|
+
kind: "BITCOIN";
|
|
1185
|
+
} | {
|
|
1186
|
+
kind: "EVM";
|
|
1187
|
+
chainId: number;
|
|
1188
|
+
};
|
|
1189
|
+
token: {
|
|
1190
|
+
kind: "NATIVE";
|
|
1191
|
+
decimals: number;
|
|
1192
|
+
} | {
|
|
1193
|
+
kind: "TOKEN";
|
|
1194
|
+
decimals: number;
|
|
1195
|
+
address: string;
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
amount: string;
|
|
1199
|
+
usd: number;
|
|
1200
|
+
};
|
|
1201
|
+
liquidity: {
|
|
1202
|
+
currency: {
|
|
1203
|
+
chain: {
|
|
1204
|
+
kind: "BITCOIN";
|
|
1205
|
+
} | {
|
|
1206
|
+
kind: "EVM";
|
|
1207
|
+
chainId: number;
|
|
1208
|
+
};
|
|
1209
|
+
token: {
|
|
1210
|
+
kind: "NATIVE";
|
|
1211
|
+
decimals: number;
|
|
1212
|
+
} | {
|
|
1213
|
+
kind: "TOKEN";
|
|
1214
|
+
decimals: number;
|
|
1215
|
+
address: string;
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
amount: string;
|
|
1219
|
+
usd: number;
|
|
1220
|
+
};
|
|
1221
|
+
protocol: {
|
|
1222
|
+
currency: {
|
|
1223
|
+
chain: {
|
|
1224
|
+
kind: "BITCOIN";
|
|
1225
|
+
} | {
|
|
1226
|
+
kind: "EVM";
|
|
1227
|
+
chainId: number;
|
|
1228
|
+
};
|
|
1229
|
+
token: {
|
|
1230
|
+
kind: "NATIVE";
|
|
1231
|
+
decimals: number;
|
|
1232
|
+
} | {
|
|
1233
|
+
kind: "TOKEN";
|
|
1234
|
+
decimals: number;
|
|
1235
|
+
address: string;
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
amount: string;
|
|
1239
|
+
usd: number;
|
|
1240
|
+
};
|
|
1241
|
+
} | undefined;
|
|
1242
|
+
postswap?: {
|
|
1243
|
+
currency: {
|
|
1244
|
+
chain: {
|
|
1245
|
+
kind: "BITCOIN";
|
|
1246
|
+
} | {
|
|
1247
|
+
kind: "EVM";
|
|
1248
|
+
chainId: number;
|
|
1249
|
+
};
|
|
1250
|
+
token: {
|
|
1251
|
+
kind: "NATIVE";
|
|
1252
|
+
decimals: number;
|
|
1253
|
+
} | {
|
|
1254
|
+
kind: "TOKEN";
|
|
1255
|
+
decimals: number;
|
|
1256
|
+
address: string;
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
amount: string;
|
|
1260
|
+
usd: number;
|
|
1261
|
+
} | undefined;
|
|
1262
|
+
totalUsd: number;
|
|
1263
|
+
};
|
|
1264
|
+
expiresAt: string;
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
422: {
|
|
1268
|
+
type: "validation";
|
|
1269
|
+
on: string;
|
|
1270
|
+
summary?: string;
|
|
1271
|
+
message?: string;
|
|
1272
|
+
found?: unknown;
|
|
1273
|
+
property?: string;
|
|
1274
|
+
expected?: string;
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
};
|
|
1279
|
+
};
|
|
1280
|
+
} & {
|
|
1281
|
+
swap: {
|
|
1282
|
+
":swapId": {
|
|
1283
|
+
tx: {
|
|
1284
|
+
post: {
|
|
1285
|
+
body: {
|
|
1286
|
+
txHash?: string | undefined;
|
|
1287
|
+
stepId: string;
|
|
1288
|
+
};
|
|
1289
|
+
params: {
|
|
1290
|
+
swapId: string;
|
|
1291
|
+
};
|
|
1292
|
+
query: unknown;
|
|
1293
|
+
headers: unknown;
|
|
1294
|
+
response: {
|
|
1295
|
+
200: {
|
|
1296
|
+
success: boolean;
|
|
1297
|
+
};
|
|
1298
|
+
422: {
|
|
1299
|
+
type: "validation";
|
|
1300
|
+
on: string;
|
|
1301
|
+
summary?: string;
|
|
1302
|
+
message?: string;
|
|
1303
|
+
found?: unknown;
|
|
1304
|
+
property?: string;
|
|
1305
|
+
expected?: string;
|
|
1306
|
+
};
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
};
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
1312
|
+
}, {
|
|
1313
|
+
derive: {};
|
|
1314
|
+
resolve: {};
|
|
1315
|
+
schema: {};
|
|
1316
|
+
standaloneSchema: {};
|
|
1317
|
+
response: {};
|
|
1318
|
+
} & {
|
|
1319
|
+
derive: {};
|
|
1320
|
+
resolve: {};
|
|
1321
|
+
schema: {};
|
|
1322
|
+
}, {
|
|
1323
|
+
derive: {};
|
|
1324
|
+
resolve: {};
|
|
1325
|
+
schema: {};
|
|
1326
|
+
standaloneSchema: {};
|
|
1327
|
+
response: {};
|
|
1328
|
+
}>;
|
|
1329
|
+
type App = typeof app;
|
|
238
1330
|
declare class SwapRouterApiError extends Error {
|
|
239
1331
|
status: number;
|
|
240
1332
|
body: ErrorResponse | undefined;
|
|
@@ -292,6 +1384,7 @@ declare class SwapRouterApiError extends Error {
|
|
|
292
1384
|
/** Type of the Rift API client */
|
|
293
1385
|
type RiftClient = Treaty.Create<App>;
|
|
294
1386
|
declare function createClient(baseUrl: string): RiftClient;
|
|
1387
|
+
import { Currency } from "@riftresearch/common";
|
|
295
1388
|
/**
|
|
296
1389
|
* Discriminated union of all possible swap routes.
|
|
297
1390
|
*
|
|
@@ -331,22 +1424,21 @@ interface SupportedModes {
|
|
|
331
1424
|
* - ERC20 → BTC: exact_input only (1inch is exact-input quoting)
|
|
332
1425
|
*/
|
|
333
1426
|
declare function getSupportedModes(from: Currency, to: Currency): SupportedModes;
|
|
1427
|
+
import { SwapStatusResponse as SwapStatusResponse3 } from "@riftresearch/common";
|
|
1428
|
+
import { SwapStatus as ApiSwapStatus, CalculatedInputAmount, CalculatedOutputAmount, Currency as Currency2, FeeBreakdown, SpecifiedAmount, SwapStatusResponse as SwapStatusResponse2 } from "@riftresearch/common";
|
|
334
1429
|
import { Account, PublicClient, Transport, WalletClient } from "viem";
|
|
335
|
-
import { Chain
|
|
336
|
-
|
|
337
|
-
|
|
1430
|
+
import { Chain } from "viem/chains";
|
|
1431
|
+
import { BitcoinChain, Chain as Chain2, Currency as Currency3, Erc20Token, EvmChain, NativeToken, TokenIdentifier } from "@riftresearch/common";
|
|
1432
|
+
type RiftSwap = SwapStatusResponse2;
|
|
1433
|
+
interface QuoteParameters {
|
|
338
1434
|
/** The currency to swap from */
|
|
339
|
-
from:
|
|
1435
|
+
from: Currency2;
|
|
340
1436
|
/** The currency to swap to */
|
|
341
|
-
to:
|
|
1437
|
+
to: Currency2;
|
|
342
1438
|
/** Amount in smallest unit (sats for BTC, wei for ETH, etc.) */
|
|
343
1439
|
amount: string;
|
|
344
1440
|
/** Whether amount refers to input or output */
|
|
345
1441
|
mode: "exact_input" | "exact_output";
|
|
346
|
-
/** Address to receive the output tokens */
|
|
347
|
-
destinationAddress: string;
|
|
348
|
-
/** Address to receive refunds if swap fails. Defaults to source wallet address */
|
|
349
|
-
refundAddress?: string;
|
|
350
1442
|
/**
|
|
351
1443
|
* Approval amount strategy for ERC20 swaps.
|
|
352
1444
|
* - "full" (default): approve max uint256
|
|
@@ -392,14 +1484,14 @@ interface ExactOutputQuoteResult extends QuoteResultBase {
|
|
|
392
1484
|
type QuoteResult = ExactInputQuoteResult | ExactOutputQuoteResult;
|
|
393
1485
|
interface GetQuoteResult {
|
|
394
1486
|
quote: QuoteResult;
|
|
395
|
-
executeSwap: <chain extends
|
|
1487
|
+
executeSwap: <chain extends Chain | undefined = Chain | undefined>(context: ExecuteSwapOptions<chain>) => Promise<SwapResult>;
|
|
396
1488
|
}
|
|
397
1489
|
interface SwapResult {
|
|
398
1490
|
swapId: string;
|
|
399
|
-
status:
|
|
1491
|
+
status: SwapStatus;
|
|
400
1492
|
rift: RiftSwap;
|
|
401
1493
|
}
|
|
402
|
-
type
|
|
1494
|
+
type SwapStatus = ApiSwapStatus;
|
|
403
1495
|
/**
|
|
404
1496
|
* Function type for sending Bitcoin.
|
|
405
1497
|
* Implementers provide this function to handle BTC transactions in their app.
|
|
@@ -426,7 +1518,7 @@ type SendBitcoinFn = (params: {
|
|
|
426
1518
|
/** Amount to send in satoshis */
|
|
427
1519
|
amountSats: string;
|
|
428
1520
|
}) => Promise<void>;
|
|
429
|
-
type ExecuteSwapContext<chain extends
|
|
1521
|
+
type ExecuteSwapContext<chain extends Chain | undefined = Chain | undefined> = {
|
|
430
1522
|
/** Viem PublicClient for reading chain data */
|
|
431
1523
|
publicClient?: PublicClient<Transport, chain>;
|
|
432
1524
|
/** Viem WalletClient for signing and sending transactions */
|
|
@@ -434,6 +1526,12 @@ type ExecuteSwapContext<chain extends Chain2 | undefined = Chain2 | undefined> =
|
|
|
434
1526
|
/** Function to send Bitcoin (implement using your preferred wallet) */
|
|
435
1527
|
sendBitcoin?: SendBitcoinFn;
|
|
436
1528
|
};
|
|
1529
|
+
type ExecuteSwapOptions<chain extends Chain | undefined = Chain | undefined> = ExecuteSwapContext<chain> & {
|
|
1530
|
+
/** Address to receive the output tokens */
|
|
1531
|
+
destinationAddress: string;
|
|
1532
|
+
/** Address to receive refunds if swap fails. Defaults to source wallet address */
|
|
1533
|
+
refundAddress?: string;
|
|
1534
|
+
};
|
|
437
1535
|
interface RiftSdkOptions {
|
|
438
1536
|
/** Rift API URL. Defaults to production API */
|
|
439
1537
|
apiUrl?: string;
|
|
@@ -464,17 +1562,17 @@ declare class RiftSdk {
|
|
|
464
1562
|
* to: Currencies.Bitcoin.BTC,
|
|
465
1563
|
* amount: '100000000', // 1 cbBTC
|
|
466
1564
|
* mode: 'exact_input',
|
|
467
|
-
* destinationAddress: 'bc1q...',
|
|
468
1565
|
* })
|
|
469
1566
|
*
|
|
470
1567
|
* console.log(`You'll receive: ${quote.to.amount} sats`)
|
|
471
1568
|
* const swap = await executeSwap({
|
|
1569
|
+
* destinationAddress: 'bc1q...',
|
|
472
1570
|
* publicClient,
|
|
473
1571
|
* walletClient,
|
|
474
1572
|
* sendBitcoin,
|
|
475
1573
|
* })
|
|
476
1574
|
*/
|
|
477
|
-
getQuote(params:
|
|
1575
|
+
getQuote(params: QuoteParameters): Promise<GetQuoteResult>;
|
|
478
1576
|
/**
|
|
479
1577
|
* Execute a single step from the server's execution steps.
|
|
480
1578
|
* Dispatch based on `action` (the execution mechanism).
|
|
@@ -502,7 +1600,7 @@ declare class RiftSdk {
|
|
|
502
1600
|
/**
|
|
503
1601
|
* Get the current status of a swap by its ID.
|
|
504
1602
|
*/
|
|
505
|
-
getSwapStatus(swapId: string): Promise<
|
|
1603
|
+
getSwapStatus(swapId: string): Promise<SwapStatusResponse3>;
|
|
506
1604
|
}
|
|
507
1605
|
declare function createRiftSdk(options: RiftSdkOptions): RiftSdk;
|
|
508
|
-
export { getSupportedModes, detectRoute, createRiftSdk, createCurrency, createClient,
|
|
1606
|
+
export { getSupportedModes, detectRoute, createRiftSdk, createCurrency, createClient, TokenIdentifier, SwapStatus, SwapRouterApiError, SwapRoute, SwapResult, SwapResponse2 as SwapResponse, SupportedModes, SendBitcoinFn, RiftSwap, RiftSdkOptions, RiftSdk, RiftClient, QuoteResult, QuoteParameters, NativeToken, GetQuoteResult, ExecutionStep, ExecutionAction, ExecuteSwapOptions, EvmChain, EvmCallStep, EvmCallKind, Erc20Token, Currency3 as Currency, Currencies, Chain2 as Chain, BtcTransferStep, BtcTransferKind, BitcoinChain, App };
|