@funkit/connect 8.3.1-next.0 → 8.4.0-next.1

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 (100) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/{chunk-5JRQC2VM.js → chunk-UE3P6YHW.js} +13 -0
  3. package/dist/{chunk-CUWQELX3.js → chunk-XX5CVGHN.js} +3 -2
  4. package/dist/{chunk-VWSYBHAK.js → chunk-YUWSE22N.js} +3 -2
  5. package/dist/clients/fanatics.css +3956 -3651
  6. package/dist/clients/fanatics.js +35 -6
  7. package/dist/components/Box/Box.d.ts +45 -45
  8. package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryBottomBar.d.ts +1 -0
  9. package/dist/components/FunCheckoutHistory/useCustomStatusAnimationAboveTopbar.d.ts +1 -3
  10. package/dist/components/FunCheckoutModalHeightAnimationWrapper/FunCheckoutModalHeightAnimationWrapper.d.ts +3 -1
  11. package/dist/components/FunInfoBanner/InfoBanner.d.ts +1 -1
  12. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +1 -0
  13. package/dist/components/FunPayments/FunPaymentMethods.d.ts +7 -0
  14. package/dist/components/Tabs/Tabs.d.ts +1 -0
  15. package/dist/consts/customers.d.ts +1 -1
  16. package/dist/css/sprinkles.css.d.ts +87 -45
  17. package/dist/domains/meld.d.ts +0 -6
  18. package/dist/hooks/queries/useFops.d.ts +4 -2
  19. package/dist/hooks/track/CheckoutModalEvent.d.ts +7 -0
  20. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -0
  21. package/dist/hooks/useStepQueryReadiness.d.ts +32 -0
  22. package/dist/index.css +3981 -3670
  23. package/dist/index.js +3566 -2930
  24. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +1 -0
  25. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -1
  26. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -1
  27. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +1 -1
  28. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +5 -1
  29. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +10 -0
  30. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +10 -0
  31. package/dist/modals/CheckoutModal/SourceChange/SourceChangeLoading.d.ts +4 -0
  32. package/dist/modals/CheckoutModal/SourceChange/{DefaultSourceList.d.ts → SourceList.d.ts} +3 -3
  33. package/dist/modals/CheckoutModal/SourceChange/sourceChange.css.d.ts +2 -1
  34. package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -0
  35. package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -0
  36. package/dist/providers/FunkitConfigContext.d.ts +2 -0
  37. package/dist/providers/FunkitThemeProvider.d.ts +63 -0
  38. package/dist/themes/baseTheme.js +1 -1
  39. package/dist/themes/darkTheme.js +2 -2
  40. package/dist/themes/lightTheme.js +2 -2
  41. package/dist/utils/across.d.ts +5 -0
  42. package/dist/utils/depositCutoff.d.ts +9 -0
  43. package/dist/utils/directExecution.d.ts +16 -0
  44. package/dist/utils/flags/config.d.ts +2 -2
  45. package/dist/utils/lighter.d.ts +1 -1
  46. package/dist/utils/sanitizeHtml.d.ts +7 -0
  47. package/dist/utils/sanitizeUrl.d.ts +10 -0
  48. package/dist/utils/tokenIconUrl.d.ts +1 -1
  49. package/dist/wallets/walletConnectors/index.js +18 -18
  50. package/package.json +4 -4
  51. package/dist/atoms/activeCheckout.d.ts +0 -183
  52. package/dist/atoms/activeWithdrawal.d.ts +0 -21
  53. package/dist/atoms/bridgeProviders/acrossAdapter.d.ts +0 -109
  54. package/dist/atoms/bridgeProviders/index.d.ts +0 -25
  55. package/dist/atoms/bridgeProviders/registry.d.ts +0 -12
  56. package/dist/atoms/bridgeProviders/relayAdapter.d.ts +0 -60
  57. package/dist/atoms/bridgeProviders/types.d.ts +0 -182
  58. package/dist/atoms/checkoutProgress.d.ts +0 -22
  59. package/dist/atoms/directExecution.d.ts +0 -70
  60. package/dist/atoms/funkitCheckout.d.ts +0 -18
  61. package/dist/atoms/funkitProvider/index.d.ts +0 -24
  62. package/dist/atoms/generalWallet.d.ts +0 -45
  63. package/dist/atoms/i18n.d.ts +0 -6
  64. package/dist/atoms/modalState.d.ts +0 -30
  65. package/dist/atoms/quote.d.ts +0 -98
  66. package/dist/atoms/stepTransition.d.ts +0 -6
  67. package/dist/atoms/store.d.ts +0 -1
  68. package/dist/atoms/track/index.d.ts +0 -10
  69. package/dist/atoms/utils.d.ts +0 -2
  70. package/dist/atoms/wagmi.d.ts +0 -4
  71. package/dist/atoms/walletClient.d.ts +0 -15391
  72. package/dist/chunk-A24XIU2M.js +0 -299
  73. package/dist/chunk-CMS4F5PL.js +0 -209
  74. package/dist/chunk-FBCU3TQA.js +0 -204
  75. package/dist/chunk-GRQP5R23.js +0 -209
  76. package/dist/chunk-MGQZMUZ2.js +0 -288
  77. package/dist/chunk-OTMBU2BL.js +0 -204
  78. package/dist/domains/across.d.ts +0 -29
  79. package/dist/domains/track.d.ts +0 -14
  80. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +0 -2
  81. package/dist/modals/CheckoutModal/SelectAsset.d.ts +0 -14
  82. package/dist/modals/CheckoutModal/SourceChange/FanaticsSourceList.d.ts +0 -15
  83. package/dist/wallets/walletConnectors/chunk-3ZWIUCOI.js +0 -96
  84. package/dist/wallets/walletConnectors/chunk-4SC3PZVM.js +0 -70
  85. package/dist/wallets/walletConnectors/chunk-5AV2NSL3.js +0 -98
  86. package/dist/wallets/walletConnectors/chunk-5FWURLPF.js +0 -218
  87. package/dist/wallets/walletConnectors/chunk-6677RKVT.js +0 -69
  88. package/dist/wallets/walletConnectors/chunk-75A4Q5E5.js +0 -92
  89. package/dist/wallets/walletConnectors/chunk-ENLR4LXN.js +0 -94
  90. package/dist/wallets/walletConnectors/chunk-FT5BX7TL.js +0 -103
  91. package/dist/wallets/walletConnectors/chunk-GEMN6DM5.js +0 -106
  92. package/dist/wallets/walletConnectors/chunk-GXTI2PZD.js +0 -100
  93. package/dist/wallets/walletConnectors/chunk-LGT6IAXI.js +0 -93
  94. package/dist/wallets/walletConnectors/chunk-N7475PGA.js +0 -110
  95. package/dist/wallets/walletConnectors/chunk-O6YFVGVQ.js +0 -99
  96. package/dist/wallets/walletConnectors/chunk-OCM5YHT5.js +0 -92
  97. package/dist/wallets/walletConnectors/chunk-PRGCIJ7Y.js +0 -87
  98. package/dist/wallets/walletConnectors/chunk-RNIMZDHW.js +0 -95
  99. package/dist/wallets/walletConnectors/chunk-TLOROKED.js +0 -96
  100. package/dist/wallets/walletConnectors/chunk-WNQ3NPHX.js +0 -66
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
- zealWallet
4
- } from "./chunk-VU2RNIQG.js";
3
+ xdefiWallet
4
+ } from "./chunk-TMFH6GXS.js";
5
5
  import {
6
6
  zerionWallet
7
7
  } from "./chunk-CZYUE3AR.js";
