@ravnexchange/sdk 0.1.7 → 0.1.9

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 CHANGED
@@ -21,8 +21,9 @@ export declare class RavnClient {
21
21
  submitSignature(params: SubmitSignatureParams): Promise<{
22
22
  statusRef: string;
23
23
  }>;
24
- /** GET /v1/status: pass the quoteToken execute() returned (not the quote's own), and as `ref`
25
- * the execution's statusRef, submitSignature's statusRef, or the origin tx hash. */
24
+ /** POST /v1/status: pass the quoteToken execute() returned (not the quote's own), and as `ref`
25
+ * the execution's statusRef, submitSignature's statusRef, or the origin tx hash. POST, not GET:
26
+ * a 2-hop quoteToken in a query string can exceed header limits and fail with 431. */
26
27
  getStatus(quoteToken: string, ref: string): Promise<StatusDTO>;
27
28
  /** GET /v1/tokens: RAVN's listed token registry for one chain. Not a per-pair routability guarantee. */
28
29
  getTokens(chainId: number): Promise<TokenDTO[]>;
package/dist/client.js CHANGED
@@ -51,11 +51,14 @@ class RavnClient {
51
51
  body: JSON.stringify(params),
52
52
  });
53
53
  }
54
- /** GET /v1/status: pass the quoteToken execute() returned (not the quote's own), and as `ref`
55
- * the execution's statusRef, submitSignature's statusRef, or the origin tx hash. */
54
+ /** POST /v1/status: pass the quoteToken execute() returned (not the quote's own), and as `ref`
55
+ * the execution's statusRef, submitSignature's statusRef, or the origin tx hash. POST, not GET:
56
+ * a 2-hop quoteToken in a query string can exceed header limits and fail with 431. */
56
57
  getStatus(quoteToken, ref) {
57
- const qs = new URLSearchParams({ quoteToken, ref }).toString();
58
- return this.request(`/status?${qs}`, { method: "GET" });
58
+ return this.request("/status", {
59
+ method: "POST",
60
+ body: JSON.stringify({ quoteToken, ref }),
61
+ });
59
62
  }
60
63
  /** GET /v1/tokens: RAVN's listed token registry for one chain. Not a per-pair routability guarantee. */
61
64
  getTokens(chainId) {
package/dist/types.d.ts CHANGED
@@ -52,6 +52,9 @@ export interface QuoteDTO {
52
52
  outputUsd: string | null;
53
53
  estimatedTimeSeconds: number;
54
54
  estimatedTimeIsGuess: boolean;
55
+ /** Epoch ms: execute() on `quoteToken` must reach RAVN before this, or it fails with
56
+ * QUOTE_EXPIRED. Already 5 s ahead of the venue's own deadline, so compare it to the clock as
57
+ * is. 0 means no deadline. A 2-hop route (`venue.id === "compose"`) re-prices at execute instead. */
55
58
  expiresAt: number;
56
59
  /** Present on 2-hop (`venue.id === "compose"`) and Relay dest-call quotes. Sign hop 1; hop 2 is
57
60
  * a unique deposit, not a second wallet tx. */
@@ -82,6 +85,9 @@ export interface AlternativeQuoteDTO {
82
85
  executable: boolean;
83
86
  estimatedTimeSeconds: number;
84
87
  estimatedTimeIsGuess: boolean;
88
+ /** This route's own execute deadline, same meaning as QuoteDTO.expiresAt. Venues differ, so
89
+ * check it before executing an alternative. */
90
+ expiresAt: number;
85
91
  hops?: {
86
92
  id: string;
87
93
  name: string;
@@ -192,14 +198,28 @@ export interface GetQuoteParams {
192
198
  rankingMode?: "best_output" | "fastest";
193
199
  /** Drop specific venues from this race, e.g. a risk objection to one of them. */
194
200
  excludeVenues?: string[];
201
+ /** Settle privately: the race narrows to NEAR Intents (Confidential Intents) and Houdini Swap,
202
+ * and NO_LIQUIDITY replaces a public fill if neither can quote. Houdini is sent the request's IP,
203
+ * user-agent and clientTimezone for compliance screening; its terms bar US persons and
204
+ * sanctioned jurisdictions, and you own your users' eligibility (excludeVenues: ["houdini"]). */
205
+ confidential?: boolean;
206
+ /** Your end user's IANA timezone (e.g. "Europe/Berlin"), forwarded only to Houdini. Default UTC. */
207
+ clientTimezone?: string;
208
+ /** Optional analytics handle: send the same value while re-pricing one swap so it counts as one
209
+ * intent. Never affects pricing, routing or fees. Max 64 chars. */
210
+ quoteSessionId?: string;
195
211
  /** Test quote -> execute -> status with no real funds and no live venue settlement. See
196
212
  * the API's own sandbox field description for per-venue/per-route exceptions. */
197
213
  sandbox?: boolean;
198
214
  }
199
215
  export interface ExecuteParams {
200
216
  quoteToken: string;
217
+ /** Only venues that bind the recipient at execute (Chainflip, Houdini Swap, Layerswap, Mayan,
218
+ * NEAR Intents, Rift) accept a new one; elsewhere a different address is INVALID_REQUEST. */
201
219
  destinationAddress?: string;
202
220
  refundAddress?: string;
221
+ /** Your end user's IANA timezone, forwarded only to Houdini. Default UTC. */
222
+ clientTimezone?: string;
203
223
  }
204
224
  export interface SubmitSignatureParams {
205
225
  quoteToken: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravnexchange/sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
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",