@shogun-sdk/swap 0.0.2-test.1 → 0.0.2-test.10

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/react.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TokenSearchParams, TokenSearchResponse } from '@shogun-sdk/intents-sdk';
2
2
  export { ChainID, isEvmChain } from '@shogun-sdk/intents-sdk';
3
- import { a as SwapQuoteResponse, e as executeOrder, b as Stage, S as SwapQuoteParams, B as BalanceRequestParams, c as BalanceResponse } from './execute-FaLLPp1i.cjs';
4
- export { P as PlaceOrderResult, Q as QuoteTokenInfo, T as TokenBalance, f as TokenInfo, d as TokenSearchResponse } from './execute-FaLLPp1i.cjs';
3
+ import { a as SwapQuoteResponse, e as executeOrder, b as Stage, g as PollResult, S as SwapQuoteParams, B as BalanceRequestParams, c as BalanceResponse } from './execute-DEFbp1WZ.cjs';
4
+ export { P as PlaceOrderResult, Q as QuoteTokenInfo, T as TokenBalance, f as TokenInfo, d as TokenSearchResponse } from './execute-DEFbp1WZ.cjs';
5
5
  import { A as AdaptedWallet } from './wallet-MmUIz8GE.cjs';
6
6
  import { WalletClient } from 'viem';
7
7
  import '@mysten/sui/transactions';
@@ -29,13 +29,6 @@ type ExecuteOrderResult = Awaited<ReturnType<typeof executeOrder>>;
29
29
  * built-in stage tracking, loading states, and error handling.
30
30
  *
31
31
  * ---
32
- * ## Features
33
- * - Live stage updates (processing, approving, signing, submitting, etc.)
34
- * - Built-in 20-min deadline by default (current timestamp + 1200s)
35
- * - Safe state handling with unmount guards
36
- * - Works for both EVM and Solana wallets
37
- *
38
- * ---
39
32
  * ## Example
40
33
  * ```tsx
41
34
  * import { useExecuteOrder } from "@shogun-sdk/swap/react"
@@ -79,9 +72,10 @@ declare function useExecuteOrder(): {
79
72
  /** Raw SDK response data. */
80
73
  data: {
81
74
  status: boolean;
82
- txHash: string;
75
+ orderId: string;
83
76
  chainId: number;
84
- stage: string;
77
+ finalStatus: PollResult;
78
+ stage: Stage;
85
79
  } | {
86
80
  status: boolean;
87
81
  message: string;
@@ -92,44 +86,16 @@ declare function useExecuteOrder(): {
92
86
  };
93
87
 
94
88
  /**
95
- * useQuote — React hook for fetching live swap quotes (single or cross-chain).
96
- *
97
- * @example
98
- * ```tsx
99
- * import { useQuote } from "@shogun-sdk/swap/react"
100
- *
101
- * export function SwapQuote({ params }) {
102
- * const { data, loading, error, warning, refetch } = useQuote(params, { debounceMs: 300 })
103
- *
104
- * if (loading) return <p>Fetching quote...</p>
105
- * if (error) return <p style={{ color: "red" }}>{error.message}</p>
106
- * if (warning) return <p style={{ color: "orange" }}>{warning}</p>
107
- *
108
- * return (
109
- * <div>
110
- * <p>Output: {data?.amountOut.toString()}</p>
111
- * <p>Reduced (after slippage): {data?.internal?.estimatedAmountOutReduced?.toString()}</p>
112
- * <button onClick={refetch}>Refresh</button>
113
- * </div>
114
- * )
115
- * }
116
- * ```
89
+ * useQuote — React hook for fetching live swap quotes.
117
90
  */
118
91
  declare function useQuote(params: SwapQuoteParams | null, options?: {
119
- /** Debounce duration (ms) for reactive fetches. Default: 250 */
120
92
  debounceMs?: number;
121
- /** Optional polling interval (ms) for auto refresh */
122
93
  autoRefreshMs?: number;
123
94
  }): {
124
- /** Latest quote data */
125
95
  data: SwapQuoteResponse | null;
126
- /** Whether a fetch is ongoing */
127
96
  loading: boolean;
128
- /** Error (if any) */
129
97
  error: Error | null;
130
- /** Warning (e.g. high slippage alert) */
131
98
  warning: string | null;
132
- /** Manual refetch */
133
99
  refetch: () => Promise<void>;
134
100
  };
135
101
 
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TokenSearchParams, TokenSearchResponse } from '@shogun-sdk/intents-sdk';
2
2
  export { ChainID, isEvmChain } from '@shogun-sdk/intents-sdk';
3
- import { a as SwapQuoteResponse, e as executeOrder, b as Stage, S as SwapQuoteParams, B as BalanceRequestParams, c as BalanceResponse } from './execute-HX1fQ7wG.js';
4
- export { P as PlaceOrderResult, Q as QuoteTokenInfo, T as TokenBalance, f as TokenInfo, d as TokenSearchResponse } from './execute-HX1fQ7wG.js';
3
+ import { a as SwapQuoteResponse, e as executeOrder, b as Stage, g as PollResult, S as SwapQuoteParams, B as BalanceRequestParams, c as BalanceResponse } from './execute-St0oo8GR.js';
4
+ export { P as PlaceOrderResult, Q as QuoteTokenInfo, T as TokenBalance, f as TokenInfo, d as TokenSearchResponse } from './execute-St0oo8GR.js';
5
5
  import { A as AdaptedWallet } from './wallet-MmUIz8GE.js';
6
6
  import { WalletClient } from 'viem';
7
7
  import '@mysten/sui/transactions';
@@ -29,13 +29,6 @@ type ExecuteOrderResult = Awaited<ReturnType<typeof executeOrder>>;
29
29
  * built-in stage tracking, loading states, and error handling.
30
30
  *
31
31
  * ---
32
- * ## Features
33
- * - Live stage updates (processing, approving, signing, submitting, etc.)
34
- * - Built-in 20-min deadline by default (current timestamp + 1200s)
35
- * - Safe state handling with unmount guards
36
- * - Works for both EVM and Solana wallets
37
- *
38
- * ---
39
32
  * ## Example
40
33
  * ```tsx
