@funkit/connect 10.1.1 → 10.2.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.
- package/CHANGELOG.md +35 -0
- package/dist/clients/lighter.js +16 -5
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +2 -2
- package/dist/clients/polymarket/index.js +5 -5
- package/dist/index.js +170 -108
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +7 -2
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +15 -0
- package/dist/utils/customer.d.ts +32 -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 +53 -53
- 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 +4 -11
- package/dist/utils/swappedRouteOverride.d.ts +0 -27
- package/dist/clients/{chunk-QR64CUND.js → chunk-ZAXSDMDU.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 10.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4f0f4a0: Consolidate the Swapped withdrawal source-override helper: import `findSwappedSourceOverride` / `SwappedSourceRouteOverride` from `@funkit/connect-core` instead of the web-local `utils/swappedRouteOverride`, which is removed (single source of truth shared with connect-rn).
|
|
8
|
+
- 99ca98d: Fix a concurrent-render livelock that stalled host-app navigation for guest
|
|
9
|
+
(disconnected) users. Two idle-mounted components (`useCheckoutDirectExecution` and
|
|
10
|
+
`ConnectModal`) subscribed to wagmi `account.status`, which flips repeatedly during
|
|
11
|
+
`reconnect()` under `ssr: false` and aborted in-flight React route transitions. Both
|
|
12
|
+
now read account state lazily at call time instead of subscribing.
|
|
13
|
+
- 89e29b3: Tag the Statsig user with `custom.sdkType` (`react-native` / `web`) so a config shared across SDKs can be scoped per-SDK via a per-customer targeting rule.
|
|
14
|
+
- 39d8ddb: Add unit test coverage for withdrawal config type guards, source-token balance guard, and amount-conversion edge cases. Test-only; no runtime change.
|
|
15
|
+
- Updated dependencies [b2abbb5]
|
|
16
|
+
- Updated dependencies [b8a3f1e]
|
|
17
|
+
- Updated dependencies [4f0f4a0]
|
|
18
|
+
- @funkit/connect-core@2.0.0
|
|
19
|
+
|
|
20
|
+
## 10.2.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 4851fe3: Add Lighter Unified Trading account support. When the connected wallet's Lighter main account reports `account_trading_mode: 1` (unified), the deposit flow hides the `USDC (Spot)` destination and shows `USDC (Perps)` as plain `USDC`, and the withdrawal flow does the same for the Fast/Secure source-token dropdowns. Simple-mode accounts (`account_trading_mode: 0`) are unchanged.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 1ee3c30: Export `getWithdrawButtonText` from the withdrawal module so its CTA
|
|
29
|
+
label/disabled-reason precedence ladder can be unit-tested directly. Internal
|
|
30
|
+
helper only — no runtime or public-API behavior change.
|
|
31
|
+
- 1af584f: Lighter Unified Trading accounts: the Fast withdrawal method subtitle now reads "USDC only" instead of "USDC Perps only" (new `withdrawal.fastDisclaimerUnified` key, all 8 locales). Simple-mode accounts are unchanged.
|
|
32
|
+
- 8ae9a55: Move the Statsig fallback generator into connect-core's own prebuild
|
|
33
|
+
- cc2f674: Migrate the on-ramp fops request to the typed FIAT_TO_CRYPTO rail config
|
|
34
|
+
- 81dc85c: Add WithdrawRecipientAddress snapshot coverage (default/use-connected/error/risk/non-EVM). Test-only; no runtime change.
|
|
35
|
+
- Updated dependencies [8ae9a55]
|
|
36
|
+
- @funkit/connect-core@1.7.1
|
|
37
|
+
|
|
3
38
|
## 10.1.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/dist/clients/lighter.js
CHANGED
|
@@ -94,6 +94,10 @@ function isLighterxyzCustomer(apiKey) {
|
|
|
94
94
|
|
|
95
95
|
// src/utils/customer.ts
|
|
96
96
|
var LIGHTER_MAIN_ACCOUNT_TYPE = 0;
|
|
97
|
+
var LIGHTER_TRADING_MODE = {
|
|
98
|
+
SIMPLE: 0,
|
|
99
|
+
UNIFIED: 1
|
|
100
|
+
};
|
|
97
101
|
async function getLighterAccountsByL1Address(address) {
|
|
98
102
|
const response = await fetch(
|
|
99
103
|
`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${address}`
|
|
@@ -127,6 +131,9 @@ function useLighterAccounts({
|
|
|
127
131
|
return {
|
|
128
132
|
...query,
|
|
129
133
|
mainAccountIndex: mainAccount?.index?.toString(),
|
|
134
|
+
// False until the accounts load — consumers fall back to the simple-mode
|
|
135
|
+
// UI (both USDC variants shown) while the trading mode is unknown.
|
|
136
|
+
isUnifiedTradingMode: mainAccount?.account_trading_mode === LIGHTER_TRADING_MODE.UNIFIED,
|
|
130
137
|
subAccounts
|
|
131
138
|
};
|
|
132
139
|
}
|
|
@@ -575,7 +582,8 @@ function buildLighterMultiMethodConfig({
|
|
|
575
582
|
config,
|
|
576
583
|
accountIndex,
|
|
577
584
|
t,
|
|
578
|
-
secureDelayText
|
|
585
|
+
secureDelayText,
|
|
586
|
+
isUnifiedTradingMode
|
|
579
587
|
}) {
|
|
580
588
|
const fastConfig = buildLighterFastWalletWithdrawalConfig({
|
|
581
589
|
signerClient: config.signerClient,
|
|
@@ -603,7 +611,9 @@ function buildLighterMultiMethodConfig({
|
|
|
603
611
|
const fast = {
|
|
604
612
|
id: LIGHTER_FAST_METHOD_ID,
|
|
605
613
|
keyText: t("withdrawal.methodFast"),
|
|
606
|
-
subtitleText: t(
|
|
614
|
+
subtitleText: t(
|
|
615
|
+
isUnifiedTradingMode ? "withdrawal.fastDisclaimerUnified" : "withdrawal.fastDisclaimer"
|
|
616
|
+
),
|
|
607
617
|
icon: /* @__PURE__ */ React3.createElement(EvmWallet, { size: 20 }),
|
|
608
618
|
valueIcon: /* @__PURE__ */ React3.createElement(ChainIconStack, { chainIds: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
|
|
609
619
|
config: fastConfig
|
|
@@ -629,7 +639,7 @@ function buildLighterMultiMethodConfig({
|
|
|
629
639
|
}
|
|
630
640
|
function useLighterWithdrawalConfig(config) {
|
|
631
641
|
const { t } = useFunkitTranslation();
|
|
632
|
-
const { mainAccountIndex } = useLighterAccounts({
|
|
642
|
+
const { mainAccountIndex, isUnifiedTradingMode } = useLighterAccounts({
|
|
633
643
|
address: config?.l1Address
|
|
634
644
|
});
|
|
635
645
|
const accountIndex = mainAccountIndex && /^\d+$/.test(mainAccountIndex) ? mainAccountIndex : void 0;
|
|
@@ -642,9 +652,10 @@ function useLighterWithdrawalConfig(config) {
|
|
|
642
652
|
config,
|
|
643
653
|
accountIndex,
|
|
644
654
|
t,
|
|
645
|
-
secureDelayText
|
|
655
|
+
secureDelayText,
|
|
656
|
+
isUnifiedTradingMode
|
|
646
657
|
});
|
|
647
|
-
}, [config, accountIndex, t, secureDelayText]);
|
|
658
|
+
}, [config, accountIndex, t, secureDelayText, isUnifiedTradingMode]);
|
|
648
659
|
}
|
|
649
660
|
export {
|
|
650
661
|
LIGHTER_DEFAULT_SECURE_MIN_WITHDRAWAL_AMOUNTS,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PolymarketDepositAccountDropdown
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-YFHTV7DT.js";
|
|
4
|
+
} from "../chunk-ZAXSDMDU.js";
|
|
6
5
|
import "../chunk-E3USJY7A.js";
|
|
7
6
|
import "../chunk-LUHEVXPD.js";
|
|
8
7
|
import "../chunk-UPZNKPYU.js";
|
|
9
8
|
import "../chunk-STLOQEN7.js";
|
|
9
|
+
import "../chunk-YFHTV7DT.js";
|
|
10
10
|
import "../chunk-6PIIYPQK.js";
|
|
11
11
|
import "../chunk-AHYOV7AV.js";
|
|
12
12
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PolymarketDepositAccountDropdown
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZAXSDMDU.js";
|
|
5
|
+
import "../chunk-E3USJY7A.js";
|
|
6
|
+
import "../chunk-LUHEVXPD.js";
|
|
7
|
+
import "../chunk-UPZNKPYU.js";
|
|
8
|
+
import "../chunk-STLOQEN7.js";
|
|
5
9
|
import {
|
|
6
10
|
POLYMARKET_PERPS_ROUTING_ID,
|
|
7
11
|
POLYMARKET_PREDICTIONS_ROUTING_ID,
|
|
8
12
|
createPolymarketDepositConfig,
|
|
9
13
|
createPredictionsGenerateActionParams
|
|
10
14
|
} from "../chunk-YFHTV7DT.js";
|
|
11
|
-
import "../chunk-E3USJY7A.js";
|
|
12
|
-
import "../chunk-LUHEVXPD.js";
|
|
13
|
-
import "../chunk-UPZNKPYU.js";
|
|
14
|
-
import "../chunk-STLOQEN7.js";
|
|
15
15
|
import {
|
|
16
16
|
AMOUNT_PLACEHOLDER,
|
|
17
17
|
COLLATERAL_ONRAMP_ABI,
|