@@ -20,27 +20,27 @@ import {
20
20
  import {
21
21
  trustWallet
22
22
  } from "./chunk-JFHP4YJG.js";
23
- import {
24
- uniswapWallet
25
- } from "./chunk-LH7BMNFZ.js";
26
23
  import {
27
24
  walletConnectWallet
28
25
  } from "./chunk-NP5QGWNL.js";
29
26
  import {
30
- xdefiWallet
31
- } from "./chunk-TMFH6GXS.js";
27
+ uniswapWallet
28
+ } from "./chunk-LH7BMNFZ.js";
29
+ import {
30
+ zealWallet
31
+ } from "./chunk-VU2RNIQG.js";
32
32
  import {
33
33
  rabbyWallet
34
34
  } from "./chunk-LW6S43RE.js";
35
35
  import {
36
36
  rainbowWallet
37
37
  } from "./chunk-77UTBHGP.js";
38
- import {
39
- ramperWallet
40
- } from "./chunk-FCG5Q6JX.js";
41
38
  import {
42
39
  roninWallet
43
40
  } from "./chunk-UOTQQJJD.js";
41
+ import {
42
+ ramperWallet
43
+ } from "./chunk-FCG5Q6JX.js";
44
44
  import {
45
45
  safeWallet
46
46
  } from "./chunk-BQQQL6UD.js";
