@sip-protocol/sdk 0.2.4 → 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/index.js CHANGED
@@ -2965,6 +2965,13 @@ var SIP = class {
2965
2965
  senderAddress ?? this.wallet?.address
2966
2966
  );
2967
2967
  const rawQuote = await this.intentsAdapter.getQuote(prepared);
2968
+ if (!rawQuote.amountOut || !rawQuote.amountIn) {
2969
+ throw new ValidationError(
2970
+ `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.`,
2971
+ "quote",
2972
+ { rawQuote }
2973
+ );
2974
+ }
2968
2975
  this.pendingSwaps.set(requestId, {
2969
2976
  depositAddress: rawQuote.depositAddress,
2970
2977
  quote: rawQuote
package/dist/index.mjs CHANGED
@@ -197,7 +197,7 @@ import {
197
197
  walletRegistry,
198
198
  withSecureBuffer,
199
199
  withSecureBufferSync
200
- } from "./chunk-VXSHK7US.mjs";
200
+ } from "./chunk-MR7HRCRS.mjs";
201
201
  import {
202
202
  CryptoError,
203
203
  EncryptionNotImplementedError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Core SDK for Shielded Intents Protocol - Privacy layer for cross-chain transactions",
5
5
  "author": "SIP Protocol <hello@sip-protocol.org>",
6
6
  "homepage": "https://sip-protocol.org",
package/src/sip.ts CHANGED
@@ -448,6 +448,16 @@ export class SIP {
448
448
  )
449
449
  const rawQuote = await this.intentsAdapter.getQuote(prepared)
450
450
 
451
+ // Validate quote response has required fields
452
+ if (!rawQuote.amountOut || !rawQuote.amountIn) {
453
+ throw new ValidationError(
454
+ `Invalid quote response from 1Click API: missing ${!rawQuote.amountOut ? 'amountOut' : 'amountIn'}. ` +
455
+ `This may indicate the trading pair is not supported or the amount is too small.`,
456
+ 'quote',
457
+ { rawQuote }
458
+ )
459
+ }
460
+
451
461
  // Cache for execute()
452
462
  this.pendingSwaps.set(requestId, {
453
463
  depositAddress: rawQuote.depositAddress,