41
34
  * import { useExecuteOrder } from "@shogun-sdk/swap/react"
@@ -79,9 +72,10 @@ declare function useExecuteOrder(): {
79
72
  /** Raw SDK response data. */
80
73
  data: {
81
74
  status: boolean;
82
- txHash: string;
75
+ orderId: string;
83
76
  chainId: number;
84
- stage: string;
77
+ finalStatus: PollResult;
78
+ stage: Stage;
85
79
  } | {
86
80
  status: boolean;
87
81
  message: string;
@@ -92,44 +86,16 @@ declare function useExecuteOrder(): {
92
86
  };
93
87
 
94
88
  /**
95
- * useQuote — React hook for fetching live swap quotes (single or cross-chain).
96
- *
97
- * @example
98
- * ```tsx
99
- * import { useQuote } from "@shogun-sdk/swap/react"
100
- *
101
- * export function SwapQuote({ params }) {
102
- * const { data, loading, error, warning, refetch } = useQuote(params, { debounceMs: 300 })
103
- *
104
- * if (loading) return <p>Fetching quote...</p>
105
- * if (error) return <p style={{ color: "red" }}>{error.message}</p>
106
- * if (warning) return <p style={{ color: "orange" }}>{warning}</p>
107
- *
108
- * return (
109
- * <div>
110
- * <p>Output: {data?.amountOut.toString()}</p>
111
- * <p>Reduced (after slippage): {data?.internal?.estimatedAmountOutReduced?.toString()}</p>
112
- * <button onClick={refetch}>Refresh</button>
113
- * </div>
114
- * )
115
- * }
116
- * ```
89
+ * useQuote — React hook for fetching live swap quotes.
117
90
  */
118
91
  declare function useQuote(params: SwapQuoteParams | null, options?: {
119
- /** Debounce duration (ms) for reactive fetches. Default: 250 */
120
92
  debounceMs?: number;
121
- /** Optional polling interval (ms) for auto refresh */
122
93
  autoRefreshMs?: number;
123
94
  }): {
124
- /** Latest quote data */
125
95
  data: SwapQuoteResponse | null;
126
- /** Whether a fetch is ongoing */
127
96
  loading: boolean;
128
- /** Error (if any) */
129
97
  error: Error | null;
130
- /** Warning (e.g. high slippage alert) */
131
98
  warning: string | null;
132
- /** Manual refetch */
133
99
  refetch: () => Promise<void>;
134
100
  };
135
101