@funkit/connect 9.7.2-next.0 → 9.8.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.
- package/CHANGELOG.md +83 -0
- package/dist/__generated__/default_configs.d.ts +1 -1
- package/dist/__generated__/default_feature_gates.d.ts +1 -0
- package/dist/clients/chunk-LMEQD56M.js +289 -0
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +55 -329
- package/dist/clients/lighter.css +14393 -0
- package/dist/clients/lighter.d.ts +30 -34
- package/dist/clients/lighter.js +657 -0
- package/dist/components/Dropdown/BaseDropdown.d.ts +7 -21
- package/dist/components/Dropdown/BaseDropdown.utils.d.ts +23 -0
- package/dist/components/Dropdown/ChainDropdown.d.ts +2 -1
- package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +9 -3
- package/dist/components/Dropdown/TokenDropdown.d.ts +7 -3
- package/dist/domains/asset.d.ts +0 -1
- package/dist/domains/quoteMode/exactOut.d.ts +2 -1
- package/dist/domains/quoteMode/resolveQuoteMode.d.ts +3 -1
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -8
- package/dist/hooks/useCheckoutDirectExecution.d.ts +1 -1
- package/dist/hooks/useIsStablecoin.d.ts +2 -0
- package/dist/hooks/useTokenAndChainDropdown.d.ts +13 -7
- package/dist/hooks/useTokenTransfer.d.ts +2 -2
- package/dist/index.css +99 -99
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5691 -4823
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +2 -1
- package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +2 -2
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +11 -1
- package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +5 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +60 -2
- package/dist/providers/FunkitHistoryContext.d.ts +2 -2
- package/dist/utils/withdrawal.d.ts +6 -1
- package/dist/wallets/Wallet.d.ts +11 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +42 -42
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +6 -5
- package/dist/chunk-64NZSUGQ.js +0 -368
- package/dist/chunk-B2B6HDIE.js +0 -238
- package/dist/chunk-OQNN7EMQ.js +0 -238
- package/dist/chunk-S65TG73G.js +0 -247
- package/dist/chunk-VLAOBEJN.js +0 -247
- package/dist/clients/chunk-SBQ2UUPK.js +0 -214
- package/dist/components/Dropdown/TokenAndChainDropdown.css.d.ts +0 -1
- package/dist/hooks/track/CheckoutTrackingContext.d.ts +0 -60
- package/dist/hooks/useTokenChain.d.ts +0 -21
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeContainer.d.ts +0 -17
- package/dist/modals/WithdrwalModal/WithdrawalCallbackSuccess.d.ts +0 -10
- package/dist/modals/WithdrwalModal/WithdrawalContent.d.ts +0 -11
- package/dist/modals/WithdrwalModal/WithdrawalModal.d.ts +0 -9
- package/dist/modals/WithdrwalModal/WithdrawalSuccess.d.ts +0 -15
- package/dist/modals/WithdrwalModal/types.d.ts +0 -5
- package/dist/modals/WithdrwalModal/useWithdrawal.d.ts +0 -24
- package/dist/wallets/walletConnectors/chunk-34HACM5U.js +0 -110
- package/dist/wallets/walletConnectors/chunk-4C7ER452.js +0 -93
- package/dist/wallets/walletConnectors/chunk-53VYSPXK.js +0 -66
- package/dist/wallets/walletConnectors/chunk-5TN5Z2WY.js +0 -87
- package/dist/wallets/walletConnectors/chunk-6DRCY52E.js +0 -69
- package/dist/wallets/walletConnectors/chunk-6UCI7GM6.js +0 -98
- package/dist/wallets/walletConnectors/chunk-6YO27XOM.js +0 -96
- package/dist/wallets/walletConnectors/chunk-7OARWILZ.js +0 -92
- package/dist/wallets/walletConnectors/chunk-7V33VJAL.js +0 -218
- package/dist/wallets/walletConnectors/chunk-APHCF4DT.js +0 -103
- package/dist/wallets/walletConnectors/chunk-CJJT7LMT.js +0 -96
- package/dist/wallets/walletConnectors/chunk-DEFRRPXB.js +0 -98
- package/dist/wallets/walletConnectors/chunk-EKJHJFRN.js +0 -69
- package/dist/wallets/walletConnectors/chunk-FG2LDVXL.js +0 -92
- package/dist/wallets/walletConnectors/chunk-GH4M6FTK.js +0 -95
- package/dist/wallets/walletConnectors/chunk-GSHSWVEG.js +0 -70
- package/dist/wallets/walletConnectors/chunk-GVOQTORD.js +0 -87
- package/dist/wallets/walletConnectors/chunk-HETS3KKI.js +0 -218
- package/dist/wallets/walletConnectors/chunk-HOPH3TQ3.js +0 -99
- package/dist/wallets/walletConnectors/chunk-HRDPUW3V.js +0 -94
- package/dist/wallets/walletConnectors/chunk-HXWUH73P.js +0 -93
- package/dist/wallets/walletConnectors/chunk-IICWJWGZ.js +0 -110
- package/dist/wallets/walletConnectors/chunk-KO56HCTI.js +0 -106
- package/dist/wallets/walletConnectors/chunk-KWX2SYU2.js +0 -100
- package/dist/wallets/walletConnectors/chunk-LCIPVVH5.js +0 -70
- package/dist/wallets/walletConnectors/chunk-LI6QY2B5.js +0 -94
- package/dist/wallets/walletConnectors/chunk-PKMAPNN6.js +0 -92
- package/dist/wallets/walletConnectors/chunk-T4ROGPMF.js +0 -106
- package/dist/wallets/walletConnectors/chunk-TTHM3WUR.js +0 -100
- package/dist/wallets/walletConnectors/chunk-UDTBQV4Q.js +0 -96
- package/dist/wallets/walletConnectors/chunk-V6UOWTEZ.js +0 -95
- package/dist/wallets/walletConnectors/chunk-VJZWNQOF.js +0 -92
- package/dist/wallets/walletConnectors/chunk-XBLHZICW.js +0 -103
- package/dist/wallets/walletConnectors/chunk-XVBSJCW5.js +0 -96
- package/dist/wallets/walletConnectors/chunk-YIEASHLS.js +0 -99
- package/dist/wallets/walletConnectors/chunk-ZPSPK6LH.js +0 -66
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const NO_SELECTION_VALUE = "";
|
|
2
|
+
export declare const ADDITIONAL_GROUP_KEY = "__additional__";
|
|
3
|
+
export interface BaseDropdownOption<T = string> {
|
|
4
|
+
label: string;
|
|
5
|
+
value: T;
|
|
6
|
+
}
|
|
7
|
+
export interface BaseDropdownGroup<T = string, G extends string = never> {
|
|
8
|
+
key: G;
|
|
9
|
+
label: string;
|
|
10
|
+
values: T[];
|
|
11
|
+
}
|
|
12
|
+
export interface OrganizedDropdownGroup<T, G extends string> {
|
|
13
|
+
key: G | typeof ADDITIONAL_GROUP_KEY | typeof NO_SELECTION_VALUE;
|
|
14
|
+
label: string | undefined;
|
|
15
|
+
options: BaseDropdownOption<T>[];
|
|
16
|
+
}
|
|
17
|
+
export interface OrganizeDropdownGroupsResult<T, G extends string> {
|
|
18
|
+
organizedGroups: OrganizedDropdownGroup<T, G>[];
|
|
19
|
+
organizedOptions: BaseDropdownOption<T>[];
|
|
20
|
+
}
|
|
21
|
+
export declare function buildAllOptions<T extends string>(options: BaseDropdownOption<T>[], allowUnselect: boolean, unselectLabel?: string): BaseDropdownOption<T>[];
|
|
22
|
+
export declare function filterOptions<T extends string>(allOptions: BaseDropdownOption<T>[], searchInput: string): BaseDropdownOption<T>[];
|
|
23
|
+
export declare function organizeDropdownGroups<T extends string, G extends string>(filteredOptions: BaseDropdownOption<T>[], groups: BaseDropdownGroup<T, G>[] | undefined, additionalGroup: 'all' | 'others', additionalGroupLabel: string | undefined): OrganizeDropdownGroupsResult<T, G>;
|
|
@@ -23,7 +23,8 @@ interface ChainDropdownProps {
|
|
|
23
23
|
alwaysOpenToTop?: BaseDropdownProps['alwaysOpenToTop'];
|
|
24
24
|
maxDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
|
|
25
25
|
tagComponent?: (value: string) => React.ReactNode;
|
|
26
|
+
placeholder?: string;
|
|
26
27
|
testId?: string;
|
|
27
28
|
}
|
|
28
|
-
export declare const ChainDropdown: ({ assets, chainIdSortOrder, selectedChainId: propSelectedChainId, selectedToken, allowUnselect, onChainSelected, activeItemProps, size, openDropdownBackgroundColor, openDropdownFullWidth, isLoading, alwaysOpenToTop, maxDropdownHeight, tagComponent, testId, }: ChainDropdownProps) => React.JSX.Element;
|
|
29
|
+
export declare const ChainDropdown: ({ assets, chainIdSortOrder, selectedChainId: propSelectedChainId, selectedToken, allowUnselect, onChainSelected, activeItemProps, size, openDropdownBackgroundColor, openDropdownFullWidth, isLoading, alwaysOpenToTop, maxDropdownHeight, tagComponent, placeholder, testId, }: ChainDropdownProps) => React.JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -3,8 +3,8 @@ import type { TokenTransferSourceChainsAndAssets } from '../../modals/CheckoutMo
|
|
|
3
3
|
import type { BaseDropdownProps } from './BaseDropdown';
|
|
4
4
|
interface TokenAndChainDropdownProps {
|
|
5
5
|
isLoading: boolean;
|
|
6
|
-
selectedToken: string;
|
|
7
|
-
selectedChainId: number;
|
|
6
|
+
selectedToken: string | undefined;
|
|
7
|
+
selectedChainId: number | undefined;
|
|
8
8
|
assets: TokenTransferSourceChainsAndAssets;
|
|
9
9
|
/**
|
|
10
10
|
* Callback fired after token selection
|
|
@@ -16,6 +16,10 @@ interface TokenAndChainDropdownProps {
|
|
|
16
16
|
onChainSelected: (chainId?: number, autoUpdate?: boolean) => void;
|
|
17
17
|
tokenLabel?: string;
|
|
18
18
|
chainLabel?: string;
|
|
19
|
+
/** Placeholder shown in the token dropdown when no token is selected */
|
|
20
|
+
tokenPlaceholder?: string;
|
|
21
|
+
/** Placeholder shown in the chain dropdown when no chain is selected */
|
|
22
|
+
chainPlaceholder?: string;
|
|
19
23
|
chainLabelAddon?: ReactNode;
|
|
20
24
|
alwaysOpenToTop?: boolean;
|
|
21
25
|
maxTokenDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
|
|
@@ -26,11 +30,13 @@ interface TokenAndChainDropdownProps {
|
|
|
26
30
|
* Override to hide the new token badge
|
|
27
31
|
*/
|
|
28
32
|
hideNewTokenBadge?: boolean;
|
|
33
|
+
/** Token symbols to show in a separate "Popular" group */
|
|
34
|
+
popularTokenSymbols?: string[];
|
|
29
35
|
/** Token symbols to prioritize at top of dropdown */
|
|
30
36
|
priorityTokenSymbols?: string[];
|
|
31
37
|
/** Determines the chain display order */
|
|
32
38
|
chainIdSortOrder?: number[];
|
|
33
39
|
}
|
|
34
40
|
/** Combines together chain and token dropdowns */
|
|
35
|
-
export declare const TokenAndChainDropdown: ({ isLoading, selectedToken, selectedChainId, assets, onTokenSelected, onChainSelected, tokenLabel, chainLabel, chainLabelAddon, alwaysOpenToTop, maxTokenDropdownHeight, maxChainDropdownHeight, openChainDropdownFullWidth, chainTagComponent, hideNewTokenBadge, priorityTokenSymbols, chainIdSortOrder, }: TokenAndChainDropdownProps) => React.JSX.Element;
|
|
41
|
+
export declare const TokenAndChainDropdown: ({ isLoading, selectedToken, selectedChainId, assets, onTokenSelected, onChainSelected, tokenLabel, chainLabel, tokenPlaceholder, chainPlaceholder, chainLabelAddon, alwaysOpenToTop, maxTokenDropdownHeight, maxChainDropdownHeight, openChainDropdownFullWidth, chainTagComponent, hideNewTokenBadge, popularTokenSymbols, priorityTokenSymbols, chainIdSortOrder, }: TokenAndChainDropdownProps) => React.JSX.Element;
|
|
36
42
|
export {};
|
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import type { TokenTransferSourceChainsAndAssets } from '../../modals/CheckoutModal/TransferToken/TransferToken';
|
|
3
3
|
import { type BaseDropdownProps } from './BaseDropdown';
|
|
4
4
|
interface TokenDropdownProps {
|
|
5
|
-
selectedChainId: number;
|
|
5
|
+
selectedChainId: number | undefined;
|
|
6
6
|
assets: TokenTransferSourceChainsAndAssets;
|
|
7
7
|
onTokenSelected: (token: string, chainId?: number,
|
|
8
8
|
/**
|
|
9
9
|
* If true, it will trigger automatic updates for the matching chain in the parent component.
|
|
10
10
|
*/
|
|
11
11
|
autoUpdate?: boolean) => void;
|
|
12
|
-
selectedToken
|
|
12
|
+
selectedToken: string | undefined;
|
|
13
13
|
isLoading?: BaseDropdownProps['isLoading'];
|
|
14
14
|
alwaysOpenToTop?: BaseDropdownProps['alwaysOpenToTop'];
|
|
15
15
|
maxDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
|
|
@@ -17,12 +17,16 @@ interface TokenDropdownProps {
|
|
|
17
17
|
* Override to hide the new token badge
|
|
18
18
|
*/
|
|
19
19
|
hideNewTokenBadge?: boolean;
|
|
20
|
+
/** Token symbols to show in a separate "Popular" group */
|
|
21
|
+
popularTokenSymbols?: string[];
|
|
20
22
|
/** Token symbols to prioritize at top of dropdown */
|
|
21
23
|
priorityTokenSymbols?: string[];
|
|
24
|
+
/** Placeholder shown when no token is selected */
|
|
25
|
+
placeholder?: string;
|
|
22
26
|
/**
|
|
23
27
|
* Test ID for the token dropdown
|
|
24
28
|
*/
|
|
25
29
|
testId?: string;
|
|
26
30
|
}
|
|
27
|
-
export declare const TokenDropdown: ({ assets, selectedChainId, selectedToken, onTokenSelected, isLoading, alwaysOpenToTop, maxDropdownHeight, hideNewTokenBadge, priorityTokenSymbols, testId, }: TokenDropdownProps) => React.JSX.Element;
|
|
31
|
+
export declare const TokenDropdown: ({ assets, selectedChainId, selectedToken, onTokenSelected, isLoading, alwaysOpenToTop, maxDropdownHeight, hideNewTokenBadge, popularTokenSymbols, priorityTokenSymbols, placeholder, testId, }: TokenDropdownProps) => React.JSX.Element;
|
|
28
32
|
export {};
|
package/dist/domains/asset.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { PaymentMethod } from '../domains/paymentMethods';
|
|
|
8
8
|
* Accounts for the customer's configured minimum deposit and a global floor.
|
|
9
9
|
*/
|
|
10
10
|
export declare function getMinValueThreshold(config: FunkitCheckoutConfig | undefined, minUsdRequired?: number): number;
|
|
11
|
-
export declare const isStablecoin: (symbol: string) => boolean;
|
|
12
11
|
export declare function isPreferredChain(chainId: number, additionalChains?: number[]): boolean;
|
|
13
12
|
export declare function isNativeTokenAddress(address: Address): boolean;
|
|
14
13
|
export declare function isDefaultToken(asset: AssetHoldingsItem, checkoutConfig: FunkitCheckoutConfig): boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { IsStablecoinFn } from '../../hooks/useIsStablecoin';
|
|
1
2
|
import { type QuoteBuilder } from './types';
|
|
2
3
|
export interface ResolveQuoteBuilderParams {
|
|
3
4
|
hasPostAction: boolean | undefined;
|
|
4
5
|
isExactInEnabled: boolean;
|
|
6
|
+
isStablecoin: IsStablecoinFn;
|
|
5
7
|
providerSupportsExactInWithActions?: boolean;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
@@ -17,4 +19,4 @@ export interface ResolveQuoteBuilderParams {
|
|
|
17
19
|
* Note: ONE_TO_ONE (subsidized routes) is not yet auto-detected.
|
|
18
20
|
* It will be enabled in a future phase when subsidy detection is implemented.
|
|
19
21
|
*/
|
|
20
|
-
export declare function resolveQuoteBuilder({ hasPostAction, isExactInEnabled, providerSupportsExactInWithActions, }: ResolveQuoteBuilderParams): QuoteBuilder;
|
|
22
|
+
export declare function resolveQuoteBuilder({ hasPostAction, isExactInEnabled, isStablecoin, providerSupportsExactInWithActions, }: ResolveQuoteBuilderParams): QuoteBuilder;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
2
2
|
interface CheckoutQuoteParams {
|
|
3
3
|
recipientAddress: string;
|
|
4
|
-
selectedChainId: string;
|
|
4
|
+
selectedChainId: string | undefined;
|
|
5
5
|
selectedTokenAddress: string | null | undefined;
|
|
6
|
-
selectedTokenSymbol: string;
|
|
6
|
+
selectedTokenSymbol: string | undefined;
|
|
7
7
|
config: FunkitWithdrawalConfig;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -11,7 +11,6 @@ interface CheckoutQuoteParams {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function useWithdrawalQuote({ recipientAddress, selectedChainId, selectedTokenAddress, selectedTokenSymbol, config, }: CheckoutQuoteParams): {
|
|
13
13
|
quoteEnabled: boolean;
|
|
14
|
-
isInstantQuoting: boolean;
|
|
15
14
|
data: {
|
|
16
15
|
baseQuote: import("@funkit/utils").CheckoutQuoteResponse;
|
|
17
16
|
checkedAssetAmount: import("../../domains/quote").CheckedAssetAmount;
|
|
@@ -51,7 +50,6 @@ export declare function useWithdrawalQuote({ recipientAddress, selectedChainId,
|
|
|
51
50
|
} | null>;
|
|
52
51
|
} | {
|
|
53
52
|
quoteEnabled: boolean;
|
|
54
|
-
isInstantQuoting: boolean;
|
|
55
53
|
data: {
|
|
56
54
|
baseQuote: import("@funkit/utils").CheckoutQuoteResponse;
|
|
57
55
|
checkedAssetAmount: import("../../domains/quote").CheckedAssetAmount;
|
|
@@ -91,7 +89,6 @@ export declare function useWithdrawalQuote({ recipientAddress, selectedChainId,
|
|
|
91
89
|
} | null>;
|
|
92
90
|
} | {
|
|
93
91
|
quoteEnabled: boolean;
|
|
94
|
-
isInstantQuoting: boolean;
|
|
95
92
|
data: undefined;
|
|
96
93
|
error: Error;
|
|
97
94
|
isError: true;
|
|
@@ -127,7 +124,6 @@ export declare function useWithdrawalQuote({ recipientAddress, selectedChainId,
|
|
|
127
124
|
} | null>;
|
|
128
125
|
} | {
|
|
129
126
|
quoteEnabled: boolean;
|
|
130
|
-
isInstantQuoting: boolean;
|
|
131
127
|
data: undefined;
|
|
132
128
|
error: null;
|
|
133
129
|
isError: false;
|
|
@@ -163,7 +159,6 @@ export declare function useWithdrawalQuote({ recipientAddress, selectedChainId,
|
|
|
163
159
|
} | null>;
|
|
164
160
|
} | {
|
|
165
161
|
quoteEnabled: boolean;
|
|
166
|
-
isInstantQuoting: boolean;
|
|
167
162
|
data: undefined;
|
|
168
163
|
error: null;
|
|
169
164
|
isError: false;
|
|
@@ -199,7 +194,6 @@ export declare function useWithdrawalQuote({ recipientAddress, selectedChainId,
|
|
|
199
194
|
} | null>;
|
|
200
195
|
} | {
|
|
201
196
|
quoteEnabled: boolean;
|
|
202
|
-
isInstantQuoting: boolean;
|
|
203
197
|
data: {
|
|
204
198
|
baseQuote: import("@funkit/utils").CheckoutQuoteResponse;
|
|
205
199
|
checkedAssetAmount: import("../../domains/quote").CheckedAssetAmount;
|
|
@@ -4,7 +4,7 @@ import type { CheckoutQuoteResponse } from '@funkit/utils';
|
|
|
4
4
|
import type { Address, Hex } from 'viem';
|
|
5
5
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
6
6
|
import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext';
|
|
7
|
-
import type
|
|
7
|
+
import { type WithdrawalClient } from '../wallets/Wallet';
|
|
8
8
|
interface DirectExecutionQuoteRequestParamsBase {
|
|
9
9
|
actionParams: FunkitCheckoutActionParams[];
|
|
10
10
|
bridgeOverride?: 'across' | 'relay';
|
|
@@ -6,21 +6,27 @@ export type TransferTokenDefault = {
|
|
|
6
6
|
};
|
|
7
7
|
interface UseTokenChainResult {
|
|
8
8
|
assets: TokenTransferSourceChainsAndAssets;
|
|
9
|
-
selectedChainId: number;
|
|
9
|
+
selectedChainId: number | undefined;
|
|
10
10
|
handleChainChange: (chainId?: number, autoUpdate?: boolean) => void;
|
|
11
|
-
selectedToken: string;
|
|
12
|
-
selectedChainName: string;
|
|
11
|
+
selectedToken: string | undefined;
|
|
12
|
+
selectedChainName: string | undefined;
|
|
13
13
|
handleTokenChange: (token: string, chainId?: number, autoUpdate?: boolean) => void;
|
|
14
14
|
isLoadingAssets: boolean;
|
|
15
15
|
chainIdSortOrder: number[];
|
|
16
|
+
popularTokenSymbols: string[];
|
|
16
17
|
priorityTokenSymbols: string[];
|
|
17
18
|
}
|
|
19
|
+
export interface UseTokenAndChainDropdownOptions {
|
|
20
|
+
transferInit?: CheckoutInitTokenTransferResponse;
|
|
21
|
+
defaultValues?: TransferTokenDefault;
|
|
22
|
+
/** When true, uses legacy withdrawal flags instead of Statsig config. Defaults to false. */
|
|
23
|
+
isWithdrawal?: boolean;
|
|
24
|
+
/** When true, starts with no chain/token pre-selected (user must pick both). Defaults to false. */
|
|
25
|
+
noDefaultSelection?: boolean;
|
|
26
|
+
}
|
|
18
27
|
/**
|
|
19
28
|
* Semi reusable hook (tied into token transfer configuration)
|
|
20
29
|
* ensures token&chain dropdown preselection logic is reusable
|
|
21
|
-
* @param transferInit - deposit address availability (solana/btc/tron filtering)
|
|
22
|
-
* @param defaultValues - caller-provided overrides (e.g. from UDA params or navigation state)
|
|
23
|
-
* @param isWithdrawal - when true, uses legacy withdrawal flags instead of Statsig config
|
|
24
30
|
*/
|
|
25
|
-
export declare const useTokenAndChainDropdown: (
|
|
31
|
+
export declare const useTokenAndChainDropdown: ({ defaultValues, isWithdrawal, noDefaultSelection, transferInit, }: UseTokenAndChainDropdownOptions) => UseTokenChainResult;
|
|
26
32
|
export {};
|
|
@@ -26,7 +26,7 @@ interface UseTokenTransferResult {
|
|
|
26
26
|
qrCodeUri: QRCodeUri | undefined;
|
|
27
27
|
blockchain: 'ethereum' | 'solana' | 'bitcoin' | 'tron';
|
|
28
28
|
}
|
|
29
|
-
export declare const useTokenTransfer: (selectedChainId: number, selectedToken: string, chainIds?: number[]) => UseTokenTransferResult;
|
|
29
|
+
export declare const useTokenTransfer: (selectedChainId: number | undefined, selectedToken: string | undefined, chainIds?: number[]) => UseTokenTransferResult;
|
|
30
30
|
export declare function getMinTransferValueForChain(chainId: number, limits: MinTransferConfig): number;
|
|
31
|
-
export declare const useMinTransferValue: (selectedChainId: number) => number;
|
|
31
|
+
export declare const useMinTransferValue: (selectedChainId: number | undefined) => number;
|
|
32
32
|
export {};
|