@relayprotocol/relay-kit-hooks 1.12.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/LICENSE +21 -0
  2. package/_cjs/package.json +1 -0
  3. package/_cjs/src/fetcher.js +20 -0
  4. package/_cjs/src/fetcher.js.map +1 -0
  5. package/_cjs/src/hooks/useExecutionStatus.js +62 -0
  6. package/_cjs/src/hooks/useExecutionStatus.js.map +1 -0
  7. package/_cjs/src/hooks/useQuote.js +94 -0
  8. package/_cjs/src/hooks/useQuote.js.map +1 -0
  9. package/_cjs/src/hooks/useRelayChains.js +33 -0
  10. package/_cjs/src/hooks/useRelayChains.js.map +1 -0
  11. package/_cjs/src/hooks/useRelayConfig.js +29 -0
  12. package/_cjs/src/hooks/useRelayConfig.js.map +1 -0
  13. package/_cjs/src/hooks/useRequests.js +39 -0
  14. package/_cjs/src/hooks/useRequests.js.map +1 -0
  15. package/_cjs/src/hooks/useTokenList.js +29 -0
  16. package/_cjs/src/hooks/useTokenList.js.map +1 -0
  17. package/_cjs/src/hooks/useTokenPrice.js +29 -0
  18. package/_cjs/src/hooks/useTokenPrice.js.map +1 -0
  19. package/_cjs/src/hooks/useTrendingCurrencies.js +24 -0
  20. package/_cjs/src/hooks/useTrendingCurrencies.js.map +1 -0
  21. package/_cjs/src/index.js +31 -0
  22. package/_cjs/src/index.js.map +1 -0
  23. package/_cjs/tsconfig.build.tsbuildinfo +1 -0
  24. package/_esm/package.json +1 -0
  25. package/_esm/src/fetcher.js +15 -0
  26. package/_esm/src/fetcher.js.map +1 -0
  27. package/_esm/src/hooks/useExecutionStatus.js +56 -0
  28. package/_esm/src/hooks/useExecutionStatus.js.map +1 -0
  29. package/_esm/src/hooks/useQuote.js +89 -0
  30. package/_esm/src/hooks/useQuote.js.map +1 -0
  31. package/_esm/src/hooks/useRelayChains.js +27 -0
  32. package/_esm/src/hooks/useRelayChains.js.map +1 -0
  33. package/_esm/src/hooks/useRelayConfig.js +23 -0
  34. package/_esm/src/hooks/useRelayConfig.js.map +1 -0
  35. package/_esm/src/hooks/useRequests.js +33 -0
  36. package/_esm/src/hooks/useRequests.js.map +1 -0
  37. package/_esm/src/hooks/useTokenList.js +24 -0
  38. package/_esm/src/hooks/useTokenList.js.map +1 -0
  39. package/_esm/src/hooks/useTokenPrice.js +23 -0
  40. package/_esm/src/hooks/useTokenPrice.js.map +1 -0
  41. package/_esm/src/hooks/useTrendingCurrencies.js +19 -0
  42. package/_esm/src/hooks/useTrendingCurrencies.js.map +1 -0
  43. package/_esm/src/index.js +10 -0
  44. package/_esm/src/index.js.map +1 -0
  45. package/_esm/tsconfig.build.tsbuildinfo +1 -0
  46. package/_types/src/fetcher.d.ts +5 -0
  47. package/_types/src/fetcher.d.ts.map +1 -0
  48. package/_types/src/hooks/useExecutionStatus.d.ts +32 -0
  49. package/_types/src/hooks/useExecutionStatus.d.ts.map +1 -0
  50. package/_types/src/hooks/useQuote.d.ts +426 -0
  51. package/_types/src/hooks/useQuote.d.ts.map +1 -0
  52. package/_types/src/hooks/useRelayChains.d.ts +141 -0
  53. package/_types/src/hooks/useRelayChains.d.ts.map +1 -0
  54. package/_types/src/hooks/useRelayConfig.d.ts +25 -0
  55. package/_types/src/hooks/useRelayConfig.d.ts.map +1 -0
  56. package/_types/src/hooks/useRequests.d.ts +5358 -0
  57. package/_types/src/hooks/useRequests.d.ts.map +1 -0
  58. package/_types/src/hooks/useTokenList.d.ts +40 -0
  59. package/_types/src/hooks/useTokenList.d.ts.map +1 -0
  60. package/_types/src/hooks/useTokenPrice.d.ts +14 -0
  61. package/_types/src/hooks/useTokenPrice.d.ts.map +1 -0
  62. package/_types/src/hooks/useTrendingCurrencies.d.ts +24 -0
  63. package/_types/src/hooks/useTrendingCurrencies.d.ts.map +1 -0
  64. package/_types/src/index.d.ts +11 -0
  65. package/_types/src/index.d.ts.map +1 -0
  66. package/_types/tsconfig.build.tsbuildinfo +1 -0
  67. package/package.json +66 -0
  68. package/readme.md +36 -0
