@funkit/connect 1.2.7 → 1.3.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 +17 -0
- package/dist/index.js +129 -62
- package/dist/utils/flags/config.d.ts +13 -3
- package/dist/utils/flags/index.d.ts +2 -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/chunk-2DWBVWFI.js +87 -0
- package/dist/wallets/walletConnectors/chunk-32KBKKGT.js +182 -0
- package/dist/wallets/walletConnectors/chunk-3CLNL7LR.js +73 -0
- package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +102 -0
- package/dist/wallets/walletConnectors/chunk-7GGRZNT3.js +96 -0
- package/dist/wallets/walletConnectors/chunk-7YDZTPO4.js +100 -0
- package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +98 -0
- package/dist/wallets/walletConnectors/chunk-CMXZK5RR.js +94 -0
- package/dist/wallets/walletConnectors/chunk-F4EJ42XO.js +105 -0
- package/dist/wallets/walletConnectors/chunk-FL2VIO76.js +71 -0
- package/dist/wallets/walletConnectors/chunk-IIJOJ6AD.js +102 -0
- package/dist/wallets/walletConnectors/chunk-KZFAL4RZ.js +27 -0
- package/dist/wallets/walletConnectors/chunk-LJRV5JY7.js +95 -0
- package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +66 -0
- package/dist/wallets/walletConnectors/chunk-MSRKKVDE.js +98 -0
- package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +92 -0
- package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +94 -0
- package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +96 -0
- package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +107 -0
- 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/dawnWallet/dawnWallet.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 +71 -71
- 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 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6c315a2: feat: enable checkout transfers
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 5f70055: refactor: switch over to userId-based checkout apis
|
|
12
|
+
- 70d3eb8: fix: quote gas estimation error fallback
|
|
13
|
+
- 8e6f93f: feat: add flags select_payment_method_text, payment_method_copy_v1
|
|
14
|
+
- Updated dependencies [5f70055]
|
|
15
|
+
- Updated dependencies [5f70055]
|
|
16
|
+
- @funkit/api-base@0.0.5
|
|
17
|
+
- @funkit/core@1.0.18
|
|
18
|
+
- @funkit/wagmi-tools@2.0.3
|
|
19
|
+
|
|
3
20
|
## 1.2.7
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
en_US_default
|
|
4
4
|
} from "./chunk-SW6GAS7K.js";
|
|
5
|
-
import {
|
|
6
|
-
lightTheme
|
|
7
|
-
} from "./chunk-FRT63PFR.js";
|
|
8
5
|
import {
|
|
9
6
|
darkTheme
|
|
10
7
|
} from "./chunk-ICLRFHOV.js";
|
|
8
|
+
import {
|
|
9
|
+
lightTheme
|
|
10
|
+
} from "./chunk-FRT63PFR.js";
|
|
11
11
|
import "./chunk-I24HX4XM.js";
|
|
12
12
|
|
|
13
13
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
@@ -373,6 +373,38 @@ var flagConfig = {
|
|
|
373
373
|
value: true
|
|
374
374
|
}
|
|
375
375
|
]
|
|
376
|
+
},
|
|
377
|
+
["select_payment_method_text" /* SelectPaymentMethodText */]: {
|
|
378
|
+
type: "string",
|
|
379
|
+
default_value: "Select Payment Method",
|
|
380
|
+
overrides: [
|
|
381
|
+
{
|
|
382
|
+
if_any: [
|
|
383
|
+
{
|
|
384
|
+
key: "userId",
|
|
385
|
+
type: "pctRollout",
|
|
386
|
+
pct: 50
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
value: "Pay With"
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
["payment_method_copy_v1" /* PaymentMethodCopyV1 */]: {
|
|
394
|
+
type: "boolean",
|
|
395
|
+
default_value: false,
|
|
396
|
+
overrides: [
|
|
397
|
+
{
|
|
398
|
+
if_any: [
|
|
399
|
+
{
|
|
400
|
+
key: "userId",
|
|
401
|
+
type: "pctRollout",
|
|
402
|
+
pct: 100
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
value: true
|
|
406
|
+
}
|
|
407
|
+
]
|
|
376
408
|
}
|
|
377
409
|
};
|
|
378
410
|
|
|
@@ -1070,7 +1102,7 @@ function FunkitConnectChainProvider({
|
|
|
1070
1102
|
apiKey
|
|
1071
1103
|
}).then(() => {
|
|
1072
1104
|
logger.log("Core configured");
|
|
1073
|
-
flags.init({
|
|
1105
|
+
void flags.init({
|
|
1074
1106
|
apiKey
|
|
1075
1107
|
});
|
|
1076
1108
|
});
|
|
@@ -2154,7 +2186,7 @@ import {
|
|
|
2154
2186
|
getAssetPriceInfo as getAssetPriceInfo2,
|
|
2155
2187
|
getCheckoutByDepositAddress,
|
|
2156
2188
|
getCheckoutQuote as getApiCheckoutQuote,
|
|
2157
|
-
|
|
2189
|
+
getCheckoutsByUserId,
|
|
2158
2190
|
getMoonpayBuyQuoteForCreditCard,
|
|
2159
2191
|
initializeCheckout as postApiInitializeCheckout,
|
|
2160
2192
|
meshPreviewTransfer
|
|
@@ -2586,12 +2618,6 @@ function validateCheckoutConfig(config, isUserLoggedIn) {
|
|
|
2586
2618
|
message: `Invalid customRecipient configuration: Has to be a valid address.`
|
|
2587
2619
|
};
|
|
2588
2620
|
}
|
|
2589
|
-
if (config.customRecipient && isAddress(config.customRecipient) && isUserLoggedIn) {
|
|
2590
|
-
return {
|
|
2591
|
-
isValid: false,
|
|
2592
|
-
message: `Invalid customRecipient configuration: Unsupported when a user is logged in.`
|
|
2593
|
-
};
|
|
2594
|
-
}
|
|
2595
2621
|
if (config.customRecipient && !!config.actionsParams.length) {
|
|
2596
2622
|
return {
|
|
2597
2623
|
isValid: false,
|
|
@@ -2843,7 +2869,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2843
2869
|
logoutSymbol,
|
|
2844
2870
|
isWeb2Login,
|
|
2845
2871
|
isWeb3Login,
|
|
2846
|
-
isUserLoggedIn
|
|
2872
|
+
isUserLoggedIn,
|
|
2873
|
+
userInfo
|
|
2847
2874
|
} = useGeneralWallet();
|
|
2848
2875
|
const { switchChainAsync } = useFunkitSwitchChains({});
|
|
2849
2876
|
const [activeCheckouts, setActiveCheckouts] = useState8({});
|
|
@@ -2870,9 +2897,9 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2870
2897
|
let newCheckoutHistoryList = [];
|
|
2871
2898
|
setIsRefreshingCheckoutHistory(true);
|
|
2872
2899
|
if (isUserLoggedIn) {
|
|
2873
|
-
logger.log("
|
|
2874
|
-
newCheckoutHistoryList = await
|
|
2875
|
-
|
|
2900
|
+
logger.log("getCheckoutsByUserId");
|
|
2901
|
+
newCheckoutHistoryList = await getCheckoutsByUserId({
|
|
2902
|
+
userId: userInfo.id,
|
|
2876
2903
|
apiKey: funkitConfig.apiKey
|
|
2877
2904
|
});
|
|
2878
2905
|
} else if (isGuestUserOnCheckoutHistory) {
|
|
@@ -2897,7 +2924,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2897
2924
|
historyDepositAddress,
|
|
2898
2925
|
isGuestUserOnCheckoutHistory,
|
|
2899
2926
|
isUserLoggedIn,
|
|
2900
|
-
walletAddress
|
|
2927
|
+
walletAddress,
|
|
2928
|
+
userInfo
|
|
2901
2929
|
]);
|
|
2902
2930
|
useEffect7(() => {
|
|
2903
2931
|
if (isUserLoggedIn || isGuestUserOnCheckoutHistory) {
|
|
@@ -3156,6 +3184,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3156
3184
|
]);
|
|
3157
3185
|
const inputCustomRecipient = checkoutItem.initSettings.config.customRecipient;
|
|
3158
3186
|
const baseQuote = await getApiCheckoutQuote({
|
|
3187
|
+
userId: userInfo.id,
|
|
3159
3188
|
fromChainId,
|
|
3160
3189
|
fromTokenAddress,
|
|
3161
3190
|
fromTokenDecimals,
|
|
@@ -3177,10 +3206,12 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3177
3206
|
...checkoutItem,
|
|
3178
3207
|
quoteStepMessage: newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb2Login ? PENDING_QUOTE_MESSAGE_GENERATOR[3 /* FINALIZING */]() : newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login ? PENDING_QUOTE_MESSAGE_GENERATOR[2 /* ESTIMATING_GAS */]() : PENDING_QUOTE_MESSAGE_GENERATOR[1 /* VERIFYING_PROVIDER */](newPaymentMethodInfo.title)
|
|
3179
3208
|
};
|
|
3180
|
-
setActiveCheckouts(
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3209
|
+
setActiveCheckouts(
|
|
3210
|
+
(prev) => ({
|
|
3211
|
+
...prev,
|
|
3212
|
+
[checkoutId]: checkoutItem
|
|
3213
|
+
})
|
|
3214
|
+
);
|
|
3184
3215
|
}
|
|
3185
3216
|
const newFinalDollarValue = baseQuote.estSubtotalUsd;
|
|
3186
3217
|
const networkFeesUsdBreakdown = {
|
|
@@ -3199,26 +3230,32 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3199
3230
|
if (newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login && checkoutItem.selectedSourceAssetInfo.chainId !== zkSync.id.toString()) {
|
|
3200
3231
|
let gasEstimateResult = BigInt(0);
|
|
3201
3232
|
const isNativeTokenTransfer = checkoutItem.selectedSourceAssetInfo.address === NATIVE_TOKEN;
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3233
|
+
logger.log("gasEstimateResult:before", { gasEstimateResult });
|
|
3234
|
+
try {
|
|
3235
|
+
if (isNativeTokenTransfer) {
|
|
3236
|
+
gasEstimateResult = await estimateGas(wagmiConfig, {
|
|
3237
|
+
to: DUMMY_TRANSFER_PARAMS.toAddress,
|
|
3238
|
+
chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
|
|
3239
|
+
value: BigInt(baseQuote.estTotalFromAmountBaseUnit)
|
|
3240
|
+
});
|
|
3241
|
+
} else {
|
|
3242
|
+
gasEstimateResult = await estimateGas(wagmiConfig, {
|
|
3243
|
+
to: checkoutItem.selectedSourceAssetInfo.address,
|
|
3244
|
+
chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
|
|
3245
|
+
data: encodeFunctionData({
|
|
3246
|
+
abi: erc20Abi,
|
|
3247
|
+
functionName: "transfer",
|
|
3248
|
+
args: [
|
|
3249
|
+
DUMMY_TRANSFER_PARAMS.toAddress,
|
|
3250
|
+
BigInt(baseQuote.estTotalFromAmountBaseUnit)
|
|
3251
|
+
]
|
|
3252
|
+
})
|
|
3253
|
+
});
|
|
3254
|
+
}
|
|
3255
|
+
} catch (err) {
|
|
3256
|
+
logger.error("_getCheckoutQuote:estimateGas:error", err);
|
|
3221
3257
|
}
|
|
3258
|
+
logger.log("gasEstimateResult:after", { gasEstimateResult });
|
|
3222
3259
|
const gasInEthAmount = GAS_ESTIMATE_MULTIPLER * parseFloat(formatEther(gasEstimateResult));
|
|
3223
3260
|
networkFeesUsdBreakdown.networkFeesUsdFromEoaGas = await _calculateAssetUsdValue(
|
|
3224
3261
|
checkoutItem.selectedSourceAssetInfo.chainId,
|
|
@@ -3346,10 +3383,12 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3346
3383
|
quoteStepMessage: "",
|
|
3347
3384
|
quoteErrorMessage: ""
|
|
3348
3385
|
};
|
|
3349
|
-
setActiveCheckouts(
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3386
|
+
setActiveCheckouts(
|
|
3387
|
+
(prev) => ({
|
|
3388
|
+
...prev,
|
|
3389
|
+
[checkoutId]: checkoutItem
|
|
3390
|
+
})
|
|
3391
|
+
);
|
|
3353
3392
|
return true;
|
|
3354
3393
|
} catch (err) {
|
|
3355
3394
|
const generatedErrorIfAny = generateQuoteApiErrorForDisplay(err.message);
|
|
@@ -3357,16 +3396,18 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3357
3396
|
generatedErrorIfAny,
|
|
3358
3397
|
checkoutItem
|
|
3359
3398
|
});
|
|
3360
|
-
setActiveCheckouts(
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3399
|
+
setActiveCheckouts(
|
|
3400
|
+
(prev) => ({
|
|
3401
|
+
...prev,
|
|
3402
|
+
[checkoutId]: {
|
|
3403
|
+
...checkoutItem,
|
|
3404
|
+
isQuoting: false,
|
|
3405
|
+
latestQuote: null,
|
|
3406
|
+
quoteStepMessage: "",
|
|
3407
|
+
quoteErrorMessage: generatedErrorIfAny ? generatedErrorIfAny : "An error occured while generating the quote. Please try again with a different payment method or payment asset."
|
|
3408
|
+
}
|
|
3409
|
+
})
|
|
3410
|
+
);
|
|
3370
3411
|
return false;
|
|
3371
3412
|
}
|
|
3372
3413
|
},
|
|
@@ -3377,7 +3418,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
3377
3418
|
isWeb2Login,
|
|
3378
3419
|
isWeb3Login,
|
|
3379
3420
|
wagmiConfig,
|
|
3380
|
-
walletAddress
|
|
3421
|
+
walletAddress,
|
|
3422
|
+
userInfo
|
|
3381
3423
|
]
|
|
3382
3424
|
);
|
|
3383
3425
|
const _generateSignedBatchOperation = useCallback7(
|
|
@@ -7205,7 +7247,13 @@ var LightningIcon = ({ color }) => {
|
|
|
7205
7247
|
var PAYMENT_METHOD_CONFIG = {
|
|
7206
7248
|
["balance" /* ACCOUNT_BALANCE */]: {
|
|
7207
7249
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.accountBalance,
|
|
7208
|
-
labelDynamic: (textCustomizations, walletAddress) =>
|
|
7250
|
+
labelDynamic: (textCustomizations, walletAddress) => {
|
|
7251
|
+
const walletSuffix = walletAddress ? ` (${walletAddress})` : "";
|
|
7252
|
+
if (textCustomizations.accountBalance !== DEFAULT_TEXT_CUSTOMIZATIONS.accountBalance) {
|
|
7253
|
+
return `${textCustomizations.accountBalance}${walletSuffix}`;
|
|
7254
|
+
}
|
|
7255
|
+
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? `Wallet${walletSuffix}` : `${textCustomizations.accountBalance}${walletSuffix}`;
|
|
7256
|
+
},
|
|
7209
7257
|
timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(LightningIcon, {
|
|
7210
7258
|
color
|
|
7211
7259
|
}),
|
|
@@ -7216,7 +7264,12 @@ var PAYMENT_METHOD_CONFIG = {
|
|
|
7216
7264
|
},
|
|
7217
7265
|
["card" /* CARD */]: {
|
|
7218
7266
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit,
|
|
7219
|
-
labelDynamic: (textCustomizations) =>
|
|
7267
|
+
labelDynamic: (textCustomizations) => {
|
|
7268
|
+
if (textCustomizations.debitOrCredit !== DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit) {
|
|
7269
|
+
return textCustomizations.debitOrCredit;
|
|
7270
|
+
}
|
|
7271
|
+
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Card" : textCustomizations.debitOrCredit;
|
|
7272
|
+
},
|
|
7220
7273
|
timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(ClockIcon, {
|
|
7221
7274
|
color
|
|
7222
7275
|
}),
|
|
@@ -7227,7 +7280,12 @@ var PAYMENT_METHOD_CONFIG = {
|
|
|
7227
7280
|
},
|
|
7228
7281
|
["brokerage" /* BROKERAGE */]: {
|
|
7229
7282
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange,
|
|
7230
|
-
labelDynamic: (textCustomizations) =>
|
|
7283
|
+
labelDynamic: (textCustomizations) => {
|
|
7284
|
+
if (textCustomizations.brokerageOrExchange !== DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange) {
|
|
7285
|
+
return textCustomizations.brokerageOrExchange;
|
|
7286
|
+
}
|
|
7287
|
+
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Exchange" : textCustomizations.brokerageOrExchange;
|
|
7288
|
+
},
|
|
7231
7289
|
timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(ClockIcon, {
|
|
7232
7290
|
color
|
|
7233
7291
|
}),
|
|
@@ -7375,7 +7433,7 @@ function FunPaymentMethods({
|
|
|
7375
7433
|
);
|
|
7376
7434
|
const [isContinuing, setIsContinuing] = useState17(false);
|
|
7377
7435
|
useWalletAssetsListener();
|
|
7378
|
-
const { walletAssets, isWeb3Login, isWeb2Login } = useGeneralWallet();
|
|
7436
|
+
const { walletAssets, isWeb3Login, isWeb2Login, isUserLoggedIn } = useGeneralWallet();
|
|
7379
7437
|
const {
|
|
7380
7438
|
checkoutItem,
|
|
7381
7439
|
reDraftSymbol,
|
|
@@ -7474,8 +7532,8 @@ function FunPaymentMethods({
|
|
|
7474
7532
|
]);
|
|
7475
7533
|
const PaymentMethodListWithStatus = useMemo16(() => {
|
|
7476
7534
|
return Object.keys(PAYMENT_METHOD_CONFIG).map((paymentMethod) => {
|
|
7477
|
-
var _a2
|
|
7478
|
-
if (paymentFlow === 0 /* DEPOSIT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "transfer" /* TRANSFER */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ &&
|
|
7535
|
+
var _a2;
|
|
7536
|
+
if (paymentFlow === 0 /* DEPOSIT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "transfer" /* TRANSFER */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && !isUserLoggedIn || paymentMethod === "otc" /* OTC */ && !((_a2 = paymentsConfig.otcConfig) == null ? void 0 : _a2.isEnabled)) {
|
|
7479
7537
|
return {
|
|
7480
7538
|
paymentMethod,
|
|
7481
7539
|
status: false,
|
|
@@ -7531,6 +7589,15 @@ function FunPaymentMethods({
|
|
|
7531
7589
|
});
|
|
7532
7590
|
}
|
|
7533
7591
|
}, [canContinue, onSelect, selectedOption]);
|
|
7592
|
+
const selectPaymentMethod = useMemo16(() => {
|
|
7593
|
+
if (textCustomizations.selectPaymentMethod !== DEFAULT_TEXT_CUSTOMIZATIONS.selectPaymentMethod) {
|
|
7594
|
+
return textCustomizations.selectPaymentMethod;
|
|
7595
|
+
}
|
|
7596
|
+
return flags.getString(
|
|
7597
|
+
"select_payment_method_text" /* SelectPaymentMethodText */,
|
|
7598
|
+
textCustomizations.selectPaymentMethod
|
|
7599
|
+
);
|
|
7600
|
+
}, [textCustomizations]);
|
|
7534
7601
|
return /* @__PURE__ */ React70.createElement(Box, {
|
|
7535
7602
|
display: "flex",
|
|
7536
7603
|
flexDirection: "column",
|
|
@@ -7549,7 +7616,7 @@ function FunPaymentMethods({
|
|
|
7549
7616
|
size: "18",
|
|
7550
7617
|
weight: "semibold",
|
|
7551
7618
|
color: "modalTextSecondary"
|
|
7552
|
-
},
|
|
7619
|
+
}, selectPaymentMethod), /* @__PURE__ */ React70.createElement(Box, {
|
|
7553
7620
|
id: "method-list",
|
|
7554
7621
|
display: "flex",
|
|
7555
7622
|
flexDirection: "column",
|
|
@@ -17284,7 +17351,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
17284
17351
|
localStorage.setItem(storageKey6, version);
|
|
17285
17352
|
}
|
|
17286
17353
|
function getCurrentSdkVersion() {
|
|
17287
|
-
return "1.
|
|
17354
|
+
return "1.3.0";
|
|
17288
17355
|
}
|
|
17289
17356
|
function useFingerprint() {
|
|
17290
17357
|
const fingerprint = useCallback33(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BooleanFlagConfig } from './types';
|
|
1
|
+
import type { BooleanFlagConfig, StringFlagConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Remember that these values show up in our logs
|
|
4
4
|
* Make sure the enum values are unique
|
|
@@ -6,9 +6,19 @@ import type { BooleanFlagConfig } from './types';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare enum FlagKey {
|
|
8
8
|
/** Shows "or continue with" label on FunSignInStep */
|
|
9
|
-
ConnectSignInShowSocialLabel = "connect_sign_in_show_social_label"
|
|
9
|
+
ConnectSignInShowSocialLabel = "connect_sign_in_show_social_label",
|
|
10
|
+
/** Custom text for the select payment method button */
|
|
11
|
+
SelectPaymentMethodText = "select_payment_method_text",
|
|
12
|
+
/**
|
|
13
|
+
* Changing the copy for each of three payment methods:
|
|
14
|
+
* - “Cross-Chain Swap” → Wallet
|
|
15
|
+
* - “Debit or Credit” → Card
|
|
16
|
+
* - “Brokerage or Exchange” → Exchange
|
|
17
|
+
*/
|
|
18
|
+
PaymentMethodCopyV1 = "payment_method_copy_v1"
|
|
10
19
|
}
|
|
11
|
-
/** @satisfies Record<FlagKey, FlagConfig> */
|
|
12
20
|
export declare const flagConfig: {
|
|
13
21
|
[FlagKey.ConnectSignInShowSocialLabel]: BooleanFlagConfig;
|
|
22
|
+
[FlagKey.SelectPaymentMethodText]: StringFlagConfig;
|
|
23
|
+
[FlagKey.PaymentMethodCopyV1]: BooleanFlagConfig;
|
|
14
24
|
};
|
|
@@ -3,5 +3,7 @@ import { FeatureFlag } from './impl';
|
|
|
3
3
|
export { FlagKey };
|
|
4
4
|
declare const singleton: FeatureFlag<{
|
|
5
5
|
connect_sign_in_show_social_label: import("./types").BooleanFlagConfig;
|
|
6
|
+
select_payment_method_text: import("./types").StringFlagConfig;
|
|
7
|
+
payment_method_copy_v1: import("./types").BooleanFlagConfig;
|
|
6
8
|
}>;
|
|
7
9
|
export declare const flags: Pick<typeof singleton, "init" | "getBool" | "getNumber" | "getString">;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FL2VIO76.js";
|
|
5
|
+
import "../chunk-F3VCNZXS.js";
|
|
5
6
|
import "../chunk-ZOLACFTK.js";
|
|
6
7
|
import "../chunk-ZDU3JFGR.js";
|
|
7
|
-
import "../chunk-F3VCNZXS.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7YDZTPO4.js";
|
|
5
|
+
import "../chunk-F3VCNZXS.js";
|
|
5
6
|
import "../chunk-ZOLACFTK.js";
|
|
6
7
|
import "../chunk-ZDU3JFGR.js";
|
|
7
|
-
import "../chunk-F3VCNZXS.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
10
10
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-F3VCNZXS.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-ZDU3JFGR.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/clvWallet/clvWallet.ts
|
|
11
|
+
var clvWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isCLVInjected = hasInjectedProvider({ namespace: "clover" });
|
|
16
|
+
const shouldUseWalletConnect = !isCLVInjected;
|
|
17
|
+
return {
|
|
18
|
+
id: "clv",
|
|
19
|
+
name: "CLV",
|
|
20
|
+
iconUrl: async () => (await import("./clvWallet-RM4V57ZB.js")).default,
|
|
21
|
+
iconBackground: "#fff",
|
|
22
|
+
iconAccent: "#BDFDE2",
|
|
23
|
+
installed: isCLVInjected,
|
|
24
|
+
downloadUrls: {
|
|
25
|
+
chrome: "https://chrome.google.com/webstore/detail/clv-wallet/nhnkbkgjikgcigadomkphalanndcapjk",
|
|
26
|
+
ios: "https://apps.apple.com/app/clover-wallet/id1570072858",
|
|
27
|
+
mobile: "https://apps.apple.com/app/clover-wallet/id1570072858",
|
|
28
|
+
qrCode: "https://clv.org/"
|
|
29
|
+
},
|
|
30
|
+
extension: {
|
|
31
|
+
instructions: {
|
|
32
|
+
learnMoreUrl: "https://clv.org/",
|
|
33
|
+
steps: [
|
|
34
|
+
{
|
|
35
|
+
description: "wallet_connectors.clv.extension.step1.description",
|
|
36
|
+
step: "install",
|
|
37
|
+
title: "wallet_connectors.clv.extension.step1.title"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: "wallet_connectors.clv.extension.step2.description",
|
|
41
|
+
step: "create",
|
|
42
|
+
title: "wallet_connectors.clv.extension.step2.title"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: "wallet_connectors.clv.extension.step3.description",
|
|
46
|
+
step: "refresh",
|
|
47
|
+
title: "wallet_connectors.clv.extension.step3.title"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
mobile: {
|
|
53
|
+
getUri: shouldUseWalletConnect ? (uri) => uri : void 0
|
|
54
|
+
},
|
|
55
|
+
qrCode: shouldUseWalletConnect ? {
|
|
56
|
+
getUri: (uri) => uri,
|
|
57
|
+
instructions: {
|
|
58
|
+
learnMoreUrl: "https://clv.org/",
|
|
59
|
+
steps: [
|
|
60
|
+
{
|
|
61
|
+
description: "wallet_connectors.clv.qr_code.step1.description",
|
|
62
|
+
step: "install",
|
|
63
|
+
title: "wallet_connectors.clv.qr_code.step1.title"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
description: "wallet_connectors.clv.qr_code.step2.description",
|
|
67
|
+
step: "create",
|
|
68
|
+
title: "wallet_connectors.clv.qr_code.step2.title"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.clv.qr_code.step3.description",
|
|
72
|
+
step: "scan",
|
|
73
|
+
title: "wallet_connectors.clv.qr_code.step3.title"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
} : void 0,
|
|
78
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
79
|
+
projectId,
|
|
80
|
+
walletConnectParameters
|
|
81
|
+
}) : getInjectedConnector({ namespace: "clover" })
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
clvWallet
|
|
87
|
+
};
|