@sip-protocol/sdk 0.2.4 → 0.2.6

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/browser.js CHANGED
@@ -2121,7 +2121,21 @@ var OneClickClient = class {
2121
2121
  */
2122
2122
  async quote(request) {
2123
2123
  this.validateQuoteRequest(request);
2124
- return this.post("/v0/quote", request);
2124
+ const rawResponse = await this.post("/v0/quote", request);
2125
+ return {
2126
+ quoteId: rawResponse.timestamp,
2127
+ // Use timestamp as quoteId since API doesn't provide one
2128
+ depositAddress: rawResponse.quote.depositAddress,
2129
+ amountIn: rawResponse.quote.amountIn,
2130
+ amountInFormatted: rawResponse.quote.amountInFormatted,
2131
+ amountOut: rawResponse.quote.amountOut,
2132
+ amountOutFormatted: rawResponse.quote.amountOutFormatted,
2133
+ amountOutUsd: rawResponse.quote.amountOutUsd,
2134
+ deadline: rawResponse.quote.deadline,
2135
+ timeEstimate: rawResponse.quote.timeEstimate,
2136
+ signature: rawResponse.signature,
2137
+ request: rawResponse.quoteRequest
2138
+ };
2125
2139
  }
2126
2140
  /**
2127
2141
  * Request a dry quote (preview without deposit address)
@@ -2966,6 +2980,13 @@ var SIP = class {
2966
2980
  senderAddress ?? this.wallet?.address
2967
2981
  );
2968
2982
  const rawQuote = await this.intentsAdapter.getQuote(prepared);
2983
+ if (!rawQuote.amountOut || !rawQuote.amountIn) {
2984
+ throw new ValidationError(
2985
+ `Invalid quote response from 1Click API: missing ${!rawQuote.amountOut ? "amountOut" : "amountIn"}. This may indicate the trading pair is not supported or the amount is too small.`,
2986
+ "quote",
2987
+ { rawQuote }
2988
+ );
2989
+ }
2969
2990
  this.pendingSwaps.set(requestId, {
2970
2991
  depositAddress: rawQuote.depositAddress,
2971
2992
  quote: rawQuote
package/dist/browser.mjs CHANGED
@@ -197,7 +197,7 @@ import {
197
197
  walletRegistry,
198
198
  withSecureBuffer,
199
199
  withSecureBufferSync
200
- } from "./chunk-VXSHK7US.mjs";
200
+ } from "./chunk-6WOV2YNG.mjs";
201
201
  import {
202
202
  fulfillment_proof_default,
203
203
  funding_proof_default,