@@ -0,0 +1,5 @@
1
+ import { type AxiosRequestConfig } from 'axios';
2
+ declare const fetcher: (url: string, headers?: HeadersInit) => Promise<any>;
3
+ export default fetcher;
4
+ export declare const axiosPostFetcher: (url: string, params: any, config?: AxiosRequestConfig) => Promise<any>;
5
+ //# sourceMappingURL=fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/fetcher.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAEtD,QAAA,MAAM,OAAO,QAAe,MAAM,YAAY,WAAW,iBASxD,CAAA;AAED,eAAe,OAAO,CAAA;AAEtB,eAAO,MAAM,gBAAgB,QACtB,MAAM,UACH,GAAG,WACF,kBAAkB,iBAI5B,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { RelayClient, type Execute, type paths, type ProgressData } from '@relayprotocol/relay-sdk';
2
+ import { useQuery, type DefaultError, type QueryKey } from '@tanstack/react-query';
3
+ type ExecutionStatusParams = paths['/intents/status/v2']['get']['parameters']['query'] & {
4
+ referrer?: string;
5
+ };
6
+ export type ExecutionStatusResponse = paths['/intents/status/v2']['get']['responses']['200']['content']['application/json'];
7
+ type QueryType = typeof useQuery<ExecutionStatusResponse, DefaultError, ExecutionStatusResponse, QueryKey>;
8
+ type QueryOptions = Parameters<QueryType>['0'];
9
+ export declare const queryExecutionStatus: (baseApiUrl?: string, options?: ExecutionStatusParams, headers?: HeadersInit) => Promise<ExecutionStatusResponse>;
10
+ export type onProgress = (data: ProgressData) => void;
11
+ export default function (client?: RelayClient, options?: ExecutionStatusParams, onRequest?: () => void, onResponse?: (data: Execute) => void, queryOptions?: Partial<QueryOptions>): Omit<import("@tanstack/react-query").UseQueryResult<{
12
+ status?: "refund" | "delayed" | "waiting" | "failure" | "pending" | "success" | undefined;
13
+ details?: string | undefined;
14
+ inTxHashes?: string[] | undefined;
15
+ txHashes?: string[] | undefined;
16
+ time?: number | undefined;
17
+ originChainId?: number | undefined;
18
+ destinationChainId?: number | undefined;
19
+ }, Error>, "data"> & {
20
+ data?: {
21
+ status?: "refund" | "delayed" | "waiting" | "failure" | "pending" | "success" | undefined;
22
+ details?: string | undefined;
23
+ inTxHashes?: string[] | undefined;
24
+ txHashes?: string[] | undefined;
25
+ time?: number | undefined;
26
+ originChainId?: number | undefined;
27
+ destinationChainId?: number | undefined;
28
+ } | undefined;
29
+ queryKey: readonly unknown[];
30
+ };
31
+ export {};
32
+ //# sourceMappingURL=useExecutionStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExecutionStatus.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExecutionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAEX,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAI9B,KAAK,qBAAqB,GACxB,KAAK,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GAAG;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAEH,MAAM,MAAM,uBAAuB,GACjC,KAAK,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAEvF,KAAK,SAAS,GAAG,OAAO,QAAQ,CAC9B,uBAAuB,EACvB,YAAY,EACZ,uBAAuB,EACvB,QAAQ,CACT,CAAA;AACD,KAAK,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAA;AAE9C,eAAO,MAAM,oBAAoB,gBACnB,MAAM,YACR,qBAAqB,YACrB,WAAW,KACpB,QAAQ,uBAAuB,CAqBjC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;AAErD,MAAM,CAAC,OAAO,WACZ,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,EACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EACpC,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;EAsCrC"}
@@ -0,0 +1,426 @@
1
+ import { RelayClient, type AdaptedWallet, type Execute, type paths, type ProgressData } from '@relayprotocol/relay-sdk';
2
+ import { useQuery, type DefaultError, type QueryKey } from '@tanstack/react-query';
3
+ import type { WalletClient } from 'viem';
4
+ import type { AxiosRequestConfig } from 'axios';
5
+ type QuoteBody = paths['/quote']['post']['requestBody']['content']['application/json'];
6
+ export type QuoteResponse = paths['/quote']['post']['responses']['200']['content']['application/json'];
7
+ type QueryType = typeof useQuery<QuoteResponse, DefaultError, QuoteResponse, QueryKey>;
8
+ type QueryOptions = Parameters<QueryType>['0'];
9
+ export declare const queryQuote: (baseApiUrl?: string, options?: QuoteBody, config?: AxiosRequestConfig) => Promise<QuoteResponse>;
10
+ export type onProgress = (data: ProgressData) => void;
11
+ export default function (client?: RelayClient, wallet?: WalletClient | AdaptedWallet, options?: QuoteBody, onRequest?: (options?: QuoteBody, config?: AxiosRequestConfig) => void, onResponse?: (data: QuoteResponse, options?: QuoteBody) => void, queryOptions?: Partial<QueryOptions>, onError?: (e: any) => void, config?: AxiosRequestConfig): Omit<import("@tanstack/react-query").UseQueryResult<{
12
+ steps?: {
13
+ id: "deposit" | "approve" | "authorize" | "authorize1" | "authorize2" | "swap" | "send";
14
+ action: string;
15
+ description: string;
16
+ kind: string;
17
+ requestId?: string | undefined;
18
+ depositAddress?: string | undefined;
19
+ items: {
20
+ status?: string | undefined;
21
+ data?: unknown;
22
+ check?: {
23
+ endpoint?: string | undefined;
24
+ method?: string | undefined;
25
+ } | undefined;
26
+ }[];
27
+ }[] | undefined;
28
+ fees?: {
29
+ gas?: {
30
+ currency?: {
31
+ chainId?: number | undefined;
32
+ address?: string | undefined;
33
+ symbol?: string | undefined;
34
+ name?: string | undefined;
35
+ decimals?: number | undefined;
36
+ metadata?: {
37
+ logoURI?: string | undefined;
38
+ verified?: boolean | undefined;
39
+ isNative?: boolean | undefined;
40
+ } | undefined;
41
+ } | undefined;
42
+ amount?: string | undefined;
43
+ amountFormatted?: string | undefined;
44
+ amountUsd?: string | undefined;
45
+ minimumAmount?: string | undefined;
46
+ } | undefined;
47
+ relayer?: {
48
+ currency?: {
49
+ chainId?: number | undefined;
50
+ address?: string | undefined;
51
+ symbol?: string | undefined;
52
+ name?: string | undefined;
53
+ decimals?: number | undefined;
54
+ metadata?: {
55
+ logoURI?: string | undefined;
56
+ verified?: boolean | undefined;
57
+ isNative?: boolean | undefined;
58
+ } | undefined;
59
+ } | undefined;
60
+ amount?: string | undefined;
61
+ amountFormatted?: string | undefined;
62
+ amountUsd?: string | undefined;
63
+ minimumAmount?: string | undefined;
64
+ } | undefined;
65
+ relayerGas?: {
66
+ currency?: {
67
+ chainId?: number | undefined;
68
+ address?: string | undefined;
69
+ symbol?: string | undefined;
70
+ name?: string | undefined;
71
+ decimals?: number | undefined;
72
+ metadata?: {
73
+ logoURI?: string | undefined;
74
+ verified?: boolean | undefined;
75
+ isNative?: boolean | undefined;
76
+ } | undefined;
77
+ } | undefined;
78
+ amount?: string | undefined;
79
+ amountFormatted?: string | undefined;
80
+ amountUsd?: string | undefined;
81
+ minimumAmount?: string | undefined;
82
+ } | undefined;
83
+ relayerService?: {
84
+ currency?: {
85
+ chainId?: number | undefined;
86
+ address?: string | undefined;
87
+ symbol?: string | undefined;
88
+ name?: string | undefined;
89
+ decimals?: number | undefined;
90
+ metadata?: {
91
+ logoURI?: string | undefined;
92
+ verified?: boolean | undefined;
93
+ isNative?: boolean | undefined;
94
+ } | undefined;
95
+ } | undefined;
96
+ amount?: string | undefined;
97
+ amountFormatted?: string | undefined;
98
+ amountUsd?: string | undefined;
99
+ minimumAmount?: string | undefined;
100
+ } | undefined;
101
+ app?: {
102
+ currency?: {
103
+ chainId?: number | undefined;
104
+ address?: string | undefined;
105
+ symbol?: string | undefined;
106
+ name?: string | undefined;
107
+ decimals?: number | undefined;
108
+ metadata?: {
109
+ logoURI?: string | undefined;
110
+ verified?: boolean | undefined;
111
+ isNative?: boolean | undefined;
112
+ } | undefined;
113
+ } | undefined;
114
+ amount?: string | undefined;
115
+ amountFormatted?: string | undefined;
116
+ amountUsd?: string | undefined;
117
+ minimumAmount?: string | undefined;
118
+ } | undefined;
119
+ } | undefined;
120
+ details?: {
121
+ operation?: string | undefined;
122
+ sender?: string | undefined;
123
+ recipient?: string | undefined;
124
+ currencyIn?: {
125
+ currency?: {
126
+ chainId?: number | undefined;
127
+ address?: string | undefined;
128
+ symbol?: string | undefined;
129
+ name?: string | undefined;
130
+ decimals?: number | undefined;
131
+ metadata?: {
132
+ logoURI?: string | undefined;
133
+ verified?: boolean | undefined;
134
+ isNative?: boolean | undefined;
135
+ } | undefined;
136
+ } | undefined;
137
+ amount?: string | undefined;
138
+ amountFormatted?: string | undefined;
139
+ amountUsd?: string | undefined;
140
+ minimumAmount?: string | undefined;
141
+ } | undefined;
142
+ currencyOut?: {
143
+ currency?: {
144
+ chainId?: number | undefined;
145
+ address?: string | undefined;
146
+ symbol?: string | undefined;
147
+ name?: string | undefined;
148
+ decimals?: number | undefined;
149
+ metadata?: {
150
+ logoURI?: string | undefined;
151
+ verified?: boolean | undefined;
152
+ isNative?: boolean | undefined;
153
+ } | undefined;
154
+ } | undefined;
155
+ amount?: string | undefined;
156
+ amountFormatted?: string | undefined;
157
+ amountUsd?: string | undefined;
158
+ minimumAmount?: string | undefined;
159
+ } | undefined;
160
+ currencyGasTopup?: {
161
+ currency?: {
162
+ chainId?: number | undefined;
163
+ address?: string | undefined;
164
+ symbol?: string | undefined;
165
+ name?: string | undefined;
166
+ decimals?: number | undefined;
167
+ metadata?: {
168
+ logoURI?: string | undefined;
169
+ verified?: boolean | undefined;
170
+ isNative?: boolean | undefined;
171
+ } | undefined;
172
+ } | undefined;
173
+ amount?: string | undefined;
174
+ amountFormatted?: string | undefined;
175
+ amountUsd?: string | undefined;
176
+ minimumAmount?: string | undefined;
177
+ } | undefined;
178
+ totalImpact?: {
179
+ usd?: string | undefined;
180
+ percent?: string | undefined;
181
+ } | undefined;
182
+ swapImpact?: {
183
+ usd?: string | undefined;
184
+ percent?: string | undefined;
185
+ } | undefined;
186
+ rate?: string | undefined;
187
+ slippageTolerance?: {
188
+ origin?: {
189
+ usd?: string | undefined;
190
+ value?: string | undefined;
191
+ percent?: string | undefined;
192
+ } | undefined;
193
+ destination?: {
194
+ usd?: string | undefined;
195
+ value?: string | undefined;
196
+ percent?: string | undefined;
197
+ } | undefined;
198
+ } | undefined;
199
+ timeEstimate?: number | undefined;
200
+ userBalance?: string | undefined;
201
+ fallbackType?: string | undefined;
202
+ } | undefined;
203
+ protocol?: {
204
+ v2?: {
205
+ orderId?: string | undefined;
206
+ paymentDetails?: {
207
+ chainId?: string | undefined;
208
+ depository?: string | undefined;
209
+ currency?: string | undefined;
210
+ amount?: string | undefined;
211
+ } | undefined;
212
+ } | undefined;
213
+ } | undefined;
214
+ }, Error>, "data"> & {
215
+ data?: {
216
+ steps?: {
217
+ id: "deposit" | "approve" | "authorize" | "authorize1" | "authorize2" | "swap" | "send";
218
+ action: string;
219
+ description: string;
220
+ kind: string;
221
+ requestId?: string | undefined;
222
+ depositAddress?: string | undefined;
223
+ items: {
224
+ status?: string | undefined;
225
+ data?: unknown;
226
+ check?: {
227
+ endpoint?: string | undefined;
228
+ method?: string | undefined;
229
+ } | undefined;
230
+ }[];
231
+ }[] | undefined;
232
+ fees?: {
233
+ gas?: {
234
+ currency?: {
235
+ chainId?: number | undefined;
236
+ address?: string | undefined;
237
+ symbol?: string | undefined;
238
+ name?: string | undefined;
239
+ decimals?: number | undefined;
240
+ metadata?: {
241
+ logoURI?: string | undefined;
242
+ verified?: boolean | undefined;
243
+ isNative?: boolean | undefined;
244
+ } | undefined;
245
+ } | undefined;
246
+ amount?: string | undefined;
247
+ amountFormatted?: string | undefined;
248
+ amountUsd?: string | undefined;
249
+ minimumAmount?: string | undefined;
250
+ } | undefined;
251
+ relayer?: {
252
+ currency?: {
253
+ chainId?: number | undefined;
254
+ address?: string | undefined;
255
+ symbol?: string | undefined;
256
+ name?: string | undefined;
257
+ decimals?: number | undefined;
258
+ metadata?: {
259
+ logoURI?: string | undefined;
260
+ verified?: boolean | undefined;
261
+ isNative?: boolean | undefined;
262
+ } | undefined;
263
+ } | undefined;
264
+ amount?: string | undefined;
265
+ amountFormatted?: string | undefined;
266
+ amountUsd?: string | undefined;
267
+ minimumAmount?: string | undefined;
268
+ } | undefined;
269
+ relayerGas?: {
270
+ currency?: {
271
+ chainId?: number | undefined;
272
+ address?: string | undefined;
273
+ symbol?: string | undefined;
274
+ name?: string | undefined;
275
+ decimals?: number | undefined;
276
+ metadata?: {
277
+ logoURI?: string | undefined;
278
+ verified?: boolean | undefined;
279
+ isNative?: boolean | undefined;
280
+ } | undefined;
281
+ } | undefined;
282
+ amount?: string | undefined;
283
+ amountFormatted?: string | undefined;
284
+ amountUsd?: string | undefined;
285
+ minimumAmount?: string | undefined;
286
+ } | undefined;
287
+ relayerService?: {
288
+ currency?: {
289
+ chainId?: number | undefined;
290
+ address?: string | undefined;
291
+ symbol?: string | undefined;
292
+ name?: string | undefined;
293
+ decimals?: number | undefined;
294
+ metadata?: {
295
+ logoURI?: string | undefined;
296
+ verified?: boolean | undefined;
297
+ isNative?: boolean | undefined;
298
+ } | undefined;
299
+ } | undefined;
300
+ amount?: string | undefined;
301
+ amountFormatted?: string | undefined;
302
+ amountUsd?: string | undefined;
303
+ minimumAmount?: string | undefined;
304
+ } | undefined;
305
+ app?: {
306
+ currency?: {
307
+ chainId?: number | undefined;
308
+ address?: string | undefined;
309
+ symbol?: string | undefined;
310
+ name?: string | undefined;
311
+ decimals?: number | undefined;
312
+ metadata?: {
313
+ logoURI?: string | undefined;
314
+ verified?: boolean | undefined;
315
+ isNative?: boolean | undefined;
316
+ } | undefined;
317
+ } | undefined;
318
+ amount?: string | undefined;
319
+ amountFormatted?: string | undefined;
320
+ amountUsd?: string | undefined;
321
+ minimumAmount?: string | undefined;
322
+ } | undefined;
323
+ } | undefined;
324
+ details?: {
325
+ operation?: string | undefined;
326
+ sender?: string | undefined;
327
+ recipient?: string | undefined;
328
+ currencyIn?: {
329
+ currency?: {
330
+ chainId?: number | undefined;
331
+ address?: string | undefined;
332
+ symbol?: string | undefined;
333
+ name?: string | undefined;
334
+ decimals?: number | undefined;
335
+ metadata?: {
336
+ logoURI?: string | undefined;
337
+ verified?: boolean | undefined;
338
+ isNative?: boolean | undefined;
339
+ } | undefined;
340
+ } | undefined;
341
+ amount?: string | undefined;
342
+ amountFormatted?: string | undefined;
343
+ amountUsd?: string | undefined;
344
+ minimumAmount?: string | undefined;
345
+ } | undefined;
346
+ currencyOut?: {
347
+ currency?: {
348
+ chainId?: number | undefined;
349
+ address?: string | undefined;
350
+ symbol?: string | undefined;
351
+ name?: string | undefined;
352
+ decimals?: number | undefined;
353
+ metadata?: {
354
+ logoURI?: string | undefined;
355
+ verified?: boolean | undefined;
356
+ isNative?: boolean | undefined;
357
+ } | undefined;
358
+ } | undefined;
359
+ amount?: string | undefined;
360
+ amountFormatted?: string | undefined;
361
+ amountUsd?: string | undefined;
362
+ minimumAmount?: string | undefined;
363
+ } | undefined;
364
+ currencyGasTopup?: {
365
+ currency?: {
366
+ chainId?: number | undefined;
367
+ address?: string | undefined;
368
+ symbol?: string | undefined;
369
+ name?: string | undefined;
370
+ decimals?: number | undefined;
371
+ metadata?: {
372
+ logoURI?: string | undefined;
373
+ verified?: boolean | undefined;
374
+ isNative?: boolean | undefined;
375
+ } | undefined;
376
+ } | undefined;
377
+ amount?: string | undefined;
378
+ amountFormatted?: string | undefined;
379
+ amountUsd?: string | undefined;
380
+ minimumAmount?: string | undefined;
381
+ } | undefined;
382
+ totalImpact?: {
383
+ usd?: string | undefined;
384
+ percent?: string | undefined;
385
+ } | undefined;
386
+ swapImpact?: {
387
+ usd?: string | undefined;
388
+ percent?: string | undefined;
389
+ } | undefined;
390
+ rate?: string | undefined;
391
+ slippageTolerance?: {
392
+ origin?: {
393
+ usd?: string | undefined;
394
+ value?: string | undefined;
395
+ percent?: string | undefined;
396
+ } | undefined;
397
+ destination?: {
398
+ usd?: string | undefined;
399
+ value?: string | undefined;
400
+ percent?: string | undefined;
401
+ } | undefined;
402
+ } | undefined;
403
+ timeEstimate?: number | undefined;
404
+ userBalance?: string | undefined;
405
+ fallbackType?: string | undefined;
406
+ } | undefined;
407
+ protocol?: {
408
+ v2?: {
409
+ orderId?: string | undefined;
410
+ paymentDetails?: {
411
+ chainId?: string | undefined;
412
+ depository?: string | undefined;
413
+ currency?: string | undefined;
414
+ amount?: string | undefined;
415
+ } | undefined;
416
+ } | undefined;
417
+ } | undefined;
418
+ } | undefined;
419
+ queryKey: readonly unknown[];
420
+ executeQuote: (onProgress: onProgress) => Promise<{
421
+ data: Execute;
422
+ abortController?: AbortController;
423
+ }> | undefined;
424
+ };
425
+ export {};
426
+ //# sourceMappingURL=useQuote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQuote.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQuote.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAE/C,KAAK,SAAS,GACZ,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAEvE,MAAM,MAAM,aAAa,GACvB,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAE5E,KAAK,SAAS,GAAG,OAAO,QAAQ,CAC9B,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,CACT,CAAA;AACD,KAAK,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAA;AAE9C,eAAO,MAAM,UAAU,gBACT,MAAM,YACR,SAAS,WACV,kBAAkB,KAC1B,QAAQ,aAAa,CAmBvB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;AAErD,MAAM,CAAC,OAAO,WACZ,MAAM,CAAC,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,YAAY,GAAG,aAAa,EACrC,OAAO,CAAC,EAAE,SAAS,EACnB,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,EACtE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,SAAS,KAAK,IAAI,EAC/D,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,EACpC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,EAC1B,MAAM,CAAC,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkEP,CACZ,YAAY,UAAU,KAEpB,QAAQ;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,eAAe,CAAA;KAAE,CAAC,GAC7D,SAAS;EAapB"}
@@ -0,0 +1,141 @@
1
+ import { type paths } from '@relayprotocol/relay-sdk';
2
+ import { useQuery, type DefaultError, type QueryKey } from '@tanstack/react-query';
3
+ type ChainsQuery = paths['/chains']['get']['parameters']['query'] & {
4
+ referrer?: string;
5
+ };
6
+ export type ChainsResponse = paths['/chains']['get']['responses']['200']['content']['application/json'];
7
+ type QueryType = typeof useQuery<ChainsResponse, DefaultError, ChainsResponse, QueryKey>;
8
+ type QueryOptions = Parameters<QueryType>['0'];
9
+ export declare const queryRelayChains: (baseApiUrl?: string, options?: ChainsQuery, headers?: HeadersInit) => Promise<ChainsResponse>;
10
+ export default function (baseApiUrl?: string, options?: ChainsQuery, queryOptions?: Partial<QueryOptions>): import("@tanstack/react-query").UseQueryResult<{
11
+ chains?: {
12
+ id?: number | undefined;
13
+ name?: string | undefined;
14
+ displayName?: string | undefined;
15
+ httpRpcUrl?: string | undefined;
16
+ wsRpcUrl?: string | undefined;
17
+ explorerUrl?: string | undefined;
18
+ explorerName?: string | undefined;
19
+ explorerPaths?: {
20
+ transaction?: string | undefined;
21
+ } | null | undefined;
22
+ depositEnabled?: boolean | undefined;
23
+ tokenSupport?: "All" | "Limited" | undefined;
24
+ disabled?: boolean | undefined;
25
+ partialDisableLimit?: number | undefined;
26
+ blockProductionLagging?: boolean | undefined;
27
+ currency?: {
28
+ id?: string | undefined;
29
+ symbol?: string | undefined;
30
+ name?: string | undefined;
31
+ address?: string | undefined;
32
+ decimals?: number | undefined;
33
+ supportsBridging?: boolean | undefined;
34
+ } | undefined;
35
+ withdrawalFee?: number | undefined;
36
+ depositFee?: number | undefined;
37
+ surgeEnabled?: boolean | undefined;
38
+ featuredTokens?: {
39
+ id?: string | undefined;
40
+ symbol?: string | undefined;
41
+ name?: string | undefined;
42
+ address?: string | undefined;
43
+ decimals?: number | undefined;
44
+ supportsBridging?: boolean | undefined;
45
+ metadata?: {
46
+ logoURI?: string | undefined;
47
+ } | undefined;
48
+ }[] | undefined;
49
+ erc20Currencies?: {
50
+ id?: string | undefined;
51
+ symbol?: string | undefined;
52
+ name?: string | undefined;
53
+ address?: string | undefined;
54
+ decimals?: number | undefined;
55
+ supportsBridging?: boolean | undefined;
56
+ supportsPermit?: boolean | undefined;
57
+ withdrawalFee?: number | undefined;
58
+ depositFee?: number | undefined;
59
+ surgeEnabled?: boolean | undefined;
60
+ }[] | undefined;
61
+ solverCurrencies?: {
62
+ id?: string | undefined;
63
+ symbol?: string | undefined;
64
+ name?: string | undefined;
65
+ address?: string | undefined;
66
+ decimals?: number | undefined;
67
+ }[] | undefined;
68
+ iconUrl?: string | null | undefined;
69
+ logoUrl?: string | null | undefined;
70
+ brandColor?: string | null | undefined;
71
+ contracts?: {
72
+ multicall3?: string | undefined;
73
+ multicaller?: string | undefined;
74
+ onlyOwnerMulticaller?: string | undefined;
75
+ relayReceiver?: string | undefined;
76
+ erc20Router?: string | undefined;
77
+ approvalProxy?: string | undefined;
78
+ } | undefined;
79
+ vmType?: "evm" | "svm" | "bvm" | undefined;
80
+ explorerQueryParams?: {
81
+ [key: string]: unknown;
82
+ } | null | undefined;
83
+ baseChainId?: number | null | undefined;
84
+ statusMessage?: string | null | undefined;
85
+ solverAddresses?: string[] | undefined;
86
+ tags?: string[] | undefined;
87
+ protocol?: {
88
+ v2?: {
89
+ chainId?: string | null | undefined;
90
+ depository?: string | null | undefined;
91
+ } | undefined;
92
+ } | undefined;
93
+ }[] | undefined;
94
+ }, Error> & {
95
+ viemChains?: ({
96
+ blockExplorers?: {
97
+ [key: string]: {
98
+ name: string;
99
+ url: string;
100
+ apiUrl?: string | undefined;
101
+ };
102
+ default: {
103
+ name: string;
104
+ url: string;
105
+ apiUrl?: string | undefined;
106
+ };
107
+ } | undefined;
108
+ contracts?: {
109
+ [x: string]: import("viem").ChainContract | {
110
+ [sourceId: number]: import("viem").ChainContract | undefined;
111
+ } | undefined;
112
+ ensRegistry?: import("viem").ChainContract | undefined;
113
+ ensUniversalResolver?: import("viem").ChainContract | undefined;
114
+ multicall3?: import("viem").ChainContract | undefined;
115
+ universalSignatureVerifier?: import("viem").ChainContract | undefined;
116
+ } | undefined;
117
+ ensTlds?: readonly string[] | undefined;
118
+ id: number;
119
+ name: string;
120
+ nativeCurrency: {
121
+ name: string;
122
+ symbol: string;
123
+ decimals: number;
124
+ };
125
+ rpcUrls: {
126
+ [key: string]: {
127
+ http: readonly string[];
128
+ webSocket?: readonly string[] | undefined;
129
+ };
130
+ default: {
131
+ http: readonly string[];
132
+ webSocket?: readonly string[] | undefined;
133
+ };
134
+ };
135
+ sourceId?: number | undefined;
136
+ testnet?: boolean | undefined;
137
+ } & import("viem").ChainConfig<import("viem").ChainFormatters | undefined, Record<string, unknown> | undefined>)[] | undefined;
138
+ chains?: (import("@relayprotocol/relay-sdk").RelayChain & Required<Pick<import("@relayprotocol/relay-sdk").RelayChain, "viemChain">>)[] | undefined;
139
+ };
140
+ export {};
141
+ //# sourceMappingURL=useRelayChains.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRelayChains.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRelayChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAI9B,KAAK,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GAAG;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,cAAc,GACxB,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAE5E,KAAK,SAAS,GAAG,OAAO,QAAQ,CAC9B,cAAc,EACd,YAAY,EACZ,cAAc,EACd,QAAQ,CACT,CAAA;AACD,KAAK,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAA;AAE9C,eAAO,MAAM,gBAAgB,gBACf,MAAM,YACR,WAAW,YACX,WAAW,KACpB,QAAQ,cAAc,CAIxB,CAAA;AAED,MAAM,CAAC,OAAO,WACZ,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBrC"}
@@ -0,0 +1,25 @@
1
+ import { type paths } from '@relayprotocol/relay-sdk';
2
+ import { useQuery, type DefaultError, type QueryKey } from '@tanstack/react-query';
3
+ type ConfigQuery = paths['/config/v2']['get']['parameters']['query'] & {
4
+ referrer?: string;
5
+ };
6
+ export type ConfigResponse = paths['/config/v2']['get']['responses']['200']['content']['application/json'];
7
+ type QueryType = typeof useQuery<ConfigResponse, DefaultError, ConfigResponse, QueryKey>;
8
+ type QueryOptions = Parameters<QueryType>['0'];
9
+ export declare const queryRelayConfig: (baseApiUrl?: string, options?: ConfigQuery, headers?: HeadersInit) => Promise<ConfigResponse>;
10
+ export default function (baseApiUrl?: string, options?: ConfigQuery, queryOptions?: Partial<QueryOptions>): import("@tanstack/react-query").UseQueryResult<{
11
+ enabled?: boolean | undefined;
12
+ user?: {
13
+ balance?: string | undefined;
14
+ maxBridgeAmount?: string | undefined;
15
+ } | undefined;
16
+ fee?: string | undefined;
17
+ solver?: {
18
+ address?: string | undefined;
19
+ balance?: string | undefined;
20
+ capacityPerRequest?: string | undefined;
21
+ } | undefined;
22
+ supportsExternalLiquidity?: boolean | undefined;
23
+ }, Error>;
24
+ export {};
25
+ //# sourceMappingURL=useRelayConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRelayConfig.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRelayConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,KAAK,EACX,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAG9B,KAAK,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,GAAG;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,cAAc,GACxB,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAE/E,KAAK,SAAS,GAAG,OAAO,QAAQ,CAC9B,cAAc,EACd,YAAY,EACZ,cAAc,EACd,QAAQ,CACT,CAAA;AACD,KAAK,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAA;AAE9C,eAAO,MAAM,gBAAgB,gBACf,MAAM,YACR,WAAW,YACX,WAAW,KACpB,QAAQ,cAAc,CAIxB,CAAA;AAED,MAAM,CAAC,OAAO,WACZ,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;UAcrC"}