@funkit/connect 5.5.15 → 5.5.16
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 +26 -0
- package/dist/domains/fees.d.ts +1 -0
- package/dist/domains/quote.d.ts +1 -1
- package/dist/domains/relay.d.ts +5 -0
- package/dist/index.css +4 -1
- package/dist/index.js +144 -97
- package/dist/providers/FunkitHistoryContext.d.ts +1 -1
- package/dist/utils/flags/config.d.ts +5 -16
- 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 +41 -41
- 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,31 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 5.5.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dd97dc2: feat: add feature flag to hide chains from withdrawal
|
|
8
|
+
- 1b38d78: feat: add token icon assets
|
|
9
|
+
- 5e1cbf8: feat(connect): update how we display fees for withdrawal
|
|
10
|
+
feat(fun-relay): update fee structure - remove variable LP
|
|
11
|
+
feat(frog): update fee structure - remove variable LP
|
|
12
|
+
- 09ac3b8: feat(relay): expose blockchain confirmation callback
|
|
13
|
+
- 4dfcaa3: skip gas estimate for withdrawal
|
|
14
|
+
- 4c4f24a: feat(connect, apps): Complete screen without scrollbar, change of hover color for Katana
|
|
15
|
+
- cc372b2: feat(connect): update how we are displaying fees to the user
|
|
16
|
+
- Updated dependencies [dd97dc2]
|
|
17
|
+
- Updated dependencies [5e1cbf8]
|
|
18
|
+
- Updated dependencies [c11a45a]
|
|
19
|
+
- Updated dependencies [f3aa50c]
|
|
20
|
+
- Updated dependencies [09ac3b8]
|
|
21
|
+
- Updated dependencies [09ac3b8]
|
|
22
|
+
- Updated dependencies [e273041]
|
|
23
|
+
- @funkit/utils@1.1.6
|
|
24
|
+
- @funkit/fun-relay@0.1.10
|
|
25
|
+
- @funkit/api-base@1.9.8
|
|
26
|
+
- @funkit/core@2.3.30
|
|
27
|
+
- @funkit/wagmi-tools@3.0.52
|
|
28
|
+
|
|
3
29
|
## 5.5.15
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/domains/fees.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ interface EvaluateFeeBreakdownItem {
|
|
|
46
46
|
wagmiConfig: Config;
|
|
47
47
|
apiKey: string;
|
|
48
48
|
loginType: LoginType;
|
|
49
|
+
isWithdrawal?: boolean;
|
|
49
50
|
}
|
|
50
51
|
export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem, enableFrogProxyServer?: boolean): Promise<{
|
|
51
52
|
fees: CheckoutFees;
|
package/dist/domains/quote.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteRe
|
|
|
11
11
|
finalFeesBreakdown: CheckoutFees;
|
|
12
12
|
}
|
|
13
13
|
export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, sponsorInitialTransferGasLimit: number, wagmiConfig: Config, directExecutionInfo: FunkitDirectExecutionInfo, senderAddress?: Address, isWithdrawal?: boolean): Promise<CheckoutQuoteResponse>;
|
|
14
|
-
export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, enableFrogProxyServer?: boolean): Promise<{
|
|
14
|
+
export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, enableFrogProxyServer?: boolean, isWithdrawal?: boolean): Promise<{
|
|
15
15
|
finalEstimation: FunkitCheckoutQuoteResult;
|
|
16
16
|
brokerage?: BrokerageDetails;
|
|
17
17
|
}>;
|
package/dist/domains/relay.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { RelayQuote } from '@funkit/fun-relay';
|
|
2
2
|
export declare const KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
|
|
3
|
+
export declare function calcCustomFees(relayQuote: RelayQuote['metadata']['relayQuote']): {
|
|
4
|
+
swapImpactUsd: number;
|
|
5
|
+
appFeeUsd: number;
|
|
6
|
+
totalImpactUsd: number;
|
|
7
|
+
};
|
|
3
8
|
export declare function extractRelayFeeInfo(relayQuote: RelayQuote['metadata']['relayQuote']): {
|
|
4
9
|
gasUsd: number;
|
|
5
10
|
fillCostUsd: number;
|
package/dist/index.css
CHANGED
|
@@ -8170,7 +8170,7 @@
|
|
|
8170
8170
|
}
|
|
8171
8171
|
}
|
|
8172
8172
|
|
|
8173
|
-
/* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#
|
|
8173
|
+
/* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#H4sIAAAAAAAAE7WVy66bMBCG9+cpLHWTLBwREs7JIZuqz9B9NeAhWDE2sodAWuXdKy6hmCRqoqor5GG+fwbPhdWPdfmTtuFmzX69MVZAw3OUh5xiFoVR2ewHYy0F5TFbB8Gpbm3DeRsFrc/lbTXqxDm4xRdxFg0v4VygJu5qSWmOdnkT4/0jus+TOaLmZEG7DC0v4YC39C58QGcSiAskkOpVNDU6k7YAkka/zhalQsJXuVpSLizUoHimTP0MGfY+Ul8rs9kFfbX88wTZvI5sO6QEIaQ+cNsnE+wnNoVZb5pQkUclhsgUc5+PeTJSS5KgJumkoNJF13CMs01QNsv9/FoCd8p92Ve6J2hh3/YZPVB8oqOekvvsOHNC21aaNzHLpRCo91PrOWZQkWltLrVGqQQsP1REaGPmCBKF/rvhxirtkPxwccxrTI6S2ttIj130BNLjwZpKC54aZWzMTmAXnNtjf3a8MALUt9Ft+UhzzKDTFdKVCs5jHmMl3/s2+w9xOeVVkfRfZaxAyy0IWbmJdGuQvfLyuSwILUmw5+/YkJ8C/CWFf/vAx+px3vbGkzEcpkaLu/knfp0yhV1h2icX0mLabr2YpUZVRdeS10Zux9Bv5NQb8nEN3NsWE0p0VDeYso9lSkglnVmwCh1DcMil5qby2xhvMFCKBatohvjTF0bDfrsO1p9hm2hnN5M8ULfhtkO4IdY92a8FCgntaCJqBlqwxWTJfbzvyqZfHSv/xzv/ozJ2mTqFg9O97T3f3zN0c4tuwzk6Wi5vl99vlQlxEwgAAA== */
|
|
8174
8174
|
[data-rk] ._1pzt4231 {
|
|
8175
8175
|
max-height: 525px;
|
|
8176
8176
|
max-width: 100vw;
|
|
@@ -8188,6 +8188,9 @@
|
|
|
8188
8188
|
[data-rk] ._1pzt4231:has(#confirmation-page) {
|
|
8189
8189
|
max-height: 825px;
|
|
8190
8190
|
}
|
|
8191
|
+
[data-rk] ._1pzt4231:has(#complete-page) {
|
|
8192
|
+
max-height: 825px;
|
|
8193
|
+
}
|
|
8191
8194
|
[data-rk] ._1pzt4231:has(#withdrawal-flow) {
|
|
8192
8195
|
max-height: 825px;
|
|
8193
8196
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
lightTheme
|
|
4
|
-
} from "./chunk-UQVBCTN3.js";
|
|
5
2
|
import {
|
|
6
3
|
darkTheme
|
|
7
4
|
} from "./chunk-DMCSGHKQ.js";
|
|
5
|
+
import {
|
|
6
|
+
lightTheme
|
|
7
|
+
} from "./chunk-UQVBCTN3.js";
|
|
8
8
|
import {
|
|
9
9
|
systemFontStack
|
|
10
10
|
} from "./chunk-R2UFCJL7.js";
|
|
@@ -1120,7 +1120,6 @@ import {
|
|
|
1120
1120
|
getDirectExecutionByTxHash as getDirectExecutionByTxHash2,
|
|
1121
1121
|
getDirectExecutionsByUserId
|
|
1122
1122
|
} from "@funkit/api-base";
|
|
1123
|
-
import { isAddress as isAddress2 } from "@funkit/core";
|
|
1124
1123
|
import { isNotNullish as isNotNullish3 } from "@funkit/utils";
|
|
1125
1124
|
import React38, {
|
|
1126
1125
|
createContext as createContext8,
|
|
@@ -1130,6 +1129,7 @@ import React38, {
|
|
|
1130
1129
|
useRef as useRef2,
|
|
1131
1130
|
useState as useState6
|
|
1132
1131
|
} from "react";
|
|
1132
|
+
import { isHex } from "viem";
|
|
1133
1133
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
1134
1134
|
|
|
1135
1135
|
// src/hooks/useSymbolRefresh.ts
|
|
@@ -2535,6 +2535,7 @@ import {
|
|
|
2535
2535
|
DEV_API_KEY as DEV_API_KEY2,
|
|
2536
2536
|
DYDX_API_KEY,
|
|
2537
2537
|
ETHEREAL_API_KEY,
|
|
2538
|
+
HYPERBEAT_API_KEY,
|
|
2538
2539
|
KATANA_API_KEY,
|
|
2539
2540
|
OSTIUM_API_KEY,
|
|
2540
2541
|
POLYMARKET_API_KEY
|
|
@@ -2849,7 +2850,7 @@ var flagConfig = {
|
|
|
2849
2850
|
{
|
|
2850
2851
|
key: "apiKey",
|
|
2851
2852
|
type: "isAnyOf",
|
|
2852
|
-
values: [
|
|
2853
|
+
values: [OSTIUM_API_KEY]
|
|
2853
2854
|
}
|
|
2854
2855
|
],
|
|
2855
2856
|
value: JSON.stringify({
|
|
@@ -2901,7 +2902,7 @@ var flagConfig = {
|
|
|
2901
2902
|
{
|
|
2902
2903
|
key: "apiKey",
|
|
2903
2904
|
type: "isAnyOf",
|
|
2904
|
-
values: [ETHEREAL_API_KEY, KATANA_API_KEY]
|
|
2905
|
+
values: [ETHEREAL_API_KEY, KATANA_API_KEY, HYPERBEAT_API_KEY]
|
|
2905
2906
|
},
|
|
2906
2907
|
// Rollout to specific users across all customers
|
|
2907
2908
|
{
|
|
@@ -2932,7 +2933,7 @@ var flagConfig = {
|
|
|
2932
2933
|
{
|
|
2933
2934
|
key: "userId",
|
|
2934
2935
|
type: "pctRollout",
|
|
2935
|
-
pct:
|
|
2936
|
+
pct: 100
|
|
2936
2937
|
},
|
|
2937
2938
|
{
|
|
2938
2939
|
key: "apiKey",
|
|
@@ -2999,7 +3000,8 @@ var flagConfig = {
|
|
|
2999
3000
|
// SUSHI
|
|
3000
3001
|
"0x476eaCd417cD65421bD34fca054377658BB5E02b"
|
|
3001
3002
|
// YFI
|
|
3002
|
-
]
|
|
3003
|
+
],
|
|
3004
|
+
999: ["0x5555555555555555555555555555555555555555"]
|
|
3003
3005
|
})
|
|
3004
3006
|
},
|
|
3005
3007
|
[FlagKey.HelpTutorialUrl]: {
|
|
@@ -3019,6 +3021,8 @@ var flagConfig = {
|
|
|
3019
3021
|
values: [
|
|
3020
3022
|
"0x735D82176A8F35a7d63098769C10017b31D74395",
|
|
3021
3023
|
// Ignatius from Katana
|
|
3024
|
+
"0xa43901c63f7702C407378E55E0d0EB4064a2AE31",
|
|
3025
|
+
// Will from Katana
|
|
3022
3026
|
"0x6ec0c2f25d323e7779925Cc20c3740101f990d9F",
|
|
3023
3027
|
// Chloe
|
|
3024
3028
|
"0xbeFE12aA8cBa36DD79F50eE5E23828adB62f2FD6",
|
|
@@ -3051,45 +3055,38 @@ var flagConfig = {
|
|
|
3051
3055
|
},
|
|
3052
3056
|
[FlagKey.EnableBrokerage]: {
|
|
3053
3057
|
type: "boolean",
|
|
3054
|
-
default_value:
|
|
3055
|
-
overrides: [
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
type: "isAnyOf",
|
|
3087
|
-
values: [KATANA_API_KEY]
|
|
3088
|
-
}
|
|
3089
|
-
],
|
|
3090
|
-
value: false
|
|
3091
|
-
}
|
|
3092
|
-
]
|
|
3058
|
+
default_value: false
|
|
3059
|
+
// overrides: [
|
|
3060
|
+
// {
|
|
3061
|
+
// if_any: [
|
|
3062
|
+
// {
|
|
3063
|
+
// key: 'userId',
|
|
3064
|
+
// type: 'isAnyOf',
|
|
3065
|
+
// values: [
|
|
3066
|
+
// '0x735D82176A8F35a7d63098769C10017b31D74395', // Ignatius from Katana
|
|
3067
|
+
// '0x6ec0c2f25d323e7779925Cc20c3740101f990d9F', // Chloe
|
|
3068
|
+
// '0xbeFE12aA8cBa36DD79F50eE5E23828adB62f2FD6', // Chloe
|
|
3069
|
+
// '0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6', // Mingyang
|
|
3070
|
+
// '0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486', // Alex
|
|
3071
|
+
// '0x0D6e43CA32545B3dc2FE6f93AafBD7e640F548d4',
|
|
3072
|
+
// '0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8', // Greg
|
|
3073
|
+
// '0x9CB7F86F360459cC96C74a0F81aF2C4cC7a54bd2', // Felix
|
|
3074
|
+
// ],
|
|
3075
|
+
// },
|
|
3076
|
+
// ],
|
|
3077
|
+
// value: true,
|
|
3078
|
+
// },
|
|
3079
|
+
// {
|
|
3080
|
+
// if_any: [
|
|
3081
|
+
// {
|
|
3082
|
+
// key: 'apiKey',
|
|
3083
|
+
// type: 'isAnyOf',
|
|
3084
|
+
// values: [KATANA_API_KEY],
|
|
3085
|
+
// },
|
|
3086
|
+
// ],
|
|
3087
|
+
// value: false,
|
|
3088
|
+
// },
|
|
3089
|
+
// ],
|
|
3093
3090
|
},
|
|
3094
3091
|
[FlagKey.EnableMeldPayment]: {
|
|
3095
3092
|
type: "boolean",
|
|
@@ -3200,6 +3197,10 @@ var flagConfig = {
|
|
|
3200
3197
|
default_value: JSON.stringify({
|
|
3201
3198
|
137: []
|
|
3202
3199
|
})
|
|
3200
|
+
},
|
|
3201
|
+
[FlagKey.WithdrawalExcludeChains]: {
|
|
3202
|
+
type: "string",
|
|
3203
|
+
default_value: JSON.stringify([56, 10])
|
|
3203
3204
|
}
|
|
3204
3205
|
};
|
|
3205
3206
|
|
|
@@ -4340,7 +4341,7 @@ var isCheckoutValid = (checkout) => {
|
|
|
4340
4341
|
return isSupported;
|
|
4341
4342
|
};
|
|
4342
4343
|
var isCheckoutHistoryDirectExecution = (checkoutId) => {
|
|
4343
|
-
return checkoutId
|
|
4344
|
+
return !isAddress(checkoutId);
|
|
4344
4345
|
};
|
|
4345
4346
|
function toMergedCheckoutHistoryItem(item) {
|
|
4346
4347
|
if ("depositAddr" in item) {
|
|
@@ -4694,7 +4695,7 @@ var useFunkitPostCheckoutInternal = (checkoutId) => {
|
|
|
4694
4695
|
const [checkoutHistoryInfo, setCheckoutHistoryInfo] = useState6();
|
|
4695
4696
|
const [directExecutionInfo, setDirectExecutionInfo] = useState6();
|
|
4696
4697
|
const [isLoading, setIsLoading] = useState6(false);
|
|
4697
|
-
if (!checkoutId || !
|
|
4698
|
+
if (!checkoutId || !isHex(checkoutId)) {
|
|
4698
4699
|
throw new Error("Invalid checkout ID");
|
|
4699
4700
|
}
|
|
4700
4701
|
useEffect6(() => {
|
|
@@ -5763,10 +5764,6 @@ function useCheckoutDirectExecution() {
|
|
|
5763
5764
|
const waitForConfirmation = () => {
|
|
5764
5765
|
return new Promise((resolve, reject) => {
|
|
5765
5766
|
executeRelayQuote({
|
|
5766
|
-
onConfirmed: async (txHash) => {
|
|
5767
|
-
logger.log("executeRelayQuote:onConfirmed", { txHash });
|
|
5768
|
-
resolve(txHash);
|
|
5769
|
-
},
|
|
5770
5767
|
onError: async (error) => {
|
|
5771
5768
|
logger.error("executeRelayQuote:error", error);
|
|
5772
5769
|
reject(error);
|
|
@@ -5774,6 +5771,12 @@ function useCheckoutDirectExecution() {
|
|
|
5774
5771
|
onProgress: (step) => {
|
|
5775
5772
|
stepMessageSetter(step?.action ?? "");
|
|
5776
5773
|
},
|
|
5774
|
+
onUserActionsCompleted: async (txHash) => {
|
|
5775
|
+
logger.info("executeRelayQuote:onUserActionsCompleted", {
|
|
5776
|
+
txHash
|
|
5777
|
+
});
|
|
5778
|
+
resolve(txHash);
|
|
5779
|
+
},
|
|
5777
5780
|
logger,
|
|
5778
5781
|
relayQuote,
|
|
5779
5782
|
walletClient: withdrawalClient ? {
|
|
@@ -6851,7 +6854,12 @@ var ASSET_LOGO_SRCS = {
|
|
|
6851
6854
|
WBTC: "https://sdk-cdn.fun.xyz/images/wbtc.svg",
|
|
6852
6855
|
WEETH: "https://sdk-cdn.fun.xyz/images/weeth.png",
|
|
6853
6856
|
WETH: "https://sdk-cdn.fun.xyz/images/weth.svg",
|
|
6854
|
-
WSTETH: "https://sdk-cdn.fun.xyz/images/wsteth.png"
|
|
6857
|
+
WSTETH: "https://sdk-cdn.fun.xyz/images/wsteth.png",
|
|
6858
|
+
TRUMP: "https://sdk-cdn.fun.xyz/images/trump.png",
|
|
6859
|
+
BNB: "https://sdk-cdn.fun.xyz/images/bsc.svg",
|
|
6860
|
+
WBNB: "https://sdk-cdn.fun.xyz/images/bsc.svg",
|
|
6861
|
+
BTCB: "https://sdk-cdn.fun.xyz/images/btc.svg",
|
|
6862
|
+
BUSD: "https://sdk-cdn.fun.xyz/images/busd.svg"
|
|
6855
6863
|
};
|
|
6856
6864
|
var FALLBACK_ASSET = "https://sdk-cdn.fun.xyz/images/dollar_circle.png";
|
|
6857
6865
|
|
|
@@ -8347,7 +8355,7 @@ import {
|
|
|
8347
8355
|
import React92, { useEffect as useEffect25, useState as useState25 } from "react";
|
|
8348
8356
|
import { createPortal as createPortal2 } from "react-dom";
|
|
8349
8357
|
import { useDebounce } from "use-debounce";
|
|
8350
|
-
import { isAddress as
|
|
8358
|
+
import { isAddress as isAddress4 } from "viem";
|
|
8351
8359
|
import { useAccount as useAccount3 } from "wagmi";
|
|
8352
8360
|
|
|
8353
8361
|
// src/components/AsyncImage/AsyncImage.tsx
|
|
@@ -9731,7 +9739,7 @@ var TokenAndChainDropdown = ({
|
|
|
9731
9739
|
chainLabel = "Supported chain",
|
|
9732
9740
|
chainLabelAddon,
|
|
9733
9741
|
alwaysOpenToTop,
|
|
9734
|
-
maxTokenDropdownHeight,
|
|
9742
|
+
maxTokenDropdownHeight = 338,
|
|
9735
9743
|
maxChainDropdownHeight,
|
|
9736
9744
|
openChainDropdownFullWidth,
|
|
9737
9745
|
chainTagComponent
|
|
@@ -10019,19 +10027,50 @@ import { motion as motion6, useAnimationControls } from "motion/react";
|
|
|
10019
10027
|
|
|
10020
10028
|
// src/domains/relay.ts
|
|
10021
10029
|
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6 } from "@funkit/chains";
|
|
10030
|
+
import { polygon as polygon3 } from "viem/chains";
|
|
10022
10031
|
var KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
|
|
10032
|
+
function calcCustomFees(relayQuote) {
|
|
10033
|
+
const { fees, details } = relayQuote;
|
|
10034
|
+
const currencyIn = details?.currencyIn?.currency;
|
|
10035
|
+
const currencyOut = details?.currencyOut?.currency;
|
|
10036
|
+
const isSameChain = currencyIn?.chainId === currencyOut?.chainId;
|
|
10037
|
+
const swapImpact = Number.parseFloat(details?.swapImpact?.usd || "0");
|
|
10038
|
+
const relayCost = Number.parseFloat(fees?.relayerService?.amountUsd || "0");
|
|
10039
|
+
const fillCostUsd = Number.parseFloat(fees?.relayerGas?.amountUsd || "0");
|
|
10040
|
+
let swapImpactUsd = relayCost - swapImpact;
|
|
10041
|
+
let appFeeUsd = Number.parseFloat(fees?.app?.amountUsd || "0");
|
|
10042
|
+
let totalImpactUsd = -Number.parseFloat(details?.totalImpact?.usd || "0");
|
|
10043
|
+
if (currencyOut?.chainId === polygon3.id && currencyOut?.symbol === "USDC") {
|
|
10044
|
+
swapImpactUsd += appFeeUsd;
|
|
10045
|
+
appFeeUsd = 0;
|
|
10046
|
+
} else if (isSameChain) {
|
|
10047
|
+
const feeAdjustment = totalImpactUsd * 2e-4;
|
|
10048
|
+
totalImpactUsd = totalImpactUsd - feeAdjustment;
|
|
10049
|
+
appFeeUsd = appFeeUsd - feeAdjustment;
|
|
10050
|
+
} else {
|
|
10051
|
+
const initialAdjustment = appFeeUsd * 1e-3;
|
|
10052
|
+
const remainingAdjustment = (appFeeUsd - initialAdjustment) * 0.75;
|
|
10053
|
+
const totalAdjustment = initialAdjustment + remainingAdjustment;
|
|
10054
|
+
swapImpactUsd = relayCost - swapImpact + totalAdjustment;
|
|
10055
|
+
appFeeUsd = appFeeUsd - totalAdjustment;
|
|
10056
|
+
}
|
|
10057
|
+
const feeSum = [fillCostUsd, swapImpactUsd, appFeeUsd].reduce(
|
|
10058
|
+
(acc, n) => acc + Number.parseFloat(n.toFixed(2))
|
|
10059
|
+
);
|
|
10060
|
+
const feeDiff = Number.parseFloat((totalImpactUsd - feeSum).toFixed(2));
|
|
10061
|
+
if (totalImpactUsd === 0) {
|
|
10062
|
+
totalImpactUsd = Math.abs(totalImpactUsd);
|
|
10063
|
+
}
|
|
10064
|
+
return { swapImpactUsd: swapImpactUsd + feeDiff, appFeeUsd, totalImpactUsd };
|
|
10065
|
+
}
|
|
10023
10066
|
function extractRelayFeeInfo(relayQuote) {
|
|
10024
10067
|
const { details, fees } = relayQuote;
|
|
10068
|
+
const { swapImpactUsd, appFeeUsd, totalImpactUsd } = calcCustomFees(relayQuote);
|
|
10025
10069
|
const gasUsd = Number.parseFloat(fees?.gas?.amountUsd || "0");
|
|
10026
10070
|
const destinationChainId = details?.currencyOut?.currency?.chainId || "";
|
|
10027
10071
|
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[destinationChainId]?.name;
|
|
10028
|
-
const appFeeUsd = Number.parseFloat(fees?.app?.amountUsd || "0");
|
|
10029
10072
|
const fillCostUsd = Number.parseFloat(fees?.relayerGas?.amountUsd || "0");
|
|
10030
|
-
const relayCostUsd = Number.parseFloat(fees?.relayerService?.amountUsd || "0");
|
|
10031
10073
|
const totalUsd = Number.parseFloat(details?.currencyIn?.amountUsd || "0");
|
|
10032
|
-
const trueSwapImpactUsd = Number.parseFloat(details?.swapImpact?.usd || "0");
|
|
10033
|
-
const swapImpactUsd = relayCostUsd - trueSwapImpactUsd;
|
|
10034
|
-
const totalImpactUsd = -Number.parseFloat(details?.totalImpact?.usd || "0");
|
|
10035
10074
|
const totalImpact = totalImpactUsd / totalUsd * 100;
|
|
10036
10075
|
const swapImpact = swapImpactUsd / totalUsd * 100;
|
|
10037
10076
|
const appFeePercent = appFeeUsd / totalUsd * 100;
|
|
@@ -10178,9 +10217,10 @@ function renderRelayFee(relayQuote, fees, totalUsd) {
|
|
|
10178
10217
|
maxSlippage,
|
|
10179
10218
|
minReceived,
|
|
10180
10219
|
chainName,
|
|
10181
|
-
fillCostUsd
|
|
10182
|
-
fillCostPercent
|
|
10220
|
+
fillCostUsd
|
|
10183
10221
|
} = extractRelayFeeInfo(relayQuote);
|
|
10222
|
+
const { details } = relayQuote;
|
|
10223
|
+
const isSameChain = details?.currencyIn?.currency?.chainId === details?.currencyOut?.currency?.chainId;
|
|
10184
10224
|
return {
|
|
10185
10225
|
collapsed: {
|
|
10186
10226
|
value: formatCurrencyAndStringify2(totalImpactUsd + gasUsd)
|
|
@@ -10243,11 +10283,7 @@ function renderRelayFee(relayQuote, fees, totalUsd) {
|
|
|
10243
10283
|
gap: "16"
|
|
10244
10284
|
},
|
|
10245
10285
|
/* @__PURE__ */ React88.createElement(Text, { size: "10" }, "Fill cost ", chainName ? `(${chainName})` : ""),
|
|
10246
|
-
/* @__PURE__ */ React88.createElement(Text, { size: "10", weight: "medium" },
|
|
10247
|
-
usd: fillCostUsd,
|
|
10248
|
-
percent: fillCostPercent,
|
|
10249
|
-
threshold: 5
|
|
10250
|
-
}))
|
|
10286
|
+
/* @__PURE__ */ React88.createElement(Text, { size: "10", weight: "medium" }, formatCurrencyAndStringify2(fillCostUsd))
|
|
10251
10287
|
), /* @__PURE__ */ React88.createElement(
|
|
10252
10288
|
Box,
|
|
10253
10289
|
{
|
|
@@ -10256,7 +10292,7 @@ function renderRelayFee(relayQuote, fees, totalUsd) {
|
|
|
10256
10292
|
justifyContent: "space-between",
|
|
10257
10293
|
gap: "16"
|
|
10258
10294
|
},
|
|
10259
|
-
/* @__PURE__ */ React88.createElement(Text, { size: "10" }, "Fun.xyz fee"),
|
|
10295
|
+
/* @__PURE__ */ React88.createElement(Text, { size: "10", style: { whiteSpace: "nowrap" } }, isSameChain ? "Fun.xyz fee" : "Instant liquidity cost"),
|
|
10260
10296
|
/* @__PURE__ */ React88.createElement(Text, { size: "10", weight: "medium" }, formatRelayFee({
|
|
10261
10297
|
usd: appFeeUsd,
|
|
10262
10298
|
percent: appFeePercent,
|
|
@@ -10501,7 +10537,7 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React89.createElement(
|
|
|
10501
10537
|
// src/hooks/queries/useWithdrawalQuote.ts
|
|
10502
10538
|
import { FlagKey as FlagKey9 } from "@funkit/utils";
|
|
10503
10539
|
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
10504
|
-
import { isAddress as
|
|
10540
|
+
import { isAddress as isAddress2 } from "viem";
|
|
10505
10541
|
import { useConfig as useConfig2 } from "wagmi";
|
|
10506
10542
|
|
|
10507
10543
|
// src/domains/quote.ts
|
|
@@ -10582,7 +10618,7 @@ async function getTransferGas(baseQuote, selectedSourceAssetInfo, wagmiConfig) {
|
|
|
10582
10618
|
})
|
|
10583
10619
|
});
|
|
10584
10620
|
} catch (err) {
|
|
10585
|
-
logger.
|
|
10621
|
+
logger.warn("_getCheckoutQuote:estimateGas:error", err);
|
|
10586
10622
|
return FALLBACK_GAS_ESTIMATE;
|
|
10587
10623
|
}
|
|
10588
10624
|
}
|
|
@@ -10591,7 +10627,8 @@ async function evaluateAccountWalletFees({
|
|
|
10591
10627
|
wagmiConfig,
|
|
10592
10628
|
selectedSourceAssetInfo,
|
|
10593
10629
|
loginType,
|
|
10594
|
-
apiKey
|
|
10630
|
+
apiKey,
|
|
10631
|
+
isWithdrawal
|
|
10595
10632
|
}) {
|
|
10596
10633
|
const nativeCurrencySymbol = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[selectedSourceAssetInfo.chainId]?.nativeCurrency.symbol || "";
|
|
10597
10634
|
const walletCheckoutFees = {
|
|
@@ -10603,7 +10640,7 @@ async function evaluateAccountWalletFees({
|
|
|
10603
10640
|
totalFeesTokenWithoutGas: Number(baseQuote.estFeesFromAmount),
|
|
10604
10641
|
nativeCurrencySymbol
|
|
10605
10642
|
};
|
|
10606
|
-
if (loginType !== "web3" /* Web3 */ || selectedSourceAssetInfo.chainId === zkSync.id.toString()) {
|
|
10643
|
+
if (loginType !== "web3" /* Web3 */ || selectedSourceAssetInfo.chainId === zkSync.id.toString() || isWithdrawal) {
|
|
10607
10644
|
return { fees: walletCheckoutFees };
|
|
10608
10645
|
}
|
|
10609
10646
|
const [gasUnit, gasPriceInWei, nativeCurrencyPrice] = await Promise.all([
|
|
@@ -10862,7 +10899,7 @@ async function getCheckoutBaseQuote(checkoutItem, userId, walletAddress, apiKey,
|
|
|
10862
10899
|
logger.log("baseQuote", baseQuote);
|
|
10863
10900
|
return baseQuote;
|
|
10864
10901
|
}
|
|
10865
|
-
async function getQuoteFinalEstimation(baseQuote, checkoutItem, newPaymentMethodInfo, wagmiConfig, apiKey, loginType, enableFrogProxyServer) {
|
|
10902
|
+
async function getQuoteFinalEstimation(baseQuote, checkoutItem, newPaymentMethodInfo, wagmiConfig, apiKey, loginType, enableFrogProxyServer, isWithdrawal) {
|
|
10866
10903
|
const newFinalDollarValue = baseQuote.estSubtotalUsd;
|
|
10867
10904
|
const { brokerage, fees: finalFeesBreakdown } = await evaluateFeeBreakdown(
|
|
10868
10905
|
{
|
|
@@ -10871,7 +10908,8 @@ async function getQuoteFinalEstimation(baseQuote, checkoutItem, newPaymentMethod
|
|
|
10871
10908
|
newPaymentMethodInfo,
|
|
10872
10909
|
wagmiConfig,
|
|
10873
10910
|
apiKey,
|
|
10874
|
-
loginType
|
|
10911
|
+
loginType,
|
|
10912
|
+
isWithdrawal
|
|
10875
10913
|
},
|
|
10876
10914
|
enableFrogProxyServer
|
|
10877
10915
|
);
|
|
@@ -11004,7 +11042,8 @@ async function getQuoteAndEstimation({
|
|
|
11004
11042
|
wagmiConfig,
|
|
11005
11043
|
apiKey,
|
|
11006
11044
|
loginType,
|
|
11007
|
-
enableFrogProxyServer
|
|
11045
|
+
enableFrogProxyServer,
|
|
11046
|
+
isWithdrawal
|
|
11008
11047
|
);
|
|
11009
11048
|
const checkedAssetAmount = await checkAssetAmount(
|
|
11010
11049
|
checkoutItem,
|
|
@@ -11042,7 +11081,7 @@ function useWithdrawalQuote({
|
|
|
11042
11081
|
const enableFrogProxyServer = useFlag(FlagKey9.EnableFrogProxyServer);
|
|
11043
11082
|
const { getWithdrawalDirectExecution } = useCheckoutDirectExecution();
|
|
11044
11083
|
const { checkoutItem } = useCheckoutContext();
|
|
11045
|
-
const enabled = !!apiKey && !!targetAsset && !!sourceAmount && !!recipientAddress && !!chainId && !!symbol &&
|
|
11084
|
+
const enabled = !!apiKey && !!targetAsset && !!sourceAmount && !!recipientAddress && !!chainId && !!symbol && isAddress2(recipientAddress) && !!checkoutItem;
|
|
11046
11085
|
const query = useQuery6({
|
|
11047
11086
|
queryKey: [
|
|
11048
11087
|
"withdrawal",
|
|
@@ -11089,14 +11128,14 @@ function useWithdrawalQuote({
|
|
|
11089
11128
|
|
|
11090
11129
|
// src/hooks/queries/useWithdrawalRisk.ts
|
|
11091
11130
|
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
11092
|
-
import { isAddress as
|
|
11131
|
+
import { isAddress as isAddress3 } from "viem";
|
|
11093
11132
|
var useWithdrawalRisk = (apiKey, receiveAddress) => {
|
|
11094
11133
|
const query = useQuery7({
|
|
11095
11134
|
queryKey: ["withdrawal", "addressRisk", apiKey, receiveAddress],
|
|
11096
11135
|
queryFn: async () => {
|
|
11097
11136
|
return await hasRisk(apiKey, receiveAddress);
|
|
11098
11137
|
},
|
|
11099
|
-
enabled: !!apiKey && !!receiveAddress &&
|
|
11138
|
+
enabled: !!apiKey && !!receiveAddress && isAddress3(receiveAddress),
|
|
11100
11139
|
refetchOnMount: false,
|
|
11101
11140
|
refetchOnReconnect: false,
|
|
11102
11141
|
refetchOnWindowFocus: false
|
|
@@ -11227,7 +11266,7 @@ var useAssetSymbolPrice = ({
|
|
|
11227
11266
|
// src/hooks/useTokenChain.ts
|
|
11228
11267
|
import { FlagKey as FlagKey12 } from "@funkit/utils";
|
|
11229
11268
|
import { useEffect as useEffect22, useState as useState20 } from "react";
|
|
11230
|
-
import { polygon as
|
|
11269
|
+
import { polygon as polygon4 } from "viem/chains";
|
|
11231
11270
|
|
|
11232
11271
|
// src/hooks/useEnabledTokenTransferChainTokens.ts
|
|
11233
11272
|
import { solanaChain } from "@funkit/chains";
|
|
@@ -11386,7 +11425,7 @@ var useTokenAndChainSelection = (transferInit, defaultValues) => {
|
|
|
11386
11425
|
);
|
|
11387
11426
|
const defaultChainIdFlag = useFlag(FlagKey12.TokenTransferDefaultChainId);
|
|
11388
11427
|
const defaultChainId = defaultValues?.chainId ?? Number(defaultChainIdFlag);
|
|
11389
|
-
const validDefaultChainId = filteredAssets[defaultChainId] !== void 0 ? defaultChainId :
|
|
11428
|
+
const validDefaultChainId = filteredAssets[defaultChainId] !== void 0 ? defaultChainId : polygon4.id;
|
|
11390
11429
|
const [selectedChainId, setSelectedChainId] = useState20(validDefaultChainId);
|
|
11391
11430
|
const defaultSelectedToken = defaultValues?.token ?? filteredAssets?.[selectedChainId]?.[0] ?? "";
|
|
11392
11431
|
const [selectedToken, setSelectedToken] = useState20(defaultSelectedToken);
|
|
@@ -11989,6 +12028,13 @@ function useWithdrawalAssets(config) {
|
|
|
11989
12028
|
});
|
|
11990
12029
|
const excludedTokenStr = useFlag(FlagKey15.WithdrawalExcludeTokens);
|
|
11991
12030
|
const excludedTokens = safeJSONParse(excludedTokenStr);
|
|
12031
|
+
const excludedChainIds = useFlag(FlagKey15.WithdrawalExcludeChains);
|
|
12032
|
+
const excludedChainIdsArray = safeJSONParse(excludedChainIds);
|
|
12033
|
+
if (excludedChainIdsArray && !!excludedChainIdsArray?.length) {
|
|
12034
|
+
for (const chainId of excludedChainIdsArray) {
|
|
12035
|
+
delete assets[chainId];
|
|
12036
|
+
}
|
|
12037
|
+
}
|
|
11992
12038
|
if (excludedTokens) {
|
|
11993
12039
|
for (const chainIdStr of Object.keys(excludedTokens)) {
|
|
11994
12040
|
const chainId = Number.parseInt(chainIdStr);
|
|
@@ -12109,7 +12155,7 @@ var WithdrawContent = ({
|
|
|
12109
12155
|
updateCustomRecipient(e.target.value);
|
|
12110
12156
|
};
|
|
12111
12157
|
const handleAddressBlur = () => {
|
|
12112
|
-
const isValidAddress =
|
|
12158
|
+
const isValidAddress = isAddress4(recipientAddress);
|
|
12113
12159
|
if (!isValidAddress && recipientAddress !== "") {
|
|
12114
12160
|
setAddressInputTouched(true);
|
|
12115
12161
|
}
|
|
@@ -12130,7 +12176,7 @@ var WithdrawContent = ({
|
|
|
12130
12176
|
if (!quote) {
|
|
12131
12177
|
throw new Error("Quote is not available");
|
|
12132
12178
|
}
|
|
12133
|
-
if (!
|
|
12179
|
+
if (!isAddress4(recipientAddress)) {
|
|
12134
12180
|
throw new Error("Invalid wallet address");
|
|
12135
12181
|
}
|
|
12136
12182
|
handleWithdrawal({
|
|
@@ -12144,7 +12190,7 @@ var WithdrawContent = ({
|
|
|
12144
12190
|
const { data: addressAssessment, isLoading: isCheckingAddressRisk } = useWithdrawalRisk(apiKey, recipientAddress);
|
|
12145
12191
|
const getWithdrawButtonText = () => {
|
|
12146
12192
|
if (isWithdrawing) return "Processing";
|
|
12147
|
-
if (!
|
|
12193
|
+
if (!isAddress4(recipientAddress)) return "Enter Recipient Address";
|
|
12148
12194
|
if (!amount || !isWithdrawAmountValid) return "Enter Withdraw Amount";
|
|
12149
12195
|
return "Withdraw";
|
|
12150
12196
|
};
|
|
@@ -12156,9 +12202,9 @@ var WithdrawContent = ({
|
|
|
12156
12202
|
return `Please ensure the address supports receiving ${selectedToken}.`;
|
|
12157
12203
|
};
|
|
12158
12204
|
const bottomSectionRef = useBottomSectionRef("withdrawal");
|
|
12159
|
-
const showAddressError = addressInputTouched && !
|
|
12205
|
+
const showAddressError = addressInputTouched && !isAddress4(recipientAddress) && recipientAddress !== "";
|
|
12160
12206
|
const showAmountError = amountInputTouched && amount !== "" && !isWithdrawAmountValid;
|
|
12161
|
-
const canContinue = recipientAddress && amount && token && selectedChainId && !isQuoteLoading && !showAmountError && !showAddressError && !isCheckingAddressRisk && !addressAssessment &&
|
|
12207
|
+
const canContinue = recipientAddress && amount && token && selectedChainId && !isQuoteLoading && !showAmountError && !showAddressError && !isCheckingAddressRisk && !addressAssessment && isAddress4(recipientAddress) && amount === debouncedAmount;
|
|
12162
12208
|
const receiveAmountCrypto = quote ? getRelayOutputCurrencyAmount(quote.finalEstimation, targetAssetAmount) : 0;
|
|
12163
12209
|
const receiveAmountFiat = quote ? Number(debouncedAmount || 0) : 0;
|
|
12164
12210
|
const withdrawButtonText = getWithdrawButtonText();
|
|
@@ -12514,7 +12560,7 @@ import {
|
|
|
12514
12560
|
getAllWalletTokens
|
|
12515
12561
|
} from "@funkit/api-base";
|
|
12516
12562
|
import { keepPreviousData, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
12517
|
-
import { arbitrum as arbitrum2, polygon as
|
|
12563
|
+
import { arbitrum as arbitrum2, polygon as polygon5 } from "viem/chains";
|
|
12518
12564
|
import { useAccount as useAccount4 } from "wagmi";
|
|
12519
12565
|
import { isTokenEquivalent as isTokenEquivalent2 } from "@funkit/utils";
|
|
12520
12566
|
var ASSETS_LOW_VALUE_THRESHOLD = 0.1;
|
|
@@ -12528,7 +12574,7 @@ function normalizeAssetSymbol(asset) {
|
|
|
12528
12574
|
if (isTokenEquivalent2({
|
|
12529
12575
|
firstTokenChainId: asset.chainId,
|
|
12530
12576
|
firstTokenAddress: asset.contractAddress,
|
|
12531
|
-
secondTokenChainId:
|
|
12577
|
+
secondTokenChainId: polygon5.id.toString(),
|
|
12532
12578
|
secondTokenAddress: POLYGON_USDCE_TOKEN
|
|
12533
12579
|
})) {
|
|
12534
12580
|
return { ...asset, symbol: "USDC.e" };
|
|
@@ -12859,7 +12905,7 @@ var FIAT_PROCESSING_TIME = "1-2 business days";
|
|
|
12859
12905
|
// src/domains/wallet.ts
|
|
12860
12906
|
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12, dydxChain as dydxChain2 } from "@funkit/chains";
|
|
12861
12907
|
import { isNotNullish as isNotNullish6 } from "@funkit/utils";
|
|
12862
|
-
import { mainnet as mainnet5, polygon as
|
|
12908
|
+
import { mainnet as mainnet5, polygon as polygon6 } from "viem/chains";
|
|
12863
12909
|
|
|
12864
12910
|
// src/utils/assets.ts
|
|
12865
12911
|
import { formatUnits } from "viem";
|
|
@@ -16714,7 +16760,7 @@ function CheckoutComplete({
|
|
|
16714
16760
|
setCompletedTimestamp(Date.now());
|
|
16715
16761
|
logCheckoutCompletion(depositAddress);
|
|
16716
16762
|
}, []);
|
|
16717
|
-
return /* @__PURE__ */ React134.createElement(
|
|
16763
|
+
return /* @__PURE__ */ React134.createElement(Box, { id: "complete-page" }, /* @__PURE__ */ React134.createElement(
|
|
16718
16764
|
FunCheckoutHistoryContent,
|
|
16719
16765
|
{
|
|
16720
16766
|
depositAddress,
|
|
@@ -16726,7 +16772,7 @@ function CheckoutComplete({
|
|
|
16726
16772
|
onBackFromHelpPage: noop6,
|
|
16727
16773
|
bottomBarId: MODAL_BOTTOM_BAR_IDS.checkout
|
|
16728
16774
|
}
|
|
16729
|
-
);
|
|
16775
|
+
));
|
|
16730
16776
|
}
|
|
16731
16777
|
|
|
16732
16778
|
// src/modals/CheckoutModal/CheckoutHelp/CheckoutHelp.tsx
|
|
@@ -18832,7 +18878,7 @@ import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
|
18832
18878
|
|
|
18833
18879
|
// src/hooks/queries/useMeldCryptoCurrencyCode.ts
|
|
18834
18880
|
import { FlagKey as FlagKey22 } from "@funkit/utils";
|
|
18835
|
-
import { arbitrum as arbitrum3, base as base6, polygon as
|
|
18881
|
+
import { arbitrum as arbitrum3, base as base6, polygon as polygon7 } from "viem/chains";
|
|
18836
18882
|
var ARB_USDC = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831".toLowerCase();
|
|
18837
18883
|
var POLYGON_USDC = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359".toLowerCase();
|
|
18838
18884
|
var POLYGON_USDCE = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174".toLowerCase();
|
|
@@ -18841,7 +18887,7 @@ var MELD_SUPPORTED_CURRENCIES = {
|
|
|
18841
18887
|
[arbitrum3.id]: {
|
|
18842
18888
|
[ARB_USDC]: "USDC_ARBITRUM"
|
|
18843
18889
|
},
|
|
18844
|
-
[
|
|
18890
|
+
[polygon7.id]: {
|
|
18845
18891
|
[POLYGON_USDC]: "USDC_POLYGON",
|
|
18846
18892
|
// use same token for USDC and USDC.e
|
|
18847
18893
|
[POLYGON_USDCE]: "USDC_POLYGON"
|
|
@@ -24734,7 +24780,7 @@ var TransferTokenDetails = ({
|
|
|
24734
24780
|
import { solanaChain as solanaChain2 } from "@funkit/chains";
|
|
24735
24781
|
import { FlagKey as FlagKey30 } from "@funkit/utils";
|
|
24736
24782
|
import { useMemo as useMemo32 } from "react";
|
|
24737
|
-
import { mainnet as mainnet8, polygon as
|
|
24783
|
+
import { mainnet as mainnet8, polygon as polygon8 } from "viem/chains";
|
|
24738
24784
|
var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
24739
24785
|
const { checkoutItem } = useCheckoutContext();
|
|
24740
24786
|
const enableUniversal = useFlag(
|
|
@@ -24752,7 +24798,7 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
|
24752
24798
|
const minTransferUsd = useMinTransferValue(selectedChainId);
|
|
24753
24799
|
const minTransferUsdPerChain = useMinTransferValues(chainIds ?? []);
|
|
24754
24800
|
const isBankrUsUser = useIsUsBankrUser();
|
|
24755
|
-
const isPolygon = selectedChainId ===
|
|
24801
|
+
const isPolygon = selectedChainId === polygon8.id;
|
|
24756
24802
|
const isUsdceOnPolygon = isPolygon && selectedToken === "USDC.e";
|
|
24757
24803
|
const isUsdcOnPolygon = isPolygon && selectedToken === "USDC";
|
|
24758
24804
|
const showOriginalRecipient = isBankrUsUser || !enableUniversal && (isUsdceOnPolygon || isUsdcOnPolygon);
|
|
@@ -25767,7 +25813,8 @@ var DEFAULT_HEIGHT = 525;
|
|
|
25767
25813
|
var mapHeightToCheckoutStep = {
|
|
25768
25814
|
["transfer_token" /* TRANSFER_TOKEN */]: 825,
|
|
25769
25815
|
["fiat_account_detail" /* FIAT_ACCOUNT_DETAIL */]: 825,
|
|
25770
|
-
["confirmation" /* CONFIRMATION */]: 825
|
|
25816
|
+
["confirmation" /* CONFIRMATION */]: 825,
|
|
25817
|
+
["checkout_complete" /* CHECKOUT_COMPLETE */]: 825
|
|
25771
25818
|
};
|
|
25772
25819
|
function FunCheckoutModalHeightAnimationWrapper({
|
|
25773
25820
|
children,
|
|
@@ -32072,7 +32119,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
32072
32119
|
localStorage.setItem(storageKey5, version);
|
|
32073
32120
|
}
|
|
32074
32121
|
function getCurrentSdkVersion() {
|
|
32075
|
-
return "5.5.
|
|
32122
|
+
return "5.5.16";
|
|
32076
32123
|
}
|
|
32077
32124
|
function useFingerprint() {
|
|
32078
32125
|
const fingerprint = useCallback50(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CheckoutHistoryItem, type DirectExecution } from '@funkit/api-base';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
|
-
import type
|
|
3
|
+
import { type Address, type Hex } from 'viem';
|
|
4
4
|
import { type MergedCheckoutHistoryItem } from '../utils/checkout';
|
|
5
5
|
import { type PurifiedCheckoutHistoryItem } from '../utils/purifyCheckoutHistoryItem';
|
|
6
6
|
export type { HistoricalCheckoutItem, ServerCheckoutConfig, } from '~/domains/clientMetadata';
|
|
@@ -230,22 +230,7 @@ export declare const flagConfig: {
|
|
|
230
230
|
};
|
|
231
231
|
enable_brokerage: {
|
|
232
232
|
type: "boolean";
|
|
233
|
-
default_value:
|
|
234
|
-
overrides: ({
|
|
235
|
-
if_any: {
|
|
236
|
-
key: "userId";
|
|
237
|
-
type: "isAnyOf";
|
|
238
|
-
values: string[];
|
|
239
|
-
}[];
|
|
240
|
-
value: true;
|
|
241
|
-
} | {
|
|
242
|
-
if_any: {
|
|
243
|
-
key: "apiKey";
|
|
244
|
-
type: "isAnyOf";
|
|
245
|
-
values: string[];
|
|
246
|
-
}[];
|
|
247
|
-
value: false;
|
|
248
|
-
})[];
|
|
233
|
+
default_value: false;
|
|
249
234
|
};
|
|
250
235
|
enable_meld_payment: {
|
|
251
236
|
type: "boolean";
|
|
@@ -306,4 +291,8 @@ export declare const flagConfig: {
|
|
|
306
291
|
type: "string";
|
|
307
292
|
default_value: string;
|
|
308
293
|
};
|
|
294
|
+
withdrawal_exclude_chains: {
|
|
295
|
+
type: "string";
|
|
296
|
+
default_value: string;
|
|
297
|
+
};
|
|
309
298
|
};
|
|
@@ -7,25 +7,25 @@ import {
|
|
|
7
7
|
} from "./chunk-JROWU5BP.js";
|
|
8
8
|
import {
|
|
9
9
|
zerionWallet
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ETTNDQQG.js";
|
|
11
11
|
import {
|
|
12
12
|
subWallet
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4UM4GTKZ.js";
|
|
14
|
+
import {
|
|
15
|
+
tahoWallet
|
|
16
|
+
} from "./chunk-6P2EMPZI.js";
|
|
14
17
|
import {
|
|
15
18
|
talismanWallet
|
|
16
19
|
} from "./chunk-ABFSXBE6.js";
|
|
17
20
|
import {
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
tokenPocketWallet
|
|
22
|
+
} from "./chunk-FRGSRLTS.js";
|
|
20
23
|
import {
|
|
21
24
|
tokenaryWallet
|
|
22
25
|
} from "./chunk-SLOIIJGP.js";
|
|
23
|
-
import {
|
|
24
|
-
tokenPocketWallet
|
|
25
|
-
} from "./chunk-IDKVN5CF.js";
|
|
26
26
|
import {
|
|
27
27
|
trustWallet
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-IPOC2VJX.js";
|
|
29
29
|
import {
|
|
30
30
|
uniswapWallet
|
|
31
31
|
} from "./chunk-LH7BMNFZ.js";
|
|
@@ -40,13 +40,13 @@ import {
|
|
|
40
40
|
} from "./chunk-BVX4XGNP.js";
|
|
41
41
|
import {
|
|
42
42
|
rainbowWallet
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-MOOBCMMB.js";
|
|
44
44
|
import {
|
|
45
45
|
ramperWallet
|
|
46
46
|
} from "./chunk-PIUNLQJG.js";
|
|
47
47
|
import {
|
|
48
48
|
roninWallet
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-25VW5TZP.js";
|
|
50
50
|
import {
|
|
51
51
|
safeWallet
|
|
52
52
|
} from "./chunk-BQQQL6UD.js";
|
|
@@ -55,43 +55,43 @@ import {
|
|
|
55
55
|
} from "./chunk-R6RWZRFF.js";
|
|
56
56
|
import {
|
|
57
57
|
safepalWallet
|
|
58
|
-
} from "./chunk-
|
|
59
|
-
import {
|
|
60
|
-
metaMaskWallet
|
|
61
|
-
} from "./chunk-G73C6P5P.js";
|
|
58
|
+
} from "./chunk-6LPM6LUQ.js";
|
|
62
59
|
import {
|
|
63
60
|
ledgerWallet
|
|
64
61
|
} from "./chunk-BRBKM4PW.js";
|
|
62
|
+
import {
|
|
63
|
+
metaMaskWallet
|
|
64
|
+
} from "./chunk-N2NIIUW6.js";
|
|
65
65
|
import {
|
|
66
66
|
mewWallet
|
|
67
67
|
} from "./chunk-V57WLZEE.js";
|
|
68
|
+
import {
|
|
69
|
+
okxWallet
|
|
70
|
+
} from "./chunk-3U3BMEH5.js";
|
|
68
71
|
import {
|
|
69
72
|
oktoWallet
|
|
70
73
|
} from "./chunk-ADIXAKUL.js";
|
|
71
74
|
import {
|
|
72
|
-
|
|
73
|
-
} from "./chunk-
|
|
75
|
+
oneInchWallet
|
|
76
|
+
} from "./chunk-OESTDX6I.js";
|
|
74
77
|
import {
|
|
75
78
|
omniWallet
|
|
76
79
|
} from "./chunk-7CUY5G6R.js";
|
|
77
|
-
import {
|
|
78
|
-
oneInchWallet
|
|
79
|
-
} from "./chunk-OESTDX6I.js";
|
|
80
80
|
import {
|
|
81
81
|
oneKeyWallet
|
|
82
82
|
} from "./chunk-4AD7VI2P.js";
|
|
83
83
|
import {
|
|
84
84
|
foxWallet
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-XYBEMO3C.js";
|
|
86
86
|
import {
|
|
87
87
|
frameWallet
|
|
88
88
|
} from "./chunk-ZMYVTWDF.js";
|
|
89
89
|
import {
|
|
90
90
|
frontierWallet
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-HKV7EMYZ.js";
|
|
92
92
|
import {
|
|
93
93
|
gateWallet
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-3NC26XLM.js";
|
|
95
95
|
import {
|
|
96
96
|
imTokenWallet
|
|
97
97
|
} from "./chunk-COZ7MIQS.js";
|
|
@@ -102,52 +102,52 @@ import {
|
|
|
102
102
|
kresusWallet
|
|
103
103
|
} from "./chunk-MJXPRJZT.js";
|
|
104
104
|
import {
|
|
105
|
-
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import {
|
|
108
|
-
bybitWallet
|
|
109
|
-
} from "./chunk-6ONTSPEY.js";
|
|
105
|
+
braveWallet
|
|
106
|
+
} from "./chunk-PB254NQ4.js";
|
|
110
107
|
import {
|
|
111
|
-
|
|
112
|
-
} from "./chunk-
|
|
108
|
+
clvWallet
|
|
109
|
+
} from "./chunk-LEXSM5KI.js";
|
|
113
110
|
import {
|
|
114
111
|
coinbaseWallet
|
|
115
112
|
} from "./chunk-H4IRCEZN.js";
|
|
116
113
|
import {
|
|
117
|
-
|
|
118
|
-
} from "./chunk-
|
|
114
|
+
coin98Wallet
|
|
115
|
+
} from "./chunk-KFFJPS5R.js";
|
|
119
116
|
import {
|
|
120
|
-
|
|
121
|
-
} from "./chunk-
|
|
117
|
+
coreWallet
|
|
118
|
+
} from "./chunk-JXP2QPW7.js";
|
|
122
119
|
import {
|
|
123
120
|
dawnWallet
|
|
124
121
|
} from "./chunk-LN7OD5EC.js";
|
|
122
|
+
import {
|
|
123
|
+
desigWallet
|
|
124
|
+
} from "./chunk-CTU6JCOK.js";
|
|
125
125
|
import {
|
|
126
126
|
enkryptWallet
|
|
127
127
|
} from "./chunk-SJTXS4ZW.js";
|
|
128
128
|
import {
|
|
129
129
|
argentWallet
|
|
130
130
|
} from "./chunk-WSQ2YJO2.js";
|
|
131
|
-
import {
|
|
132
|
-
bitskiWallet
|
|
133
|
-
} from "./chunk-P74YPRF6.js";
|
|
134
131
|
import {
|
|
135
132
|
bifrostWallet
|
|
136
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-545L7Y4M.js";
|
|
137
134
|
import {
|
|
138
135
|
bitgetWallet
|
|
139
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-7GSNBOD3.js";
|
|
137
|
+
import {
|
|
138
|
+
bitskiWallet
|
|
139
|
+
} from "./chunk-P74YPRF6.js";
|
|
140
140
|
import {
|
|
141
141
|
bitverseWallet
|
|
142
142
|
} from "./chunk-3HZRRP4Y.js";
|
|
143
143
|
import {
|
|
144
144
|
bloomWallet
|
|
145
145
|
} from "./chunk-S27IADFU.js";
|
|
146
|
-
import "./chunk-23WIEY36.js";
|
|
147
146
|
import {
|
|
148
|
-
|
|
149
|
-
} from "./chunk-
|
|
147
|
+
bybitWallet
|
|
148
|
+
} from "./chunk-W5O4YSZN.js";
|
|
150
149
|
import "./chunk-WRA2DVJ7.js";
|
|
150
|
+
import "./chunk-23WIEY36.js";
|
|
151
151
|
export {
|
|
152
152
|
argentWallet,
|
|
153
153
|
bifrostWallet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.16",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
"ua-parser-js": "^1.0.37",
|
|
89
89
|
"use-debounce": "^10.0.5",
|
|
90
90
|
"uuid": "^9.0.1",
|
|
91
|
-
"@funkit/api-base": "1.9.7",
|
|
92
91
|
"@funkit/chains": "0.3.3",
|
|
93
|
-
"@funkit/
|
|
94
|
-
"@funkit/
|
|
95
|
-
"@funkit/
|
|
96
|
-
"@funkit/
|
|
92
|
+
"@funkit/api-base": "1.9.8",
|
|
93
|
+
"@funkit/core": "2.3.30",
|
|
94
|
+
"@funkit/utils": "1.1.6",
|
|
95
|
+
"@funkit/fun-relay": "0.1.10",
|
|
96
|
+
"@funkit/wagmi-tools": "3.0.52"
|
|
97
97
|
},
|
|
98
98
|
"repository": {
|
|
99
99
|
"type": "git",
|