@shogun-sdk/intents-sdk 1.2.31 → 1.3.0

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.
Files changed (68) hide show
  1. package/README.md +61 -3
  2. package/dist/esm/constants.js +5 -4
  3. package/dist/esm/constants.js.map +1 -1
  4. package/dist/esm/core/evm/intent-helpers.js +11 -6
  5. package/dist/esm/core/evm/intent-helpers.js.map +1 -1
  6. package/dist/esm/core/orders/cross-chain.js +0 -8
  7. package/dist/esm/core/orders/cross-chain.js.map +1 -1
  8. package/dist/esm/core/solana/intent-helpers.js +11 -8
  9. package/dist/esm/core/solana/intent-helpers.js.map +1 -1
  10. package/dist/esm/core/sui/cross-chain-limit-order.js +0 -17
  11. package/dist/esm/core/sui/cross-chain-limit-order.js.map +1 -1
  12. package/dist/esm/core/sui/intent-helpers.js +12 -8
  13. package/dist/esm/core/sui/intent-helpers.js.map +1 -1
  14. package/dist/esm/index.js +6 -3
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/types/token-list.js +2 -0
  17. package/dist/esm/types/token-list.js.map +1 -0
  18. package/dist/esm/utils/generate-execution-details-hash.js +15 -0
  19. package/dist/esm/utils/generate-execution-details-hash.js.map +1 -0
  20. package/dist/esm/utils/quote/aggregator.js +85 -10
  21. package/dist/esm/utils/quote/aggregator.js.map +1 -1
  22. package/dist/esm/utils/quote/raydium.js +82 -0
  23. package/dist/esm/utils/quote/raydium.js.map +1 -0
  24. package/dist/esm/utils/tokens/index.js +37 -0
  25. package/dist/esm/utils/tokens/index.js.map +1 -0
  26. package/dist/types/constants.d.ts +4 -3
  27. package/dist/types/constants.d.ts.map +1 -1
  28. package/dist/types/core/evm/intent-helpers.d.ts.map +1 -1
  29. package/dist/types/core/orders/cross-chain.d.ts +0 -2
  30. package/dist/types/core/orders/cross-chain.d.ts.map +1 -1
  31. package/dist/types/core/solana/intent-helpers.d.ts.map +1 -1
  32. package/dist/types/core/sui/cross-chain-limit-order.d.ts +0 -9
  33. package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +1 -1
  34. package/dist/types/core/sui/intent-helpers.d.ts +1 -0
  35. package/dist/types/core/sui/intent-helpers.d.ts.map +1 -1
  36. package/dist/types/index.d.ts +6 -5
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/types/intent.d.ts +2 -2
  39. package/dist/types/types/intent.d.ts.map +1 -1
  40. package/dist/types/types/token-list.d.ts +30 -0
  41. package/dist/types/types/token-list.d.ts.map +1 -0
  42. package/dist/types/utils/generate-execution-details-hash.d.ts +11 -0
  43. package/dist/types/utils/generate-execution-details-hash.d.ts.map +1 -0
  44. package/dist/types/utils/quote/aggregator.d.ts +21 -5
  45. package/dist/types/utils/quote/aggregator.d.ts.map +1 -1
  46. package/dist/types/utils/quote/raydium.d.ts +79 -0
  47. package/dist/types/utils/quote/raydium.d.ts.map +1 -0
  48. package/dist/types/utils/tokens/index.d.ts +20 -0
  49. package/dist/types/utils/tokens/index.d.ts.map +1 -0
  50. package/package.json +19 -18
  51. package/src/constants.ts +6 -4
  52. package/src/core/evm/intent-helpers.ts +13 -6
  53. package/src/core/orders/cross-chain.ts +0 -10
  54. package/src/core/solana/intent-helpers.ts +11 -8
  55. package/src/core/sui/cross-chain-limit-order.ts +0 -25
  56. package/src/core/sui/intent-helpers.ts +14 -13
  57. package/src/index.ts +14 -7
  58. package/src/types/intent.ts +3 -2
  59. package/src/types/token-list.ts +35 -0
  60. package/src/utils/generate-execution-details-hash.ts +34 -0
  61. package/src/utils/quote/aggregator.ts +106 -16
  62. package/src/utils/quote/raydium.ts +165 -0
  63. package/src/utils/tokens/index.ts +38 -0
  64. package/dist/esm/core/solana/cross-chain-limit-order.js +0 -18
  65. package/dist/esm/core/solana/cross-chain-limit-order.js.map +0 -1
  66. package/dist/types/core/solana/cross-chain-limit-order.d.ts +0 -9
  67. package/dist/types/core/solana/cross-chain-limit-order.d.ts.map +0 -1
  68. package/src/core/solana/cross-chain-limit-order.ts +0 -24