@@ -86,12 +86,12 @@ import {
86
86
  import {
87
87
  frontierWallet
88
88
  } from "./chunk-T5KHVUFR.js";
89
- import {
90
- imTokenWallet
91
- } from "./chunk-COZ7MIQS.js";
92
89
  import {
93
90
  gateWallet
94
91
  } from "./chunk-MRRZOQGZ.js";
92
+ import {
93
+ imTokenWallet
94
+ } from "./chunk-COZ7MIQS.js";
95
95
  import {
96
96
  injectedWallet
97
97
  } from "./chunk-MQSCN4BO.js";
@@ -135,18 +135,18 @@ import {
135
135
  bitgetWallet
136
136
  } from "./chunk-FA5DTT5R.js";
137
137
  import {
138
- bitverseWallet
139
- } from "./chunk-3HZRRP4Y.js";
138
+ bitskiWallet
139
+ } from "./chunk-YMUSFW44.js";
140
140
  import {
141
141
  bloomWallet
142
142
  } from "./chunk-S27IADFU.js";
143
+ import {
144
+ bitverseWallet
145
+ } from "./chunk-3HZRRP4Y.js";
143
146
  import "./chunk-23WIEY36.js";
144
147
  import {
145
148
  braveWallet
146
149
  } from "./chunk-4ZXII3UA.js";
147
- import {
148
- bitskiWallet
149
- } from "./chunk-YMUSFW44.js";
150
150
  import "./chunk-ARYAYQ7Z.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "8.3.1-next.0",
3
+ "version": "8.4.0-next.1",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -103,10 +103,10 @@
103
103
  "ua-parser-js": "^1.0.37",
104
104
  "use-debounce": "^10.0.5",
105
105
  "uuid": "^9.0.1",
106
- "@funkit/fun-relay": "2.4.1-next.0",
106
+ "@funkit/api-base": "2.2.0-next.0",
107
107
  "@funkit/chains": "1.1.0",
108
- "@funkit/api-base": "2.1.3",
109
- "@funkit/utils": "1.2.0"
108
+ "@funkit/fun-relay": "2.4.1-next.1",
109
+ "@funkit/utils": "1.2.1-next.0"
110
110
  },
