@funkit/connect 9.28.1 → 10.1.0-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 +60 -0
- package/dist/clients/chunk-42XZD2Y3.js +1112 -0
- package/dist/clients/chunk-5UIZBNLC.js +1175 -0
- package/dist/clients/chunk-6PIIYPQK.js +702 -0
- package/dist/clients/chunk-BO7AZVPG.js +1112 -0
- package/dist/clients/chunk-BUCJRBW7.js +1472 -0
- package/dist/clients/{chunk-2NBYHUIW.js → chunk-ETB2YYFT.js} +1 -1
- package/dist/clients/{chunk-4O4YAFYK.js → chunk-HD4Y4NKC.js} +4 -4
- package/dist/clients/{chunk-CGHPNWIF.js → chunk-JNZY3GAA.js} +3 -1
- package/dist/clients/{chunk-7LKK5QMZ.js → chunk-ME4OAQIY.js} +1 -1
- package/dist/clients/chunk-PEVDOGEA.js +109 -0
- package/dist/clients/chunk-QIWGVVAW.js +1113 -0
- package/dist/clients/chunk-VJZW3MA3.js +94 -0
- package/dist/clients/chunk-WEETVC7U.js +1113 -0
- package/dist/clients/chunk-Y2KXVS36.js +230 -0
- package/dist/clients/{chunk-TQVRP3Z2.js → chunk-YFHTV7DT.js} +1 -1
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +2 -2
- package/dist/clients/lighter.css +11 -11
- package/dist/clients/lighter.d.ts +12 -2
- package/dist/clients/lighter.js +21 -9
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +11 -11
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +5 -5
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
- package/dist/clients/polymarket/index.css +11 -11
- package/dist/clients/polymarket/index.js +5 -5
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/clients/polymarket/usePolymarketAccountBalances.d.ts +66 -0
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +3 -1
- package/dist/domains/paymentMethods.d.ts +8 -1
- package/dist/domains/relay.d.ts +40 -0
- package/dist/hooks/queries/useWithdrawFops.d.ts +1 -0
- package/dist/hooks/useNewTokenBanner.d.ts +6 -1
- package/dist/hooks/usePaymentSources.d.ts +1 -0
- package/dist/index.css +11 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1351 -2047
- package/dist/locales/i18n.d.ts +2 -1
- package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoice.d.ts +3 -3
- package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoiceQrCode.d.ts +3 -2
- package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +17 -6
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +7 -2
- package/dist/modals/CheckoutModal/buildRelayChains.d.ts +12 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -1
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +32 -5
- package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +3 -3
- package/dist/providers/FunkitCheckoutContext/types.d.ts +20 -2
- package/dist/providers/FunkitConfigContext.d.ts +2 -0
- package/dist/utils/checkout.d.ts +2 -1
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/chunk-4NV5BYRP.js +95 -0
- package/dist/wallets/walletConnectors/chunk-AVDUNQUW.js +96 -0
- package/dist/wallets/walletConnectors/chunk-GUQM4QSL.js +66 -0
- package/dist/wallets/walletConnectors/chunk-IULPZP2Q.js +69 -0
- package/dist/wallets/walletConnectors/chunk-JPN6TWIT.js +92 -0
- package/dist/wallets/walletConnectors/chunk-KCRO2AGO.js +106 -0
- package/dist/wallets/walletConnectors/chunk-KI5Y2BBF.js +94 -0
- package/dist/wallets/walletConnectors/chunk-NR2OGDHQ.js +103 -0
- package/dist/wallets/walletConnectors/chunk-OEEGYENV.js +87 -0
- package/dist/wallets/walletConnectors/chunk-OX37G4YT.js +98 -0
- package/dist/wallets/walletConnectors/chunk-SWFF3TWJ.js +100 -0
- package/dist/wallets/walletConnectors/chunk-TKB2OY6G.js +99 -0
- package/dist/wallets/walletConnectors/chunk-W2LCLDPX.js +70 -0
- package/dist/wallets/walletConnectors/chunk-WAHGI5L7.js +96 -0
- package/dist/wallets/walletConnectors/chunk-WKNQMP4A.js +93 -0
- package/dist/wallets/walletConnectors/chunk-XCNHV3HS.js +110 -0
- package/dist/wallets/walletConnectors/chunk-YO2K4MBH.js +218 -0
- package/dist/wallets/walletConnectors/chunk-YQFGVZGR.js +92 -0
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/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 +57 -57
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +4 -6
- /package/dist/clients/{chunk-LUHEVXPD.js → chunk-HMP3LHMW.js} +0 -0
package/dist/locales/i18n.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type PaymentMethodBitcoinLightningInfo, type PaymentMethodCashAppLightningInfo } from '../../../domains/paymentMethods';
|
|
3
3
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
4
4
|
export type LightningInvoiceState = CheckoutModalCommonState & {
|
|
5
|
-
paymentMethodInfo: PaymentMethodBitcoinLightningInfo;
|
|
5
|
+
paymentMethodInfo: PaymentMethodBitcoinLightningInfo | PaymentMethodCashAppLightningInfo;
|
|
6
6
|
};
|
|
7
7
|
export type LightningInvoiceNext = Record<string, never>;
|
|
8
8
|
export declare const LightningInvoiceInfo: ModalStepInfo<FunCheckoutStep.LIGHTNING_INVOICE>;
|
|
9
|
-
export declare function LightningInvoice(
|
|
9
|
+
export declare function LightningInvoice(props: ModalStepComponentProps<FunCheckoutStep.LIGHTNING_INVOICE>): React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BoxProps } from '../../../components/Box/Box';
|
|
3
3
|
interface LightningInvoiceQrCodeProps {
|
|
4
|
-
|
|
4
|
+
isCashApp?: boolean;
|
|
5
|
+
bolt11?: string;
|
|
5
6
|
marginY?: BoxProps['marginY'];
|
|
6
7
|
}
|
|
7
|
-
export declare function LightningInvoiceQrCode({
|
|
8
|
+
export declare function LightningInvoiceQrCode({ isCashApp, bolt11, marginY, }: LightningInvoiceQrCodeProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import type { ExchangeRates, GetFopsResponse, SwappedFormOfPayment } from '@funkit/api-base';
|
|
1
|
+
import type { ExchangeRates, GetFopsResponse, SavedFormOfPayment, SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
|
+
import type { ListFormOfPayment, SyntheticFormOfPayment } from '@funkit/connect-core';
|
|
2
3
|
import React from 'react';
|
|
4
|
+
/** FOP list normalized to hold real (Swapped) and synthetic methods together. */
|
|
5
|
+
interface ListFopsData {
|
|
6
|
+
genericFormsOfPayments: ListFormOfPayment[];
|
|
7
|
+
savedFormsOfPayments: SavedFormOfPayment[];
|
|
8
|
+
}
|
|
3
9
|
interface FormOfPaymentsListProps {
|
|
4
10
|
fopsData?: GetFopsResponse;
|
|
5
11
|
isLoading: boolean;
|
|
6
|
-
selectedFop?:
|
|
7
|
-
|
|
12
|
+
selectedFop?: ListFormOfPayment | null;
|
|
13
|
+
/**
|
|
14
|
+
* Non-Swapped methods (e.g. Cash App Lightning) to interleave into the list.
|
|
15
|
+
* They flow through the same sort/section/slice machinery as real FOPs.
|
|
16
|
+
*/
|
|
17
|
+
syntheticFops?: SyntheticFormOfPayment[];
|
|
18
|
+
onSelect: (fop: ListFormOfPayment) => void;
|
|
8
19
|
exchangeRatesData?: ExchangeRates;
|
|
9
20
|
enableSourceGroupLabels: boolean;
|
|
10
21
|
isDisabled?: boolean;
|
|
@@ -23,12 +34,12 @@ interface FormOfPaymentsListProps {
|
|
|
23
34
|
isBelowMinimumBalance?: boolean;
|
|
24
35
|
}
|
|
25
36
|
interface FormOfPaymentSection {
|
|
26
|
-
items:
|
|
37
|
+
items: ListFormOfPayment[];
|
|
27
38
|
labelKey: 'sourceChange.mostPopular' | 'sourceChange.savedPaymentMethods' | 'sourceChange.moreOptions';
|
|
28
39
|
}
|
|
29
|
-
export declare function getFormOfPaymentSections(fopsData:
|
|
40
|
+
export declare function getFormOfPaymentSections(fopsData: ListFopsData, fopPriority: readonly string[]): {
|
|
30
41
|
primary: FormOfPaymentSection;
|
|
31
42
|
secondary: FormOfPaymentSection;
|
|
32
43
|
};
|
|
33
|
-
export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop,
|
|
44
|
+
export declare function FormOfPaymentsList({ fopsData, isLoading, selectedFop, syntheticFops, onSelect, exchangeRatesData, getDisclaimerLimit, enableSourceGroupLabels, isDisabled, isBelowMinimumBalance, }: FormOfPaymentsListProps): React.JSX.Element;
|
|
34
45
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SwappedFormOfPayment } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodBitcoinLightningInfo, type PaymentMethodCardInfo, type PaymentMethodVirtualBankIncompleteInfo } from '../../../domains/paymentMethods';
|
|
3
|
+
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodBitcoinLightningInfo, type PaymentMethodCardInfo, type PaymentMethodCashAppLightningInfo, type PaymentMethodVirtualBankIncompleteInfo } from '../../../domains/paymentMethods';
|
|
4
4
|
import { type PaymentMethodType } from '../../../hooks/usePaymentSources';
|
|
5
5
|
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
6
6
|
export type SourceChangeState = CheckoutModalCommonState & {
|
|
@@ -14,13 +14,18 @@ export type SourceChangeNext = {
|
|
|
14
14
|
brokerageFailed: false;
|
|
15
15
|
} | {
|
|
16
16
|
connectNew: true;
|
|
17
|
-
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK | PaymentMethod.BITCOIN_LIGHTNING>;
|
|
17
|
+
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK | PaymentMethod.BITCOIN_LIGHTNING | PaymentMethod.CASH_APP_LIGHTNING>;
|
|
18
18
|
brokerageFailed: false;
|
|
19
19
|
} | {
|
|
20
20
|
connectNew: true;
|
|
21
21
|
paymentMethod: PaymentMethod.BITCOIN_LIGHTNING;
|
|
22
22
|
paymentMethodInfo: PaymentMethodBitcoinLightningInfo;
|
|
23
23
|
brokerageFailed: false;
|
|
24
|
+
} | {
|
|
25
|
+
connectNew: true;
|
|
26
|
+
paymentMethod: PaymentMethod.CASH_APP_LIGHTNING;
|
|
27
|
+
paymentMethodInfo: PaymentMethodCashAppLightningInfo;
|
|
28
|
+
brokerageFailed: false;
|
|
24
29
|
} | {
|
|
25
30
|
connectNew: true;
|
|
26
31
|
paymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Chain } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the chain list for the relay client, applying per-chain RPC overrides
|
|
4
|
+
* (keyed by chain id) onto each chain's `rpcUrls.default.http`.
|
|
5
|
+
*
|
|
6
|
+
* The relay-sdk derives the RPC it polls for transaction receipts from each
|
|
7
|
+
* chain's `rpcUrls.default`, so this points that receipt-wait at a reachable
|
|
8
|
+
* endpoint for chains whose default RPC isn't (e.g. an early-access chain like
|
|
9
|
+
* Robinhood). Only chains listed in `rpcOverrides` are changed; everything else
|
|
10
|
+
* is returned unchanged. See {@link FunkitConfig.relayRpcOverrides}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildRelayChains(chains: readonly Chain[], rpcOverrides?: Record<number, string>): Chain[];
|
|
@@ -91,7 +91,7 @@ export type ModalStepInfo<S extends FunCheckoutStep> = {
|
|
|
91
91
|
onNext(state: CheckoutModalState<S>, payload: NextPayload<S>): CheckoutModalState;
|
|
92
92
|
showFullHeight?: boolean;
|
|
93
93
|
/** Defaults to checkoutItem.initSettings.config.modalTitle (returning undefined uses default) */
|
|
94
|
-
title?(textCustomizations: FunkitTextCustomizationsConfig): string | undefined;
|
|
94
|
+
title?(textCustomizations: FunkitTextCustomizationsConfig, state: CheckoutModalState<S>): string | undefined;
|
|
95
95
|
/** If title is not defined in config nor with the title() function, this is used instead. Defaults to 'Checkout' */
|
|
96
96
|
fallbackTitle?: string;
|
|
97
97
|
};
|
|
@@ -6,12 +6,38 @@
|
|
|
6
6
|
import type { LighterAccountIndex } from '@funkit/api-base';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import type { Address } from 'viem';
|
|
9
|
-
import type { CustomWithdrawalConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
9
|
+
import type { CustomWithdrawalConfig, LighterRouteType, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
10
10
|
import type { LighterShare } from '../../utils/customer';
|
|
11
11
|
import type { SourceTokenOption } from './WithdrawAmountInput';
|
|
12
12
|
/** Stable method ids for the Fast / Secure options (used for tracking + switching). */
|
|
13
13
|
export declare const LIGHTER_FAST_METHOD_ID = "lighter-fast";
|
|
14
14
|
export declare const LIGHTER_SECURE_METHOD_ID = "lighter-secure";
|
|
15
|
+
/**
|
|
16
|
+
* USDC exists twice on a Lighter account: as perps collateral
|
|
17
|
+
* (`total_asset_value`, withdrawn via route 0) and as a spot asset balance
|
|
18
|
+
* (asset entry 3, withdrawn via route 1). The Secure dropdown keys selection
|
|
19
|
+
* by `symbol`, so the spot variant gets a pseudo-symbol to stay selectable
|
|
20
|
+
* alongside the plain `USDC` (perps) entry.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LIGHTER_USDC_SPOT_SYMBOL = "USDC (Spot)";
|
|
23
|
+
/** Lighter L2 route types (`RouteType` in the withdraw/transfer tx payload). */
|
|
24
|
+
export declare const LIGHTER_ROUTE_TYPE: {
|
|
25
|
+
readonly PERPS: 0;
|
|
26
|
+
readonly SPOT: 1;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Strips the ` (Spot)` / ` (Perps)` variant suffix off a Lighter source-token
|
|
30
|
+
* selection, returning the real token symbol (e.g. `USDC (Spot)` → `USDC`).
|
|
31
|
+
* Symbol-keyed lookups (icons, prices, asset indices, min amounts) operate on
|
|
32
|
+
* the base symbol; only selection identity and route resolution keep the suffix.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getLighterBaseSymbol(symbol: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the Lighter L2 route type for a Secure source-token selection.
|
|
37
|
+
* Plain `USDC` withdraws perps collateral (route 0); everything else —
|
|
38
|
+
* including the `USDC (Spot)` pseudo-symbol — is a spot asset (route 1).
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveLighterSecureRouteType(selectedSourceToken: string): LighterRouteType;
|
|
15
41
|
/**
|
|
16
42
|
* Mainnet ERC-20 address for a Lighter Secure source token symbol, or undefined
|
|
17
43
|
* if the symbol isn't a known Secure asset.
|
|
@@ -91,7 +117,8 @@ export declare function resolveLighterAssetIndex(lighterAssets: {
|
|
|
91
117
|
* Builds the source-token options list for the Lighter compound input dropdown.
|
|
92
118
|
*
|
|
93
119
|
* - Fast path: only USDC (Perps).
|
|
94
|
-
* - Secure path: USDC (from total_asset_value) +
|
|
120
|
+
* - Secure path: USDC (Perps) (from total_asset_value) + USDC (Spot) when the
|
|
121
|
+
* account carries a spot USDC asset + every non-USDC asset on the account.
|
|
95
122
|
*/
|
|
96
123
|
export declare function buildLighterSourceTokenOptions(config: FunkitWithdrawalConfig, lighterAssets: {
|
|
97
124
|
symbol: string;
|
|
@@ -130,17 +157,17 @@ export declare function LighterSecureAddressDisplay({ address }: {
|
|
|
130
157
|
* token always matches the source asset, and the destination chain is always
|
|
131
158
|
* Ethereum mainnet. Each field surfaces a hover tooltip explaining the lock.
|
|
132
159
|
*/
|
|
133
|
-
export declare function LighterSecureReceiveDisplay({ sourceTokenSymbol, }: {
|
|
160
|
+
export declare function LighterSecureReceiveDisplay({ sourceTokenSymbol: rawSourceTokenSymbol, }: {
|
|
134
161
|
sourceTokenSymbol: string;
|
|
135
162
|
}): React.JSX.Element;
|
|
136
163
|
/**
|
|
137
164
|
* Lighter Secure: receive amount value (1:1 — same token, no swap).
|
|
138
165
|
*/
|
|
139
|
-
export declare function LighterSecureReceiveAmountValue({ amount, tokenSymbol, }: {
|
|
166
|
+
export declare function LighterSecureReceiveAmountValue({ amount, tokenSymbol: rawTokenSymbol, }: {
|
|
140
167
|
amount: string;
|
|
141
168
|
tokenSymbol: string;
|
|
142
169
|
}): React.JSX.Element;
|
|
143
|
-
export declare function LighterSecureWithdrawalSuccess({ onClose, onNewWithdrawal, amount, tokenSymbol, txHash, }: {
|
|
170
|
+
export declare function LighterSecureWithdrawalSuccess({ onClose, onNewWithdrawal, amount, tokenSymbol: rawTokenSymbol, txHash, }: {
|
|
144
171
|
onClose: () => void;
|
|
145
172
|
onNewWithdrawal: () => void;
|
|
146
173
|
amount: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address, Hex } from 'viem';
|
|
2
2
|
import { type CheckoutConfirmationError } from '../../domains/checkoutErrors';
|
|
3
3
|
import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
|
|
4
|
-
import { type FunkitActiveWithdrawalItem, type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
|
|
4
|
+
import { type FunkitActiveWithdrawalItem, type FunkitWithdrawalConfig, type WithdrawalCustomerData } from '../../providers/FunkitCheckoutContext';
|
|
5
5
|
interface UseWithdrawalResult {
|
|
6
6
|
handleWithdrawal: (withdrawal: WithdrawalFormData) => Promise<Hex | null>;
|
|
7
7
|
isWithdrawing: boolean;
|
|
@@ -15,8 +15,8 @@ export type WithdrawalFormData = {
|
|
|
15
15
|
tokenAddress: Address;
|
|
16
16
|
chainId: number;
|
|
17
17
|
quote?: FunkitCheckoutQuoteResult;
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/** Customer-specific data for quoteless flows (e.g. Lighter Secure). */
|
|
19
|
+
customerData?: WithdrawalCustomerData;
|
|
20
20
|
userInputAmount: string;
|
|
21
21
|
};
|
|
22
22
|
export declare function useWithdrawal({ config, withdrawalItem, onSuccess, }: {
|
|
@@ -281,14 +281,32 @@ export interface CustomWithdrawalConfig extends WithdrawalConfigBase {
|
|
|
281
281
|
*/
|
|
282
282
|
withdrawCallback: (param: WithdrawalParam) => Promise<undefined | string>;
|
|
283
283
|
}
|
|
284
|
+
/** Lighter L2 route type: 0 = perps (USDC collateral), 1 = spot. */
|
|
285
|
+
export type LighterRouteType = 0 | 1;
|
|
286
|
+
/**
|
|
287
|
+
* Lighter-specific data for quoteless Secure withdrawal. `assetIndex` selects
|
|
288
|
+
* the L2 asset (avoids overloading targetChainId); `routeType` disambiguates
|
|
289
|
+
* USDC, whose perps and spot balances share asset index 3.
|
|
290
|
+
*/
|
|
291
|
+
export interface LighterWithdrawalCustomerData {
|
|
292
|
+
customerName: 'lighter';
|
|
293
|
+
assetIndex: number;
|
|
294
|
+
routeType: LighterRouteType;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Customer-specific data threaded through withdrawal callbacks, discriminated
|
|
298
|
+
* by `customerName` so future customers extend the union instead of adding
|
|
299
|
+
* top-level params.
|
|
300
|
+
*/
|
|
301
|
+
export type WithdrawalCustomerData = LighterWithdrawalCustomerData;
|
|
284
302
|
export interface WithdrawalParam {
|
|
285
303
|
quoteId: string;
|
|
286
304
|
funQuote: unknown;
|
|
287
305
|
targetAssetAddress: Address;
|
|
288
306
|
targetChainId: number;
|
|
289
307
|
destinationAddress: Address;
|
|
290
|
-
/**
|
|
291
|
-
|
|
308
|
+
/** Customer-specific data for quoteless flows (e.g. Lighter Secure). */
|
|
309
|
+
customerData?: WithdrawalCustomerData;
|
|
292
310
|
/** User-entered amount in token units for quoteless flows (avoids overloading quoteId). */
|
|
293
311
|
userInputAmount?: string;
|
|
294
312
|
/**
|
|
@@ -14,6 +14,7 @@ export interface FunkitTextCustomizationsConfig {
|
|
|
14
14
|
tokensListTitle: string;
|
|
15
15
|
transferTokens: string;
|
|
16
16
|
bitcoinLightning: string;
|
|
17
|
+
cashAppLightning: string;
|
|
17
18
|
receiveDropdownTitle: string;
|
|
18
19
|
receiveDropdownLabel: string;
|
|
19
20
|
txStatus?: {
|
|
@@ -62,6 +63,7 @@ export interface FunkitTextCustomizationsConfig {
|
|
|
62
63
|
paypal?: string;
|
|
63
64
|
transferTokens?: string;
|
|
64
65
|
bitcoinLightning?: string;
|
|
66
|
+
cashAppLightning?: string;
|
|
65
67
|
virtualFiat?: string;
|
|
66
68
|
};
|
|
67
69
|
}
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FunAddress } from '@funkit/api-base';
|
|
1
2
|
export { isCheckoutHistoryDirectExecution, isCheckoutValid, type MergedCheckoutHistoryItem, toMergedCheckoutHistoryItem, } from '@funkit/connect-core';
|
|
2
3
|
import { type ApiFunkitCheckoutQuoteResult, type CheckoutQuoteResponse } from '@funkit/utils';
|
|
3
4
|
import type { Dnum } from 'dnum';
|
|
@@ -94,7 +95,7 @@ export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQ
|
|
|
94
95
|
* @param quoteResult - Failed quote results
|
|
95
96
|
*/
|
|
96
97
|
export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult, targetAssetDecimals: number): Dnum;
|
|
97
|
-
export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress:
|
|
98
|
+
export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress: FunAddress): Promise<number>;
|
|
98
99
|
export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig): Promise<FunkitCheckoutActionParams[]>;
|
|
99
100
|
export declare function isCheckoutCrFlow(config: FunkitCheckoutConfig): boolean;
|
|
100
101
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-IULPZP2Q.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-TKB2OY6G.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bybitWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-OX37G4YT.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bybitWallet
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-OLZ7626J.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/coreWallet/coreWallet.ts
|
|
11
|
+
var coreWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isCoreInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "avalanche",
|
|
17
|
+
flag: "isAvalanche"
|
|
18
|
+
});
|
|
19
|
+
const shouldUseWalletConnect = !isCoreInjected;
|
|
20
|
+
return {
|
|
21
|
+
id: "core",
|
|
22
|
+
name: "Core",
|
|
23
|
+
rdns: "app.core.extension",
|
|
24
|
+
iconUrl: async () => (await import("./coreWallet-RFVUHOVE.js")).default,
|
|
25
|
+
iconBackground: "#1A1A1C",
|
|
26
|
+
installed: !shouldUseWalletConnect ? isCoreInjected : void 0,
|
|
27
|
+
downloadUrls: {
|
|
28
|
+
android: "https://play.google.com/store/apps/details?id=com.avaxwallet",
|
|
29
|
+
ios: "https://apps.apple.com/us/app/core-wallet/id6443685999",
|
|
30
|
+
mobile: "https://core.app/?downloadCoreMobile=1",
|
|
31
|
+
qrCode: "https://core.app/?downloadCoreMobile=1",
|
|
32
|
+
chrome: "https://chrome.google.com/webstore/detail/core-crypto-wallet-nft-ex/agoakfejjabomempkjlepdflaleeobhb",
|
|
33
|
+
browserExtension: "https://extension.core.app/"
|
|
34
|
+
},
|
|
35
|
+
mobile: {
|
|
36
|
+
getUri: shouldUseWalletConnect ? (uri) => uri : void 0
|
|
37
|
+
},
|
|
38
|
+
qrCode: shouldUseWalletConnect ? {
|
|
39
|
+
getUri: (uri) => uri,
|
|
40
|
+
instructions: {
|
|
41
|
+
learnMoreUrl: "https://support.avax.network/en/articles/6115608-core-mobile-how-to-add-the-core-mobile-to-my-phone",
|
|
42
|
+
steps: [
|
|
43
|
+
{
|
|
44
|
+
description: "wallet_connectors.core.qr_code.step1.description",
|
|
45
|
+
step: "install",
|
|
46
|
+
title: "wallet_connectors.core.qr_code.step1.title"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
description: "wallet_connectors.core.qr_code.step2.description",
|
|
50
|
+
step: "create",
|
|
51
|
+
title: "wallet_connectors.core.qr_code.step2.title"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
description: "wallet_connectors.core.qr_code.step3.description",
|
|
55
|
+
step: "scan",
|
|
56
|
+
title: "wallet_connectors.core.qr_code.step3.title"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
} : void 0,
|
|
61
|
+
extension: {
|
|
62
|
+
instructions: {
|
|
63
|
+
learnMoreUrl: "https://extension.core.app/",
|
|
64
|
+
steps: [
|
|
65
|
+
{
|
|
66
|
+
description: "wallet_connectors.core.extension.step1.description",
|
|
67
|
+
step: "install",
|
|
68
|
+
title: "wallet_connectors.core.extension.step1.title"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.core.extension.step2.description",
|
|
72
|
+
step: "create",
|
|
73
|
+
title: "wallet_connectors.core.extension.step2.title"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
description: "wallet_connectors.core.extension.step3.description",
|
|
77
|
+
step: "refresh",
|
|
78
|
+
title: "wallet_connectors.core.extension.step3.title"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
84
|
+
projectId,
|
|
85
|
+
walletConnectParameters
|
|
86
|
+
}) : getInjectedConnector({
|
|
87
|
+
namespace: "avalanche",
|
|
88
|
+
flag: "isAvalanche"
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
coreWallet
|
|
95
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-OLZ7626J.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/frontierWallet/frontierWallet.ts
|
|
11
|
+
import { isAndroid } from "@funkit/utils";
|
|
12
|
+
var frontierWallet = ({
|
|
13
|
+
projectId,
|
|
14
|
+
walletConnectParameters
|
|
15
|
+
}) => {
|
|
16
|
+
const isFrontierInjected = hasInjectedProvider({
|
|
17
|
+
namespace: "frontier.ethereum",
|
|
18
|
+
flag: "isFrontier"
|
|
19
|
+
});
|
|
20
|
+
const shouldUseWalletConnect = !isFrontierInjected;
|
|
21
|
+
return {
|
|
22
|
+
id: "frontier",
|
|
23
|
+
name: "Frontier Wallet",
|
|
24
|
+
rdns: "xyz.frontier.wallet",
|
|
25
|
+
installed: isFrontierInjected,
|
|
26
|
+
iconUrl: async () => (await import("./frontierWallet-5QV7ZACT.js")).default,
|
|
27
|
+
iconBackground: "#CC703C",
|
|
28
|
+
downloadUrls: {
|
|
29
|
+
android: "https://play.google.com/store/apps/details?id=com.frontierwallet",
|
|
30
|
+
ios: "https://apps.apple.com/us/app/frontier-crypto-defi-wallet/id1482380988",
|
|
31
|
+
qrCode: "https://www.frontier.xyz/download",
|
|
32
|
+
chrome: "https://chrome.google.com/webstore/detail/frontier-wallet/kppfdiipphfccemcignhifpjkapfbihd",
|
|
33
|
+
browserExtension: "https://www.frontier.xyz/download"
|
|
34
|
+
},
|
|
35
|
+
mobile: {
|
|
36
|
+
getUri: shouldUseWalletConnect ? (uri) => {
|
|
37
|
+
return isAndroid() ? `frontier://wc?uri=${encodeURIComponent(uri)}` : uri;
|
|
38
|
+
} : void 0
|
|
39
|
+
},
|
|
40
|
+
qrCode: shouldUseWalletConnect ? {
|
|
41
|
+
getUri: (uri) => {
|
|
42
|
+
return isAndroid() ? `frontier://wc?uri=${encodeURIComponent(uri)}` : uri;
|
|
43
|
+
},
|
|
44
|
+
instructions: {
|
|
45
|
+
learnMoreUrl: "https://help.frontier.xyz/en/",
|
|
46
|
+
steps: [
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.im_token.qr_code.step1.description",
|
|
49
|
+
step: "install",
|
|
50
|
+
title: "wallet_connectors.im_token.qr_code.step1.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.im_token.qr_code.step2.description",
|
|
54
|
+
step: "create",
|
|
55
|
+
title: "wallet_connectors.im_token.qr_code.step2.title"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
description: "wallet_connectors.im_token.qr_code.step3.description",
|
|
59
|
+
step: "scan",
|
|
60
|
+
title: "wallet_connectors.im_token.qr_code.step3.title"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
} : void 0,
|
|
65
|
+
extension: {
|
|
66
|
+
instructions: {
|
|
67
|
+
learnMoreUrl: "https://help.frontier.xyz/en/articles/6967236-setting-up-frontier-on-your-device",
|
|
68
|
+
steps: [
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.frontier.extension.step1.description",
|
|
71
|
+
step: "install",
|
|
72
|
+
title: "wallet_connectors.frontier.extension.step1.title"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "wallet_connectors.frontier.extension.step2.description",
|
|
76
|
+
step: "create",
|
|
77
|
+
title: "wallet_connectors.frontier.extension.step2.title"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
description: "wallet_connectors.frontier.extension.step3.description",
|
|
81
|
+
step: "refresh",
|
|
82
|
+
title: "wallet_connectors.frontier.extension.step3.title"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({ projectId, walletConnectParameters }) : getInjectedConnector({
|
|
88
|
+
namespace: "frontier.ethereum",
|
|
89
|
+
flag: "isFrontier"
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
frontierWallet
|
|
96
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-OLZ7626J.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/foxWallet/foxWallet.ts
|
|
11
|
+
var foxWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isFoxInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "foxwallet.ethereum"
|
|
17
|
+
});
|
|
18
|
+
const shouldUseWalletConnect = !isFoxInjected;
|
|
19
|
+
return {
|
|
20
|
+
id: "foxwallet",
|
|
21
|
+
name: "FoxWallet",
|
|
22
|
+
iconUrl: async () => (await import("./foxWallet-I7D5KIW4.js")).default,
|
|
23
|
+
iconBackground: "#fff",
|
|
24
|
+
downloadUrls: {
|
|
25
|
+
android: "https://play.google.com/store/apps/details?id=com.foxwallet.play",
|
|
26
|
+
ios: "https://apps.apple.com/app/foxwallet-crypto-web3/id1590983231",
|
|
27
|
+
qrCode: "https://foxwallet.com/download"
|
|
28
|
+
},
|
|
29
|
+
mobile: {
|
|
30
|
+
getUri: shouldUseWalletConnect ? (uri) => {
|
|
31
|
+
return `foxwallet://wc?uri=${encodeURIComponent(uri)}`;
|
|
32
|
+
} : void 0
|
|
33
|
+
},
|
|
34
|
+
qrCode: shouldUseWalletConnect ? {
|
|
35
|
+
getUri: (uri) => uri,
|
|
36
|
+
instructions: {
|
|
37
|
+
learnMoreUrl: "https://foxwallet.com",
|
|
38
|
+
steps: [
|
|
39
|
+
{
|
|
40
|
+
description: "wallet_connectors.fox.qr_code.step1.description",
|
|
41
|
+
step: "install",
|
|
42
|
+
title: "wallet_connectors.fox.qr_code.step1.title"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: "wallet_connectors.fox.qr_code.step2.description",
|
|
46
|
+
step: "create",
|
|
47
|
+
title: "wallet_connectors.fox.qr_code.step2.title"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
description: "wallet_connectors.fox.qr_code.step3.description",
|
|
51
|
+
step: "scan",
|
|
52
|
+
title: "wallet_connectors.fox.qr_code.step3.title"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
} : void 0,
|
|
57
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
58
|
+
projectId,
|
|
59
|
+
walletConnectParameters
|
|
60
|
+
}) : getInjectedConnector({ namespace: "foxwallet.ethereum" })
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
foxWallet
|
|
66
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getWalletConnectConnector
|
|
4
|
+
} from "./chunk-N4IJLYFY.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-OLZ7626J.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/bifrostWallet/bifrostWallet.ts
|
|
11
|
+
import { isAndroid } from "@funkit/utils";
|
|
12
|
+
var bifrostWallet = ({
|
|
13
|
+
projectId,
|
|
14
|
+
walletConnectParameters
|
|
15
|
+
}) => {
|
|
16
|
+
const isBifrostInjected = hasInjectedProvider({ flag: "isBifrost" });
|
|
17
|
+
const shouldUseWalletConnect = !isBifrostInjected;
|
|
18
|
+
const getUri = (uri) => {
|
|
19
|
+
return isAndroid() ? uri : `https://app.bifrostwallet.com/wc?uri=${encodeURIComponent(uri)}`;
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
id: "bifrostWallet",
|
|
23
|
+
name: "Bifrost Wallet",
|
|
24
|
+
iconUrl: async () => (await import("./bifrostWallet-5NQVDZ5P.js")).default,
|
|
25
|
+
iconBackground: "#fff",
|
|
26
|
+
installed: !shouldUseWalletConnect ? isBifrostInjected : void 0,
|
|
27
|
+
downloadUrls: {
|
|
28
|
+
android: "https://play.google.com/store/apps/details?id=com.bifrostwallet.app",
|
|
29
|
+
ios: "https://apps.apple.com/us/app/bifrost-wallet/id1577198351",
|
|
30
|
+
qrCode: "https://bifrostwallet.com/#download-app"
|
|
31
|
+
},
|
|
32
|
+
mobile: {
|
|
33
|
+
getUri: shouldUseWalletConnect ? getUri : void 0
|
|
34
|
+
},
|
|
35
|
+
qrCode: shouldUseWalletConnect ? {
|
|
36
|
+
getUri: (uri) => uri,
|
|
37
|
+
instructions: {
|
|
38
|
+
learnMoreUrl: "https://support.bifrostwallet.com/en/articles/6886814-how-to-use-walletconnect",
|
|
39
|
+
steps: [
|
|
40
|
+
{
|
|
41
|
+
description: "wallet_connectors.bifrost.qr_code.step1.description",
|
|
42
|
+
step: "install",
|
|
43
|
+
title: "wallet_connectors.bifrost.qr_code.step1.title"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: "wallet_connectors.bifrost.qr_code.step2.description",
|
|
47
|
+
step: "create",
|
|
48
|
+
title: "wallet_connectors.bifrost.qr_code.step2.title"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
description: "wallet_connectors.bifrost.qr_code.step3.description",
|
|
52
|
+
step: "scan",
|
|
53
|
+
title: "wallet_connectors.bifrost.qr_code.step3.title"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
} : void 0,
|
|
58
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
59
|
+
projectId,
|
|
60
|
+
walletConnectParameters
|
|
61
|
+
}) : getInjectedConnector({
|
|
62
|
+
flag: "isBifrost"
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
bifrostWallet
|
|
69
|
+
};
|