@sip-protocol/sdk 0.2.3 → 0.2.5

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
@@ -2885,9 +2885,10 @@ var SIP = class {
2885
2885
  *
2886
2886
  * @param params - Intent parameters (CreateIntentParams for production, ShieldedIntent/CreateIntentParams for demo)
2887
2887
  * @param recipientMetaAddress - Optional stealth meta-address for privacy modes
2888
+ * @param senderAddress - Optional sender wallet address for cross-curve refunds
2888
2889
  * @returns Array of quotes (with deposit info in production mode)
2889
2890
  */
2890
- async getQuotes(params, recipientMetaAddress) {
2891
+ async getQuotes(params, recipientMetaAddress, senderAddress) {
2891
2892
  if (this.isProductionMode()) {
2892
2893
  if (!("input" in params)) {
2893
2894
  throw new ValidationError(
@@ -2895,7 +2896,7 @@ var SIP = class {
2895
2896
  "params"
2896
2897
  );
2897
2898
  }
2898
- return this.getQuotesProduction(params, recipientMetaAddress);
2899
+ return this.getQuotesProduction(params, recipientMetaAddress, senderAddress);
2899
2900
  }
2900
2901
  return this.getQuotesDemo(params);
2901
2902
  }
@@ -2935,7 +2936,7 @@ var SIP = class {
2935
2936
  return this.config.network;
2936
2937
  }
2937
2938
  // ─── Production Mode Implementation ─────────────────────────────────────────
2938
- async getQuotesProduction(params, recipientMetaAddress) {
2939
+ async getQuotesProduction(params, recipientMetaAddress, senderAddress) {
2939
2940
  if (!this.intentsAdapter) {
2940
2941
  throw new ValidationError(
2941
2942
  "NEAR Intents adapter not configured. Set intentsAdapter in config for production mode.",
@@ -2962,9 +2963,16 @@ var SIP = class {
2962
2963
  const prepared = await this.intentsAdapter.prepareSwap(
2963
2964
  swapRequest,
2964
2965
  metaAddr,
2965
- this.wallet?.address
2966
+ senderAddress ?? this.wallet?.address
2966
2967
  );
2967
2968
  const rawQuote = await this.intentsAdapter.getQuote(prepared);
2969
+ if (!rawQuote.amountOut || !rawQuote.amountIn) {
2970
+ throw new ValidationError(
2971
+ `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.`,
2972
+ "quote",
2973
+ { rawQuote }
2974
+ );
2975
+ }
2968
2976
  this.pendingSwaps.set(requestId, {
2969
2977
  depositAddress: rawQuote.depositAddress,
2970
2978
  quote: rawQuote
package/dist/browser.mjs CHANGED
@@ -197,7 +197,7 @@ import {
197
197
  walletRegistry,
198
198
  withSecureBuffer,
199
199
  withSecureBufferSync
200
- } from "./chunk-NDGUWOOZ.mjs";
200
+ } from "./chunk-MR7HRCRS.mjs";
201
201
  import {
202
202
  fulfillment_proof_default,
203
203
  funding_proof_default,