@funkit/connect 10.5.0 → 10.6.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 +35 -0
- package/dist/clients/{chunk-WRS7AFM2.js → chunk-3LJQTM37.js} +0 -1
- package/dist/clients/{chunk-QHS5N7GP.js → chunk-TG2AACP2.js} +1 -1
- package/dist/clients/internal/nado/withdrawalConfig.js +1 -0
- package/dist/clients/lighter.css +5 -1
- package/dist/clients/lighter.js +1 -2
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +5 -1
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +2 -2
- package/dist/clients/polymarket/index.css +5 -1
- package/dist/clients/polymarket/index.js +2 -2
- package/dist/components/BottomLinks/BottomLinks.d.ts +3 -1
- package/dist/consts/meld.d.ts +1 -1
- package/dist/hooks/queries/useSwappedDefaultCurrency.d.ts +3 -3
- package/dist/hooks/queries/useWithdrawFops.d.ts +0 -1
- package/dist/hooks/track/useTrack.d.ts +1 -0
- package/dist/index.css +5 -1
- package/dist/index.js +1311 -1015
- package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +1 -2
- package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +6 -9
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +34 -17
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +1 -61
- package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +53 -0
- package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +38 -0
- package/dist/providers/FunkitConfigContext.d.ts +2 -2
- package/dist/utils/consts.d.ts +1 -1
- package/dist/utils/customer.d.ts +18 -3
- package/dist/utils/withdrawal.d.ts +6 -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 +36 -36
- 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 +2 -2
- package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
|
@@ -3,7 +3,6 @@ import type { QuoteDisplayAmounts } from '../../../domains/quoteMode';
|
|
|
3
3
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
4
4
|
interface CheckoutPrimaryInfoProps {
|
|
5
5
|
showLeftAlignedDollarValueWithLabel: boolean;
|
|
6
|
-
showTokenAmount: boolean;
|
|
7
6
|
config: FunkitCheckoutConfig;
|
|
8
7
|
usdAmount?: number;
|
|
9
8
|
isLoading?: boolean;
|
|
@@ -12,5 +11,5 @@ interface CheckoutPrimaryInfoProps {
|
|
|
12
11
|
/** In EXACT_IN mode, the fiat value the user entered on InputAmount (avoids skeleton flash) */
|
|
13
12
|
inputFiatAmount?: number | null;
|
|
14
13
|
}
|
|
15
|
-
export declare function CheckoutPrimaryInfo({ showLeftAlignedDollarValueWithLabel,
|
|
14
|
+
export declare function CheckoutPrimaryInfo({ showLeftAlignedDollarValueWithLabel, usdAmount, config, isLoading, displayAmounts, inputFiatAmount, }: CheckoutPrimaryInfoProps): React.JSX.Element;
|
|
16
15
|
export {};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type CheckoutAmountLimitsUsd } from '@funkit/connect-core';
|
|
2
|
+
import type { PaymentMethod } from '../../../domains/paymentMethods';
|
|
2
3
|
import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
|
|
3
|
-
export
|
|
4
|
-
minUsd: number | undefined;
|
|
5
|
-
maxUsd: number;
|
|
6
|
-
}
|
|
4
|
+
export type { CheckoutAmountLimitsUsd };
|
|
7
5
|
/**
|
|
8
6
|
* Resolves the min/max USD bounds for the amount input based on the active
|
|
9
|
-
* payment method
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* max-checkout dynamic config.
|
|
7
|
+
* payment method. Fetches the inputs (min-transfer floor, brokerage limits,
|
|
8
|
+
* global max) and delegates the per-method rules to
|
|
9
|
+
* `getCheckoutAmountLimitsUsd` in `@funkit/connect-core`.
|
|
13
10
|
*/
|
|
14
11
|
export declare const useCheckoutAmountLimits: ({ checkoutConfig, paymentMethod, }: {
|
|
15
12
|
checkoutConfig: FunkitCheckoutConfig;
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import { type Address, type Hex } from 'viem';
|
|
9
9
|
import { type CheckoutConfirmationError } from '../../domains/checkoutErrors';
|
|
10
10
|
import type { CustomWithdrawalConfig, LighterRouteType, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
11
|
-
import type { LighterShare } from '../../utils/customer';
|
|
11
|
+
import type { LighterAsset, LighterPoolInfo, LighterShare } from '../../utils/customer';
|
|
12
12
|
import type { SourceTokenOption } from './WithdrawAmountInput';
|
|
13
13
|
/** Stable method ids for the Fast / Secure options (used for tracking + switching). */
|
|
14
14
|
export declare const LIGHTER_FAST_METHOD_ID = "lighter-fast";
|
|
@@ -66,28 +66,45 @@ export declare function freeBalance(balance: string, lockedBalance: string): str
|
|
|
66
66
|
* withdrawal amount before quoting — for users who aren't sufficiently staked
|
|
67
67
|
* in Lighter's staking pool. Sufficiently-staked users pay nothing.
|
|
68
68
|
*
|
|
69
|
-
* "Sufficiently staked" = the
|
|
70
|
-
*
|
|
71
|
-
* hardcoded here (previously read from
|
|
72
|
-
* it's currently the only public pool
|
|
73
|
-
* Non-stakers report `shares: []`.
|
|
69
|
+
* "Sufficiently staked" = the *current* LIT value of the user's staking-pool
|
|
70
|
+
* share is at or above the threshold. The pool is LIT-denominated and
|
|
71
|
+
* identified by its index, hardcoded here (previously read from
|
|
72
|
+
* `systemConfig.staking_pool_index`) since it's currently the only public pool
|
|
73
|
+
* a withdrawing user holds a share in. Non-stakers report `shares: []`.
|
|
74
74
|
*/
|
|
75
75
|
export declare const LIGHTER_STAKING_POOL_INDEX = 281474976624800;
|
|
76
76
|
export declare const LIGHTER_UNSTAKED_FEE_TOKENS = 3;
|
|
77
|
-
export declare const
|
|
77
|
+
export declare const LIGHTER_STAKING_THRESHOLD_LIT = 100;
|
|
78
|
+
/**
|
|
79
|
+
* LIT per share unit for the staking pool: its LIT balance over total shares.
|
|
80
|
+
*
|
|
81
|
+
* `undefined` when the pool account is unavailable or reports no shares — the
|
|
82
|
+
* fee gate then degrades to the entry principal rather than guessing.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveLighterSharePrice(poolAccount: {
|
|
85
|
+
assets?: LighterAsset[];
|
|
86
|
+
pool_info?: LighterPoolInfo;
|
|
87
|
+
} | undefined): number | undefined;
|
|
78
88
|
/**
|
|
79
89
|
* Resolves the Lighter Fast unstaked fee (in source tokens, i.e. USDC) for a
|
|
80
|
-
* user.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
90
|
+
* user. A non-staker (`shares: []`, or no staking-pool share) pays the fee.
|
|
91
|
+
*
|
|
92
|
+
* Gated on the share's *current* LIT value (`shares_amount × sharePrice` — the
|
|
93
|
+
* "Your Stake" figure in Lighter's UI), not `principal_amount`, which is the
|
|
94
|
+
* entry deposit and never grows with accrued yield. Gating on the principal
|
|
95
|
+
* charged stakers whose position had appreciated past the minimum from below.
|
|
96
|
+
*
|
|
97
|
+
* Falls back to the principal when `sharePrice` is unavailable — never worse
|
|
98
|
+
* than the previous behaviour, and avoids waiving the fee for everyone when
|
|
99
|
+
* the pool account fails to load.
|
|
83
100
|
*/
|
|
84
|
-
export declare function resolveLighterUnstakedFeeTokens(shares: LighterShare[]): number;
|
|
101
|
+
export declare function resolveLighterUnstakedFeeTokens(shares: LighterShare[], sharePrice?: number): number;
|
|
85
102
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
103
|
+
* Share price for the staking pool, read off the pool's own account. Kept a
|
|
104
|
+
* separate query from the user's account: a user's `shares[]` carries entry
|
|
105
|
+
* state only, so current value is unobtainable without the pool's NAV.
|
|
89
106
|
*/
|
|
90
|
-
export declare function
|
|
107
|
+
export declare function useLighterStakingSharePrice(enabled: boolean): number | undefined;
|
|
91
108
|
/**
|
|
92
109
|
* Fetches all asset balances for a Lighter account. Returns:
|
|
93
110
|
*
|
|
@@ -98,7 +115,7 @@ export declare function useLighterWithdrawalBalances({ accountIndex, }: {
|
|
|
98
115
|
accountIndex: LighterAccountIndex | undefined;
|
|
99
116
|
}): {
|
|
100
117
|
balances: Record<string, string>;
|
|
101
|
-
assets:
|
|
118
|
+
assets: LighterAsset[];
|
|
102
119
|
shares: LighterShare[];
|
|
103
120
|
isLoading: boolean;
|
|
104
121
|
};
|
|
@@ -139,7 +156,7 @@ export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, set
|
|
|
139
156
|
isUnifiedTradingMode: boolean;
|
|
140
157
|
connectedAddress: `0x${string}` | undefined;
|
|
141
158
|
lighterBalances: Record<string, string>;
|
|
142
|
-
lighterAssets:
|
|
159
|
+
lighterAssets: LighterAsset[];
|
|
143
160
|
lighterFastUnstakedFee: number;
|
|
144
161
|
invalidateLighterAccount: () => void;
|
|
145
162
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { TFunction } from 'i18next';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import type { Hex } from 'viem';
|
|
4
3
|
import { type ModalBottomBarIdType } from '../../components/Dialog/Dialog';
|
|
5
|
-
import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem,
|
|
4
|
+
import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
6
5
|
import { type WithdrawalFormData } from './useWithdrawal';
|
|
7
6
|
/**
|
|
8
7
|
* WithdrawalContent only operates on concrete single-method withdrawal configs.
|
|
@@ -32,64 +31,5 @@ interface WithdrawContentProps {
|
|
|
32
31
|
*/
|
|
33
32
|
disableSubmit?: boolean;
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Converts a source-token amount string to its USD value using the given unit
|
|
37
|
-
* price. Returns `undefined` when the price is not yet loaded so callers can
|
|
38
|
-
* differentiate "still loading" from "actually $0".
|
|
39
|
-
*
|
|
40
|
-
* Exported for testing.
|
|
41
|
-
*/
|
|
42
|
-
export declare function toUsdValue(sourceAmount: string, sourceTokenUsdPrice: number | undefined): number | undefined;
|
|
43
|
-
export declare function getWithdrawButtonText({ isWithdrawing, isValidAddress, isRecipientBlacklisted, isRecipientSameAsSource, withdrawalInputAmount, isWithdrawAmountValid, isWithdrawAmountTooHigh, isValidAddressAndChain, selectedToken, selectedChainId, selectedChainName, t, }: {
|
|
44
|
-
isWithdrawing: boolean;
|
|
45
|
-
isValidAddress: boolean;
|
|
46
|
-
isRecipientBlacklisted: boolean;
|
|
47
|
-
isRecipientSameAsSource: boolean;
|
|
48
|
-
withdrawalInputAmount: string;
|
|
49
|
-
isWithdrawAmountValid: boolean;
|
|
50
|
-
isWithdrawAmountTooHigh: boolean;
|
|
51
|
-
isValidAddressAndChain: boolean;
|
|
52
|
-
selectedToken: string | undefined;
|
|
53
|
-
selectedChainId: number | undefined;
|
|
54
|
-
selectedChainName: string | undefined;
|
|
55
|
-
t: TFunction;
|
|
56
|
-
}): string;
|
|
57
|
-
export declare function isValidWithdrawal({ config, checkoutConfig, withdrawalInputAmount, sourceTokenUsdPrice, recipientAddress, selectedChainId, sourceTokenBalance, selectedSourceToken, }: {
|
|
58
|
-
config: FunkitWithdrawalConfig;
|
|
59
|
-
checkoutConfig: FunkitCheckoutConfig | undefined;
|
|
60
|
-
/** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
|
|
61
|
-
withdrawalInputAmount: string;
|
|
62
|
-
/**
|
|
63
|
-
* USD price per unit of the source token. Hardcoded to 1 for stablecoin
|
|
64
|
-
* sources; only Lighter Secure resolves a live spot price, and that path
|
|
65
|
-
* uses `getMinWithdrawalAmount` (per-token) which takes priority over the
|
|
66
|
-
* USD-min branch — so this field is only meaningfully consumed when it's 1.
|
|
67
|
-
*/
|
|
68
|
-
sourceTokenUsdPrice: number;
|
|
69
|
-
sourceTokenBalance: string;
|
|
70
|
-
recipientAddress: string;
|
|
71
|
-
selectedChainId: number | undefined;
|
|
72
|
-
selectedSourceToken: string | undefined;
|
|
73
|
-
}): {
|
|
74
|
-
isValidAddress: boolean;
|
|
75
|
-
isValidAddressAndChain: boolean;
|
|
76
|
-
isWithdrawAmountTooLow: boolean;
|
|
77
|
-
isWithdrawAmountTooHigh: boolean;
|
|
78
|
-
isWithdrawAmountAboveBalance: boolean;
|
|
79
|
-
isWithdrawAmountValid: boolean;
|
|
80
|
-
minWithdrawalDisplayValue: number;
|
|
81
|
-
};
|
|
82
|
-
export declare const useFrozenSourceTokenBalance: ({ isWithdrawing, sourceTokenBalance, }: {
|
|
83
|
-
isWithdrawing: boolean;
|
|
84
|
-
sourceTokenBalance: string;
|
|
85
|
-
}) => {
|
|
86
|
-
displayedSourceTokenBalance: string;
|
|
87
|
-
freezeDisplayedSourceTokenBalance(sourceTokenBalance: string): void;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Builds the source-token options list for the Lighter compound input dropdown.
|
|
91
|
-
* Currently returns a single option per config; expands when Lighter exposes
|
|
92
|
-
* multi-asset API support.
|
|
93
|
-
*/
|
|
94
34
|
export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, onSwitchToSecure, bottomBarId, disableSubmit, }: WithdrawContentProps) => React.JSX.Element;
|
|
95
35
|
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
|
|
3
|
+
import type { CustomWithdrawalConfig, FunkitCheckoutConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
|
+
type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
|
|
5
|
+
export declare function getWithdrawButtonText({ isWithdrawing, isValidAddress, isRecipientBlacklisted, isRecipientSameAsSource, withdrawalInputAmount, isWithdrawAmountValid, isWithdrawAmountTooHigh, isValidAddressAndChain, selectedToken, selectedChainId, selectedChainName, t, }: {
|
|
6
|
+
isWithdrawing: boolean;
|
|
7
|
+
isValidAddress: boolean;
|
|
8
|
+
isRecipientBlacklisted: boolean;
|
|
9
|
+
isRecipientSameAsSource: boolean;
|
|
10
|
+
withdrawalInputAmount: string;
|
|
11
|
+
isWithdrawAmountValid: boolean;
|
|
12
|
+
isWithdrawAmountTooHigh: boolean;
|
|
13
|
+
isValidAddressAndChain: boolean;
|
|
14
|
+
selectedToken: string | undefined;
|
|
15
|
+
selectedChainId: number | undefined;
|
|
16
|
+
selectedChainName: string | undefined;
|
|
17
|
+
t: TFunction;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function isValidWithdrawal({ config, checkoutConfig, withdrawalInputAmount, sourceTokenUsdPrice, recipientAddress, selectedChainId, sourceTokenBalance, selectedSourceToken, }: {
|
|
20
|
+
config: FunkitWithdrawalConfig;
|
|
21
|
+
checkoutConfig: FunkitCheckoutConfig | undefined;
|
|
22
|
+
/** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
|
|
23
|
+
withdrawalInputAmount: string;
|
|
24
|
+
/**
|
|
25
|
+
* USD price per unit of the source token. Hardcoded to 1 for stablecoin
|
|
26
|
+
* sources; only Lighter Secure resolves a live spot price, and that path
|
|
27
|
+
* uses `getMinWithdrawalAmount` (per-token) which takes priority over the
|
|
28
|
+
* USD-min branch — so this field is only meaningfully consumed when it's 1.
|
|
29
|
+
*/
|
|
30
|
+
sourceTokenUsdPrice: number;
|
|
31
|
+
sourceTokenBalance: string;
|
|
32
|
+
recipientAddress: string;
|
|
33
|
+
selectedChainId: number | undefined;
|
|
34
|
+
selectedSourceToken: string | undefined;
|
|
35
|
+
}): {
|
|
36
|
+
isWithdrawAmountTooLow: boolean;
|
|
37
|
+
isWithdrawAmountTooHigh: boolean;
|
|
38
|
+
isWithdrawAmountAboveBalance: boolean;
|
|
39
|
+
isWithdrawAmountValid: boolean;
|
|
40
|
+
minWithdrawalDisplayValue: number;
|
|
41
|
+
isValidAddress: boolean;
|
|
42
|
+
isValidAddressAndChain: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Converts a source-token amount string to its USD value using the given unit
|
|
46
|
+
* price. Returns `undefined` when the price is not yet loaded so callers can
|
|
47
|
+
* differentiate "still loading" from "actually $0".
|
|
48
|
+
*
|
|
49
|
+
* Exported for testing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function toUsdValue(sourceAmount: string, sourceTokenUsdPrice: number | undefined): number | undefined;
|
|
52
|
+
export declare function getRelayOutputCurrencyAmount(quote: FunkitCheckoutQuoteResult, fallback: number | undefined): number;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CustomWithdrawalConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
2
|
+
type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
|
|
3
|
+
export declare function useWithdrawalAssets(config: FunkitWithdrawalConfig): {
|
|
4
|
+
assets: import("../CheckoutModal/TransferToken/TransferToken").TokenTransferSourceChainsAndAssets;
|
|
5
|
+
selectedChainId: number | undefined;
|
|
6
|
+
handleChainChange: (chainId?: number, autoUpdate?: boolean) => void;
|
|
7
|
+
selectedToken: string | undefined;
|
|
8
|
+
selectedChainName: string | undefined;
|
|
9
|
+
handleTokenChange: (token: string, chainId?: number, autoUpdate?: boolean) => void;
|
|
10
|
+
chainIdSortOrder: number[];
|
|
11
|
+
popularTokenSymbols: string[];
|
|
12
|
+
priorityTokenSymbols: string[];
|
|
13
|
+
isLoadingAssets: boolean;
|
|
14
|
+
addressBySymbolByChainId: Record<number, Record<string, string>>;
|
|
15
|
+
};
|
|
16
|
+
export declare const useFrozenSourceTokenBalance: ({ isWithdrawing, sourceTokenBalance, }: {
|
|
17
|
+
isWithdrawing: boolean;
|
|
18
|
+
sourceTokenBalance: string;
|
|
19
|
+
}) => {
|
|
20
|
+
displayedSourceTokenBalance: string;
|
|
21
|
+
freezeDisplayedSourceTokenBalance(sourceTokenBalance: string): void;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The withdrawal form's warning logs. Effect bodies and dependency arrays are
|
|
25
|
+
* unchanged from WithdrawalContent; the refs that dedupe them move along too.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useWithdrawalLogging({ targetAssetFetchError, quoteErrorObject, isRisky, isRecipientBlacklisted, selectedChainId, selectedToken, recipientAddress, debouncedInputAmount, debouncedInputAmountUsd, }: {
|
|
28
|
+
targetAssetFetchError: unknown;
|
|
29
|
+
quoteErrorObject: unknown;
|
|
30
|
+
isRisky: boolean | undefined;
|
|
31
|
+
isRecipientBlacklisted: boolean;
|
|
32
|
+
selectedChainId: number | undefined;
|
|
33
|
+
selectedToken: string | undefined;
|
|
34
|
+
recipientAddress: string;
|
|
35
|
+
debouncedInputAmount: string;
|
|
36
|
+
debouncedInputAmountUsd: number | undefined;
|
|
37
|
+
}): void;
|
|
38
|
+
export {};
|
|
@@ -126,7 +126,7 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
126
126
|
* - "chainDependent": show price impact and additionally show gas as well for eth-mainnet
|
|
127
127
|
*/
|
|
128
128
|
showTransactionDigest?: 'none' | 'chainDependent';
|
|
129
|
-
/**
|
|
129
|
+
/** @deprecated The token amount below the USD equivalent has been removed. This field is ignored. */
|
|
130
130
|
showTokenAmount?: boolean;
|
|
131
131
|
/** Instead of showing the dollar value centered, show it left-aligned with "Deposit" label - defaults to false */
|
|
132
132
|
showLeftAlignedDollarValueWithLabel?: boolean;
|
|
@@ -247,7 +247,7 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
247
247
|
*/
|
|
248
248
|
type RequiredExceptCustomComponents<T> = Required<Omit<T & {}, `${string}Component`>>;
|
|
249
249
|
export type FunkitUiCustomizationsConfigInternal = Required<FunkitUiCustomizationsConfig> & {
|
|
250
|
-
confirmationScreen: FunkitUiCustomizationsConfig['confirmationScreen'] & Required<Omit<FunkitUiCustomizationsConfig['confirmationScreen'] & {}, 'destinationConfig' | 'selectedRouteConfig'>>;
|
|
250
|
+
confirmationScreen: FunkitUiCustomizationsConfig['confirmationScreen'] & Required<Omit<FunkitUiCustomizationsConfig['confirmationScreen'] & {}, 'destinationConfig' | 'selectedRouteConfig' | 'showTokenAmount'>>;
|
|
251
251
|
inputAmountScreen: Required<FunkitUiCustomizationsConfig['inputAmountScreen'] & {}>;
|
|
252
252
|
selectAssetScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['selectAssetScreen']>;
|
|
253
253
|
transferCryptoScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['transferCryptoScreen']>;
|
package/dist/utils/consts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export { MAX_BTC_LIGHTNING_AMOUNT_USD } from '@funkit/connect-core';
|
|
1
2
|
export declare const MIN_CHECKOUT_AMOUNT_USD = 1;
|
|
2
|
-
export declare const MAX_BTC_LIGHTNING_AMOUNT_USD = 10000;
|
|
3
3
|
export declare const LOW_BALANCE = "Low Balance";
|
|
4
4
|
export declare const CONTACT_US_LINK = "https://intercom.help/funxyz/en/articles/10732578-contact-us";
|
|
5
5
|
export declare const DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
|
package/dist/utils/customer.d.ts
CHANGED
|
@@ -52,9 +52,14 @@ export type LighterAsset = {
|
|
|
52
52
|
locked_balance: string;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* A user's stake in a Lighter public pool
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* A user's stake in a Lighter public pool, identified by matching
|
|
56
|
+
* `public_pool_index` against the known pool index.
|
|
57
|
+
*
|
|
58
|
+
* Carries only *entry* state — there is no current-value field:
|
|
59
|
+
* - `principal_amount` — deposited at entry, in the pool's own asset (Lighter's
|
|
60
|
+
* UI shows this as "Your Deposits"). Never grows with accrued yield.
|
|
61
|
+
* - `shares_amount` — pool shares held. Current value ("Your Stake") is this
|
|
62
|
+
* times the pool's share price, so it needs the pool account too.
|
|
58
63
|
*/
|
|
59
64
|
export type LighterShare = {
|
|
60
65
|
public_pool_index: number;
|
|
@@ -63,6 +68,14 @@ export type LighterShare = {
|
|
|
63
68
|
principal_amount: string;
|
|
64
69
|
entry_timestamp: number;
|
|
65
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Public-pool accounting, present only on pool accounts (`account_type: 4`).
|
|
73
|
+
* Share price is `<pool asset balance> / total_shares`.
|
|
74
|
+
*/
|
|
75
|
+
export type LighterPoolInfo = {
|
|
76
|
+
total_shares: number;
|
|
77
|
+
operator_shares: number;
|
|
78
|
+
};
|
|
66
79
|
export type LighterAccount = {
|
|
67
80
|
code: number;
|
|
68
81
|
account_type: number;
|
|
@@ -90,6 +103,8 @@ export type LighterAccount = {
|
|
|
90
103
|
cross_asset_value: string;
|
|
91
104
|
shares: LighterShare[];
|
|
92
105
|
pending_unlocks: unknown[];
|
|
106
|
+
/** Pool accounts only — absent on user accounts. */
|
|
107
|
+
pool_info?: LighterPoolInfo;
|
|
93
108
|
};
|
|
94
109
|
export type LighterAccountResponse = {
|
|
95
110
|
code: number;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { CustomWithdrawalConfig, FunkitWithdrawalConfig, MultiMethodWithdrawalConfig, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext';
|
|
2
|
+
/**
|
|
3
|
+
* Deducts a flat fee (in token units) from a withdrawal input amount, clamped
|
|
4
|
+
* at 0. Uses `dnum` fixed-point math so decimal strings straight off the amount
|
|
5
|
+
* field stay exact.
|
|
6
|
+
*/
|
|
7
|
+
export declare function deductFlatFee(inputAmount: string, feeTokens: number): string;
|
|
2
8
|
/**
|
|
3
9
|
* Evaluates the integrator's `withdrawalSourceTokenBalance` callback to a safe
|
|
4
10
|
* numeric string. Returns `'0'` (with a warn) for missing/empty/NaN/negative
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-IULPZP2Q.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-TKB2OY6G.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bybitWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-OX37G4YT.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bybitWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
coin98Wallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-WAHGI5L7.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
coin98Wallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
frontierWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-AVDUNQUW.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
frontierWallet
|