@ravnexchange/sdk 0.1.10 → 0.1.12
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/client.d.ts +2 -1
- package/dist/client.js +4 -1
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export interface RavnClientConfig {
|
|
|
4
4
|
apiKey?: string;
|
|
5
5
|
/** Default: https://app.ravn.exchange/api/v1 */
|
|
6
6
|
baseUrl?: string;
|
|
7
|
-
/** Swap in your own fetch (e.g. for React Native, or a test double). Defaults to global fetch.
|
|
7
|
+
/** Swap in your own fetch (e.g. for React Native, or a test double). Defaults to global fetch.
|
|
8
|
+
* Called as a plain function (no `this`): pass fetch itself, or a plain or bound wrapper. */
|
|
8
9
|
fetch?: typeof fetch;
|
|
9
10
|
}
|
|
10
11
|
export declare class RavnClient {
|
package/dist/client.js
CHANGED
|
@@ -13,7 +13,10 @@ class RavnClient {
|
|
|
13
13
|
this.fetchImpl = config.fetch ?? globalThis.fetch;
|
|
14
14
|
}
|
|
15
15
|
async request(path, init) {
|
|
16
|
-
|
|
16
|
+
// Called unbound, never as this.fetchImpl(...): a browser's own fetch (the default, or one
|
|
17
|
+
// passed in) throws "Illegal invocation" when `this` is the client, failing every call.
|
|
18
|
+
const fetchImpl = this.fetchImpl;
|
|
19
|
+
const res = await fetchImpl(`${this.baseUrl}${path}`, {
|
|
17
20
|
...init,
|
|
18
21
|
headers: {
|
|
19
22
|
"content-type": "application/json",
|
package/dist/types.d.ts
CHANGED
|
@@ -203,7 +203,12 @@ export interface GetQuoteParams {
|
|
|
203
203
|
/** Omitting this yields a preview-only quote; see QuoteDTO.executable. */
|
|
204
204
|
destinationAddress?: string;
|
|
205
205
|
refundAddress?: string;
|
|
206
|
+
/** Max slippage in bps. Omitted = Auto (50, wider where a route needs it). Setting it keeps
|
|
207
|
+
* venues with no minimum (slippage.noMinimum, today Rift) out of the race unless allowNoMinimum. */
|
|
206
208
|
slippageBps?: number;
|
|
209
|
+
/** Let venues with no minimum (today Rift) race even though slippageBps is set. Their quotes
|
|
210
|
+
* carry slippage.noMinimum: true and guaranteedMin: null; slippageBps does not protect them. */
|
|
211
|
+
allowNoMinimum?: boolean;
|
|
207
212
|
rankingMode?: "best_output" | "fastest";
|
|
208
213
|
/** Drop specific venues from this race, e.g. a risk objection to one of them. */
|
|
209
214
|
excludeVenues?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ravnexchange/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
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",
|