111
111
  "repository": {
112
112
  "type": "git",
@@ -1,183 +0,0 @@
1
- import type { DynamicRoutePath } from '@funkit/fun-relay';
2
- import type { Address } from 'viem';
3
- import { type PaymentMethodInfo } from '../domains/paymentMethods';
4
- import type { FunkitCheckoutQuoteResult } from '../domains/quote';
5
- import type { AssetHoldingsItem } from '../domains/wallet';
6
- import type { TrackEventData } from '../hooks/track/useTrack';
7
- import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig, UseFunkitCheckoutPropsWithFullConfig } from '../providers/FunkitCheckoutContext';
8
- import type { LoginType } from '../providers/GeneralWalletProvider';
9
- import type { WithdrawalClient } from '../wallets/Wallet';
10
- import type { FunkitDirectExecutionInfo } from './directExecution';
11
- /**
12
- * Write-only atom to set the checkout state.
13
- */
14
- export declare const setCheckoutAtom: import("jotai").WritableAtom<null, [value: FunkitActiveCheckoutItem | null], void> & {
15
- init: null;
16
- };
17
- /**
18
- * Read/write atom for the active checkout.
19
- */
20
- export declare const activeCheckoutAtom: import("jotai").WritableAtom<FunkitActiveCheckoutItem | null, [value: FunkitActiveCheckoutItem | null], void>;
21
- /**
22
- * Partial update atom for the active checkout.
23
- * Accepts either partial data or a function that receives current checkout and returns partial data.
24
- */
25
- export declare const updateCheckoutAtom: import("jotai").WritableAtom<null, [data: Partial<FunkitActiveCheckoutItem> | ((checkoutItem: FunkitActiveCheckoutItem) => Partial<FunkitActiveCheckoutItem>)], void> & {
26
- init: null;
27
- };
28
- /**
29
- * Updates the source asset of a given checkout.
30
- */
31
- export declare const updateSourceAssetAtom: import("jotai").WritableAtom<null, [selectedSource: Omit<AssetHoldingsItem, "amount" | "usdAmount">], void> & {
32
- init: null;
33
- };
34
- /**
35
- * Updates the target asset amount of a given checkout.
36
- * Uses flushSync internally to avoid stale data issues.
37
- */
38
- export declare const updateTargetAssetAmountAtom: import("jotai").WritableAtom<null, [newTargetAssetAmount: number], void> & {
39
- init: null;
40
- };
41
- /**
42
- * Updates the selected payment method info.
43
- */
44
- export declare const updateSelectedPaymentMethodInfoAtom: import("jotai").WritableAtom<null, [newInfo: PaymentMethodInfo], void> & {
45
- init: null;
46
- };
47
- /**
48
- * Resets the checkout state to initial (null).
49
- */
50
- export declare const resetCheckoutAtom: import("jotai").WritableAtom<null, [], void> & {
51
- init: null;
52
- };
53
- /**
54
- * Creates a new checkout object in the frontend. Not yet initialized in backend.
55
- * @returns The new checkoutId
56
- */
57
- export declare const initNewCheckoutAtom: import("jotai").WritableAtom<null, [props: UseFunkitCheckoutPropsWithFullConfig], string> & {
58
- init: null;
59
- };
60
- export declare const setCompletedTimestampAtom: import("jotai").WritableAtom<null, [timestampMs: number], void> & {
61
- init: null;
62
- };
63
- /**
64
- * Updates the target asset of a checkout.
65
- */
66
- export declare const updateTargetAssetAtom: import("jotai").WritableAtom<null, [asset: {
67
- targetAsset: Address;
68
- targetChain: string;
69
- targetAssetTicker: string;
70
- targetAssetMinAmount?: number;
71
- iconSrc: string | undefined;
72
- }], void> & {
73
- init: null;
74
- };
75
- /**
76
- * Applies dynamic routing configuration to the checkout.
77
- */
78
- export declare const applyDynamicRoutingAtom: import("jotai").WritableAtom<null, [path: Omit<DynamicRoutePath, "generateActionsParams" | "getCustomRecipient"> & {
79
- customRecipient?: FunkitCheckoutConfig["customRecipient"];
80
- generateActionsParams?: FunkitCheckoutConfig["generateActionsParams"];
81
- }], void> & {
82
- init: null;
83
- };
84
- /**
85
- * Updates the dynamic routing ID.
86
- */
87
- export declare const updateDynamicRoutingIdAtom: import("jotai").WritableAtom<null, [id: string], void> & {
88
- init: null;
89
- };
90
- /**
91
- * Updates the modal title meta.
92
- */
93
- export declare const updateModalTitleMetaAtom: import("jotai").WritableAtom<null, [newMeta: string], void> & {
94
- init: null;
95
- };
96
- /**
97
- * Updates the custom recipient address.
98
- */
99
- export declare const updateCustomRecipientAtom: import("jotai").WritableAtom<null, [recipient: `0x${string}`], void> & {
100
- init: null;
101
- };
102
- /**
103
- * Updates the withdrawal source asset amount.
104
- */
105
- export declare const updateWithdrawalSourceAssetAmountAtom: import("jotai").WritableAtom<null, [amount: number], void> & {
106
- init: null;
107
- };
108
- /**
109
- * Asserts that a checkout item exists, throws if null.
110
- */
111
- export declare function assertCheckoutItem(checkoutItem: FunkitActiveCheckoutItem | null): FunkitActiveCheckoutItem;
112
- /**
113
- * Mutation atom to cancel/deactivate a checkout using jotai-tanstack-query.
114
- * Use `mutateAsync` to get a promise that resolves to boolean indicating success.
115
- */
116
- export declare const cancelCheckoutAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<boolean, unknown, `0x${string}`, unknown>>;
117
- export interface UDAParams {
118
- targetChain: string;
119
- targetAsset: Address;
120
- targetAssetTicker: string;
121
- iconSrc: string;
122
- qrcodeActionType?: string;
123
- defaultTokenSymbol?: string;
124
- defaultChainId?: string;
125
- }
126
- export interface StartDirectExecutionCheckoutParams {
127
- stepMessageSetter: (m: string) => void;
128
- latestQuote: FunkitCheckoutQuoteResult;
129
- sourceOfFund: string;
130
- clientMetadata: object;
131
- actionsParams: FunkitCheckoutActionParams[];
132
- withdrawalClient?: WithdrawalClient;
133
- isPaymentMethodBalance: boolean;
134
- directExecutionInfo: FunkitDirectExecutionInfo;
135
- userId: string;
136
- walletAddress: Address | '';
137
- udaParams?: UDAParams;
138
- logEvent: (event: TrackEventData) => void;
139
- refreshCheckoutHistory: () => void;
140
- setCheckoutProgress: (checkoutId: string, progress: {
141
- step: 1 | 2;
142
- }) => void;
143
- updateActiveCheckout: (update: Partial<FunkitActiveCheckoutItem>) => void;
144
- }
145
- export interface StartRegularCheckoutParams {
146
- stepMessageSetter: (m: string) => void;
147
- latestQuote: FunkitCheckoutQuoteResult;
148
- sourceOfFund: string;
149
- clientMetadata: object;
150
- refreshCheckoutHistory: () => void;
151
- updateActiveCheckout: (update: Partial<FunkitActiveCheckoutItem>) => void;
152
- }
153
- export interface ConfirmCheckoutParams {
154
- latestQuote: FunkitCheckoutQuoteResult;
155
- stepMessageSetter: (m: string) => void;
156
- withdrawalClient?: WithdrawalClient;
157
- getDirectExecutionInfo: (checkoutItem: FunkitActiveCheckoutItem | null) => FunkitDirectExecutionInfo;
158
- getWithdrawalDirectExecution: () => FunkitDirectExecutionInfo;
159
- loginType: LoginType;
160
- userId: string;
161
- walletAddress: Address | '';
162
- udaParams?: UDAParams;
163
- logEvent: (event: TrackEventData) => void;
164
- refreshCheckoutHistory: () => void;
165
- setCheckoutProgress: (checkoutId: string, progress: {
166
- step: 1 | 2;
167
- }) => void;
168
- updateActiveCheckout: (update: Partial<FunkitActiveCheckoutItem>) => void;
169
- }
170
- /**
171
- * Mutation atom to start a direct execution checkout.
172
- * Handles both account balance and other direct execution flows.
173
- */
174
- export declare const startDirectExecutionCheckoutAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<`0x${string}`, unknown, StartDirectExecutionCheckoutParams, unknown>>;
175
- /**
176
- * Mutation atom to start a regular (non-direct-execution) checkout.
177
- */
178
- export declare const startRegularCheckoutAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<`0x${string}`, unknown, StartRegularCheckoutParams, unknown>>;
179
- /**
180
- * Mutation atom to confirm and initialize a checkout.
181
- * Main entry point that coordinates checkout confirmation.
182
- */
183
- export declare const confirmCheckoutAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<`0x${string}`, unknown, ConfirmCheckoutParams, unknown>>;
@@ -1,21 +0,0 @@
1
- import type { FunkitActiveWithdrawalItem, UseFunkitCheckoutPropsWithFullConfig } from '../providers/FunkitCheckoutContext';
2
- /**
3
- * Base atom holding the active withdrawal state.
4
- */
5
- export declare const withdrawalStateAtom: import("jotai").PrimitiveAtom<FunkitActiveWithdrawalItem | null> & {
6
- init: FunkitActiveWithdrawalItem | null;
7
- };
8
- /**
9
- * Write-only atom to set the withdrawal state.
10
- */
11
- export declare const setWithdrawalStateAtom: import("jotai").WritableAtom<null, [value: FunkitActiveWithdrawalItem | null], void> & {
12
- init: null;
13
- };
14
- /**
15
- * Creates a new withdrawal object in the frontend. Not yet initialized in backend.
16
- * Also creates a corresponding checkout item for the withdrawal flow.
17
- * @returns The new withdrawalId
18
- */
19
- export declare const initNewWithdrawalAtom: import("jotai").WritableAtom<null, [props: UseFunkitCheckoutPropsWithFullConfig, checkoutConfig: UseFunkitCheckoutPropsWithFullConfig], string> & {
20
- init: null;
21
- };
@@ -1,109 +0,0 @@
1
- import { type AcrossClient } from '@across-protocol/app-sdk';
2
- import { type Getter } from 'jotai';
3
- import type { Address, Hex } from 'viem';
4
- import type { BridgeExecutionParams, BridgeProviderAdapter, BridgeQuoteRequestParams, BridgeQuoteResult, SelectedRouteInfo } from './types';
5
- /**
6
- * Across quote metadata structure.
7
- * Contains provider-specific data from Across SDK.
8
- */
9
- export interface AcrossQuoteMetadata {
10
- /** The execution chain ID where the deposit transaction occurs */
11
- executionChainId?: number;
12
- /** Across swap quote from the SDK */
13
- acrossSwapQuote?: AcrossSwapQuote;
14
- }
15
- /**
16
- * Across swap quote data from the SDK.
17
- */
18
- export interface AcrossSwapQuote {
19
- /** Swap transaction details */
20
- swapTx?: {
21
- to: Address;
22
- value?: string;
23
- data: Hex;
24
- chainId: number;
25
- };
26
- /** Estimated fill time in seconds */
27
- expectedFillTime?: number;
28
- /** Input amount */
29
- inputAmount?: string;
30
- /** Output amount */
31
- expectedOutputAmount?: string;
32
- /** Approval transactions if needed */
33
- approvalTxns?: Array<{
34
- to: string;
35
- data: string;
36
- chainId: number;
37
- }>;
38
- }
39
- /**
40
- * Extended quote result with Across-specific metadata.
41
- */
42
- export interface AcrossQuote extends BridgeQuoteResult {
43
- metadata?: {
44
- acrossSwapQuote?: AcrossSwapQuote;
45
- };
46
- }
47
- /**
48
- * Atom holding the Across client instance.
49
- * Lazily created when first accessed.
50
- */
51
- export declare const acrossClientAtom: import("jotai").Atom<AcrossClient | null>;
52
- /**
53
- * Mutation atom for getting an Across quote using the SDK.
54
- *
55
- * @example
56
- * ```ts
57
- * const { mutateAsync: getQuote } = useAtomValue(acrossGetQuoteAtom)
58
- * const quote = await getQuote(params)
59
- * ```
60
- */
61
- export declare const acrossGetQuoteAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<BridgeQuoteResult | null, unknown, BridgeQuoteRequestParams, unknown>>;
62
- /**
63
- * Mutation atom for executing an Across quote using the SDK.
64
- *
65
- * @example
66
- * ```ts
67
- * const { mutateAsync: execute } = useAtomValue(acrossExecuteAtom)
68
- * const txHash = await execute(params)
69
- * ```
70
- */
71
- export declare const acrossExecuteAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<`0x${string}` | null, unknown, BridgeExecutionParams, unknown>>;
72
- /**
73
- * Derived atom for getting the selected route display info.
74
- * Reactively updates when quote or config changes.
75
- *
76
- * @example
77
- * ```ts
78
- * const selectedRoute = useAtomValue(acrossSelectedRouteAtom)
79
- * if (selectedRoute) {
80
- * console.log(selectedRoute.label, selectedRoute.isPassthrough)
81
- * }
82
- * ```
83
- */
84
- export declare const acrossSelectedRouteAtom: import("jotai").Atom<SelectedRouteInfo | null>;
85
- /**
86
- * Derived atom for estimated time from the latest quote.
87
- *
88
- * @example
89
- * ```ts
90
- * const estimatedTime = useAtomValue(acrossEstimatedTimeAtom)
91
- * ```
92
- */
93
- export declare const acrossEstimatedTimeAtom: import("jotai").Atom<number | null>;
94
- /**
95
- * Composed Across adapter atom that implements BridgeProviderAdapter.
96
- * Combines all individual atoms into a unified interface.
97
- *
98
- * @example
99
- * ```ts
100
- * const adapter = useAtomValue(acrossAdapterAtom)
101
- * const quote = await adapter.getQuote(params)
102
- * ```
103
- */
104
- export declare const acrossAdapterAtom: import("jotai").Atom<BridgeProviderAdapter>;
105
- /**
106
- * @deprecated Use `acrossAdapterAtom` instead.
107
- * Creates an Across bridge provider adapter.
108
- */
109
- export declare function createAcrossAdapter(get: Getter): BridgeProviderAdapter;
@@ -1,25 +0,0 @@
1
- /**
2
- * Bridge Provider Adapters
3
- *
4
- * This module provides a standardized interface for bridge providers
5
- * (Relay, Across, etc.) used in the wallet checkout flow.
6
- *
7
- * @example
8
- * ```ts
9
- * import {
10
- * relayAdapterAtom,
11
- * relaySelectedRouteAtom,
12
- * createProviderRegistry,
13
- * type BridgeProviderAdapter,
14
- * } from './bridgeProviders'
15
- *
16
- * // Use the composed adapter
17
- * const adapter = useAtomValue(relayAdapterAtom)
18
- *
19
- * // Or use individual atoms for reactive updates
20
- * const selectedRoute = useAtomValue(relaySelectedRouteAtom)
21
- * ```
22
- */
23
- export type { BridgeProviderAdapter, BridgeProviderRegistry, BridgeQuoteParams, BridgeQuoteExactInParams, BridgeQuoteExactOutParams, BridgeQuoteRequestParams, BridgeQuoteResult, BridgeExecutionParams, BridgeExecutionResult, ChainAsset, ProviderSelectionCriteria, RouteEligibilityParams, SelectedRouteInfo, } from './types';
24
- export { createProviderRegistry } from './registry';
25
- export { relayAdapterAtom, relayGetQuoteAtom, relayExecuteAtom, relaySelectedRouteAtom, relayEstimatedTimeAtom, createRelayAdapter, } from './relayAdapter';
@@ -1,12 +0,0 @@
1
- import type { BridgeProviderAdapter, BridgeProviderRegistry } from './types';
2
- /**
3
- * Creates a simple provider registry with default selection logic.
4
- *
5
- * Selection priority:
6
- * 1. Preferred provider (if specified and supports route)
7
- * 2. First provider that supports the route
8
- *
9
- * @param providers - Array of bridge provider adapters
10
- * @returns A provider registry
11
- */
12
- export declare function createProviderRegistry(providers: BridgeProviderAdapter[]): BridgeProviderRegistry;
@@ -1,60 +0,0 @@
1
- import { type Getter } from 'jotai';
2
- import type { BridgeExecutionParams, BridgeProviderAdapter, BridgeQuoteRequestParams, BridgeQuoteResult, SelectedRouteInfo } from './types';
3
- /**
4
- * Mutation atom for getting a Relay quote.
5
- *
6
- * @example
7
- * ```ts
8
- * const { mutateAsync: getQuote } = useAtomValue(relayGetQuoteAtom)
9
- * const quote = await getQuote(params)
10
- * ```
11
- */
12
- export declare const relayGetQuoteAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<BridgeQuoteResult | null, unknown, BridgeQuoteRequestParams, unknown>>;
13
- /**
14
- * Mutation atom for executing a Relay quote.
15
- *
16
- * @example
17
- * ```ts
18
- * const { mutateAsync: execute } = useAtomValue(relayExecuteAtom)
19
- * const txHash = await execute(params)
20
- * ```
21
- */
22
- export declare const relayExecuteAtom: import("jotai").Atom<import("jotai-tanstack-query").AtomWithMutationResult<`0x${string}` | null, unknown, BridgeExecutionParams, unknown>>;
23
- /**
24
- * Derived atom for getting the selected route display info.
25
- * Reactively updates when quote or config changes.
26
- *
27
- * @example
28
- * ```ts
29
- * const selectedRoute = useAtomValue(relaySelectedRouteAtom)
30
- * if (selectedRoute) {
31
- * console.log(selectedRoute.label, selectedRoute.isPassthrough)
32
- * }
33
- * ```
34
- */
35
- export declare const relaySelectedRouteAtom: import("jotai").Atom<SelectedRouteInfo | null>;
36
- /**
37
- * Derived atom for estimated time from the latest quote.
38
- *
39
- * @example
40
- * ```ts
41
- * const estimatedTime = useAtomValue(relayEstimatedTimeAtom)
42
- * ```
43
- */
44
- export declare const relayEstimatedTimeAtom: import("jotai").Atom<number | null>;
45
- /**
46
- * Composed Relay adapter atom that implements BridgeProviderAdapter.
47
- * Combines all individual atoms into a unified interface.
48
- *
49
- * @example
50
- * ```ts
51
- * const adapter = useAtomValue(relayAdapterAtom)
52
- * const quote = await adapter.getQuote(params)
53
- * ```
54
- */
55
- export declare const relayAdapterAtom: import("jotai").Atom<BridgeProviderAdapter>;
56
- /**
57
- * @deprecated Use `relayAdapterAtom` instead.
58
- * Creates a Relay bridge provider adapter.
59
- */
60
- export declare function createRelayAdapter(get: Getter): BridgeProviderAdapter;