@@ -7,6 +7,11 @@ import { AftermathQuoteProvider } from './aftermath.js';
7
7
  import type { RouterCompleteTradeRoute } from 'aftermath-ts-sdk';
8
8
  import { calculateAmounts } from '../defillama.js';
9
9
  import { LiquidSwapQuoteProvider, type LiquidSwapQuoteResponse } from './liquidswap.js';
10
+ import { RaydiumQuoteProvider, type RaydiumQuoteResponse } from './raydium.js';
11
+
12
+ const compareAddresses = (firstAddress?: string, secondAddress?: string): boolean => {
13
+ return !!firstAddress && !!secondAddress && firstAddress.toLowerCase() === secondAddress.toLowerCase();
14
+ };
10
15
 
11
16
  type SingleChainQuoteParams = {
12
17
  chainId: ChainID;
@@ -14,9 +19,10 @@ type SingleChainQuoteParams = {
14
19
  tokenIn: string;
15
20
  tokenOut: string;
16
21
  slippageBps?: number;
22
+ provider?: RouteProvider; // Optional provider override
17
23
  };
18
24
 
19
- export type RouteProvider = 'paraswap' | 'jupiter' | 'aftermath' | 'liquidswap';
25
+ export type RouteProvider = 'paraswap' | 'jupiter' | 'aftermath' | 'liquidswap' | 'raydium';
20
26
 
21
27
  export type Quote = {
22
28
  amountIn: bigint;
@@ -29,7 +35,7 @@ export type Quote = {
29
35
  rawQuote: any;
30
36
  };
31
37
 
32
- export type QuoteParams = {
38
+ export type IntentsQuoteParams = {
33
39
  sourceChainId: ChainID;
34
40
  destChainId: ChainID;
35
41
  amount: bigint;
@@ -52,7 +58,7 @@ export class QuoteProvider {
52
58
  private static readonly DEFAULT_BRIDGE_TOKEN = 'USDC';
53
59
  private static readonly DEFAULT_BRIDGE_TOKEN_DECIMALS = 6;
54
60
 
55
- public static async getQuoteFromDefillama(params: QuoteParams): Promise<QuoteResponse> {
61
+ public static async getQuoteFromDefillama(params: IntentsQuoteParams): Promise<QuoteResponse> {
56
62
  const defillamaQuote = await calculateAmounts({
57
63
  amountIn: params.amount,
58
64
  tokenIn: params.tokenIn,
@@ -72,7 +78,7 @@ export class QuoteProvider {
72
78
  };
73
79
  }
74
80
 
75
- public static async getQuoteWithDefillamaFallback(params: QuoteParams): Promise<QuoteResponse> {
81
+ public static async getQuoteWithDefillamaFallback(params: IntentsQuoteParams): Promise<QuoteResponse> {
76
82
  try {
77
83
  const quote = await this.getQuoteFromRouters(params);
78
84
  return quote;
@@ -82,11 +88,35 @@ export class QuoteProvider {
82
88
  }
83
89
  }
84
90
 
85
- public static async getQuote(params: QuoteParams): Promise<QuoteResponse> {
91
+ public static async getQuote(params: IntentsQuoteParams): Promise<QuoteResponse> {
86
92
  return this.getQuoteWithDefillamaFallback(params);
87
93
  }
88
94
 
89
- private static async getQuoteFromRouters(params: QuoteParams): Promise<QuoteResponse> {
95
+ /**
96
+ * Get a quote for Solana with explicit provider selection
97
+ * @param params - Quote parameters including provider preference
98
+ * @returns Quote response
99
+ */
100
+ public static async getSolanaQuote(params: {
101
+ amount: bigint;
102
+ tokenIn: string;
103
+ tokenOut: string;
104
+ slippageBps?: number;
105
+ provider?: 'jupiter' | 'raydium';
106
+ }): Promise<Quote> {
107
+ const singleChainParams: SingleChainQuoteParams = {
108
+ chainId: ChainID.Solana,
109
+ amount: params.amount,
110
+ tokenIn: params.tokenIn,
111
+ tokenOut: params.tokenOut,
112
+ slippageBps: params.slippageBps,
113
+ provider: params.provider,
114
+ };
115
+
116
+ return this.getSingleChainQuote(singleChainParams);
117
+ }
118
+
119
+ private static async getQuoteFromRouters(params: IntentsQuoteParams): Promise<QuoteResponse> {
90
120
  const bridgeTokenSymbol = QuoteProvider.DEFAULT_BRIDGE_TOKEN;
91
121
 
92
122
  const sourceBridgeToken = CROSS_CHAIN_TOKENS[bridgeTokenSymbol]?.[params.sourceChainId] || '';
@@ -132,10 +162,10 @@ export class QuoteProvider {
132
162
  }
133
163
 
134
164
  public static async getSingleChainQuote(params: SingleChainQuoteParams): Promise<Quote> {
135
- if (params.tokenIn.toLowerCase() === params.tokenOut.toLowerCase()) {
165
+ if (compareAddresses(params.tokenIn, params.tokenOut)) {
136
166
  let amountUsd = 0;
137
167
 
138
- if (params.tokenIn.toLowerCase() === CROSS_CHAIN_TOKENS.USDC![params.chainId].toLowerCase()) {
168
+ if (compareAddresses(params.tokenIn, CROSS_CHAIN_TOKENS.USDC![params.chainId])) {
139
169
  amountUsd = Number(params.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
140
170
  }
141
171
 
@@ -146,7 +176,7 @@ export class QuoteProvider {
146
176
  amountInUsd: amountUsd,
147
177
  slippage: 0,
148
178
  priceImpact: 0,
149
- provider: getProviderNameByChainId(params.chainId),
179
+ provider: params.provider || getProviderNameByChainId(params.chainId),
150
180
  rawQuote: null,
151
181
  };
152
182
  }
@@ -157,8 +187,30 @@ export class QuoteProvider {
157
187
  }
158
188
 
159
189
  if (params.chainId === ChainID.Solana) {
160
- const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
161
- return QuoteProvider.transformJupiterQuote(jupiterQuote);
190
+ // Check if provider is explicitly specified
191
+ if (params.provider === 'jupiter') {
192
+ const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
193
+ return QuoteProvider.transformJupiterQuote(jupiterQuote);
194
+ } else if (params.provider === 'raydium') {
195
+ const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
196
+ return QuoteProvider.transformRaydiumQuote(raydiumQuote);
197
+ } else {
198
+ // Default: Try Jupiter first, fallback to Raydium if it fails
199
+ try {
200
+ const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
201
+ if(!jupiterQuote.quote) {
202
+ throw new Error('Jupiter quote failed');
203
+ }
204
+
205
+ const transformedQuote = QuoteProvider.transformJupiterQuote(jupiterQuote);
206
+ return transformedQuote;
207
+ } catch (error) {
208
+ console.warn('Jupiter quote failed, falling back to Raydium:', error);
209
+ const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
210
+ const transformedQuote = QuoteProvider.transformRaydiumQuote(raydiumQuote);
211
+ return transformedQuote;
212
+ }
213
+ }
162
214
  }
163
215
 
164
216
  if (params.chainId === ChainID.Sui) {
@@ -248,6 +300,17 @@ export class QuoteProvider {
248
300
  });
249
301
  }
250
302
 
303
+ protected static async getRaydiumQuote(params: SingleChainQuoteParams) {
304
+ const raydiumQuoter = new RaydiumQuoteProvider();
305
+
306
+ return raydiumQuoter.getQuote({
307
+ inputMint: params.tokenIn,
308
+ outputMint: params.tokenOut,
309
+ amount: params.amount.toString(),
310
+ slippageBps: params.slippageBps || 50, // Default 0.5% slippage
311
+ });
312
+ }
313
+
251
314
  private static transformAftermathQuote({
252
315
  quote,
253
316
  request,
@@ -257,11 +320,11 @@ export class QuoteProvider {
257
320
  }): Quote {
258
321
  let amountUsd = 0;
259
322
 
260
- if (request.tokenIn === CROSS_CHAIN_TOKENS.USDC![request.chainId]) {
323
+ if (compareAddresses(request.tokenIn, CROSS_CHAIN_TOKENS.USDC![request.chainId])) {
261
324
  amountUsd = Number(quote.coinIn.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
262
325
  }
263
326
 
264
- if (request.tokenOut === CROSS_CHAIN_TOKENS.USDC![request.chainId]) {
327
+ if (compareAddresses(request.tokenOut, CROSS_CHAIN_TOKENS.USDC![request.chainId])) {
265
328
  amountUsd = Number(quote.coinOut.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
266
329
  }
267
330
 
@@ -293,14 +356,15 @@ export class QuoteProvider {
293
356
  private static transformJupiterQuote({ quote }: { quote: JupiterQuoteResponse }): Quote {
294
357
  const amountIn = Number(quote.inAmount);
295
358
  const amountOut = Number(quote.outAmount);
359
+
296
360
  let amountUsd = 0;
297
361
  const priceImpact = quote.priceImpactPct ? Number(quote.priceImpactPct) * 100 : 0;
298
362
 
299
- if (quote.outputMint === CROSS_CHAIN_TOKENS.USDC![ChainID.Solana]) {
363
+ if (compareAddresses(quote.outputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
300
364
  amountUsd = amountOut / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
301
365
  }
302
366
 
303
- if (quote.inputMint === CROSS_CHAIN_TOKENS.USDC![ChainID.Solana]) {
367
+ if (compareAddresses(quote.inputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
304
368
  amountUsd = amountIn / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
305
369
  }
306
370
 
@@ -315,6 +379,32 @@ export class QuoteProvider {
315
379
  rawQuote: quote,
316
380
  };
317
381
  }
382
+
383
+ private static transformRaydiumQuote(raydiumQuote: RaydiumQuoteResponse): Quote {
384
+ const amountIn = Number(raydiumQuote.data.inAmount);
385
+ const amountOut = Number(raydiumQuote.data.outAmount);
386
+ let amountUsd = 0;
387
+ const priceImpact = Number(raydiumQuote.data.priceImpactPct) * 100;
388
+
389
+ if (compareAddresses(raydiumQuote.data.outputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
390
+ amountUsd = amountOut / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
391
+ }
392
+
393
+ if (compareAddresses(raydiumQuote.data.inputMint, CROSS_CHAIN_TOKENS.USDC![ChainID.Solana])) {
394
+ amountUsd = amountIn / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
395
+ }
396
+
397
+ return {
398
+ amountIn: BigInt(amountIn),
399
+ amountOut: BigInt(amountOut),
400
+ amountOutUsd: amountUsd,
401
+ amountInUsd: amountUsd,
402
+ slippage: raydiumQuote.data.slippageBps / 100,
403
+ priceImpact,
404
+ provider: 'raydium',
405
+ rawQuote: raydiumQuote,
406
+ };
407
+ }
318
408
  }
319
409
 
320
410
  function getProviderNameByChainId(chainId: ChainID): RouteProvider {
@@ -322,7 +412,7 @@ function getProviderNameByChainId(chainId: ChainID): RouteProvider {
322
412
  case ChainID.Sui:
323
413
  return 'aftermath';
324
414
  case ChainID.Solana:
325
- return 'jupiter';
415
+ return 'jupiter'; // Primary provider, with Raydium as fallback
326
416
  case ChainID.Hyperliquid:
327
417
  return 'liquidswap';
328
418
  default:
@@ -0,0 +1,165 @@
1
+ import { NATIVE_SOLANA_TOKEN_ADDRESS, WRAPPED_SOL_MINT_ADDRESS } from '../../constants.js';
2
+ import { API_URLS } from '@raydium-io/raydium-sdk-v2';
3
+
4
+ // Local implementation of compareAddresses function
5
+ const compareAddresses = (firstAddress?: string, secondAddress?: string): boolean => {
6
+ return !!firstAddress && !!secondAddress && firstAddress.toLowerCase() === secondAddress.toLowerCase();
7
+ };
8
+
9
+ type RaydiumQuoteParams = {
10
+ inputMint: string;
11
+ outputMint: string;
12
+ amount: string;
13
+ slippageBps: number;
14
+ };
15
+
16
+ export type RaydiumQuoteResponse = {
17
+ success: boolean;
18
+ data: {
19
+ inputMint: string;
20
+ outputMint: string;
21
+ inAmount: string;
22
+ outAmount: string;
23
+ otherAmountThreshold: string;
24
+ swapMode: string;
25
+ slippageBps: number;
26
+ platformFee: null;
27
+ priceImpactPct: string;
28
+ routePlan: Array<{
29
+ swapInfo: {
30
+ ammKey: string;
31
+ label: string;
32
+ inputMint: string;
33
+ outputMint: string;
34
+ notEnoughLiquidity: boolean;
35
+ minInAmount: string;
36
+ minOutAmount: string;
37
+ priceImpactPct: string;
38
+ lpFee: {
39
+ amount: string;
40
+ mint: string;
41
+ pct: number;
42
+ };
43
+ platformFee: {
44
+ amount: string;
45
+ mint: string;
46
+ pct: number;
47
+ };
48
+ };
49
+ percent: number;
50
+ }>;
51
+ };
52
+ };
53
+
54
+ // Using API_URLS from Raydium SDK v2
55
+
56
+ export class RaydiumQuoteProvider {
57
+ /**
58
+ * Get priority fee recommendations from Raydium API
59
+ * @returns Priority fee data with different tiers (vh, h, m)
60
+ */
61
+ public async getPriorityFee(): Promise<{
62
+ vh: number; // very high
63
+ h: number; // high
64
+ m: number; // medium
65
+ }> {
66
+ const url = new URL(API_URLS.PRIORITY_FEE, API_URLS.BASE_HOST);
67
+ const response = await fetch(url);
68
+
69
+ if (!response.ok) {
70
+ throw new Error(`Failed to fetch priority fee from Raydium API: ${response.status} ${response.statusText}`);
71
+ }
72
+
73
+ const data = await response.json();
74
+
75
+ if (!data.success) {
76
+ throw new Error('Raydium API returned unsuccessful response for priority fee');
77
+ }
78
+
79
+ return data.data.default;
80
+ }
81
+
82
+ public async getQuote(raydiumParams: RaydiumQuoteParams): Promise<RaydiumQuoteResponse> {
83
+ const params = { ...raydiumParams };
84
+
85
+ // Handle native SOL token mapping for Solana
86
+ if (compareAddresses(params.inputMint, NATIVE_SOLANA_TOKEN_ADDRESS)) {
87
+ params.inputMint = WRAPPED_SOL_MINT_ADDRESS;
88
+ }
89
+
90
+ if (compareAddresses(params.outputMint, NATIVE_SOLANA_TOKEN_ADDRESS)) {
91
+ params.outputMint = WRAPPED_SOL_MINT_ADDRESS;
92
+ }
93
+
94
+ const url = new URL('/compute/swap-base-in', API_URLS.SWAP_HOST);
95
+ url.searchParams.set('inputMint', params.inputMint);
96
+ url.searchParams.set('outputMint', params.outputMint);
97
+ url.searchParams.set('amount', params.amount);
98
+ url.searchParams.set('slippageBps', params.slippageBps.toString());
99
+
100
+ const response = await fetch(url);
101
+
102
+ if (!response.ok) {
103
+ throw new Error(`Failed to fetch quote from Raydium API: ${response.status} ${response.statusText}`);
104
+ }
105
+
106
+ const data: RaydiumQuoteResponse = await response.json();
107
+
108
+ if (!data.success) {
109
+ throw new Error('Raydium API returned unsuccessful response');
110
+ }
111
+
112
+ return data;
113
+ }
114
+
115
+ /**
116
+ * Get transaction data for executing a swap
117
+ * @param params - Transaction parameters
118
+ * @returns Serialized transaction data
119
+ */
120
+ public async getSwapTransaction(params: {
121
+ swapResponse: RaydiumQuoteResponse;
122
+ wallet: string;
123
+ txVersion: 'V0' | 'LEGACY';
124
+ wrapSol?: boolean;
125
+ unwrapSol?: boolean;
126
+ inputAccount?: string;
127
+ outputAccount?: string;
128
+ computeUnitPriceMicroLamports?: string;
129
+ }): Promise<{
130
+ id: string;
131
+ version: string;
132
+ success: boolean;
133
+ data: { transaction: string }[];
134
+ }> {
135
+ const url = new URL('/transaction/swap-base-in', API_URLS.SWAP_HOST);
136
+ const response = await fetch(url, {
137
+ method: 'POST',
138
+ headers: {
139
+ 'Content-Type': 'application/json',
140
+ },
141
+ body: JSON.stringify({
142
+ computeUnitPriceMicroLamports: params.computeUnitPriceMicroLamports || '0',
143
+ swapResponse: params.swapResponse,
144
+ txVersion: params.txVersion,
145
+ wallet: params.wallet,
146
+ wrapSol: params.wrapSol || false,
147
+ unwrapSol: params.unwrapSol || false,
148
+ inputAccount: params.inputAccount,
149
+ outputAccount: params.outputAccount,
150
+ }),
151
+ });
152
+
153
+ if (!response.ok) {
154
+ throw new Error(`Failed to get swap transaction from Raydium API: ${response.status} ${response.statusText}`);
155
+ }
156
+
157
+ const data = await response.json();
158
+
159
+ if (!data.success) {
160
+ throw new Error('Raydium API returned unsuccessful response for swap transaction');
161
+ }
162
+
163
+ return data;
164
+ }
165
+ }
@@ -0,0 +1,38 @@
1
+ import { TOKEN_SEARCH_API_BASE_URL } from '../../constants.js';
2
+ import type { TokenSearchParams, TokenSearchResponse } from '../../types/token-list.js';
3
+
4
+ /**
5
+ * getTokenList
6
+ *
7
+ * High-level SDK function for token discovery.
8
+ * Supports cancellation via AbortController.
9
+ *
10
+ * Example:
11
+ * ```ts
12
+ * import { getTokenList } from "@shogun/sdk";
13
+ *
14
+ * const controller = new AbortController();
15
+ * const res = await getTokenList({ q: "usdc", networkId: 8453, signal: controller.signal });
16
+ *
17
+ * To cancel:
18
+ * controller.abort();
19
+ * ```
20
+ */
21
+ export async function getTokenList(params: TokenSearchParams): Promise<TokenSearchResponse> {
22
+ const url = new URL(`${TOKEN_SEARCH_API_BASE_URL}/tokens/search`);
23
+
24
+ if (params.q) url.searchParams.append('q', params.q);
25
+ if (params.networkId) url.searchParams.append('networkId', String(params.networkId));
26
+ if (params.page) url.searchParams.append('page', String(params.page));
27
+ if (params.limit) url.searchParams.append('limit', String(params.limit));
28
+
29
+ const res = await fetch(url.toString(), {
30
+ signal: params.signal,
31
+ });
32
+
33
+ if (!res.ok) {
34
+ throw new Error(`Failed to fetch tokens: ${res.status} ${res.statusText}`);
35
+ }
36
+
37
+ return (await res.json()) as TokenSearchResponse;
38
+ }
@@ -1,18 +0,0 @@
1
- import { createHash } from "crypto";
2
- /**
3
- * Generate execution details hash for cross-chain orders
4
- * @param destChainId Destination chain ID
5
- * @param destinationAddress Destination address on target chain
6
- * @param tokenOut Token address on destination chain
7
- * @param amountOutMin Minimum amount out
8
- */
9
- export function generateExecutionDetailsHash(destChainId, destinationAddress, tokenOut, amountOutMin) {
10
- const executionDetails = JSON.stringify({
11
- destChainId,
12
- destinationAddress,
13
- tokenOut,
14
- amountOutMin,
15
- });
16
- return new Uint8Array(createHash('sha256').update(executionDetails).digest());
17
- }
18
- //# sourceMappingURL=cross-chain-limit-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-chain-limit-order.js","sourceRoot":"","sources":["../../../../src/core/solana/cross-chain-limit-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAC1C,WAAmB,EACnB,kBAA0B,EAC1B,QAAgB,EAChB,YAAoB;IAEpB,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC;QACtC,WAAW;QACX,kBAAkB;QAClB,QAAQ;QACR,YAAY;KACb,CAAC,CAAC;IAEH,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Generate execution details hash for cross-chain orders
3
- * @param destChainId Destination chain ID
4
- * @param destinationAddress Destination address on target chain
5
- * @param tokenOut Token address on destination chain
6
- * @param amountOutMin Minimum amount out
7
- */
8
- export declare function generateExecutionDetailsHash(destChainId: number, destinationAddress: string, tokenOut: string, amountOutMin: string): Uint8Array;
9
- //# sourceMappingURL=cross-chain-limit-order.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-chain-limit-order.d.ts","sourceRoot":"","sources":["../../../../src/core/solana/cross-chain-limit-order.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,UAAU,CASZ"}
@@ -1,24 +0,0 @@
1
- import { createHash } from "crypto";
2
-
3
- /**
4
- * Generate execution details hash for cross-chain orders
5
- * @param destChainId Destination chain ID
6
- * @param destinationAddress Destination address on target chain
7
- * @param tokenOut Token address on destination chain
8
- * @param amountOutMin Minimum amount out
9
- */
10
- export function generateExecutionDetailsHash(
11
- destChainId: number,
12
- destinationAddress: string,
13
- tokenOut: string,
14
- amountOutMin: string,
15
- ): Uint8Array {
16
- const executionDetails = JSON.stringify({
17
- destChainId,
18
- destinationAddress,
19
- tokenOut,
20
- amountOutMin,
21
- });
22
-
23
- return new Uint8Array(createHash('sha256').update(executionDetails).digest());
24
- }