@funkit/connect 10.1.1 → 10.2.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 +18 -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 +100 -39
- 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/index.js +33 -33
- package/package.json +3 -10
- package/dist/clients/{chunk-QR64CUND.js → chunk-ZAXSDMDU.js} +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 10.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 1ee3c30: Export `getWithdrawButtonText` from the withdrawal module so its CTA
|
|
12
|
+
label/disabled-reason precedence ladder can be unit-tested directly. Internal
|
|
13
|
+
helper only — no runtime or public-API behavior change.
|
|
14
|
+
- 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.
|
|
15
|
+
- 8ae9a55: Move the Statsig fallback generator into connect-core's own prebuild
|
|
16
|
+
- cc2f674: Migrate the on-ramp fops request to the typed FIAT_TO_CRYPTO rail config
|
|
17
|
+
- 81dc85c: Add WithdrawRecipientAddress snapshot coverage (default/use-connected/error/risk/non-EVM). Test-only; no runtime change.
|
|
18
|
+
- Updated dependencies [8ae9a55]
|
|
19
|
+
- @funkit/connect-core@1.7.1
|
|
20
|
+
|
|
3
21
|
## 10.1.1
|
|
4
22
|
|
|
5
23
|
### 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,
|
package/dist/index.js
CHANGED
|
@@ -1687,7 +1687,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
1687
1687
|
localStorage.setItem(storageKey, version);
|
|
1688
1688
|
}
|
|
1689
1689
|
function getCurrentSdkVersion() {
|
|
1690
|
-
return "10.
|
|
1690
|
+
return "10.2.0";
|
|
1691
1691
|
}
|
|
1692
1692
|
function useFingerprint() {
|
|
1693
1693
|
const fingerprint = useCallback3(() => {
|
|
@@ -2035,6 +2035,30 @@ function useFunkitConfig() {
|
|
|
2035
2035
|
|
|
2036
2036
|
// src/utils/customer.ts
|
|
2037
2037
|
var LIGHTER_MAIN_ACCOUNT_TYPE = 0;
|
|
2038
|
+
var LIGHTER_TRADING_MODE = {
|
|
2039
|
+
SIMPLE: 0,
|
|
2040
|
+
UNIFIED: 1
|
|
2041
|
+
};
|
|
2042
|
+
var LIGHTER_USDC_SPOT_ROUTING_IDS = /* @__PURE__ */ new Set([
|
|
2043
|
+
"LIGHTER_USDC_SPOT",
|
|
2044
|
+
"LIGHTER_USDC_SPOT_NEW_USER"
|
|
2045
|
+
]);
|
|
2046
|
+
var LIGHTER_USDC_SPOT_CANDIDATE_SYMBOL = "USDC (SPOT)";
|
|
2047
|
+
function stripLighterPerpsSuffix(symbol) {
|
|
2048
|
+
return symbol?.replace(/\s*\(perps\)\s*$/i, "");
|
|
2049
|
+
}
|
|
2050
|
+
function isLighterUsdcSpotCandidate(candidate) {
|
|
2051
|
+
if (candidate.dynamicRoutingId) {
|
|
2052
|
+
return LIGHTER_USDC_SPOT_ROUTING_IDS.has(candidate.dynamicRoutingId);
|
|
2053
|
+
}
|
|
2054
|
+
return candidate.tokenSymbol.toUpperCase() === LIGHTER_USDC_SPOT_CANDIDATE_SYMBOL;
|
|
2055
|
+
}
|
|
2056
|
+
function adaptLighterTargetAssetsForUnifiedAccount(candidates) {
|
|
2057
|
+
return candidates.filter((candidate) => !isLighterUsdcSpotCandidate(candidate)).map((candidate) => ({
|
|
2058
|
+
...candidate,
|
|
2059
|
+
tokenSymbol: stripLighterPerpsSuffix(candidate.tokenSymbol)
|
|
2060
|
+
}));
|
|
2061
|
+
}
|
|
2038
2062
|
async function getLighterAccountsByL1Address(address) {
|
|
2039
2063
|
const response = await fetch(
|
|
2040
2064
|
`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${address}`
|
|
@@ -2107,6 +2131,9 @@ function useLighterAccounts({
|
|
|
2107
2131
|
return {
|
|
2108
2132
|
...query,
|
|
2109
2133
|
mainAccountIndex: mainAccount?.index?.toString(),
|
|
2134
|
+
// False until the accounts load — consumers fall back to the simple-mode
|
|
2135
|
+
// UI (both USDC variants shown) while the trading mode is unknown.
|
|
2136
|
+
isUnifiedTradingMode: mainAccount?.account_trading_mode === LIGHTER_TRADING_MODE.UNIFIED,
|
|
2110
2137
|
subAccounts
|
|
2111
2138
|
};
|
|
2112
2139
|
}
|
|
@@ -2124,6 +2151,7 @@ import { useEffect as useEffect9, useState as useState9 } from "react";
|
|
|
2124
2151
|
// src/hooks/queries/useFops.ts
|
|
2125
2152
|
import {
|
|
2126
2153
|
FormOfPaymentType as FormOfPaymentType2,
|
|
2154
|
+
RailConfigType,
|
|
2127
2155
|
getFops
|
|
2128
2156
|
} from "@funkit/api-base";
|
|
2129
2157
|
import { solanaChain as solanaChain2 } from "@funkit/chains";
|
|
@@ -4451,7 +4479,8 @@ var useFops = () => {
|
|
|
4451
4479
|
transferInit
|
|
4452
4480
|
);
|
|
4453
4481
|
const isValidRecipientAddress = !!recipientAddress && isAddressCompatibleWithChain(recipientAddress, Number(targetChain));
|
|
4454
|
-
const
|
|
4482
|
+
const countryCode = userIpInfo?.alpha2;
|
|
4483
|
+
const isEnabled = isSwappedEnabled && !comingSoon && !!apiKey && !!targetAsset && !!targetChain && !isSwappedCurrencyCodeLoading && isValidRecipientAddress && !!transferInit && !!countryCode;
|
|
4455
4484
|
const query = useQuery9({
|
|
4456
4485
|
// `prefillFiatEmail` is intentionally NOT in the queryKey: it's read inside
|
|
4457
4486
|
// `queryFn` and captured at fetch time, so post-mount changes don't trigger a refetch
|
|
@@ -4463,7 +4492,7 @@ var useFops = () => {
|
|
|
4463
4492
|
targetAsset,
|
|
4464
4493
|
targetChain,
|
|
4465
4494
|
swappedCurrencyCode,
|
|
4466
|
-
|
|
4495
|
+
countryCode,
|
|
4467
4496
|
apiKey,
|
|
4468
4497
|
themeConfig,
|
|
4469
4498
|
fopPriority,
|
|
@@ -4490,22 +4519,31 @@ var useFops = () => {
|
|
|
4490
4519
|
apiKey,
|
|
4491
4520
|
logger,
|
|
4492
4521
|
params: {
|
|
4522
|
+
// recipientAddress and destinationToken are required by the backend's
|
|
4523
|
+
// Zod schema but ignored when railConfigs is present — the
|
|
4524
|
+
// FIAT_TO_CRYPTO handler reads railConfigs[].recipientTargets.
|
|
4493
4525
|
recipientAddress,
|
|
4494
4526
|
userId,
|
|
4495
4527
|
destinationToken,
|
|
4496
4528
|
fiatCurrencyCode: swappedCurrencyCode,
|
|
4497
|
-
countryCode
|
|
4498
|
-
|
|
4499
|
-
{ recipientAddress, destinationToken },
|
|
4529
|
+
countryCode,
|
|
4530
|
+
railConfigs: [
|
|
4500
4531
|
{
|
|
4501
|
-
|
|
4502
|
-
|
|
4532
|
+
type: RailConfigType.FIAT_TO_CRYPTO,
|
|
4533
|
+
userId,
|
|
4534
|
+
countryCode,
|
|
4535
|
+
fiatCurrencyCode: swappedCurrencyCode,
|
|
4536
|
+
recipientTargets: [
|
|
4537
|
+
{ recipientAddress, destinationToken },
|
|
4538
|
+
{
|
|
4539
|
+
recipientAddress: transferInit.solanaAddr,
|
|
4540
|
+
destinationToken: secondaryDestinationToken
|
|
4541
|
+
}
|
|
4542
|
+
],
|
|
4543
|
+
thirdPartyPaymentConfigs,
|
|
4544
|
+
checkoutLimitsCriteria: { defaultMinAmount: defaultMinAmountEur }
|
|
4503
4545
|
}
|
|
4504
|
-
]
|
|
4505
|
-
thirdPartyPaymentConfigs,
|
|
4506
|
-
checkoutLimitsCriteria: {
|
|
4507
|
-
defaultMinAmount: defaultMinAmountEur
|
|
4508
|
-
}
|
|
4546
|
+
]
|
|
4509
4547
|
}
|
|
4510
4548
|
});
|
|
4511
4549
|
const validFopsData = validateFops(response, "useFops");
|
|
@@ -9842,6 +9880,7 @@ var en_default = {
|
|
|
9842
9880
|
methodFast: "Fast",
|
|
9843
9881
|
methodSecure: "Native Bridge",
|
|
9844
9882
|
fastDisclaimer: "USDC Perps only \xB7 Multiple chains \xB7 Instant",
|
|
9883
|
+
fastDisclaimerUnified: "USDC only \xB7 Multiple chains \xB7 Instant",
|
|
9845
9884
|
secureDisclaimer: "All tokens \xB7 Ethereum chain only \xB7 {{delay}}",
|
|
9846
9885
|
secureFallbackDelay: "60+ minutes",
|
|
9847
9886
|
lighterSecureAddressTooltip: "You can only withdraw to your connected wallet",
|
|
@@ -10448,6 +10487,7 @@ var es_default = {
|
|
|
10448
10487
|
methodFast: "R\xE1pido",
|
|
10449
10488
|
methodSecure: "Puente Nativo",
|
|
10450
10489
|
fastDisclaimer: "Solo USDC Perps \xB7 M\xFAltiples cadenas \xB7 Instant\xE1neo",
|
|
10490
|
+
fastDisclaimerUnified: "Solo USDC \xB7 M\xFAltiples cadenas \xB7 Instant\xE1neo",
|
|
10451
10491
|
secureDisclaimer: "Todos los tokens \xB7 Solo cadena Ethereum \xB7 {{delay}}",
|
|
10452
10492
|
secureFallbackDelay: "60+ minutos",
|
|
10453
10493
|
lighterSecureAddressTooltip: "Solo puedes retirar a tu billetera conectada",
|
|
@@ -11051,6 +11091,7 @@ var fr_default = {
|
|
|
11051
11091
|
methodFast: "Rapide",
|
|
11052
11092
|
methodSecure: "Pont natif",
|
|
11053
11093
|
fastDisclaimer: "USDC Perps uniquement \xB7 Plusieurs cha\xEEnes \xB7 Instantan\xE9",
|
|
11094
|
+
fastDisclaimerUnified: "USDC uniquement \xB7 Plusieurs cha\xEEnes \xB7 Instantan\xE9",
|
|
11054
11095
|
secureDisclaimer: "Tous les tokens \xB7 Cha\xEEne Ethereum uniquement \xB7 {{delay}}",
|
|
11055
11096
|
secureFallbackDelay: "60+ minutes",
|
|
11056
11097
|
lighterSecureAddressTooltip: "Vous ne pouvez retirer que vers votre portefeuille connect\xE9",
|
|
@@ -11654,6 +11695,7 @@ var ja_default = {
|
|
|
11654
11695
|
methodFast: "\u9AD8\u901F",
|
|
11655
11696
|
methodSecure: "\u30CD\u30A4\u30C6\u30A3\u30D6\u30D6\u30EA\u30C3\u30B8",
|
|
11656
11697
|
fastDisclaimer: "USDC\u30D1\u30FC\u30D7\u30B9\u306E\u307F \xB7 \u8907\u6570\u30C1\u30A7\u30FC\u30F3 \xB7 \u5373\u6642",
|
|
11698
|
+
fastDisclaimerUnified: "USDC\u306E\u307F \xB7 \u8907\u6570\u30C1\u30A7\u30FC\u30F3 \xB7 \u5373\u6642",
|
|
11657
11699
|
secureDisclaimer: "\u5168\u30C8\u30FC\u30AF\u30F3 \xB7 \u30A4\u30FC\u30B5\u30EA\u30A2\u30E0\u30C1\u30A7\u30FC\u30F3\u306E\u307F \xB7 {{delay}}",
|
|
11658
11700
|
secureFallbackDelay: "60\u5206\u4EE5\u4E0A",
|
|
11659
11701
|
lighterSecureAddressTooltip: "\u63A5\u7D9A\u4E2D\u306E\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u306E\u307F\u51FA\u91D1\u3067\u304D\u307E\u3059",
|
|
@@ -12257,6 +12299,7 @@ var ko_default = {
|
|
|
12257
12299
|
methodFast: "\uBE60\uB978",
|
|
12258
12300
|
methodSecure: "\uB124\uC774\uD2F0\uBE0C \uBE0C\uB9AC\uC9C0",
|
|
12259
12301
|
fastDisclaimer: "USDC \uD37C\uD504\uC2A4\uB9CC \xB7 \uB2E4\uC911 \uCCB4\uC778 \xB7 \uC989\uC2DC",
|
|
12302
|
+
fastDisclaimerUnified: "USDC\uB9CC \xB7 \uB2E4\uC911 \uCCB4\uC778 \xB7 \uC989\uC2DC",
|
|
12260
12303
|
secureDisclaimer: "\uBAA8\uB4E0 \uD1A0\uD070 \xB7 \uC774\uB354\uB9AC\uC6C0 \uCCB4\uC778\uB9CC \xB7 {{delay}}",
|
|
12261
12304
|
secureFallbackDelay: "60\uBD84 \uC774\uC0C1",
|
|
12262
12305
|
lighterSecureAddressTooltip: "\uC5F0\uACB0\uB41C \uC9C0\uAC11\uC73C\uB85C\uB9CC \uCD9C\uAE08\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4",
|
|
@@ -12860,6 +12903,7 @@ var ru_default = {
|
|
|
12860
12903
|
methodFast: "\u0411\u044B\u0441\u0442\u0440\u044B\u0439",
|
|
12861
12904
|
methodSecure: "\u041D\u0430\u0442\u0438\u0432\u043D\u044B\u0439 \u043C\u043E\u0441\u0442",
|
|
12862
12905
|
fastDisclaimer: "\u0422\u043E\u043B\u044C\u043A\u043E USDC \u0431\u0435\u0441\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \xB7 \u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u0435\u0439 \xB7 \u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E",
|
|
12906
|
+
fastDisclaimerUnified: "\u0422\u043E\u043B\u044C\u043A\u043E USDC \xB7 \u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u0435\u0439 \xB7 \u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E",
|
|
12863
12907
|
secureDisclaimer: "\u0412\u0441\u0435 \u0442\u043E\u043A\u0435\u043D\u044B \xB7 \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u044C Ethereum \xB7 {{delay}}",
|
|
12864
12908
|
secureFallbackDelay: "60+ \u043C\u0438\u043D\u0443\u0442",
|
|
12865
12909
|
lighterSecureAddressTooltip: "\u0412\u044B\u0432\u043E\u0434 \u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u044B\u0439 \u043A\u043E\u0448\u0435\u043B\u0451\u043A",
|
|
@@ -13463,6 +13507,7 @@ var tr_default = {
|
|
|
13463
13507
|
methodFast: "H\u0131zl\u0131",
|
|
13464
13508
|
methodSecure: "Yerel K\xF6pr\xFC",
|
|
13465
13509
|
fastDisclaimer: "Yaln\u0131zca USDC Perps \xB7 Birden fazla zincir \xB7 An\u0131nda",
|
|
13510
|
+
fastDisclaimerUnified: "Yaln\u0131zca USDC \xB7 Birden fazla zincir \xB7 An\u0131nda",
|
|
13466
13511
|
secureDisclaimer: "T\xFCm tokenlar \xB7 Yaln\u0131zca Ethereum zinciri \xB7 {{delay}}",
|
|
13467
13512
|
secureFallbackDelay: "60+ dakika",
|
|
13468
13513
|
lighterSecureAddressTooltip: "Yaln\u0131zca ba\u011Fl\u0131 c\xFCzdan\u0131n\u0131za para \xE7ekebilirsiniz",
|
|
@@ -14066,6 +14111,7 @@ var zh_default = {
|
|
|
14066
14111
|
methodFast: "\u5FEB\u901F",
|
|
14067
14112
|
methodSecure: "\u539F\u751F\u8DE8\u94FE\u6865",
|
|
14068
14113
|
fastDisclaimer: "\u4EC5\u9650USDC\u6C38\u7EED \xB7 \u591A\u94FE \xB7 \u5373\u65F6",
|
|
14114
|
+
fastDisclaimerUnified: "\u4EC5\u9650USDC \xB7 \u591A\u94FE \xB7 \u5373\u65F6",
|
|
14069
14115
|
secureDisclaimer: "\u6240\u6709\u4EE3\u5E01 \xB7 \u4EC5\u4EE5\u592A\u574A\u94FE \xB7 {{delay}}",
|
|
14070
14116
|
secureFallbackDelay: "60\u5206\u949F\u4EE5\u4E0A",
|
|
14071
14117
|
lighterSecureAddressTooltip: "\u60A8\u53EA\u80FD\u63D0\u73B0\u5230\u5DF2\u8FDE\u63A5\u7684\u94B1\u5305",
|
|
@@ -19229,23 +19275,19 @@ function resolveLighterAssetIndex(lighterAssets, selectedSourceToken) {
|
|
|
19229
19275
|
)?.asset_id;
|
|
19230
19276
|
return lookupAssetId ?? (selectedSymbol === "USDC" ? LIGHTER_USDC_ASSET_INDEX : void 0);
|
|
19231
19277
|
}
|
|
19232
|
-
function buildLighterSourceTokenOptions(config, lighterAssets) {
|
|
19278
|
+
function buildLighterSourceTokenOptions(config, lighterAssets, isUnifiedTradingMode = false) {
|
|
19233
19279
|
const isLighterFast = config.sourceChainId === RELAY_LIGHTER_CHAIN_ID2;
|
|
19234
|
-
|
|
19235
|
-
return [
|
|
19236
|
-
{
|
|
19237
|
-
symbol: "USDC",
|
|
19238
|
-
label: "USDC (Perps)",
|
|
19239
|
-
iconSrc: getTokenIconUrl("USDC")
|
|
19240
|
-
}
|
|
19241
|
-
];
|
|
19242
|
-
}
|
|
19243
|
-
const usdcPerpsOption = {
|
|
19280
|
+
const usdcOption = {
|
|
19244
19281
|
symbol: "USDC",
|
|
19245
|
-
label: "USDC (Perps)",
|
|
19282
|
+
label: isUnifiedTradingMode ? "USDC" : "USDC (Perps)",
|
|
19246
19283
|
iconSrc: getTokenIconUrl("USDC")
|
|
19247
19284
|
};
|
|
19248
|
-
|
|
19285
|
+
if (isLighterFast) {
|
|
19286
|
+
return [usdcOption];
|
|
19287
|
+
}
|
|
19288
|
+
const spotOptions = lighterAssets.filter(
|
|
19289
|
+
(asset) => !(isUnifiedTradingMode && asset.symbol.toUpperCase() === "USDC")
|
|
19290
|
+
).map((asset) => {
|
|
19249
19291
|
if (asset.symbol.toUpperCase() === "USDC") {
|
|
19250
19292
|
return {
|
|
19251
19293
|
symbol: LIGHTER_USDC_SPOT_SYMBOL,
|
|
@@ -19259,7 +19301,7 @@ function buildLighterSourceTokenOptions(config, lighterAssets) {
|
|
|
19259
19301
|
iconSrc: getTokenIconUrl(asset.symbol)
|
|
19260
19302
|
};
|
|
19261
19303
|
});
|
|
19262
|
-
return [
|
|
19304
|
+
return [usdcOption, ...spotOptions];
|
|
19263
19305
|
}
|
|
19264
19306
|
function useLighterWithdrawal(config, setRecipientAddress) {
|
|
19265
19307
|
const { apiKey } = useFunkitConfig();
|
|
@@ -19271,7 +19313,7 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19271
19313
|
setRecipientAddress(connectedAddress);
|
|
19272
19314
|
}
|
|
19273
19315
|
}, [isLighterSecure, connectedAddress, setRecipientAddress]);
|
|
19274
|
-
const { mainAccountIndex } = useLighterAccounts({
|
|
19316
|
+
const { mainAccountIndex, isUnifiedTradingMode } = useLighterAccounts({
|
|
19275
19317
|
address: connectedAddress
|
|
19276
19318
|
});
|
|
19277
19319
|
const {
|
|
@@ -19305,6 +19347,7 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19305
19347
|
return {
|
|
19306
19348
|
isLighterSecure,
|
|
19307
19349
|
isLighterFast,
|
|
19350
|
+
isUnifiedTradingMode,
|
|
19308
19351
|
connectedAddress,
|
|
19309
19352
|
lighterBalances,
|
|
19310
19353
|
lighterAssets,
|
|
@@ -19312,11 +19355,15 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19312
19355
|
invalidateLighterAccount
|
|
19313
19356
|
};
|
|
19314
19357
|
}
|
|
19315
|
-
function useLighterSourceTokenOptions(config, apiKey, lighterAssets) {
|
|
19358
|
+
function useLighterSourceTokenOptions(config, apiKey, lighterAssets, isUnifiedTradingMode = false) {
|
|
19316
19359
|
if (!isLighterxyzCustomer(apiKey)) {
|
|
19317
19360
|
return void 0;
|
|
19318
19361
|
}
|
|
19319
|
-
return buildLighterSourceTokenOptions(
|
|
19362
|
+
return buildLighterSourceTokenOptions(
|
|
19363
|
+
config,
|
|
19364
|
+
lighterAssets,
|
|
19365
|
+
isUnifiedTradingMode
|
|
19366
|
+
);
|
|
19320
19367
|
}
|
|
19321
19368
|
function LighterSecureLockedField({
|
|
19322
19369
|
tooltip,
|
|
@@ -19703,7 +19750,7 @@ function useCheckoutTimeEstimate(latestQuote, originalTimeEstimationMs, paymentM
|
|
|
19703
19750
|
import { useMemo as useMemo28 } from "react";
|
|
19704
19751
|
|
|
19705
19752
|
// src/hooks/queries/useSwappedExchanges.ts
|
|
19706
|
-
import { RailConfigType, getFops as getFops2 } from "@funkit/api-base";
|
|
19753
|
+
import { RailConfigType as RailConfigType2, getFops as getFops2 } from "@funkit/api-base";
|
|
19707
19754
|
import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain3, tronChain as tronChain2 } from "@funkit/chains";
|
|
19708
19755
|
import { keepPreviousData as keepPreviousData2, useQuery as useQuery14 } from "@tanstack/react-query";
|
|
19709
19756
|
import { useMemo as useMemo27 } from "react";
|
|
@@ -19822,7 +19869,7 @@ var useSwappedExchanges = () => {
|
|
|
19822
19869
|
countryCode,
|
|
19823
19870
|
railConfigs: [
|
|
19824
19871
|
{
|
|
19825
|
-
type:
|
|
19872
|
+
type: RailConfigType2.CRYPTO_TO_CRYPTO,
|
|
19826
19873
|
userId,
|
|
19827
19874
|
countryCode,
|
|
19828
19875
|
baseCurrencyCode: swappedCurrencyCode,
|
|
@@ -25996,6 +26043,7 @@ var WithdrawContent = ({
|
|
|
25996
26043
|
const {
|
|
25997
26044
|
isLighterSecure,
|
|
25998
26045
|
isLighterFast,
|
|
26046
|
+
isUnifiedTradingMode,
|
|
25999
26047
|
connectedAddress,
|
|
26000
26048
|
lighterBalances,
|
|
26001
26049
|
lighterAssets,
|
|
@@ -26091,7 +26139,8 @@ var WithdrawContent = ({
|
|
|
26091
26139
|
const sourceTokenOptions = useLighterSourceTokenOptions(
|
|
26092
26140
|
config,
|
|
26093
26141
|
apiKey,
|
|
26094
|
-
lighterAssets
|
|
26142
|
+
lighterAssets,
|
|
26143
|
+
isUnifiedTradingMode
|
|
26095
26144
|
);
|
|
26096
26145
|
const normalizedSelectedToken = selectedToken?.toUpperCase();
|
|
26097
26146
|
const { checkoutItem } = useCheckoutContext();
|
|
@@ -26548,7 +26597,7 @@ import React139 from "react";
|
|
|
26548
26597
|
import { Trans as Trans9 } from "react-i18next";
|
|
26549
26598
|
|
|
26550
26599
|
// src/hooks/queries/useWithdrawFops.ts
|
|
26551
|
-
import { RailConfigType as
|
|
26600
|
+
import { RailConfigType as RailConfigType3, getFops as getFops3 } from "@funkit/api-base";
|
|
26552
26601
|
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
26553
26602
|
import { useMemo as useMemo40 } from "react";
|
|
26554
26603
|
|
|
@@ -26660,7 +26709,7 @@ var useWithdrawFops = (params) => {
|
|
|
26660
26709
|
countryCode,
|
|
26661
26710
|
railConfigs: [
|
|
26662
26711
|
{
|
|
26663
|
-
type:
|
|
26712
|
+
type: RailConfigType3.CRYPTO_TO_FIAT,
|
|
26664
26713
|
userId,
|
|
26665
26714
|
countryCode,
|
|
26666
26715
|
fiatCurrencyCode: swappedCurrencyCode,
|
|
@@ -40291,7 +40340,7 @@ function AccountSelectAsset({
|
|
|
40291
40340
|
applyDynamicRouting
|
|
40292
40341
|
} = useCheckoutContext();
|
|
40293
40342
|
const { walletAddress } = useGeneralWallet();
|
|
40294
|
-
const { mainAccountIndex } = useLighterAccounts({
|
|
40343
|
+
const { mainAccountIndex, isUnifiedTradingMode } = useLighterAccounts({
|
|
40295
40344
|
address: walletAddress
|
|
40296
40345
|
});
|
|
40297
40346
|
const bottomSectionRef = useBottomSectionRef();
|
|
@@ -40337,7 +40386,9 @@ function AccountSelectAsset({
|
|
|
40337
40386
|
applyDynamicRouting({
|
|
40338
40387
|
targetAsset: dynamicPath.path.targetAsset,
|
|
40339
40388
|
targetChain: dynamicPath.path.targetChain,
|
|
40340
|
-
|
|
40389
|
+
// Lighter Unified accounts have no spot/perps split — the perps route
|
|
40390
|
+
// ticker ("USDC (Perps)") displays as plain "USDC".
|
|
40391
|
+
targetAssetTicker: isUnifiedTradingMode ? stripLighterPerpsSuffix(dynamicPath.path.targetAssetTicker) : dynamicPath.path.targetAssetTicker,
|
|
40341
40392
|
iconSrc: dynamicPath.path.iconSrc,
|
|
40342
40393
|
generateActionsParams: walletAddress ? dynamicPath.path.generateActionsParams?.(walletAddress) : void 0,
|
|
40343
40394
|
customRecipient: dynamicPath.path.getCustomRecipient?.({
|
|
@@ -41175,7 +41226,17 @@ function SourceChange({
|
|
|
41175
41226
|
const paymentListScroll = useScrollDivider();
|
|
41176
41227
|
const { paymentMethodInfo, targetChainId } = modalState;
|
|
41177
41228
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
41178
|
-
const
|
|
41229
|
+
const { walletAddress } = useGeneralWallet();
|
|
41230
|
+
const { isUnifiedTradingMode: isLighterUnifiedAccount } = useLighterAccounts({
|
|
41231
|
+
address: walletAddress
|
|
41232
|
+
});
|
|
41233
|
+
const dynamicTargetAssets = useMemo60(() => {
|
|
41234
|
+
const candidates = checkoutConfig?.dynamicTargetAssetCandidates;
|
|
41235
|
+
if (!candidates || !isLighterUnifiedAccount) {
|
|
41236
|
+
return candidates;
|
|
41237
|
+
}
|
|
41238
|
+
return adaptLighterTargetAssetsForUnifiedAccount(candidates);
|
|
41239
|
+
}, [checkoutConfig?.dynamicTargetAssetCandidates, isLighterUnifiedAccount]);
|
|
41179
41240
|
const isAutoContinue = !isOstiumCustomer(apiKey);
|
|
41180
41241
|
const isLighter = isLighterxyzCustomer(apiKey);
|
|
41181
41242
|
const {
|
|
@@ -41565,7 +41626,7 @@ function SourceChange({
|
|
|
41565
41626
|
chainId: Number(selectedTargetAsset.tokenChainId),
|
|
41566
41627
|
displayedChainId: isLighter ? LIGHTER_CHAIN_ID3 : void 0,
|
|
41567
41628
|
onTokenSelected: handleTargetAssetChange,
|
|
41568
|
-
selectedToken: selectedTargetAsset?.tokenSymbol,
|
|
41629
|
+
selectedToken: isLighterUnifiedAccount ? stripLighterPerpsSuffix(selectedTargetAsset?.tokenSymbol) : selectedTargetAsset?.tokenSymbol,
|
|
41569
41630
|
tokens: dynamicTargetAssets
|
|
41570
41631
|
}
|
|
41571
41632
|
))
|
|
@@ -119,10 +119,14 @@ export declare function resolveLighterAssetIndex(lighterAssets: {
|
|
|
119
119
|
* - Fast path: only USDC (Perps).
|
|
120
120
|
* - Secure path: USDC (Perps) (from total_asset_value) + USDC (Spot) when the
|
|
121
121
|
* account carries a spot USDC asset + every non-USDC asset on the account.
|
|
122
|
+
*
|
|
123
|
+
* Unified Trading accounts (`isUnifiedTradingMode`) have a single USDC balance
|
|
124
|
+
* — no spot/perps split — so the perps entry is labeled plain `USDC` and the
|
|
125
|
+
* `USDC (Spot)` entry is hidden on both paths.
|
|
122
126
|
*/
|
|
123
127
|
export declare function buildLighterSourceTokenOptions(config: FunkitWithdrawalConfig, lighterAssets: {
|
|
124
128
|
symbol: string;
|
|
125
|
-
}[]): SourceTokenOption[];
|
|
129
|
+
}[], isUnifiedTradingMode?: boolean): SourceTokenOption[];
|
|
126
130
|
/**
|
|
127
131
|
* Detects Lighter Secure withdrawal (mainnet source chain), auto-fills the
|
|
128
132
|
* recipient address with the connected wallet, and fetches the Lighter account
|
|
@@ -131,6 +135,7 @@ export declare function buildLighterSourceTokenOptions(config: FunkitWithdrawalC
|
|
|
131
135
|
export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, setRecipientAddress: (addr: string) => void): {
|
|
132
136
|
isLighterSecure: boolean;
|
|
133
137
|
isLighterFast: boolean;
|
|
138
|
+
isUnifiedTradingMode: boolean;
|
|
134
139
|
connectedAddress: `0x${string}` | undefined;
|
|
135
140
|
lighterBalances: Record<string, string>;
|
|
136
141
|
lighterAssets: import("../../utils/customer").LighterAsset[];
|
|
@@ -143,7 +148,7 @@ export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, set
|
|
|
143
148
|
*/
|
|
144
149
|
export declare function useLighterSourceTokenOptions(config: FunkitWithdrawalConfig, apiKey: string, lighterAssets: {
|
|
145
150
|
symbol: string;
|
|
146
|
-
}[]): SourceTokenOption[] | undefined;
|
|
151
|
+
}[], isUnifiedTradingMode?: boolean): SourceTokenOption[] | undefined;
|
|
147
152
|
/**
|
|
148
153
|
* Lighter Secure: recipient address, locked to the connected wallet. A
|
|
149
154
|
* read-only `FunInput` (not a `<div>`) keeps it focusable and announced by
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { Hex } from 'viem';
|
|
3
4
|
import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
@@ -25,6 +26,20 @@ interface WithdrawContentProps {
|
|
|
25
26
|
* Exported for testing.
|
|
26
27
|
*/
|
|
27
28
|
export declare function toUsdValue(sourceAmount: string, sourceTokenUsdPrice: number | undefined): number | undefined;
|
|
29
|
+
export declare function getWithdrawButtonText({ isWithdrawing, isValidAddress, isRecipientBlacklisted, isRecipientSameAsSource, withdrawalInputAmount, isWithdrawAmountValid, isWithdrawAmountTooHigh, isValidAddressAndChain, selectedToken, selectedChainId, selectedChainName, t, }: {
|
|
30
|
+
isWithdrawing: boolean;
|
|
31
|
+
isValidAddress: boolean;
|
|
32
|
+
isRecipientBlacklisted: boolean;
|
|
33
|
+
isRecipientSameAsSource: boolean;
|
|
34
|
+
withdrawalInputAmount: string;
|
|
35
|
+
isWithdrawAmountValid: boolean;
|
|
36
|
+
isWithdrawAmountTooHigh: boolean;
|
|
37
|
+
isValidAddressAndChain: boolean;
|
|
38
|
+
selectedToken: string | undefined;
|
|
39
|
+
selectedChainId: number | undefined;
|
|
40
|
+
selectedChainName: string | undefined;
|
|
41
|
+
t: TFunction;
|
|
42
|
+
}): string;
|
|
28
43
|
export declare function isValidWithdrawal({ config, checkoutConfig, withdrawalInputAmount, sourceTokenUsdPrice, recipientAddress, selectedChainId, sourceTokenBalance, selectedSourceToken, }: {
|
|
29
44
|
config: FunkitWithdrawalConfig;
|
|
30
45
|
checkoutConfig: FunkitCheckoutConfig | undefined;
|
package/dist/utils/customer.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import type { LighterAccountIndex } from '@funkit/api-base';
|
|
2
|
+
import type { DynamicTargetAssetCandidate } from '@funkit/connect-core';
|
|
2
3
|
import type { Address } from 'viem';
|
|
4
|
+
/**
|
|
5
|
+
* Lighter `account_trading_mode` discriminator: `0` = simple (separate spot
|
|
6
|
+
* and perps USDC balances), `1` = Unified Trading account (one USDC balance —
|
|
7
|
+
* no spot/perps split). Unified accounts hide the spot USDC option and label
|
|
8
|
+
* perps USDC as plain `USDC` in both deposit and withdrawal flows.
|
|
9
|
+
*/
|
|
10
|
+
export declare const LIGHTER_TRADING_MODE: {
|
|
11
|
+
readonly SIMPLE: 0;
|
|
12
|
+
readonly UNIFIED: 1;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Strips the ` (Perps)` variant suffix off a Lighter ticker (e.g.
|
|
16
|
+
* `USDC (Perps)` → `USDC`). Non-perps tickers pass through unchanged.
|
|
17
|
+
*/
|
|
18
|
+
export declare function stripLighterPerpsSuffix(symbol: string): string;
|
|
19
|
+
export declare function stripLighterPerpsSuffix(symbol: string | undefined): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Rewrites the deposit target-asset candidates for a Unified Trading account:
|
|
22
|
+
* drops the spot-USDC candidates and relabels `USDC (Perps)` as `USDC`. The
|
|
23
|
+
* underlying routing is unchanged — unified deposits still ride the perps
|
|
24
|
+
* routes (`LIGHTER_USDC_PERPS*`), only the presentation differs.
|
|
25
|
+
*/
|
|
26
|
+
export declare function adaptLighterTargetAssetsForUnifiedAccount(candidates: DynamicTargetAssetCandidate[]): DynamicTargetAssetCandidate[];
|
|
3
27
|
export type LighterSubAccount = {
|
|
4
28
|
code: number;
|
|
5
29
|
account_type: number;
|
|
@@ -12,6 +36,8 @@ export type LighterSubAccount = {
|
|
|
12
36
|
available_balance: string;
|
|
13
37
|
status: number;
|
|
14
38
|
collateral: string;
|
|
39
|
+
transaction_time: number;
|
|
40
|
+
account_trading_mode: number;
|
|
15
41
|
};
|
|
16
42
|
export type LighterAccountsByL1AddressResponse = {
|
|
17
43
|
code: number;
|
|
@@ -247,6 +273,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
247
273
|
address: Address | '' | undefined;
|
|
248
274
|
}): {
|
|
249
275
|
mainAccountIndex: string | undefined;
|
|
276
|
+
isUnifiedTradingMode: boolean;
|
|
250
277
|
subAccounts: LighterSubAccount[] | undefined;
|
|
251
278
|
data: LighterAccountsByL1AddressResponse;
|
|
252
279
|
error: Error;
|
|
@@ -275,6 +302,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
275
302
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
276
303
|
} | {
|
|
277
304
|
mainAccountIndex: string | undefined;
|
|
305
|
+
isUnifiedTradingMode: boolean;
|
|
278
306
|
subAccounts: LighterSubAccount[] | undefined;
|
|
279
307
|
data: LighterAccountsByL1AddressResponse;
|
|
280
308
|
error: null;
|
|
@@ -303,6 +331,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
303
331
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
304
332
|
} | {
|
|
305
333
|
mainAccountIndex: string | undefined;
|
|
334
|
+
isUnifiedTradingMode: boolean;
|
|
306
335
|
subAccounts: LighterSubAccount[] | undefined;
|
|
307
336
|
data: undefined;
|
|
308
337
|
error: Error;
|
|
@@ -331,6 +360,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
331
360
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
332
361
|
} | {
|
|
333
362
|
mainAccountIndex: string | undefined;
|
|
363
|
+
isUnifiedTradingMode: boolean;
|
|
334
364
|
subAccounts: LighterSubAccount[] | undefined;
|
|
335
365
|
data: undefined;
|
|
336
366
|
error: null;
|
|
@@ -359,6 +389,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
359
389
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
360
390
|
} | {
|
|
361
391
|
mainAccountIndex: string | undefined;
|
|
392
|
+
isUnifiedTradingMode: boolean;
|
|
362
393
|
subAccounts: LighterSubAccount[] | undefined;
|
|
363
394
|
data: undefined;
|
|
364
395
|
error: null;
|
|
@@ -387,6 +418,7 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
387
418
|
promise: Promise<LighterAccountsByL1AddressResponse>;
|
|
388
419
|
} | {
|
|
389
420
|
mainAccountIndex: string | undefined;
|
|
421
|
+
isUnifiedTradingMode: boolean;
|
|
390
422
|
subAccounts: LighterSubAccount[] | undefined;
|
|
391
423
|
data: LighterAccountsByL1AddressResponse;
|
|
392
424
|
isError: false;
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
zerionWallet
|
|
7
7
|
} from "./chunk-SWFF3TWJ.js";
|
|
8
|
-
import {
|
|
9
|
-
tahoWallet
|
|
10
|
-
} from "./chunk-7ZYCBDQ4.js";
|
|
11
8
|
import {
|
|
12
9
|
talismanWallet
|
|
13
10
|
} from "./chunk-4DCO3TGL.js";
|
|
11
|
+
import {
|
|
12
|
+
tahoWallet
|
|
13
|
+
} from "./chunk-7ZYCBDQ4.js";
|
|
14
14
|
import {
|
|
15
15
|
tokenPocketWallet
|
|
16
16
|
} from "./chunk-WKNQMP4A.js";
|
|
@@ -20,21 +20,21 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
trustWallet
|
|
22
22
|
} from "./chunk-KCRO2AGO.js";
|
|
23
|
-
import {
|
|
24
|
-
uniswapWallet
|
|
25
|
-
} from "./chunk-Z3PPW6NC.js";
|
|
26
23
|
import {
|
|
27
24
|
walletConnectWallet
|
|
28
25
|
} from "./chunk-3FCWJRI4.js";
|
|
26
|
+
import {
|
|
27
|
+
uniswapWallet
|
|
28
|
+
} from "./chunk-Z3PPW6NC.js";
|
|
29
29
|
import {
|
|
30
30
|
xdefiWallet
|
|
31
31
|
} from "./chunk-JN5I3DNC.js";
|
|
32
|
+
import {
|
|
33
|
+
rabbyWallet
|
|
34
|
+
} from "./chunk-RB66PKPA.js";
|
|
32
35
|
import {
|
|
33
36
|
rainbowWallet
|
|
34
37
|
} from "./chunk-W2LCLDPX.js";
|
|
35
|
-
import {
|
|
36
|
-
kresusWallet
|
|
37
|
-
} from "./chunk-RICTB3FA.js";
|
|
38
38
|
import {
|
|
39
39
|
ramperWallet
|
|
40
40
|
} from "./chunk-OQB55QXP.js";
|
|
@@ -56,6 +56,9 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
metaMaskWallet
|
|
58
58
|
} from "./chunk-YO2K4MBH.js";
|
|
59
|
+
import {
|
|
60
|
+
mewWallet
|
|
61
|
+
} from "./chunk-MQM45ADF.js";
|
|
59
62
|
import {
|
|
60
63
|
oktoWallet
|
|
61
64
|
} from "./chunk-YWOVAU6O.js";
|
|
@@ -74,9 +77,6 @@ import {
|
|
|
74
77
|
import {
|
|
75
78
|
phantomWallet
|
|
76
79
|
} from "./chunk-QY53O7WG.js";
|
|
77
|
-
import {
|
|
78
|
-
rabbyWallet
|
|
79
|
-
} from "./chunk-RB66PKPA.js";
|
|
80
80
|
import {
|
|
81
81
|
foxWallet
|
|
82
82
|
} from "./chunk-GUQM4QSL.js";
|
|
@@ -86,36 +86,36 @@ import {
|
|
|
86
86
|
import {
|
|
87
87
|
frontierWallet
|
|
88
88
|
} from "./chunk-AVDUNQUW.js";
|
|
89
|
-
import {
|
|
90
|
-
imTokenWallet
|
|
91
|
-
} from "./chunk-WNAGGFMG.js";
|
|
92
89
|
import {
|
|
93
90
|
gateWallet
|
|
94
91
|
} from "./chunk-JPN6TWIT.js";
|
|
95
92
|
import {
|
|
96
|
-
|
|
97
|
-
} from "./chunk-
|
|
93
|
+
imTokenWallet
|
|
94
|
+
} from "./chunk-WNAGGFMG.js";
|
|
98
95
|
import {
|
|
99
96
|
injectedWallet
|
|
100
97
|
} from "./chunk-T6LGKC3F.js";
|
|
101
98
|
import {
|
|
102
|
-
|
|
103
|
-
} from "./chunk-
|
|
99
|
+
kresusWallet
|
|
100
|
+
} from "./chunk-RICTB3FA.js";
|
|
101
|
+
import {
|
|
102
|
+
ledgerWallet
|
|
103
|
+
} from "./chunk-RPV27V2Y.js";
|
|
104
|
+
import {
|
|
105
|
+
bloomWallet
|
|
106
|
+
} from "./chunk-PJ7Y57EH.js";
|
|
104
107
|
import {
|
|
105
108
|
clvWallet
|
|
106
109
|
} from "./chunk-OEEGYENV.js";
|
|
107
|
-
import {
|
|
108
|
-
bybitWallet
|
|
109
|
-
} from "./chunk-OX37G4YT.js";
|
|
110
110
|
import {
|
|
111
111
|
coin98Wallet
|
|
112
112
|
} from "./chunk-WAHGI5L7.js";
|
|
113
|
-
import {
|
|
114
|
-
coreWallet
|
|
115
|
-
} from "./chunk-4NV5BYRP.js";
|
|
116
113
|
import {
|
|
117
114
|
coinbaseWallet
|
|
118
115
|
} from "./chunk-2DLDAZRH.js";
|
|
116
|
+
import {
|
|
117
|
+
coreWallet
|
|
118
|
+
} from "./chunk-4NV5BYRP.js";
|
|
119
119
|
import {
|
|
120
120
|
dawnWallet
|
|
121
121
|
} from "./chunk-G2PHTVL6.js";
|
|
@@ -125,24 +125,24 @@ import {
|
|
|
125
125
|
import {
|
|
126
126
|
enkryptWallet
|
|
127
127
|
} from "./chunk-HBQK5RD5.js";
|
|
128
|
-
import {
|
|
129
|
-
bitgetWallet
|
|
130
|
-
} from "./chunk-TKB2OY6G.js";
|
|
131
128
|
import {
|
|
132
129
|
argentWallet
|
|
133
130
|
} from "./chunk-NTMBEOR2.js";
|
|
134
|
-
import {
|
|
135
|
-
bitskiWallet
|
|
136
|
-
} from "./chunk-7HRFUZFX.js";
|
|
137
131
|
import {
|
|
138
132
|
bifrostWallet
|
|
139
133
|
} from "./chunk-IULPZP2Q.js";
|
|
134
|
+
import {
|
|
135
|
+
bitgetWallet
|
|
136
|
+
} from "./chunk-TKB2OY6G.js";
|
|
137
|
+
import {
|
|
138
|
+
bitskiWallet
|
|
139
|
+
} from "./chunk-7HRFUZFX.js";
|
|
140
140
|
import {
|
|
141
141
|
bitverseWallet
|
|
142
142
|
} from "./chunk-NSK6A7TI.js";
|
|
143
143
|
import {
|
|
144
|
-
|
|
145
|
-
} from "./chunk-
|
|
144
|
+
bybitWallet
|
|
145
|
+
} from "./chunk-OX37G4YT.js";
|
|
146
146
|
import "./chunk-N4IJLYFY.js";
|
|
147
147
|
import {
|
|
148
148
|
braveWallet
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -63,11 +63,8 @@
|
|
|
63
63
|
"@vitejs/plugin-react": "^6.0.2",
|
|
64
64
|
"autoprefixer": "^10.4.27",
|
|
65
65
|
"buffer": "^6.0.3",
|
|
66
|
-
"dotenv": "^17.2.3",
|
|
67
66
|
"esbuild-plugin-replace": "^1.4.0",
|
|
68
67
|
"jsdom": "^26.1.0",
|
|
69
|
-
"openapi-fetch": "^0.17.0",
|
|
70
|
-
"openapi-typescript": "^7.13.0",
|
|
71
68
|
"postcss": "^8.5.10",
|
|
72
69
|
"postcss-prefix-selector": "^1.16.0",
|
|
73
70
|
"process": "^0.11.10",
|
|
@@ -75,7 +72,6 @@
|
|
|
75
72
|
"storybook": "^10.3.6",
|
|
76
73
|
"stream-browserify": "^3.0.0",
|
|
77
74
|
"tsc-alias": "1.8.17",
|
|
78
|
-
"tsx": "^4.22.4",
|
|
79
75
|
"util": "^0.12.5",
|
|
80
76
|
"vite-plugin-node-polyfills": "^0.26.0",
|
|
81
77
|
"vitest": "^4.1.6",
|
|
@@ -111,7 +107,7 @@
|
|
|
111
107
|
"uuid": "^11.1.1",
|
|
112
108
|
"@funkit/api-base": "6.0.0",
|
|
113
109
|
"@funkit/chains": "2.1.3",
|
|
114
|
-
"@funkit/connect-core": "1.7.
|
|
110
|
+
"@funkit/connect-core": "1.7.1",
|
|
115
111
|
"@funkit/fun-relay": "2.9.0",
|
|
116
112
|
"@funkit/utils": "4.0.0"
|
|
117
113
|
},
|
|
@@ -125,9 +121,8 @@
|
|
|
125
121
|
"svgo": "svgo -rf .",
|
|
126
122
|
"build": "node build.js && pnpm typecheck",
|
|
127
123
|
"build:watch": "node build.js --watch",
|
|
128
|
-
"predev": "pnpm statsig:generate",
|
|
129
124
|
"dev": "pnpm build:watch & pnpm typegen:watch",
|
|
130
|
-
"prebuild": "pnpm
|
|
125
|
+
"prebuild": "pnpm typegen",
|
|
131
126
|
"typecheck": "pnpm tsc --noEmit",
|
|
132
127
|
"typegen": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsc-alias",
|
|
133
128
|
"typegen:watch": "tsc --project tsconfig.build.json --emitDeclarationOnly --watch",
|
|
@@ -140,8 +135,6 @@
|
|
|
140
135
|
"storybook:fast": "NODE_OPTIONS='--max-old-space-size=4096' storybook dev -p 6006 --no-open",
|
|
141
136
|
"storybook:clean": "rm -rf node_modules/.vite && npm run storybook",
|
|
142
137
|
"build-storybook": "storybook build",
|
|
143
|
-
"statsig:api-types": "openapi-typescript https://api.statsig.com/openapi/20240601.json -o scripts/statsig/api-types.ts",
|
|
144
|
-
"statsig:generate": "tsx scripts/statsig/generate.ts",
|
|
145
138
|
"i18n:unused": "node scripts/find-unused-i18n-keys.mjs"
|
|
146
139
|
}
|
|
147
140
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
POLYMARKET_PERPS_ROUTING_ID,
|
|
4
|
-
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
5
|
-
} from "./chunk-YFHTV7DT.js";
|
|
6
2
|
import {
|
|
7
3
|
FunInput,
|
|
8
4
|
FunSkeletonBlock,
|
|
@@ -16,6 +12,10 @@ import {
|
|
|
16
12
|
import {
|
|
17
13
|
useFunkitTranslation
|
|
18
14
|
} from "./chunk-STLOQEN7.js";
|
|
15
|
+
import {
|
|
16
|
+
POLYMARKET_PERPS_ROUTING_ID,
|
|
17
|
+
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
18
|
+
} from "./chunk-YFHTV7DT.js";
|
|
19
19
|
import {
|
|
20
20
|
POLYGON_USDCE,
|
|
21
21
|
PUSD_TOKEN
|