@ravnexchange/sdk 0.2.1 → 0.2.3
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/types.d.ts +46 -9
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -65,7 +65,8 @@ export interface QuoteDTO {
|
|
|
65
65
|
* minimum shown can no longer be met). */
|
|
66
66
|
expiresAt: number;
|
|
67
67
|
/** Present on 2-hop (`venue.id === "compose"`) and Relay dest-call quotes. Sign hop 1; hop 2 is
|
|
68
|
-
* a unique deposit, not a second wallet tx.
|
|
68
|
+
* a unique deposit, not a second wallet tx. The stablecoin route also sweeps its leftover through
|
|
69
|
+
* 0x (`0x_swap`), which isn't listed here. */
|
|
69
70
|
hops?: {
|
|
70
71
|
id: string;
|
|
71
72
|
name: string;
|
|
@@ -188,6 +189,14 @@ export type ExecutionDTO = {
|
|
|
188
189
|
* stays with RAVN.
|
|
189
190
|
*/
|
|
190
191
|
fee?: DepositFeeDTO;
|
|
192
|
+
/** EVM: everything to send, in order (approval.reset, approval, the swap or the deposit
|
|
193
|
+
* transfer, RAVN's fee). Each once the one before has succeeded (stop if one reverts), or, when
|
|
194
|
+
* `batch` is true, all in one atomic wallet batch (EIP-5792 `wallet_sendCalls`,
|
|
195
|
+
* `atomicRequired: true`): simulate it first, and send them one by one if that fails or the
|
|
196
|
+
* last call needs more than ~400k gas. */
|
|
197
|
+
calls?: CallDTO[];
|
|
198
|
+
/** Whether `calls` (more than one) may go in one atomic wallet batch. */
|
|
199
|
+
batch?: boolean;
|
|
191
200
|
} | {
|
|
192
201
|
executionType: "SIGNATURE";
|
|
193
202
|
/** True for a sandbox quote: nothing here is real (see GetQuoteParams.sandbox); never send
|
|
@@ -221,6 +230,13 @@ export type ExecutionDTO = {
|
|
|
221
230
|
amount: string;
|
|
222
231
|
chainId?: number;
|
|
223
232
|
expiresAt?: string;
|
|
233
|
+
/** Bitcoin, from a native SegWit (bc1q…) userAddress: the deposit (and RAVN's fee as a second
|
|
234
|
+
* output) as a ready-to-sign PSBT, base64, change back to it. Absent when it can't be built. */
|
|
235
|
+
psbt?: string;
|
|
236
|
+
/** Solana, when the deposit carries RAVN's fee: deposit and fee as one unsigned transaction,
|
|
237
|
+
* base64. Sign and send it within a minute (its blockhash expires; a retry with the same
|
|
238
|
+
* Idempotency-Key returns this same one). */
|
|
239
|
+
transaction?: string;
|
|
224
240
|
};
|
|
225
241
|
/** Poll getStatus with this, not `deposit.address`. */
|
|
226
242
|
statusRef: string;
|
|
@@ -229,7 +245,22 @@ export type ExecutionDTO = {
|
|
|
229
245
|
* fee is owed to you. A fee paid on a swap the venue then refunds stays with RAVN and nothing
|
|
230
246
|
* is owed on it, so send an EVM fee payment once the deposit has confirmed. */
|
|
231
247
|
fee?: DepositFeeDTO;
|
|
248
|
+
/** EVM: everything to send, in order (approval.reset, approval, the swap or the deposit
|
|
249
|
+
* transfer, RAVN's fee). Each once the one before has succeeded (stop if one reverts), or, when
|
|
250
|
+
* `batch` is true, all in one atomic wallet batch (EIP-5792 `wallet_sendCalls`,
|
|
251
|
+
* `atomicRequired: true`): simulate it first, and send them one by one if that fails or the
|
|
252
|
+
* last call needs more than ~400k gas. */
|
|
253
|
+
calls?: CallDTO[];
|
|
254
|
+
/** Whether `calls` (more than one) may go in one atomic wallet batch. */
|
|
255
|
+
batch?: boolean;
|
|
232
256
|
};
|
|
257
|
+
/** One EVM transaction to send, as given. */
|
|
258
|
+
export interface CallDTO {
|
|
259
|
+
to: string;
|
|
260
|
+
data: string;
|
|
261
|
+
value: string;
|
|
262
|
+
chainId: number;
|
|
263
|
+
}
|
|
233
264
|
/** RAVN's integrator fee beside a deposit (or a transaction), in the input token, paid by your user
|
|
234
265
|
* to RAVN; your share is paid out as usual. `deposit.amount` (the transaction) already leaves it out. */
|
|
235
266
|
export interface DepositFeeDTO {
|
|
@@ -301,16 +332,22 @@ export interface GetQuoteParams {
|
|
|
301
332
|
* wait; a quote with slippage.noMinimum counts only 2000 ms past the limit). A positive integer;
|
|
302
333
|
* default 6000, clamped to 1000–15000. An API that predates it ignores it. */
|
|
303
334
|
timeoutMs?: number;
|
|
304
|
-
/**
|
|
335
|
+
/** Venues never to use, e.g. a risk objection to one of them. An excluded venue is used
|
|
336
|
+
* nowhere in the route, including the steps of RAVN's multi-step routes (compose, relay quotes
|
|
337
|
+
* with hops); a multi-step route that needs it isn't offered. Venues that swap for you may still
|
|
338
|
+
* route through it on their own (see onlyVenues). */
|
|
305
339
|
excludeVenues?: string[];
|
|
306
340
|
/** Race only these venues, e.g. ["bebop"] for an RFQ-only race. Every other venue is left
|
|
307
|
-
* out, including ones RAVN adds later; excludeVenues still applies on top.
|
|
308
|
-
* venue
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
341
|
+
* out, including ones RAVN adds later; excludeVenues still applies on top. It covers every
|
|
342
|
+
* venue RAVN routes funds through: a multi-step route is offered only when its own venue.id and
|
|
343
|
+
* every venue in its hops are listed, e.g. ["compose", "jupiter", "relay"] or
|
|
344
|
+
* ["relay", "kyberswap"]. RAVN's stablecoin route also needs "0x_swap" beside its hops: it
|
|
345
|
+
* sweeps the leftover. Venues that swap for you may route through other venues of their own
|
|
346
|
+
* choosing, which neither list can reach: Layerswap (a Solana token often goes through Jupiter
|
|
347
|
+
* first), Relay, Rift, Across (when it swaps before or after bridging) and Mayan (Jupiter on
|
|
348
|
+
* Solana, other DEXs such as Nordstern on EVM). An empty list is rejected (INVALID_REQUEST); if
|
|
349
|
+
* none of them can quote, NO_LIQUIDITY lists every left-out venue in
|
|
350
|
+
* error.details.excludedVenues. */
|
|
314
351
|
onlyVenues?: string[];
|
|
315
352
|
/** Settle privately: the race narrows to NEAR Intents (Confidential Intents) and Houdini Swap,
|
|
316
353
|
* and NO_LIQUIDITY replaces a public fill if neither can quote. Houdini is sent the request's IP,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ravnexchange/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Typed client for the RAVN integrator API (/api/v1): quote, execute, submit-signature, status.",
|
|
5
5
|
"keywords": ["ravn", "cross-chain", "swap", "swap-api", "dex-aggregator", "bitcoin", "native-btc", "solana", "evm", "crypto", "defi", "typescript", "sdk", "api-client"],
|
|
6
6
|
"main": "./dist/index.js",
|