@silentswap/react 0.0.66 → 0.0.68

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.
@@ -7,6 +7,8 @@ export interface useQuoteOptions {
7
7
  maxImpactPercent?: number;
8
8
  /** Timeout for quote requests in milliseconds (default: 30000) */
9
9
  quoteTimeout?: number;
10
+ /** Force a single bridge provider for testing (skips the other) */
11
+ forceProvider?: 'relay' | 'debridge';
10
12
  }
11
13
  export type { RelayQuoteResponse, DeBridgeOrderResponse, SolveUsdcResult, EstimateSample, Estimate, BridgeQuoteResult, } from '@silentswap/sdk';
12
14
  export type SolveResult = SolveUsdcResult;
@@ -70,4 +72,4 @@ export interface useQuoteReturn {
70
72
  * Hook for getting optimized bridge quotes with retention rate tracking
71
73
  * Implements the same functionality as estimate.ts from the original app
72
74
  */
73
- export declare function useQuote({ address, maxImpactPercent }?: useQuoteOptions): useQuoteReturn;
75
+ export declare function useQuote({ address, maxImpactPercent, forceProvider, }?: useQuoteOptions): useQuoteReturn;
@@ -7,7 +7,7 @@ const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
7
7
  * Hook for getting optimized bridge quotes with retention rate tracking
8
8
  * Implements the same functionality as estimate.ts from the original app
9
9
  */
10
- export function useQuote({ address, maxImpactPercent = X_MAX_IMPACT_PERCENT } = {}) {
10
+ export function useQuote({ address, maxImpactPercent = X_MAX_IMPACT_PERCENT, forceProvider, } = {}) {
11
11
  const [isLoading, setIsLoading] = useState(false);
12
12
  const [error, setError] = useState(null);
13
13
  // Estimates cache (replaces H_ESTIMATES_INGRESS and H_ESTIMATES_EGRESS from original)
@@ -71,7 +71,8 @@ export function useQuote({ address, maxImpactPercent = X_MAX_IMPACT_PERCENT } =
71
71
  // sourceAddress is the address format for the source chain (for relay.link)
72
72
  console.log('[Quote] Step 3: Calling sdkGetBridgeQuote');
73
73
  const result = await sdkGetBridgeQuote(srcChainId, srcTokenNorm, srcAmount, dstChainId, dstTokenNorm, normalizedAddress, signal, recipientAddress, // Pass recipient address for Solana destinations
74
- sourceAddress);
74
+ sourceAddress, // Pass source address for relay.link (must match source chain format)
75
+ forceProvider);
75
76
  console.log('[Quote] Step 4: getQuote completed successfully', {
76
77
  provider: result.provider,
77
78
  });
@@ -91,7 +92,7 @@ export function useQuote({ address, maxImpactPercent = X_MAX_IMPACT_PERCENT } =
91
92
  finally {
92
93
  setIsLoading(false);
93
94
  }
94
- }, [normalizedAddress, createNewAbortController]);
95
+ }, [normalizedAddress, createNewAbortController, forceProvider]);
95
96
  /**
96
97
  * Get live estimate for a given asset and direction
97
98
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/react",
3
3
  "type": "module",
4
- "version": "0.0.66",
4
+ "version": "0.0.68",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "@bigmi/core": "^0.6.5",
26
26
  "@ensdomains/ensjs": "^4.2.0",
27
- "@silentswap/sdk": "0.0.66",
28
- "@silentswap/ui-kit": "0.0.66",
27
+ "@silentswap/sdk": "0.0.68",
28
+ "@silentswap/ui-kit": "0.0.68",
29
29
  "@solana/codecs-strings": "^5.1.0",
30
30
  "@solana/kit": "^5.1.0",
31
31
  "@solana/rpc": "^5.1.0",