@funkit/connect 7.0.2 → 7.0.3-next.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 +16 -0
- package/dist/{chunk-DN7UTQK5.js → chunk-5GV4UXWB.js} +3 -3
- package/dist/{chunk-OVMNR35O.js → chunk-IVO7KGHT.js} +3 -3
- package/dist/consts/customers.d.ts +2 -0
- package/dist/domains/asset.d.ts +2 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +1 -0
- package/dist/hooks/useCheckoutTransferInit.d.ts +1 -0
- package/dist/index.js +322 -179
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.js +1 -1
- package/dist/utils/checkout.d.ts +1 -0
- package/dist/utils/flags/config.d.ts +2 -2
- package/dist/utils/lighter.d.ts +4 -0
- package/dist/wallets/walletConnectors/index.js +7 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 7.0.3-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a3a4275: feat(connect): enable monad for hyena + based
|
|
8
|
+
- 361d54c: feat(connect): rounding to the nearest tick size
|
|
9
|
+
- 8feddc9: set default modal size medium
|
|
10
|
+
- f7fa2bc: disable non mainnet eth for lighter eth
|
|
11
|
+
- d0fdef4: add insufficient eth message
|
|
12
|
+
- 087557e: feat(connect): migrate showpoweredtagline flag to statsig
|
|
13
|
+
- e3f0125: add new check for isLighterEthSpot
|
|
14
|
+
- Updated dependencies [3601d23]
|
|
15
|
+
- Updated dependencies [f0f39af]
|
|
16
|
+
- @funkit/fun-relay@2.1.16-next.0
|
|
17
|
+
- @funkit/chains@0.5.2-next.0
|
|
18
|
+
|
|
3
19
|
## 7.0.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -142,13 +142,13 @@ var lightTheme = ({
|
|
|
142
142
|
// lightStroke
|
|
143
143
|
modalFooterDivider: "#F7F7F7",
|
|
144
144
|
// lightStroke
|
|
145
|
-
spinnerBackground: "rgba(255, 255, 255, 0.3)",
|
|
145
|
+
spinnerBackground: customColors?.mediumStroke ?? "rgba(255, 255, 255, 0.3)",
|
|
146
146
|
// 30% buttonTextPrimary
|
|
147
|
-
spinnerIndicator: "#FFF",
|
|
147
|
+
spinnerIndicator: customColors?.primaryText ?? "#FFF",
|
|
148
148
|
// 100% buttonTextPrimary
|
|
149
149
|
spinnerBackgroundVerifyAccount: "rgba(255, 255, 255, 0.3)",
|
|
150
150
|
// 30% buttonTextPrimary
|
|
151
|
-
spinnerIndicatorVerifyAccount: "#FFF",
|
|
151
|
+
spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#FFF",
|
|
152
152
|
// 100% buttonTextPrimary
|
|
153
153
|
// Override colors
|
|
154
154
|
...customColors || {},
|
|
@@ -142,13 +142,13 @@ var darkTheme = ({
|
|
|
142
142
|
// lightStroke
|
|
143
143
|
modalFooterDivider: "#333333",
|
|
144
144
|
// lightStroke
|
|
145
|
-
spinnerBackground: "rgba(0, 0, 0, 0.3)",
|
|
145
|
+
spinnerBackground: customColors?.mediumStroke ?? "rgba(0, 0, 0, 0.3)",
|
|
146
146
|
// 30% buttonTextPrimary
|
|
147
|
-
spinnerIndicator: "#000",
|
|
147
|
+
spinnerIndicator: customColors?.primaryText ?? "#000",
|
|
148
148
|
// 100% buttonTextPrimary
|
|
149
149
|
spinnerBackgroundVerifyAccount: "rgba(0, 0, 0, 0.3)",
|
|
150
150
|
// 30% buttonTextPrimary
|
|
151
|
-
spinnerIndicatorVerifyAccount: "#000",
|
|
151
|
+
spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#000",
|
|
152
152
|
// 100% buttonTextPrimary
|
|
153
153
|
// Override colors
|
|
154
154
|
...customColors || {},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
|
|
1
2
|
export declare function isPolymarketCustomer(apiKey: string): apiKey is "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6";
|
|
2
3
|
export declare function isOstiumCustomer(apiKey: string): apiKey is "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN";
|
|
3
4
|
export declare function isBankrCustomer(apiKey: string): apiKey is "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ";
|
|
@@ -13,3 +14,4 @@ export declare function isHyenaCustomer(apiKey: string): apiKey is "pLQBJsA6zS9t
|
|
|
13
14
|
export declare function isAvantisCustomer(apiKey: string): apiKey is "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2";
|
|
14
15
|
export declare function isPerplCustomer(apiKey: string): apiKey is "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu";
|
|
15
16
|
export declare function isLighterxyzCustomer(apiKey: string): apiKey is "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2";
|
|
17
|
+
export declare function isLighterEthSpot(apiKey: string, checkoutConfig: FunkitCheckoutConfig | undefined): boolean | undefined;
|
package/dist/domains/asset.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare function isNativeTokenAddress(address: Address): boolean;
|
|
|
9
9
|
export declare function isDefaultToken(asset: AssetHoldingsItem, checkoutConfig: FunkitCheckoutConfig): boolean;
|
|
10
10
|
export declare const isPolygonEcosystemToken: (chainId: string, tokenAddress: string) => boolean;
|
|
11
11
|
interface AssetUsableToPayParms {
|
|
12
|
+
apiKey: string;
|
|
12
13
|
config: FunkitCheckoutConfig;
|
|
13
14
|
payerAddress: string;
|
|
14
15
|
paymentMethod: PaymentMethod;
|
|
@@ -21,7 +22,7 @@ interface AssetUsableToPayParms {
|
|
|
21
22
|
minUsdRequired?: number;
|
|
22
23
|
t: TFunction;
|
|
23
24
|
}
|
|
24
|
-
export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, t, }: AssetUsableToPayParms) => {
|
|
25
|
+
export declare const isAssetUsableToPayForCheckout: ({ apiKey, config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, t, }: AssetUsableToPayParms) => {
|
|
25
26
|
isUsable: boolean;
|
|
26
27
|
reason: string;
|
|
27
28
|
minUsdRequired?: number;
|
|
@@ -14,6 +14,7 @@ interface DirectExecutionQuoteRequestParamsBase {
|
|
|
14
14
|
toTokenAddress: Address;
|
|
15
15
|
recipientAddress: Address;
|
|
16
16
|
senderAddress?: Address;
|
|
17
|
+
tickSize?: bigint;
|
|
17
18
|
}
|
|
18
19
|
interface RegularDEQuoteRequest extends DirectExecutionQuoteRequestParamsBase {
|
|
19
20
|
toTokenAmount: number;
|
|
@@ -19,6 +19,7 @@ export declare function getCheckoutTokenTransferParams({ checkoutConfig, userId,
|
|
|
19
19
|
recipientAddr: FunAddress;
|
|
20
20
|
actionType: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
|
+
export declare function useIsQRCodeTransferEnabled(): boolean;
|
|
22
23
|
/**
|
|
23
24
|
* creates QR code transfer EOA
|
|
24
25
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
darkTheme
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IVO7KGHT.js";
|
|
5
5
|
import {
|
|
6
6
|
lightTheme
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5GV4UXWB.js";
|
|
8
8
|
import {
|
|
9
9
|
systemFontStack
|
|
10
10
|
} from "./chunk-RJAD5CZH.js";
|
|
@@ -861,6 +861,55 @@ import {
|
|
|
861
861
|
} from "@funkit/utils";
|
|
862
862
|
import { arbitrum as arbitrum5, base as base7, mainnet as mainnet11, optimism, polygon as polygon6 } from "viem/chains";
|
|
863
863
|
|
|
864
|
+
// src/consts/customers.ts
|
|
865
|
+
import {
|
|
866
|
+
AVANTIS_API_KEY,
|
|
867
|
+
BANKR_API_KEY,
|
|
868
|
+
BASED_API_KEY,
|
|
869
|
+
BSX_API_KEY,
|
|
870
|
+
ETHEREAL_API_KEY,
|
|
871
|
+
HYENA_API_KEY,
|
|
872
|
+
HYPERBEAT_API_KEY,
|
|
873
|
+
HYPERDASH_API_KEY,
|
|
874
|
+
KATANA_API_KEY,
|
|
875
|
+
LIGHTERXYZ_API_KEY,
|
|
876
|
+
MONAD_API_KEY,
|
|
877
|
+
MONKEY_TILT_API_KEY,
|
|
878
|
+
OSTIUM_API_KEY,
|
|
879
|
+
PERPL_API_KEY,
|
|
880
|
+
POLYMARKET_API_KEY
|
|
881
|
+
} from "@funkit/api-base";
|
|
882
|
+
function isPolymarketCustomer(apiKey) {
|
|
883
|
+
return apiKey === POLYMARKET_API_KEY;
|
|
884
|
+
}
|
|
885
|
+
function isOstiumCustomer(apiKey) {
|
|
886
|
+
return apiKey === OSTIUM_API_KEY;
|
|
887
|
+
}
|
|
888
|
+
function isBankrCustomer(apiKey) {
|
|
889
|
+
return apiKey === BANKR_API_KEY;
|
|
890
|
+
}
|
|
891
|
+
function isEtherealCustomer(apiKey) {
|
|
892
|
+
return apiKey === ETHEREAL_API_KEY;
|
|
893
|
+
}
|
|
894
|
+
function isKatanaCustomer(apiKey) {
|
|
895
|
+
return apiKey === KATANA_API_KEY;
|
|
896
|
+
}
|
|
897
|
+
function isMonadCustomer(apiKey) {
|
|
898
|
+
return apiKey === MONAD_API_KEY;
|
|
899
|
+
}
|
|
900
|
+
function isBasedCustomer(apiKey) {
|
|
901
|
+
return apiKey === BASED_API_KEY;
|
|
902
|
+
}
|
|
903
|
+
function isHyenaCustomer(apiKey) {
|
|
904
|
+
return apiKey === HYENA_API_KEY;
|
|
905
|
+
}
|
|
906
|
+
function isLighterxyzCustomer(apiKey) {
|
|
907
|
+
return apiKey === LIGHTERXYZ_API_KEY;
|
|
908
|
+
}
|
|
909
|
+
function isLighterEthSpot(apiKey, checkoutConfig) {
|
|
910
|
+
return checkoutConfig && isLighterxyzCustomer(apiKey) && checkoutConfig.qrcodeActionType === "LIGHTER_ETH_SPOT_DEPOSIT";
|
|
911
|
+
}
|
|
912
|
+
|
|
864
913
|
// src/modals/CheckoutModal/InputAmount/utils.ts
|
|
865
914
|
import { formatCurrencyAndStringify } from "@funkit/utils";
|
|
866
915
|
|
|
@@ -1065,7 +1114,7 @@ import {
|
|
|
1065
1114
|
initializeCheckout as postApiInitializeCheckout
|
|
1066
1115
|
} from "@funkit/api-base";
|
|
1067
1116
|
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12 } from "@funkit/chains";
|
|
1068
|
-
import { FlagKey as
|
|
1117
|
+
import { FlagKey as FlagKey22, isNotNullish as isNotNullish8 } from "@funkit/utils";
|
|
1069
1118
|
import React234, {
|
|
1070
1119
|
createContext as createContext17,
|
|
1071
1120
|
useCallback as useCallback49,
|
|
@@ -1089,7 +1138,7 @@ function getCheckoutRecipient({
|
|
|
1089
1138
|
import { exhaustiveCheck, formatAddress } from "@funkit/utils";
|
|
1090
1139
|
|
|
1091
1140
|
// src/consts/bluvo.tsx
|
|
1092
|
-
import { ETHEREAL_API_KEY } from "@funkit/api-base";
|
|
1141
|
+
import { ETHEREAL_API_KEY as ETHEREAL_API_KEY2 } from "@funkit/api-base";
|
|
1093
1142
|
import React16 from "react";
|
|
1094
1143
|
|
|
1095
1144
|
// src/components/Icons/BinanceIcon.tsx
|
|
@@ -1205,7 +1254,7 @@ var KrakenIcon = ({ size = 24 }) => {
|
|
|
1205
1254
|
|
|
1206
1255
|
// src/consts/bluvo.tsx
|
|
1207
1256
|
var BLUVO_MIN_DEPOSIT_BY_CUSTOMER = {
|
|
1208
|
-
[
|
|
1257
|
+
[ETHEREAL_API_KEY2]: 15
|
|
1209
1258
|
};
|
|
1210
1259
|
var SUPPORTED_EXCHANGES = [
|
|
1211
1260
|
{ exchange: "coinbase" /* Coinbase */, status: "live" /* Live */ },
|
|
@@ -1377,7 +1426,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
1377
1426
|
localStorage.setItem(storageKey, version);
|
|
1378
1427
|
}
|
|
1379
1428
|
function getCurrentSdkVersion() {
|
|
1380
|
-
return "7.0.
|
|
1429
|
+
return "7.0.3-next.0";
|
|
1381
1430
|
}
|
|
1382
1431
|
function useFingerprint() {
|
|
1383
1432
|
const fingerprint = useCallback3(() => {
|
|
@@ -2118,56 +2167,66 @@ async function disableAtomicBatchIfSupported(wallet, chainId) {
|
|
|
2118
2167
|
});
|
|
2119
2168
|
}
|
|
2120
2169
|
|
|
2170
|
+
// src/utils/lighter.ts
|
|
2171
|
+
import { getAddress } from "viem";
|
|
2172
|
+
var LIGHTER_DEPOSIT_ABI = [
|
|
2173
|
+
{
|
|
2174
|
+
inputs: [
|
|
2175
|
+
{ internalType: "address", name: "_to", type: "address" },
|
|
2176
|
+
{ internalType: "uint16", name: "_assetIndex", type: "uint16" },
|
|
2177
|
+
{
|
|
2178
|
+
internalType: "enum TxTypes.RouteType",
|
|
2179
|
+
name: "_routeType",
|
|
2180
|
+
type: "uint8"
|
|
2181
|
+
},
|
|
2182
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" }
|
|
2183
|
+
],
|
|
2184
|
+
name: "deposit",
|
|
2185
|
+
outputs: [],
|
|
2186
|
+
stateMutability: "payable",
|
|
2187
|
+
type: "function"
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
2191
|
+
name: "addressToAccountIndex",
|
|
2192
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2193
|
+
stateMutability: "view",
|
|
2194
|
+
type: "function"
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
inputs: [{ internalType: "uint16", name: "assetIndex", type: "uint16" }],
|
|
2198
|
+
name: "assetConfigs",
|
|
2199
|
+
outputs: [
|
|
2200
|
+
{ internalType: "address", name: "tokenAddress", type: "address" },
|
|
2201
|
+
{
|
|
2202
|
+
internalType: "uint8",
|
|
2203
|
+
name: "withdrawalsEnabled",
|
|
2204
|
+
type: "uint8"
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
internalType: "uint56",
|
|
2208
|
+
name: "extensionMultiplier",
|
|
2209
|
+
type: "uint56"
|
|
2210
|
+
},
|
|
2211
|
+
{ internalType: "uint128", name: "tickSize", type: "uint128" },
|
|
2212
|
+
{ internalType: "uint64", name: "depositCapTicks", type: "uint64" },
|
|
2213
|
+
{ internalType: "uint64", name: "minDepositTicks", type: "uint64" }
|
|
2214
|
+
],
|
|
2215
|
+
stateMutability: "view",
|
|
2216
|
+
type: "function"
|
|
2217
|
+
}
|
|
2218
|
+
];
|
|
2219
|
+
var LIGHTER_DEPOSIT_ADDRESS = getAddress(
|
|
2220
|
+
"0x3b4d794a66304f130a4db8f2551b0070dfcf5ca7"
|
|
2221
|
+
);
|
|
2222
|
+
var roundDownToTick = (amount, tickSize) => {
|
|
2223
|
+
return amount - amount % tickSize;
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2121
2226
|
// src/hooks/useRelayBypass.ts
|
|
2122
2227
|
import { FlagKey as FlagKey3, isTokenAddressEquivalent } from "@funkit/utils";
|
|
2123
2228
|
import { useCallback as useCallback6, useMemo as useMemo10 } from "react";
|
|
2124
2229
|
|
|
2125
|
-
// src/consts/customers.ts
|
|
2126
|
-
import {
|
|
2127
|
-
AVANTIS_API_KEY,
|
|
2128
|
-
BANKR_API_KEY,
|
|
2129
|
-
BASED_API_KEY,
|
|
2130
|
-
BSX_API_KEY,
|
|
2131
|
-
ETHEREAL_API_KEY as ETHEREAL_API_KEY2,
|
|
2132
|
-
HYENA_API_KEY,
|
|
2133
|
-
HYPERBEAT_API_KEY,
|
|
2134
|
-
HYPERDASH_API_KEY,
|
|
2135
|
-
KATANA_API_KEY,
|
|
2136
|
-
LIGHTERXYZ_API_KEY,
|
|
2137
|
-
MONAD_API_KEY,
|
|
2138
|
-
MONKEY_TILT_API_KEY,
|
|
2139
|
-
OSTIUM_API_KEY,
|
|
2140
|
-
PERPL_API_KEY,
|
|
2141
|
-
POLYMARKET_API_KEY
|
|
2142
|
-
} from "@funkit/api-base";
|
|
2143
|
-
function isPolymarketCustomer(apiKey) {
|
|
2144
|
-
return apiKey === POLYMARKET_API_KEY;
|
|
2145
|
-
}
|
|
2146
|
-
function isOstiumCustomer(apiKey) {
|
|
2147
|
-
return apiKey === OSTIUM_API_KEY;
|
|
2148
|
-
}
|
|
2149
|
-
function isBankrCustomer(apiKey) {
|
|
2150
|
-
return apiKey === BANKR_API_KEY;
|
|
2151
|
-
}
|
|
2152
|
-
function isEtherealCustomer(apiKey) {
|
|
2153
|
-
return apiKey === ETHEREAL_API_KEY2;
|
|
2154
|
-
}
|
|
2155
|
-
function isKatanaCustomer(apiKey) {
|
|
2156
|
-
return apiKey === KATANA_API_KEY;
|
|
2157
|
-
}
|
|
2158
|
-
function isMonadCustomer(apiKey) {
|
|
2159
|
-
return apiKey === MONAD_API_KEY;
|
|
2160
|
-
}
|
|
2161
|
-
function isBasedCustomer(apiKey) {
|
|
2162
|
-
return apiKey === BASED_API_KEY;
|
|
2163
|
-
}
|
|
2164
|
-
function isHyenaCustomer(apiKey) {
|
|
2165
|
-
return apiKey === HYENA_API_KEY;
|
|
2166
|
-
}
|
|
2167
|
-
function isLighterxyzCustomer(apiKey) {
|
|
2168
|
-
return apiKey === LIGHTERXYZ_API_KEY;
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
2230
|
// src/providers/FunkitFlagsProvider.tsx
|
|
2172
2231
|
import { datadogLogs as datadogLogs2 } from "@datadog/browser-logs";
|
|
2173
2232
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
@@ -2203,6 +2262,7 @@ import {
|
|
|
2203
2262
|
POLYMARKET_API_KEY as POLYMARKET_API_KEY2,
|
|
2204
2263
|
RAREBETSPORTS_API_KEY,
|
|
2205
2264
|
SUSHI_API_KEY,
|
|
2265
|
+
TRADEFOX_API_KEY,
|
|
2206
2266
|
VENTUALS_API_KEY
|
|
2207
2267
|
} from "@funkit/api-base";
|
|
2208
2268
|
import { MONAD_CHAIN_ID, bitcoinChain } from "@funkit/chains";
|
|
@@ -2438,7 +2498,8 @@ var flagConfig = {
|
|
|
2438
2498
|
POLYMARKET_API_KEY2,
|
|
2439
2499
|
RAREBETSPORTS_API_KEY,
|
|
2440
2500
|
SUSHI_API_KEY,
|
|
2441
|
-
VENTUALS_API_KEY
|
|
2501
|
+
VENTUALS_API_KEY,
|
|
2502
|
+
TRADEFOX_API_KEY
|
|
2442
2503
|
]
|
|
2443
2504
|
}
|
|
2444
2505
|
],
|
|
@@ -2519,7 +2580,7 @@ var flagConfig = {
|
|
|
2519
2580
|
{
|
|
2520
2581
|
key: "apiKey",
|
|
2521
2582
|
type: "isAnyOf",
|
|
2522
|
-
values: [POLYMARKET_API_KEY2]
|
|
2583
|
+
values: [POLYMARKET_API_KEY2, BASED_API_KEY2, HYENA_API_KEY2]
|
|
2523
2584
|
}
|
|
2524
2585
|
],
|
|
2525
2586
|
value: JSON.stringify(QR_CODE_WITH_MONAD)
|
|
@@ -3404,16 +3465,22 @@ function useCheckoutDirectExecution() {
|
|
|
3404
3465
|
if (params.isExactIn) {
|
|
3405
3466
|
const { fromTokenDecimals, fromTokenAmount } = params;
|
|
3406
3467
|
const multiplier2 = 10 ** fromTokenDecimals;
|
|
3468
|
+
const fromAmountBaseUnit = BigInt(
|
|
3469
|
+
Math.floor(fromTokenAmount * multiplier2)
|
|
3470
|
+
);
|
|
3471
|
+
const roundedFromAmountBaseUnit = params.tickSize ? roundDownToTick(fromAmountBaseUnit, params.tickSize) : fromAmountBaseUnit;
|
|
3407
3472
|
return await getCheckoutQuoteV2({
|
|
3408
3473
|
...getCheckoutQuoteParams,
|
|
3409
|
-
fromAmountBaseUnit:
|
|
3474
|
+
fromAmountBaseUnit: roundedFromAmountBaseUnit
|
|
3410
3475
|
});
|
|
3411
3476
|
}
|
|
3412
3477
|
const { toTokenAmount, toTokenDecimals } = params;
|
|
3413
3478
|
const multiplier = 10 ** toTokenDecimals;
|
|
3479
|
+
const toAmountBaseUnit = BigInt(Math.floor(toTokenAmount * multiplier));
|
|
3480
|
+
const roundedToAmountBaseUnit = params.tickSize ? roundDownToTick(toAmountBaseUnit, params.tickSize) : toAmountBaseUnit;
|
|
3414
3481
|
return await getCheckoutQuoteV2({
|
|
3415
3482
|
...getCheckoutQuoteParams,
|
|
3416
|
-
toAmountBaseUnit:
|
|
3483
|
+
toAmountBaseUnit: roundedToAmountBaseUnit
|
|
3417
3484
|
});
|
|
3418
3485
|
},
|
|
3419
3486
|
[address, apiKey]
|
|
@@ -3644,12 +3711,19 @@ function getCheckoutTokenTransferParams({
|
|
|
3644
3711
|
toTokenAddress: checkoutConfig.targetAsset
|
|
3645
3712
|
};
|
|
3646
3713
|
}
|
|
3714
|
+
function useIsQRCodeTransferEnabled() {
|
|
3715
|
+
const { checkoutItem } = useCheckoutContext();
|
|
3716
|
+
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
3717
|
+
const isQrCodeEnabled = useFlag(FlagKey4.EnableTokenTransfer, false);
|
|
3718
|
+
const { apiKey } = useFunkitConfig();
|
|
3719
|
+
return isQrCodeEnabled && !isLighterEthSpot(apiKey, checkoutConfig);
|
|
3720
|
+
}
|
|
3647
3721
|
var useCheckoutTransferInit = (enabled = true) => {
|
|
3648
3722
|
const { checkoutItem } = useCheckoutContext();
|
|
3649
3723
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
3724
|
+
const isQrCodeEnabled = useIsQRCodeTransferEnabled();
|
|
3650
3725
|
const { walletAddress, userInfo } = useGeneralWallet();
|
|
3651
3726
|
const { apiKey } = useFunkitConfig();
|
|
3652
|
-
const isQrCodeEnabled = useFlag(FlagKey4.EnableTokenTransfer, false);
|
|
3653
3727
|
const recipientAddr = checkoutConfig?.customRecipient || walletAddress || "0x";
|
|
3654
3728
|
const userId = userInfo.id || "";
|
|
3655
3729
|
const queryKey = getCheckoutTokenTransferParams({
|
|
@@ -5908,7 +5982,9 @@ var ModalSizeOptions = {
|
|
|
5908
5982
|
MEDIUM: "medium",
|
|
5909
5983
|
WIDE: "wide"
|
|
5910
5984
|
};
|
|
5911
|
-
var ModalSizeContext = createContext10(
|
|
5985
|
+
var ModalSizeContext = createContext10(
|
|
5986
|
+
ModalSizeOptions.MEDIUM
|
|
5987
|
+
);
|
|
5912
5988
|
function ModalSizeProvider({
|
|
5913
5989
|
children,
|
|
5914
5990
|
modalSize
|
|
@@ -6167,9 +6243,75 @@ var ErrorBoundary = class extends Component {
|
|
|
6167
6243
|
var ErrorBoundary_default = ErrorBoundary;
|
|
6168
6244
|
|
|
6169
6245
|
// src/components/FunBottomBar/FunBottomBar.tsx
|
|
6170
|
-
import {
|
|
6246
|
+
import { isMobile as isMobile2 } from "@funkit/utils";
|
|
6171
6247
|
import React40 from "react";
|
|
6172
6248
|
|
|
6249
|
+
// src/hooks/statsig/useDynamicConfig.ts
|
|
6250
|
+
import { useDynamicConfig as useStatsigDynamicConfig } from "@statsig/react-bindings";
|
|
6251
|
+
|
|
6252
|
+
// src/__generated__/default_configs.ts
|
|
6253
|
+
var default_configs_default = {
|
|
6254
|
+
addressblacklist: {
|
|
6255
|
+
value: [
|
|
6256
|
+
"0x7b97b46D35a28B561d47F50CFB9a2735E506e59d",
|
|
6257
|
+
"0x409ad08cc6CA757f69Fb80250a424B9eFeB99807",
|
|
6258
|
+
"0x02A86f51aA7B8b1c17c30364748d5Ae4a0727E23",
|
|
6259
|
+
"0x64131b60502C01362639CC5cfE1a1efB6Be1165A",
|
|
6260
|
+
"0xb84440Ee8BAD69c14755bBb7093f861c3512E3D1"
|
|
6261
|
+
]
|
|
6262
|
+
},
|
|
6263
|
+
array_of_strings: {
|
|
6264
|
+
value: []
|
|
6265
|
+
},
|
|
6266
|
+
blockedcountries: {
|
|
6267
|
+
value: [
|
|
6268
|
+
"AF",
|
|
6269
|
+
"BY",
|
|
6270
|
+
"MM",
|
|
6271
|
+
"CF",
|
|
6272
|
+
"CU",
|
|
6273
|
+
"CD",
|
|
6274
|
+
"IR",
|
|
6275
|
+
"LB",
|
|
6276
|
+
"LY",
|
|
6277
|
+
"NI",
|
|
6278
|
+
"KP",
|
|
6279
|
+
"UA",
|
|
6280
|
+
"SO",
|
|
6281
|
+
"SS",
|
|
6282
|
+
"SY",
|
|
6283
|
+
"VE"
|
|
6284
|
+
]
|
|
6285
|
+
},
|
|
6286
|
+
boolean: {
|
|
6287
|
+
value: false
|
|
6288
|
+
},
|
|
6289
|
+
brokerage_hide_you_receive: {
|
|
6290
|
+
value: false
|
|
6291
|
+
},
|
|
6292
|
+
showinfobanner: {
|
|
6293
|
+
value: {
|
|
6294
|
+
message: "",
|
|
6295
|
+
expireAtMs: 1,
|
|
6296
|
+
type: "announcement"
|
|
6297
|
+
}
|
|
6298
|
+
},
|
|
6299
|
+
showpoweredtagline: {
|
|
6300
|
+
value: false
|
|
6301
|
+
},
|
|
6302
|
+
supportedexchangesv2: {
|
|
6303
|
+
value: []
|
|
6304
|
+
}
|
|
6305
|
+
};
|
|
6306
|
+
|
|
6307
|
+
// src/hooks/statsig/useDynamicConfig.ts
|
|
6308
|
+
var useDynamicConfig = (name) => {
|
|
6309
|
+
const config = useStatsigDynamicConfig(name);
|
|
6310
|
+
const fallback2 = default_configs_default[name];
|
|
6311
|
+
const value = config.get("value", fallback2.value);
|
|
6312
|
+
return value;
|
|
6313
|
+
};
|
|
6314
|
+
|
|
6173
6315
|
// src/components/FunButton/FunButton.tsx
|
|
6174
6316
|
import clsx6 from "clsx";
|
|
6175
6317
|
import React37 from "react";
|
|
@@ -6509,7 +6651,7 @@ var FunBottomBar = ({
|
|
|
6509
6651
|
}) => {
|
|
6510
6652
|
const { t } = useFunkitTranslation();
|
|
6511
6653
|
const { uiCustomizations } = useFunkitConfig();
|
|
6512
|
-
const showTagline =
|
|
6654
|
+
const showTagline = useDynamicConfig("showpoweredtagline");
|
|
6513
6655
|
const powerTagline = showTagline ? /* @__PURE__ */ React40.createElement(FunPoweredTagline, null) : void 0;
|
|
6514
6656
|
const hasMultipleButtons = !!actionButtonProps && !!onClose;
|
|
6515
6657
|
const customButtonRadius = showTagline || hasMultipleButtons ? void 0 : isMobile2() ? "modalActionButtonMobile" : "modalActionButton";
|
|
@@ -7204,7 +7346,7 @@ import {
|
|
|
7204
7346
|
solanaChain as solanaChain4
|
|
7205
7347
|
} from "@funkit/chains";
|
|
7206
7348
|
import {
|
|
7207
|
-
FlagKey as
|
|
7349
|
+
FlagKey as FlagKey11,
|
|
7208
7350
|
formatCryptoAndStringify as formatCryptoAndStringify2,
|
|
7209
7351
|
formatCurrencyAndStringify as formatCurrencyAndStringify3
|
|
7210
7352
|
} from "@funkit/utils";
|
|
@@ -7217,7 +7359,7 @@ import { useAccount as useAccount4 } from "wagmi";
|
|
|
7217
7359
|
import React62 from "react";
|
|
7218
7360
|
|
|
7219
7361
|
// src/components/Dropdown/ChainDropdown.tsx
|
|
7220
|
-
import { FlagKey as
|
|
7362
|
+
import { FlagKey as FlagKey6 } from "@funkit/utils";
|
|
7221
7363
|
import React59 from "react";
|
|
7222
7364
|
|
|
7223
7365
|
// src/components/FunTooltip/FunTooltip.tsx
|
|
@@ -8311,9 +8453,9 @@ var ChainDropdown = ({
|
|
|
8311
8453
|
testId
|
|
8312
8454
|
}) => {
|
|
8313
8455
|
const { t } = useFunkitTranslation();
|
|
8314
|
-
const defaultChainIdJson = useFlag(
|
|
8456
|
+
const defaultChainIdJson = useFlag(FlagKey6.TokenTransferDefaultChainId);
|
|
8315
8457
|
const defaultChainId = safeJSONParse(defaultChainIdJson);
|
|
8316
|
-
const chainSortOrderJson = useFlag(
|
|
8458
|
+
const chainSortOrderJson = useFlag(FlagKey6.ChainIdSortOrder);
|
|
8317
8459
|
const chainSortOrder = safeJSONParse(chainSortOrderJson) || [];
|
|
8318
8460
|
const chainIds = getSortedChainIds();
|
|
8319
8461
|
const options = allowUnselect ? [DEFAULT_VALUE, ...chainIds] : chainIds;
|
|
@@ -8423,7 +8565,7 @@ var ChainDropdown = ({
|
|
|
8423
8565
|
};
|
|
8424
8566
|
|
|
8425
8567
|
// src/components/Dropdown/TokenDropdown.tsx
|
|
8426
|
-
import { FlagKey as
|
|
8568
|
+
import { FlagKey as FlagKey7 } from "@funkit/utils";
|
|
8427
8569
|
import React61, { useState as useState19 } from "react";
|
|
8428
8570
|
|
|
8429
8571
|
// src/utils/flags/patches/enable-bitcoin-patch.ts
|
|
@@ -8568,12 +8710,12 @@ var NewTokenBadge = ({ iconSymbol }) => {
|
|
|
8568
8710
|
// src/components/Dropdown/TokenDropdown.tsx
|
|
8569
8711
|
var TOKEN_ICON_SIZE = 16;
|
|
8570
8712
|
var useNewTokens = () => {
|
|
8571
|
-
const enableBitcoin = useFlag(
|
|
8572
|
-
const bannerJson = useFlag(
|
|
8713
|
+
const enableBitcoin = useFlag(FlagKey7.EnableBitcoin);
|
|
8714
|
+
const bannerJson = useFlag(FlagKey7.NewTokenAssetSelectionBanner);
|
|
8573
8715
|
const bannerData = useSafeJSONParse(bannerJson);
|
|
8574
8716
|
const addBitcoinToNewTokensMiddleware = enableBitcoin ? addBitcoinToNewTokens : void 0;
|
|
8575
8717
|
const newBadgeTokensJson = useFlag(
|
|
8576
|
-
|
|
8718
|
+
FlagKey7.TokenTransferNewTokens,
|
|
8577
8719
|
void 0,
|
|
8578
8720
|
addBitcoinToNewTokensMiddleware
|
|
8579
8721
|
);
|
|
@@ -8594,7 +8736,7 @@ var TokenDropdown = ({
|
|
|
8594
8736
|
hideNewTokenBadge,
|
|
8595
8737
|
testId
|
|
8596
8738
|
}) => {
|
|
8597
|
-
const defaultTokensJson = useFlag(
|
|
8739
|
+
const defaultTokensJson = useFlag(FlagKey7.TokenTransferDefaultTokens);
|
|
8598
8740
|
const defaultTokens = safeJSONParse(defaultTokensJson);
|
|
8599
8741
|
const enabledTokens = assets[selectedChainId];
|
|
8600
8742
|
const allTokens = getSortedTokens();
|
|
@@ -9820,9 +9962,11 @@ async function getCheckoutBaseQuote(checkoutItem, userId, walletAddress, apiKey,
|
|
|
9820
9962
|
const toTokenAddress = config.targetAsset;
|
|
9821
9963
|
const fromChainId = selectedSourceAssetInfo.chainId;
|
|
9822
9964
|
const fromTokenAddress = selectedSourceAssetInfo.address;
|
|
9823
|
-
const
|
|
9965
|
+
const isLighterSpot = isLighterEthSpot(apiKey, config);
|
|
9966
|
+
const [toTokenDecimals, fromTokenDecimals, lighterTickSize] = await Promise.all([
|
|
9824
9967
|
getTokenDecimals(wagmiConfig, toChainId, toTokenAddress),
|
|
9825
|
-
getTokenDecimals(wagmiConfig, fromChainId, fromTokenAddress)
|
|
9968
|
+
getTokenDecimals(wagmiConfig, fromChainId, fromTokenAddress),
|
|
9969
|
+
isLighterSpot ? getLighterTickSize(wagmiConfig, toChainId, 1) : Promise.resolve(void 0)
|
|
9826
9970
|
]);
|
|
9827
9971
|
const toTokenAmount = config.targetAssetAmount ?? 0;
|
|
9828
9972
|
const fromTokenAmount = checkoutItem.sourceAssetAmount ?? 0;
|
|
@@ -9842,7 +9986,8 @@ async function getCheckoutBaseQuote(checkoutItem, userId, walletAddress, apiKey,
|
|
|
9842
9986
|
senderAddress,
|
|
9843
9987
|
fromTokenAmount,
|
|
9844
9988
|
fromTokenDecimals,
|
|
9845
|
-
isExactIn: isWithdrawal
|
|
9989
|
+
isExactIn: isWithdrawal,
|
|
9990
|
+
tickSize: lighterTickSize
|
|
9846
9991
|
}) : await getApiCheckoutQuote({
|
|
9847
9992
|
userId,
|
|
9848
9993
|
fromChainId,
|
|
@@ -10357,13 +10502,13 @@ var useAssetSymbolPrice = ({
|
|
|
10357
10502
|
};
|
|
10358
10503
|
|
|
10359
10504
|
// src/hooks/useTokenChain.ts
|
|
10360
|
-
import { FlagKey as
|
|
10505
|
+
import { FlagKey as FlagKey9 } from "@funkit/utils";
|
|
10361
10506
|
import { useEffect as useEffect24, useState as useState21 } from "react";
|
|
10362
10507
|
import { polygon as polygon2 } from "viem/chains";
|
|
10363
10508
|
|
|
10364
10509
|
// src/hooks/useEnabledTokenTransferChainTokens.ts
|
|
10365
10510
|
import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain2 } from "@funkit/chains";
|
|
10366
|
-
import { FlagKey as
|
|
10511
|
+
import { FlagKey as FlagKey8 } from "@funkit/utils";
|
|
10367
10512
|
import { base as base4 } from "viem/chains";
|
|
10368
10513
|
|
|
10369
10514
|
// src/hooks/useIsUsUser.ts
|
|
@@ -10380,14 +10525,14 @@ function useIsUsBankrUser() {
|
|
|
10380
10525
|
// src/hooks/useEnabledTokenTransferChainTokens.ts
|
|
10381
10526
|
function useEnabledTokenTransferChainTokens(transferInit, isWithdrawal) {
|
|
10382
10527
|
const isBankrUsUser = useIsUsBankrUser();
|
|
10383
|
-
const enableBitcoin = useFlag(
|
|
10528
|
+
const enableBitcoin = useFlag(FlagKey8.EnableBitcoin);
|
|
10384
10529
|
const addBitcoinToSourceChainsAndAssetsMiddleware = enableBitcoin ? addBitcoinToSourceChainsAndAssets : void 0;
|
|
10385
10530
|
const depositAssets = useFlag(
|
|
10386
|
-
|
|
10531
|
+
FlagKey8.TokenTransferSourceChainsAndAssets,
|
|
10387
10532
|
void 0,
|
|
10388
10533
|
addBitcoinToSourceChainsAndAssetsMiddleware
|
|
10389
10534
|
);
|
|
10390
|
-
const withdrawalAssets = useFlag(
|
|
10535
|
+
const withdrawalAssets = useFlag(FlagKey8.WithdrawalChainsAndAssets);
|
|
10391
10536
|
const assetsJsonString = isWithdrawal ? withdrawalAssets : depositAssets;
|
|
10392
10537
|
const assets = safeJSONParse(assetsJsonString);
|
|
10393
10538
|
if (!assets) {
|
|
@@ -10424,7 +10569,7 @@ var useTokenAndChainSelection = (transferInit, defaultValues, isWithdrawal) => {
|
|
|
10424
10569
|
transferInit ?? null,
|
|
10425
10570
|
isWithdrawal
|
|
10426
10571
|
);
|
|
10427
|
-
const defaultChainIdFlag = useFlag(
|
|
10572
|
+
const defaultChainIdFlag = useFlag(FlagKey9.TokenTransferDefaultChainId);
|
|
10428
10573
|
const defaultChainId = defaultValues?.chainId ?? Number(defaultChainIdFlag);
|
|
10429
10574
|
const validDefaultChainId = filteredAssets[defaultChainId] !== void 0 ? defaultChainId : polygon2.id;
|
|
10430
10575
|
const [selectedChainId, setSelectedChainId] = useState21(validDefaultChainId);
|
|
@@ -10753,72 +10898,6 @@ function useAutoClearState(initialValue = null) {
|
|
|
10753
10898
|
import { ClientError as ClientError2 } from "@funkit/utils";
|
|
10754
10899
|
import { useState as useState25 } from "react";
|
|
10755
10900
|
|
|
10756
|
-
// src/hooks/statsig/useDynamicConfig.ts
|
|
10757
|
-
import { useDynamicConfig as useStatsigDynamicConfig } from "@statsig/react-bindings";
|
|
10758
|
-
|
|
10759
|
-
// src/__generated__/default_configs.ts
|
|
10760
|
-
var default_configs_default = {
|
|
10761
|
-
addressblacklist: {
|
|
10762
|
-
value: [
|
|
10763
|
-
"0x7b97b46D35a28B561d47F50CFB9a2735E506e59d",
|
|
10764
|
-
"0x409ad08cc6CA757f69Fb80250a424B9eFeB99807",
|
|
10765
|
-
"0x02A86f51aA7B8b1c17c30364748d5Ae4a0727E23",
|
|
10766
|
-
"0x64131b60502C01362639CC5cfE1a1efB6Be1165A",
|
|
10767
|
-
"0xb84440Ee8BAD69c14755bBb7093f861c3512E3D1"
|
|
10768
|
-
]
|
|
10769
|
-
},
|
|
10770
|
-
array_of_strings: {
|
|
10771
|
-
value: []
|
|
10772
|
-
},
|
|
10773
|
-
blockedcountries: {
|
|
10774
|
-
value: [
|
|
10775
|
-
"AF",
|
|
10776
|
-
"BY",
|
|
10777
|
-
"MM",
|
|
10778
|
-
"CF",
|
|
10779
|
-
"CU",
|
|
10780
|
-
"CD",
|
|
10781
|
-
"IR",
|
|
10782
|
-
"LB",
|
|
10783
|
-
"LY",
|
|
10784
|
-
"NI",
|
|
10785
|
-
"KP",
|
|
10786
|
-
"UA",
|
|
10787
|
-
"SO",
|
|
10788
|
-
"SS",
|
|
10789
|
-
"SY",
|
|
10790
|
-
"VE"
|
|
10791
|
-
]
|
|
10792
|
-
},
|
|
10793
|
-
boolean: {
|
|
10794
|
-
value: false
|
|
10795
|
-
},
|
|
10796
|
-
brokerage_hide_you_receive: {
|
|
10797
|
-
value: false
|
|
10798
|
-
},
|
|
10799
|
-
showinfobanner: {
|
|
10800
|
-
value: {
|
|
10801
|
-
message: "",
|
|
10802
|
-
expireAtMs: 1,
|
|
10803
|
-
type: "announcement"
|
|
10804
|
-
}
|
|
10805
|
-
},
|
|
10806
|
-
showpoweredtagline: {
|
|
10807
|
-
value: false
|
|
10808
|
-
},
|
|
10809
|
-
supportedexchangesv2: {
|
|
10810
|
-
value: []
|
|
10811
|
-
}
|
|
10812
|
-
};
|
|
10813
|
-
|
|
10814
|
-
// src/hooks/statsig/useDynamicConfig.ts
|
|
10815
|
-
var useDynamicConfig = (name) => {
|
|
10816
|
-
const config = useStatsigDynamicConfig(name);
|
|
10817
|
-
const fallback2 = default_configs_default[name];
|
|
10818
|
-
const value = config.get("value", fallback2.value);
|
|
10819
|
-
return value;
|
|
10820
|
-
};
|
|
10821
|
-
|
|
10822
10901
|
// src/hooks/useIsBlacklisted.ts
|
|
10823
10902
|
var useIsBlacklisted = (walletAddress, customRecipient) => {
|
|
10824
10903
|
const addressblacklist = useDynamicConfig("addressblacklist");
|
|
@@ -10900,7 +10979,7 @@ import {
|
|
|
10900
10979
|
monadChain,
|
|
10901
10980
|
solanaChain as solanaChain3
|
|
10902
10981
|
} from "@funkit/chains";
|
|
10903
|
-
import { FlagKey as
|
|
10982
|
+
import { FlagKey as FlagKey10 } from "@funkit/utils";
|
|
10904
10983
|
import { useMemo as useMemo16 } from "react";
|
|
10905
10984
|
import { arbitrum as arbitrum2, mainnet as mainnet6, polygon as polygon4 } from "viem/chains";
|
|
10906
10985
|
|
|
@@ -10925,7 +11004,7 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
|
10925
11004
|
const { apiKey } = useFunkitConfig();
|
|
10926
11005
|
const { checkoutItem } = useCheckoutContext();
|
|
10927
11006
|
const enableUniversal = useFlag(
|
|
10928
|
-
|
|
11007
|
+
FlagKey10.EnableTokenTransferUniversalDepositAddress,
|
|
10929
11008
|
false
|
|
10930
11009
|
);
|
|
10931
11010
|
const estPriceImpact = usePriceImpactEstimation(
|
|
@@ -10979,7 +11058,7 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
|
10979
11058
|
};
|
|
10980
11059
|
var useMinTransferLimits = () => {
|
|
10981
11060
|
const { userIpInfo } = useFunkitUserIp();
|
|
10982
|
-
const minTransferValueJsonString = useFlag(
|
|
11061
|
+
const minTransferValueJsonString = useFlag(FlagKey10.MinTokenTransferValue);
|
|
10983
11062
|
const minTransferValue = safeJSONParse(
|
|
10984
11063
|
minTransferValueJsonString
|
|
10985
11064
|
);
|
|
@@ -12219,7 +12298,7 @@ function useWithdrawalAssets(config) {
|
|
|
12219
12298
|
},
|
|
12220
12299
|
true
|
|
12221
12300
|
);
|
|
12222
|
-
const excludedTokenStr = useFlag(
|
|
12301
|
+
const excludedTokenStr = useFlag(FlagKey11.WithdrawalExcludeTokens);
|
|
12223
12302
|
const excludedTokens = safeJSONParse(excludedTokenStr);
|
|
12224
12303
|
if (excludedTokens) {
|
|
12225
12304
|
for (const chainIdStr of Object.keys(excludedTokens)) {
|
|
@@ -12941,7 +13020,7 @@ import { useAccount as useAccount5 } from "wagmi";
|
|
|
12941
13020
|
|
|
12942
13021
|
// src/components/FunPayments/FunPaymentMethods.tsx
|
|
12943
13022
|
import { BridgeCustomerStatus as BridgeCustomerStatus3 } from "@funkit/api-base";
|
|
12944
|
-
import { FlagKey as
|
|
13023
|
+
import { FlagKey as FlagKey13, formatCurrencyAndStringify as formatCurrencyAndStringify4 } from "@funkit/utils";
|
|
12945
13024
|
import React79, { useEffect as useEffect29 } from "react";
|
|
12946
13025
|
|
|
12947
13026
|
// src/domains/bridge.ts
|
|
@@ -13042,7 +13121,7 @@ import {
|
|
|
13042
13121
|
createBridgeBankAccount,
|
|
13043
13122
|
getBridgeKycLink
|
|
13044
13123
|
} from "@funkit/api-base";
|
|
13045
|
-
import { FlagKey as
|
|
13124
|
+
import { FlagKey as FlagKey12 } from "@funkit/utils";
|
|
13046
13125
|
import { useQuery as useQuery11, useQueryClient } from "@tanstack/react-query";
|
|
13047
13126
|
import { useCallback as useCallback18 } from "react";
|
|
13048
13127
|
var sepaCountryCode = [
|
|
@@ -13122,8 +13201,8 @@ function useFiatEnabled() {
|
|
|
13122
13201
|
const isEuSepaUser = sepaCountryCode.includes(
|
|
13123
13202
|
userIpInfo?.alpha2 || "PLACEHOLDER"
|
|
13124
13203
|
);
|
|
13125
|
-
const isTokenTransferEnabled =
|
|
13126
|
-
const isFiatEnabled = useFlag(
|
|
13204
|
+
const isTokenTransferEnabled = useIsQRCodeTransferEnabled();
|
|
13205
|
+
const isFiatEnabled = useFlag(FlagKey12.EnableFiatDeposit);
|
|
13127
13206
|
return isEuSepaUser && isTokenTransferEnabled && isFiatEnabled;
|
|
13128
13207
|
}
|
|
13129
13208
|
function useFrogAccounts() {
|
|
@@ -13296,6 +13375,10 @@ var processWalletAssets = (walletAssets, targetChain) => {
|
|
|
13296
13375
|
if (!isCheckoutOnMainnet && targetChain !== asset.chainId) {
|
|
13297
13376
|
return result;
|
|
13298
13377
|
}
|
|
13378
|
+
const MAINNET_WETH_ADDRESS = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
|
|
13379
|
+
if (asset.contractAddress.toLowerCase() === MAINNET_WETH_ADDRESS && asset.chainId === "1") {
|
|
13380
|
+
asset.symbol = "WETH";
|
|
13381
|
+
}
|
|
13299
13382
|
const chainSymbol = combineChainSymbolOrAddress({
|
|
13300
13383
|
chainId: asset.chainId,
|
|
13301
13384
|
symbolOrAddress: asset.symbol
|
|
@@ -14633,12 +14716,12 @@ var TransferPaymentMethodItem = ({
|
|
|
14633
14716
|
}) => {
|
|
14634
14717
|
const { t } = useFunkitTranslation();
|
|
14635
14718
|
const { textCustomizations } = useFunkitConfig();
|
|
14636
|
-
const enableBitcoin = useFlag(
|
|
14637
|
-
const bannerJson = useFlag(
|
|
14719
|
+
const enableBitcoin = useFlag(FlagKey13.EnableBitcoin);
|
|
14720
|
+
const bannerJson = useFlag(FlagKey13.NewTokenAssetSelectionBanner);
|
|
14638
14721
|
const bannerData = useSafeJSONParse(bannerJson);
|
|
14639
14722
|
const addBitcoinToSourceChainsAndAssetsMiddleware = enableBitcoin ? addBitcoinToSourceChainsAndAssets : void 0;
|
|
14640
14723
|
const depositAssetsJson = useFlag(
|
|
14641
|
-
|
|
14724
|
+
FlagKey13.TokenTransferSourceChainsAndAssets,
|
|
14642
14725
|
void 0,
|
|
14643
14726
|
addBitcoinToSourceChainsAndAssetsMiddleware
|
|
14644
14727
|
);
|
|
@@ -15239,13 +15322,13 @@ var selectWrapperStyle = "_163ehmk1";
|
|
|
15239
15322
|
import {
|
|
15240
15323
|
getCheckoutsByUserId as getCheckoutsByUserId2
|
|
15241
15324
|
} from "@funkit/api-base";
|
|
15242
|
-
import { FlagKey as
|
|
15325
|
+
import { FlagKey as FlagKey14 } from "@funkit/utils";
|
|
15243
15326
|
import { useQuery as useQuery12 } from "@tanstack/react-query";
|
|
15244
15327
|
var hasCorrectPaymentMethod = (checkout, paymentMethod) => !paymentMethod || checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
|
|
15245
15328
|
var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
|
|
15246
15329
|
var DEFAULT_NOTIF_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
|
|
15247
15330
|
function useCheckoutRefreshInterval() {
|
|
15248
|
-
const str = useFlag(
|
|
15331
|
+
const str = useFlag(FlagKey14.CheckoutNotificationsRefreshInterval);
|
|
15249
15332
|
return safeJSONParse(str) || { listRefresh: 50 * 1e3, itemRefresh: 5 * 1e3 };
|
|
15250
15333
|
}
|
|
15251
15334
|
var useRecentCheckouts = ({
|
|
@@ -22622,7 +22705,7 @@ import { getMeldDefaultFiat } from "@funkit/api-base";
|
|
|
22622
22705
|
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
22623
22706
|
|
|
22624
22707
|
// src/hooks/queries/useMeldCryptoCurrencyCode.ts
|
|
22625
|
-
import { FlagKey as
|
|
22708
|
+
import { FlagKey as FlagKey15 } from "@funkit/utils";
|
|
22626
22709
|
import { arbitrum as arbitrum4, base as base6, polygon as polygon5 } from "viem/chains";
|
|
22627
22710
|
var ARB_USDC = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831".toLowerCase();
|
|
22628
22711
|
var POLYGON_USDC = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359".toLowerCase();
|
|
@@ -22655,7 +22738,7 @@ function useMeldCryptoCurrencyCode() {
|
|
|
22655
22738
|
return mappedCurrency;
|
|
22656
22739
|
}
|
|
22657
22740
|
function useIsMeldEnabled() {
|
|
22658
|
-
const meldEnabled = useFlag(
|
|
22741
|
+
const meldEnabled = useFlag(FlagKey15.EnableMeldPayment);
|
|
22659
22742
|
const meldCurrencyCode = useMeldCryptoCurrencyCode();
|
|
22660
22743
|
return meldEnabled && !!meldCurrencyCode;
|
|
22661
22744
|
}
|
|
@@ -22852,7 +22935,7 @@ var useMeldLimitError = (amount, fiatCurrency) => {
|
|
|
22852
22935
|
|
|
22853
22936
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoaded.tsx
|
|
22854
22937
|
import {
|
|
22855
|
-
FlagKey as
|
|
22938
|
+
FlagKey as FlagKey18,
|
|
22856
22939
|
formatCryptoAndStringify as formatCryptoAndStringify5,
|
|
22857
22940
|
formatCurrencyAndStringify as formatCurrencyAndStringify9,
|
|
22858
22941
|
isTokenEquivalent as isTokenEquivalent4,
|
|
@@ -22941,7 +23024,7 @@ var CurrencySelector = ({
|
|
|
22941
23024
|
};
|
|
22942
23025
|
|
|
22943
23026
|
// src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.tsx
|
|
22944
|
-
import { FlagKey as
|
|
23027
|
+
import { FlagKey as FlagKey16 } from "@funkit/utils";
|
|
22945
23028
|
import clsx21 from "clsx";
|
|
22946
23029
|
import { useAnimate as useAnimate3 } from "motion/react";
|
|
22947
23030
|
import React162 from "react";
|
|
@@ -23548,7 +23631,7 @@ var SourcePaymentMethodItem = ({
|
|
|
23548
23631
|
}
|
|
23549
23632
|
];
|
|
23550
23633
|
const isMeldEnabled = useIsMeldEnabled();
|
|
23551
|
-
const isBrokerageEnabled = useFlag(
|
|
23634
|
+
const isBrokerageEnabled = useFlag(FlagKey16.EnableBluvoBrokerage);
|
|
23552
23635
|
const usableAlternativeIcons = icons.filter(({ paymentMethod }) => {
|
|
23553
23636
|
if (paymentMethod === type || paymentMethod === "card" /* CARD */ && !isMeldEnabled || paymentMethod === "brokerage" /* BROKERAGE */ && !isBrokerageEnabled) {
|
|
23554
23637
|
return false;
|
|
@@ -23905,7 +23988,7 @@ function InputAmountLayout({
|
|
|
23905
23988
|
}
|
|
23906
23989
|
|
|
23907
23990
|
// src/modals/CheckoutModal/InputAmount/QuickOptions.tsx
|
|
23908
|
-
import { FlagKey as
|
|
23991
|
+
import { FlagKey as FlagKey17, clamp as clamp2, formatCurrencyAndStringify as formatCurrencyAndStringify7 } from "@funkit/utils";
|
|
23909
23992
|
import React167 from "react";
|
|
23910
23993
|
var USD_AMOUNT_OPTIONS_PCT = [25, 50, 75, 100];
|
|
23911
23994
|
function deduplicateArray(arr) {
|
|
@@ -23913,7 +23996,7 @@ function deduplicateArray(arr) {
|
|
|
23913
23996
|
}
|
|
23914
23997
|
function useFiatAmountOptions(currency) {
|
|
23915
23998
|
const isMeldEnabled = useIsMeldEnabled();
|
|
23916
|
-
const currencyQuickOptionStr = useFlag(
|
|
23999
|
+
const currencyQuickOptionStr = useFlag(FlagKey17.MeldQuickOptions);
|
|
23917
24000
|
const currencyQuickOption = safeJSONParse(
|
|
23918
24001
|
currencyQuickOptionStr
|
|
23919
24002
|
);
|
|
@@ -25216,7 +25299,7 @@ function InputAmountLoaded({
|
|
|
25216
25299
|
textCustomizations
|
|
25217
25300
|
}) {
|
|
25218
25301
|
const { t } = useFunkitTranslation();
|
|
25219
|
-
const maxCheckoutUsdString = useFlag(
|
|
25302
|
+
const maxCheckoutUsdString = useFlag(FlagKey18.MaxCheckoutUsd);
|
|
25220
25303
|
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
25221
25304
|
const paymentMethodInfo = modalState.paymentMethodInfo;
|
|
25222
25305
|
const { quote: manuallySelectedQuote } = modalState;
|
|
@@ -25912,15 +25995,15 @@ function InputAmount(props) {
|
|
|
25912
25995
|
import React176, { useEffect as useEffect46 } from "react";
|
|
25913
25996
|
|
|
25914
25997
|
// src/hooks/usePaymentSources.ts
|
|
25915
|
-
import { FlagKey as
|
|
25998
|
+
import { FlagKey as FlagKey19, isNotNullish as isNotNullish5 } from "@funkit/utils";
|
|
25916
25999
|
function usePaymentMethodEnablement({
|
|
25917
26000
|
checkoutConfig
|
|
25918
26001
|
}) {
|
|
25919
26002
|
const { apiKey } = useFunkitConfig();
|
|
25920
|
-
const isTokenTransferFlagEnabled =
|
|
26003
|
+
const isTokenTransferFlagEnabled = useIsQRCodeTransferEnabled();
|
|
25921
26004
|
const isFiatFlagEnabled = useFiatEnabled();
|
|
25922
26005
|
const isMeldFlagEnabled = useIsMeldEnabled();
|
|
25923
|
-
const isBrokerageFlagEnabled = useFlag(
|
|
26006
|
+
const isBrokerageFlagEnabled = useFlag(FlagKey19.EnableBluvoBrokerage);
|
|
25924
26007
|
const isKatanaEarnFlowAction = isKatanaEarnFlow({ apiKey, checkoutConfig });
|
|
25925
26008
|
const isFiatEnabled = isFiatFlagEnabled && !isKatanaEarnFlowAction;
|
|
25926
26009
|
const isTokenTransferEnabled = isTokenTransferFlagEnabled && !isKatanaEarnFlowAction;
|
|
@@ -26693,7 +26776,7 @@ var ReceiveTokenDropdown = ({
|
|
|
26693
26776
|
// src/components/NewTokenDepositAlert/NewTokenDepositAlert.tsx
|
|
26694
26777
|
import React181 from "react";
|
|
26695
26778
|
import { Trans as Trans11 } from "react-i18next";
|
|
26696
|
-
import { FlagKey as
|
|
26779
|
+
import { FlagKey as FlagKey20 } from "@funkit/utils";
|
|
26697
26780
|
var FunLinkButtonComponent2 = ({
|
|
26698
26781
|
children,
|
|
26699
26782
|
onClick,
|
|
@@ -26713,9 +26796,9 @@ var NewTokenDepositAlert = ({
|
|
|
26713
26796
|
onClick
|
|
26714
26797
|
}) => {
|
|
26715
26798
|
const { t } = useFunkitTranslation();
|
|
26716
|
-
const alertJson = useFlag(
|
|
26799
|
+
const alertJson = useFlag(FlagKey20.NewTokenAssetSelectionBanner);
|
|
26717
26800
|
const alertData = useSafeJSONParse(alertJson);
|
|
26718
|
-
const isTokenTransferEnabled =
|
|
26801
|
+
const isTokenTransferEnabled = useIsQRCodeTransferEnabled();
|
|
26719
26802
|
if (!alertData || !isTokenTransferEnabled) {
|
|
26720
26803
|
return null;
|
|
26721
26804
|
}
|
|
@@ -26840,6 +26923,7 @@ function useEnrichedAccountHoldings({
|
|
|
26840
26923
|
accountHoldings,
|
|
26841
26924
|
targetAssetInfo
|
|
26842
26925
|
}) {
|
|
26926
|
+
const { apiKey } = useFunkitConfig();
|
|
26843
26927
|
const { t } = useFunkitTranslation();
|
|
26844
26928
|
const { isAllowed, isLoading } = useAllowedAssets();
|
|
26845
26929
|
const { walletAddress } = useGeneralWallet();
|
|
@@ -26856,6 +26940,7 @@ function useEnrichedAccountHoldings({
|
|
|
26856
26940
|
minUsdRequired = minUsd;
|
|
26857
26941
|
}
|
|
26858
26942
|
const usableForCheckout = isAssetUsableToPayForCheckout({
|
|
26943
|
+
apiKey,
|
|
26859
26944
|
config: checkoutConfig,
|
|
26860
26945
|
targetTokenAddress: targetAssetInfo.tokenAddress,
|
|
26861
26946
|
targetChainId: targetAssetInfo.tokenChainId,
|
|
@@ -26874,6 +26959,7 @@ function useEnrichedAccountHoldings({
|
|
|
26874
26959
|
return { asset, usableForCheckout };
|
|
26875
26960
|
});
|
|
26876
26961
|
}, [
|
|
26962
|
+
apiKey,
|
|
26877
26963
|
accountHoldings,
|
|
26878
26964
|
checkoutConfig,
|
|
26879
26965
|
isAllowed,
|
|
@@ -27093,11 +27179,32 @@ function AccountSelectAsset({
|
|
|
27093
27179
|
const isAssetsEmpty = assetOptions.length === 0;
|
|
27094
27180
|
const isDisabled = isAssetsEmpty || !selectedChainTokenSymbol || isLoading;
|
|
27095
27181
|
const onBalanceTopUpSwitch = checkoutItem?.initSettings.onBalanceTopUpSwitch;
|
|
27182
|
+
const showLighterEthMessage = isLighterEthSpot(apiKey, checkoutConfig) && assetOptions.every((asset) => asset.isDisabled);
|
|
27096
27183
|
const assetList = isLoading ? /* @__PURE__ */ React182.createElement(FunAssetLoading, { count: 5 }) : isAssetsEmpty ? /* @__PURE__ */ React182.createElement(
|
|
27097
27184
|
FunNoResults,
|
|
27098
27185
|
{
|
|
27099
|
-
text: t("checkout.noAvailableTokensMessage"),
|
|
27100
27186
|
title: t("checkout.noAvailableTokens"),
|
|
27187
|
+
text: t("checkout.noAvailableTokensMessage"),
|
|
27188
|
+
variant: "actionable",
|
|
27189
|
+
actionButton: onBalanceTopUpSwitch ? /* @__PURE__ */ React182.createElement(
|
|
27190
|
+
FunButton,
|
|
27191
|
+
{
|
|
27192
|
+
type: "tertiary",
|
|
27193
|
+
onClick: () => {
|
|
27194
|
+
if (onBalanceTopUpSwitch) {
|
|
27195
|
+
onBalanceTopUpSwitch();
|
|
27196
|
+
}
|
|
27197
|
+
onClose?.();
|
|
27198
|
+
},
|
|
27199
|
+
title: t("checkout.topUpWallet")
|
|
27200
|
+
}
|
|
27201
|
+
) : void 0
|
|
27202
|
+
}
|
|
27203
|
+
) : showLighterEthMessage ? /* @__PURE__ */ React182.createElement(
|
|
27204
|
+
FunNoResults,
|
|
27205
|
+
{
|
|
27206
|
+
title: t("checkout.insufficientEth"),
|
|
27207
|
+
text: t("checkout.insufficientEthMessage"),
|
|
27101
27208
|
variant: "actionable",
|
|
27102
27209
|
actionButton: onBalanceTopUpSwitch ? /* @__PURE__ */ React182.createElement(
|
|
27103
27210
|
FunButton,
|
|
@@ -27868,12 +27975,12 @@ function CopyInputDisplayedAddress(props) {
|
|
|
27868
27975
|
}
|
|
27869
27976
|
|
|
27870
27977
|
// src/components/FunInfoBanner/ChainInfoBanners.tsx
|
|
27871
|
-
import { FlagKey as
|
|
27978
|
+
import { FlagKey as FlagKey21 } from "@funkit/utils";
|
|
27872
27979
|
import React186 from "react";
|
|
27873
27980
|
var ChainInfoBanners = ({
|
|
27874
27981
|
chainId
|
|
27875
27982
|
}) => {
|
|
27876
|
-
const chainInfoBanners = useFlag(
|
|
27983
|
+
const chainInfoBanners = useFlag(FlagKey21.ChainInfoBanners);
|
|
27877
27984
|
const chainInfoBannersData = useSafeJSONParse(chainInfoBanners) ?? {};
|
|
27878
27985
|
try {
|
|
27879
27986
|
const chainBanners = chainInfoBannersData[chainId] ?? [];
|
|
@@ -32437,7 +32544,7 @@ function useFunkitCheckout(props) {
|
|
|
32437
32544
|
const { openWithdrawalModal } = useWithdrawalModal();
|
|
32438
32545
|
const { connectModalOpen, openConnectModal } = useConnectModal();
|
|
32439
32546
|
const { isUserLoggedIn } = useGeneralWallet();
|
|
32440
|
-
const isCheckoutActivated = useFlag(
|
|
32547
|
+
const isCheckoutActivated = useFlag(FlagKey22.IsCheckoutActivated);
|
|
32441
32548
|
const onErrorWrapper = useCallback49(
|
|
32442
32549
|
(payload) => {
|
|
32443
32550
|
logger.warn(payload.message, payload);
|
|
@@ -32785,6 +32892,16 @@ async function getTokenDecimals(wagmiConfig, chainId, tokenAddress) {
|
|
|
32785
32892
|
}
|
|
32786
32893
|
}
|
|
32787
32894
|
}
|
|
32895
|
+
async function getLighterTickSize(wagmiConfig, chainId, assetIndex) {
|
|
32896
|
+
const assetConfig = await readContract(wagmiConfig, {
|
|
32897
|
+
address: LIGHTER_DEPOSIT_ADDRESS,
|
|
32898
|
+
abi: LIGHTER_DEPOSIT_ABI,
|
|
32899
|
+
functionName: "assetConfigs",
|
|
32900
|
+
args: [assetIndex],
|
|
32901
|
+
chainId: Number.parseInt(chainId)
|
|
32902
|
+
});
|
|
32903
|
+
return assetConfig[3];
|
|
32904
|
+
}
|
|
32788
32905
|
async function evaluateCheckoutGenerateActionsParams(config) {
|
|
32789
32906
|
if (!config.generateActionsParams) {
|
|
32790
32907
|
return [];
|
|
@@ -32910,6 +33027,7 @@ function isNativeTokenAddress(address) {
|
|
|
32910
33027
|
}
|
|
32911
33028
|
var isPolygonEcosystemToken = (chainId, tokenAddress) => chainId === polygon6.id.toString() && tokenAddress === "0x0000000000000000000000000000000000001010";
|
|
32912
33029
|
var isAssetUsableToPayForCheckout = ({
|
|
33030
|
+
apiKey,
|
|
32913
33031
|
config,
|
|
32914
33032
|
payerAddress,
|
|
32915
33033
|
paymentMethod,
|
|
@@ -32974,7 +33092,16 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
32974
33092
|
minUsdRequired: minValueThreshold + feeEstimate
|
|
32975
33093
|
};
|
|
32976
33094
|
}
|
|
32977
|
-
|
|
33095
|
+
let isSupported = isAllowedForCheckout && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO14[assetChainId]?.isCheckoutSupported;
|
|
33096
|
+
const isLighterEth = isLighterEthSpot(apiKey, config);
|
|
33097
|
+
if (isSupported && isLighterEth) {
|
|
33098
|
+
isSupported = isTokenEquivalent7({
|
|
33099
|
+
firstTokenChainId: assetChainId,
|
|
33100
|
+
firstTokenAddress: assetTokenAddress,
|
|
33101
|
+
secondTokenChainId: mainnet11.id.toString(),
|
|
33102
|
+
secondTokenAddress: NATIVE_TOKEN
|
|
33103
|
+
});
|
|
33104
|
+
}
|
|
32978
33105
|
return {
|
|
32979
33106
|
isUsable: !!isSupported,
|
|
32980
33107
|
reason: !isSupported ? t("payment.unsupported") : ""
|
|
@@ -33904,9 +34031,9 @@ function cssStringFromTheme(theme, options = {}) {
|
|
|
33904
34031
|
}
|
|
33905
34032
|
|
|
33906
34033
|
// src/hooks/useFunkitMaxCheckoutUsdInfo.ts
|
|
33907
|
-
import { FlagKey as
|
|
34034
|
+
import { FlagKey as FlagKey23, formatCurrencyAndStringify as formatCurrencyAndStringify16 } from "@funkit/utils";
|
|
33908
34035
|
var useFunkitMaxCheckoutUsdInfo = () => {
|
|
33909
|
-
const maxCheckoutUsd = Number(useFlag(
|
|
34036
|
+
const maxCheckoutUsd = Number(useFlag(FlagKey23.MaxCheckoutUsd));
|
|
33910
34037
|
const limitText = maxCheckoutUsd === Number.MAX_VALUE ? "no" : formatCurrencyAndStringify16(maxCheckoutUsd, {
|
|
33911
34038
|
decimalPrecisionForSuffix: 0,
|
|
33912
34039
|
minimumSignificantDigits: 0,
|
|
@@ -34023,6 +34150,8 @@ var en_default = {
|
|
|
34023
34150
|
checkout: {
|
|
34024
34151
|
noAvailableTokens: "No available tokens",
|
|
34025
34152
|
noAvailableTokensMessage: "You don't have any crypto tokens in your wallet. Top up or transfer crypto to your wallet to continue.",
|
|
34153
|
+
insufficientEth: "Insufficient ETH",
|
|
34154
|
+
insufficientEthMessage: "You don't have enough mainnet ETH in your wallet. You need at least 0.001 ETH to continue.",
|
|
34026
34155
|
topUpWallet: "Top up wallet",
|
|
34027
34156
|
refundProcessing: "Funds were withdrawn, but the transaction didn't complete. A refund is being processed.",
|
|
34028
34157
|
orderRefunded: "Your order was refunded.",
|
|
@@ -34521,6 +34650,8 @@ var es_default = {
|
|
|
34521
34650
|
checkout: {
|
|
34522
34651
|
noAvailableTokens: "No hay tokens disponibles",
|
|
34523
34652
|
noAvailableTokensMessage: "No tienes ning\xFAn token cripto en tu billetera. Recarga o transfiere cripto a tu billetera para continuar.",
|
|
34653
|
+
insufficientEth: "ETH insuficiente",
|
|
34654
|
+
insufficientEthMessage: "No tienes suficiente ETH de mainnet en tu billetera. Necesitas al menos 0.001 ETH para continuar.",
|
|
34524
34655
|
topUpWallet: "Recargar billetera",
|
|
34525
34656
|
refundProcessing: "Los fondos fueron retirados, pero la transacci\xF3n no se complet\xF3. Se est\xE1 procesando un reembolso.",
|
|
34526
34657
|
orderRefunded: "Tu pedido fue reembolsado.",
|
|
@@ -35019,6 +35150,8 @@ var fr_default = {
|
|
|
35019
35150
|
checkout: {
|
|
35020
35151
|
noAvailableTokens: "Aucun actif disponible",
|
|
35021
35152
|
noAvailableTokensMessage: "Vous n'avez aucun actif dans votre portefeuille. Approvisionnez ou transf\xE9rez des cryptomonnaies vers votre portefeuille pour continuer.",
|
|
35153
|
+
insufficientEth: "ETH insuffisant",
|
|
35154
|
+
insufficientEthMessage: "Vous n'avez pas assez d'ETH mainnet dans votre portefeuille. Vous avez besoin d'au moins 0,001 ETH pour continuer.",
|
|
35022
35155
|
topUpWallet: "Approvisionner le portefeuille",
|
|
35023
35156
|
refundProcessing: "Les fonds ont \xE9t\xE9 d\xE9bit\xE9s, mais la transaction n'a pas abouti. Un remboursement est en cours.",
|
|
35024
35157
|
orderRefunded: "Votre commande a \xE9t\xE9 rembours\xE9e.",
|
|
@@ -35517,6 +35650,8 @@ var ja_default = {
|
|
|
35517
35650
|
checkout: {
|
|
35518
35651
|
noAvailableTokens: "\u5229\u7528\u53EF\u80FD\u306A\u30C8\u30FC\u30AF\u30F3\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
35519
35652
|
noAvailableTokensMessage: "\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u6697\u53F7\u8CC7\u7523\u30C8\u30FC\u30AF\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7D9A\u884C\u3059\u308B\u306B\u306F\u3001\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u6697\u53F7\u8CC7\u7523\u3092\u30C1\u30E3\u30FC\u30B8\u307E\u305F\u306F\u9001\u91D1\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
35653
|
+
insufficientEth: "ETH\u6B8B\u9AD8\u4E0D\u8DB3",
|
|
35654
|
+
insufficientEthMessage: "\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u30E1\u30A4\u30F3\u30CD\u30C3\u30C8ETH\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002\u7D9A\u884C\u3059\u308B\u306B\u306F\u5C11\u306A\u304F\u3068\u30820.001 ETH\u304C\u5FC5\u8981\u3067\u3059\u3002",
|
|
35520
35655
|
topUpWallet: "\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u30C1\u30E3\u30FC\u30B8",
|
|
35521
35656
|
refundProcessing: "\u8CC7\u91D1\u306F\u5F15\u304D\u51FA\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u53D6\u5F15\u306F\u5B8C\u4E86\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u8FD4\u91D1\u51E6\u7406\u4E2D\u3067\u3059\u3002",
|
|
35522
35657
|
orderRefunded: "\u3054\u6CE8\u6587\u306F\u8FD4\u91D1\u3055\u308C\u307E\u3057\u305F\u3002",
|
|
@@ -36015,6 +36150,8 @@ var ko_default = {
|
|
|
36015
36150
|
checkout: {
|
|
36016
36151
|
noAvailableTokens: "\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uD1A0\uD070\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
36017
36152
|
noAvailableTokensMessage: "\uC9C0\uAC11\uC5D0 \uC554\uD638\uD654\uD3D0 \uD1A0\uD070\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uACC4\uC18D\uD558\uB824\uBA74 \uC9C0\uAC11\uC5D0 \uC554\uD638\uD654\uD3D0\uB97C \uCDA9\uC804\uD558\uAC70\uB098 \uC804\uC1A1\uD558\uC138\uC694.",
|
|
36153
|
+
insufficientEth: "ETH \uBD80\uC871",
|
|
36154
|
+
insufficientEthMessage: "\uC9C0\uAC11\uC5D0 \uBA54\uC778\uB137 ETH\uAC00 \uCDA9\uBD84\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uACC4\uC18D\uD558\uB824\uBA74 \uCD5C\uC18C 0.001 ETH\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
36018
36155
|
topUpWallet: "\uC9C0\uAC11 \uCDA9\uC804",
|
|
36019
36156
|
refundProcessing: "\uC790\uAE08\uC774 \uCD9C\uAE08\uB418\uC5C8\uC9C0\uB9CC \uAC70\uB798\uAC00 \uC644\uB8CC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD658\uBD88\uC774 \uCC98\uB9AC\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
36020
36157
|
orderRefunded: "\uC8FC\uBB38\uC774 \uD658\uBD88\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",
|
|
@@ -36513,6 +36650,8 @@ var ru_default = {
|
|
|
36513
36650
|
checkout: {
|
|
36514
36651
|
noAvailableTokens: "\u041D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u0442\u043E\u043A\u0435\u043D\u043E\u0432",
|
|
36515
36652
|
noAvailableTokensMessage: "\u0423 \u0432\u0430\u0441 \u043D\u0435\u0442 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u043D\u044B\u0445 \u0442\u043E\u043A\u0435\u043D\u043E\u0432 \u0432 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0435. \u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u0443 \u0432 \u043A\u043E\u0448\u0435\u043B\u0451\u043A \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F.",
|
|
36653
|
+
insufficientEth: "\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E ETH",
|
|
36654
|
+
insufficientEthMessage: "\u0412 \u0432\u0430\u0448\u0435\u043C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0435 \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E ETH \u0432 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u0435\u0442\u0438. \u0414\u043B\u044F \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u043D\u0435 \u043C\u0435\u043D\u0435\u0435 0.001 ETH.",
|
|
36516
36655
|
topUpWallet: "\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043A\u043E\u0448\u0435\u043B\u0451\u043A",
|
|
36517
36656
|
refundProcessing: "\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0431\u044B\u043B\u0438 \u0432\u044B\u0432\u0435\u0434\u0435\u043D\u044B, \u043D\u043E \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430. \u041E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0432\u043E\u0437\u0432\u0440\u0430\u0442.",
|
|
36518
36657
|
orderRefunded: "\u0412\u0430\u0448 \u0437\u0430\u043A\u0430\u0437 \u0431\u044B\u043B \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0451\u043D.",
|
|
@@ -37011,6 +37150,8 @@ var tr_default = {
|
|
|
37011
37150
|
checkout: {
|
|
37012
37151
|
noAvailableTokens: "Kullan\u0131labilir token yok",
|
|
37013
37152
|
noAvailableTokensMessage: "C\xFCzdan\u0131n\u0131zda kripto token bulunmamaktad\u0131r. Devam etmek i\xE7in c\xFCzdan\u0131n\u0131za para yat\u0131r\u0131n veya kripto transfer edin.",
|
|
37153
|
+
insufficientEth: "Yetersiz ETH",
|
|
37154
|
+
insufficientEthMessage: "C\xFCzdan\u0131n\u0131zda yeterli mainnet ETH bulunmuyor. Devam etmek i\xE7in en az 0.001 ETH gereklidir.",
|
|
37014
37155
|
topUpWallet: "C\xFCzdana para y\xFCkle",
|
|
37015
37156
|
refundProcessing: "\u0130ade edilecek fonlar haz\u0131rland\u0131, ancak i\u015Flem tamamlanmad\u0131. \u0130ade i\u015Flemi yap\u0131l\u0131yor.",
|
|
37016
37157
|
orderRefunded: "Sipari\u015Finiz iade edildi.",
|
|
@@ -37509,6 +37650,8 @@ var zh_default = {
|
|
|
37509
37650
|
checkout: {
|
|
37510
37651
|
noAvailableTokens: "\u6CA1\u6709\u53EF\u7528\u4EE3\u5E01",
|
|
37511
37652
|
noAvailableTokensMessage: "\u60A8\u7684\u94B1\u5305\u4E2D\u6CA1\u6709\u4EFB\u4F55\u52A0\u5BC6\u4EE3\u5E01\u3002\u5145\u503C\u6216\u8F6C\u8D26\u52A0\u5BC6\u8D27\u5E01\u5230\u60A8\u7684\u94B1\u5305\u4EE5\u7EE7\u7EED\u3002",
|
|
37653
|
+
insufficientEth: "ETH \u4E0D\u8DB3",
|
|
37654
|
+
insufficientEthMessage: "\u60A8\u7684\u94B1\u5305\u4E2D\u6CA1\u6709\u8DB3\u591F\u7684\u4E3B\u7F51 ETH\u3002\u60A8\u81F3\u5C11\u9700\u8981 0.001 ETH \u624D\u80FD\u7EE7\u7EED\u3002",
|
|
37512
37655
|
topUpWallet: "\u5145\u503C\u94B1\u5305",
|
|
37513
37656
|
refundProcessing: "\u8D44\u91D1\u5DF2\u63D0\u53D6\uFF0C\u4F46\u4EA4\u6613\u672A\u5B8C\u6210\u3002\u6B63\u5728\u5904\u7406\u9000\u6B3E\u3002",
|
|
37514
37657
|
orderRefunded: "\u60A8\u7684\u8BA2\u5355\u5DF2\u9000\u6B3E\u3002",
|
|
@@ -38193,7 +38336,7 @@ function FunkitProviderInner({
|
|
|
38193
38336
|
}, [activeTheme, selector]);
|
|
38194
38337
|
const avatarContext = avatar ?? defaultAvatar;
|
|
38195
38338
|
const isSandboxMode = !!sandbox;
|
|
38196
|
-
const modalSizeFinal = modalSize || ModalSizeOptions.
|
|
38339
|
+
const modalSizeFinal = modalSize || ModalSizeOptions.MEDIUM;
|
|
38197
38340
|
return /* @__PURE__ */ React240.createElement(FunkitI18nProvider, { locale }, /* @__PURE__ */ React240.createElement(FunkitStatsigProvider, { isDevelopment: debug }, /* @__PURE__ */ React240.createElement(FunkitConfigContext.Provider, { value: funkitConfig }, /* @__PURE__ */ React240.createElement(FunkitConnectChainProvider, { initialChain }, /* @__PURE__ */ React240.createElement(ModalSizeProvider, { modalSize: modalSizeFinal }, /* @__PURE__ */ React240.createElement(GeneralWalletProvider, null, /* @__PURE__ */ React240.createElement(FunkitFlagsProvider, null, /* @__PURE__ */ React240.createElement(FunkitCheckoutHistoryProvider, null, /* @__PURE__ */ React240.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React240.createElement(FunkitSandboxContext.Provider, { value: isSandboxMode }, /* @__PURE__ */ React240.createElement(FunkitBrokerageProvider, null, /* @__PURE__ */ React240.createElement(FunkitQuoteProvider, null, /* @__PURE__ */ React240.createElement(AvatarContext.Provider, { value: avatarContext }, /* @__PURE__ */ React240.createElement(ThemeIdContext2.Provider, { value: id }, /* @__PURE__ */ React240.createElement(ShowBalanceProvider, null, /* @__PURE__ */ React240.createElement(UserPresenceProvider, null, /* @__PURE__ */ React240.createElement(ModalProvider, null, activeTheme ? /* @__PURE__ */ React240.createElement(
|
|
38198
38341
|
"div",
|
|
38199
38342
|
{
|
package/dist/themes/darkTheme.js
CHANGED
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQ
|
|
|
95
95
|
*/
|
|
96
96
|
export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult): number;
|
|
97
97
|
export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress: Address): Promise<number>;
|
|
98
|
+
export declare function getLighterTickSize(wagmiConfig: Config, chainId: string, assetIndex: number): Promise<bigint>;
|
|
98
99
|
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig): Promise<FunkitCheckoutActionParams[]>;
|
|
99
100
|
export declare function isCheckoutCrFlow(config: FunkitCheckoutConfig): boolean;
|
|
100
101
|
/**
|
|
@@ -49,7 +49,7 @@ export declare const flagConfig: {
|
|
|
49
49
|
readonly if_any: [{
|
|
50
50
|
readonly key: "apiKey";
|
|
51
51
|
readonly type: "isAnyOf";
|
|
52
|
-
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "1QxzeJ4XKT78ba86whLct6sc7dW60Dl461UVWFdw", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
|
|
52
|
+
readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "1QxzeJ4XKT78ba86whLct6sc7dW60Dl461UVWFdw", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2", "AiXTqs1RO13a47tS5vjqA1UdRggx0tzJ3xKrrNH6"];
|
|
53
53
|
}];
|
|
54
54
|
readonly value: true;
|
|
55
55
|
}];
|
|
@@ -94,7 +94,7 @@ export declare const flagConfig: {
|
|
|
94
94
|
readonly if_any: [{
|
|
95
95
|
readonly key: "apiKey";
|
|
96
96
|
readonly type: "isAnyOf";
|
|
97
|
-
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6"];
|
|
97
|
+
readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW"];
|
|
98
98
|
}];
|
|
99
99
|
readonly value: string;
|
|
100
100
|
}];
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
uniswapWallet
|
|
25
25
|
} from "./chunk-LH7BMNFZ.js";
|
|
26
|
-
import {
|
|
27
|
-
walletConnectWallet
|
|
28
|
-
} from "./chunk-NP5QGWNL.js";
|
|
29
26
|
import {
|
|
30
27
|
xdefiWallet
|
|
31
28
|
} from "./chunk-BOU4WKRZ.js";
|
|
32
29
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
30
|
+
walletConnectWallet
|
|
31
|
+
} from "./chunk-NP5QGWNL.js";
|
|
32
|
+
import {
|
|
33
|
+
phantomWallet
|
|
34
|
+
} from "./chunk-362NXNTM.js";
|
|
35
35
|
import {
|
|
36
36
|
rainbowWallet
|
|
37
37
|
} from "./chunk-2KUBG3S6.js";
|
|
@@ -75,8 +75,8 @@ import {
|
|
|
75
75
|
oneKeyWallet
|
|
76
76
|
} from "./chunk-SHBUZ7U7.js";
|
|
77
77
|
import {
|
|
78
|
-
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
rabbyWallet
|
|
79
|
+
} from "./chunk-BBOM42DL.js";
|
|
80
80
|
import {
|
|
81
81
|
foxWallet
|
|
82
82
|
} from "./chunk-7QONTUXT.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3-next.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"use-debounce": "^10.0.5",
|
|
102
102
|
"uuid": "^9.0.1",
|
|
103
103
|
"@funkit/api-base": "1.12.21",
|
|
104
|
-
"@funkit/chains": "0.5.
|
|
105
|
-
"@funkit/fun-relay": "2.1.
|
|
104
|
+
"@funkit/chains": "0.5.2-next.0",
|
|
105
|
+
"@funkit/fun-relay": "2.1.16-next.0",
|
|
106
106
|
"@funkit/utils": "1.1.21"
|
|
107
107
|
},
|
|
108
108
|
"repository": {
|