@funkit/connect 12.23.0 → 13.0.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 +75 -0
- package/dist/clients/chunk-44LV4GCX.js +83 -0
- package/dist/clients/{chunk-GQINBV24.js → chunk-AJGDTTRJ.js} +1 -6
- package/dist/clients/{chunk-QS3S2PXZ.js → chunk-D6EY2WW4.js} +1 -1
- package/dist/clients/{chunk-4NWQR25X.js → chunk-JXTKKLVA.js} +55 -205
- package/dist/clients/{chunk-JBJ5FEIA.js → chunk-NNMZMHO6.js} +3 -3
- package/dist/clients/{chunk-HEOTAER5.js → chunk-Q4JGDB4L.js} +2 -2
- package/dist/clients/{chunk-IDYAC2RY.js → chunk-T6YNXIOS.js} +1 -1
- package/dist/clients/{chunk-35XAIUH6.js → chunk-ZBBYOJWK.js} +1 -206
- package/dist/clients/{chunk-55LEL7SW.js → chunk-ZEXIDBIZ.js} +1 -1
- package/dist/clients/fanatics.css +0 -19
- package/dist/clients/fanatics.d.ts +0 -4
- package/dist/clients/fanatics.js +28 -244
- package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +19 -6
- package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
- package/dist/clients/lighter.js +180 -28
- package/dist/clients/mallard.js +2 -2
- package/dist/clients/nado.js +4 -4
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
- package/dist/clients/polymarket/index.js +3 -3
- package/dist/clients/polymarket/polymarket.d.ts +2 -2
- package/dist/clients/polymarket/polymarket.js +2 -2
- package/dist/components/FunPayments/ExchangeIconCluster.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +1 -12
- package/dist/components/FunPayments/SourceExchangeIcon.d.ts +1 -1
- package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +1 -2
- package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +1 -1
- package/dist/consts/centralExchange.d.ts +18 -1
- package/dist/domains/asset.d.ts +1 -1
- package/dist/domains/convert/sourceWallet.d.ts +1 -1
- package/dist/domains/convert/types.d.ts +4 -5
- package/dist/domains/feeEstimate.d.ts +1 -3
- package/dist/domains/fees.d.ts +2 -16
- package/dist/domains/paymentMethods.d.ts +4 -16
- package/dist/domains/quote.d.ts +3 -5
- package/dist/domains/quoteMode/types.d.ts +0 -5
- package/dist/domains/wallet.d.ts +0 -4
- package/dist/hooks/track/CheckoutModalEvent.d.ts +0 -4
- package/dist/hooks/track/analytics/events.d.ts +11 -11
- package/dist/hooks/track/analytics/mappers.d.ts +1 -1
- package/dist/hooks/track/analytics/swappedIframeError.d.ts +3 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +1 -9
- package/dist/hooks/track/analytics/useTrackSwappedIframeError.d.ts +2 -0
- package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +1 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +2 -1
- package/dist/hooks/useExchangeOptions.d.ts +5 -10
- package/dist/hooks/usePaymentSources.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4621 -6788
- package/dist/interfaces/solanaWallet.d.ts +12 -25
- package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +4 -12
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +0 -3
- package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +3 -3
- package/dist/modals/CheckoutModal/LoadingAccount.d.ts +1 -4
- package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +3 -4
- package/dist/modals/CheckoutModal/SelectAsset/SelectAssetList.d.ts +0 -2
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +0 -9
- package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -9
- package/dist/providers/FunkitCheckoutContext/index.d.ts +2 -2
- package/dist/providers/FunkitConfigContext.d.ts +1 -14
- package/dist/providers/SolanaWalletProvider.d.ts +5 -5
- package/dist/utils/checkout.d.ts +0 -7
- package/dist/utils/solanaRelayWallet.d.ts +2 -7
- package/dist/wallets/Wallet.d.ts +16 -1
- package/dist/wallets/solanaWithdrawal.d.ts +5 -5
- package/dist/wallets/walletConnectors/index.js +41 -41
- package/package.json +3 -16
- package/dist/clients/chunk-CE42WHAA.js +0 -21
- package/dist/clients/chunk-TKEBGMVW.js +0 -176
- package/dist/clients/solana-transfer.d.ts +0 -1
- package/dist/clients/solana-transfer.js +0 -13
- package/dist/consts/bluvo.d.ts +0 -61
- package/dist/hooks/useBluvo.d.ts +0 -1537
- package/dist/modals/CheckoutModal/Brokerage/BrokerageSuccessModal.d.ts +0 -10
- package/dist/modals/CheckoutModal/Brokerage/BrokerageTwoFA.d.ts +0 -17
- package/dist/modals/CheckoutModal/Brokerage/ConnectExchange.d.ts +0 -13
- package/dist/modals/CheckoutModal/Brokerage/components/BrokerageSuccess.d.ts +0 -8
- package/dist/providers/FunkitBrokerageProvider.d.ts +0 -20
- package/dist/utils/bluvo.d.ts +0 -153
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
address: string;
|
|
1
|
+
import type { FunkitSolanaAdapter } from '@funkit/fun-relay';
|
|
2
|
+
/**
|
|
3
|
+
* A Solana wallet your app already has connected. funkit reads balances,
|
|
4
|
+
* quotes and executes with it — it never creates or connects a wallet itself.
|
|
5
|
+
*/
|
|
6
|
+
export interface SolanaWalletConnection {
|
|
8
7
|
/**
|
|
9
8
|
* Wallet name, e.g. `Phantom`. Picks the icon when none is supplied, and is
|
|
10
9
|
* how funkit recognises the same wallet connected on both ecosystems.
|
|
@@ -15,27 +14,15 @@ interface SolanaWalletBase {
|
|
|
15
14
|
* bundled icon for wallets funkit recognises by name, then to a generic one.
|
|
16
15
|
*/
|
|
17
16
|
icon?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The RPC connection funkit submits and confirms through. Use an endpoint
|
|
20
|
-
* you trust for write traffic — Solana's public RPC rejects browser origins.
|
|
21
|
-
*/
|
|
22
|
-
connection: SolanaConnection;
|
|
23
17
|
/**
|
|
24
18
|
* Disconnect the wallet on your side. Called from funkit's logout.
|
|
25
19
|
* It never disconnects a wallet it didn't connect. Pass a no-op if there's nothing to release.
|
|
26
20
|
*/
|
|
27
21
|
disconnect: () => void | Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Built with `createSolanaAdapter` from `@funkit/solana-kit` or
|
|
24
|
+
* `@funkit/solana-web3`. Solana is disabled, with a warning, if it's missing
|
|
25
|
+
* or its address isn't a valid Solana address.
|
|
26
|
+
*/
|
|
27
|
+
adapter: FunkitSolanaAdapter;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
30
|
-
* A Solana wallet your app already has connected. funkit reads balances,
|
|
31
|
-
* quotes and executes with it — it never creates or connects a wallet itself.
|
|
32
|
-
*
|
|
33
|
-
* At least one signing method is required.
|
|
34
|
-
*/
|
|
35
|
-
export type SolanaWalletConnection = SolanaWalletBase & SolanaSigner;
|
|
36
|
-
/**
|
|
37
|
-
* The subset a signing-only flow needs: where to submit and how to sign. A
|
|
38
|
-
* full {@link SolanaWalletConnection} satisfies it.
|
|
39
|
-
*/
|
|
40
|
-
export type SolanaWalletSigner = Pick<SolanaWalletBase, 'address' | 'connection'> & SolanaSigner;
|
|
41
|
-
export {};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import { type CheckoutModalCommonState, FunCheckoutStep } from '../stepTransition.shared';
|
|
5
|
-
import { type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
2
|
+
import { type CheckoutModalCommonState, type FunCheckoutStep } from '../stepTransition.shared';
|
|
3
|
+
import { type ModalStepInfo } from '../stepTransition';
|
|
6
4
|
export type SelectBrokerageState = CheckoutModalCommonState;
|
|
7
|
-
export type SelectBrokerageNext =
|
|
8
|
-
hasActiveConnection: true;
|
|
9
|
-
paymentInfo: PaymentMethodBrokerageInfo;
|
|
10
|
-
} | {
|
|
11
|
-
hasActiveConnection: false;
|
|
12
|
-
brokerType: BluvoExchangeType;
|
|
13
|
-
};
|
|
5
|
+
export type SelectBrokerageNext = null;
|
|
14
6
|
export declare const SelectBrokerageInfo: ModalStepInfo<FunCheckoutStep.SELECT_BROKERAGE>;
|
|
15
|
-
export declare function SelectBrokerage(
|
|
7
|
+
export declare function SelectBrokerage(): React.JSX.Element;
|
|
@@ -17,9 +17,6 @@ export declare enum FunCheckoutStep {
|
|
|
17
17
|
MELD_REDIRECT = "meld_redirect",
|
|
18
18
|
MELD_CURRENCY_SELECT = "meld_currency_select",
|
|
19
19
|
SELECT_BROKERAGE = "select_brokerage",
|
|
20
|
-
CONNECT_EXCHANGE = "connect_exchange",
|
|
21
|
-
BROKERAGE_TWO_FA = "brokerage_two_fa",
|
|
22
|
-
BROKERAGE_SUCCESS = "brokerage_success",
|
|
23
20
|
SWAPPED_IFRAME = "swapped_iframe",
|
|
24
21
|
PERPS_TRANSFER = "perps_transfer",
|
|
25
22
|
CONVERT = "convert",
|
|
@@ -4,9 +4,9 @@ import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutCont
|
|
|
4
4
|
export type { CheckoutAmountLimitsUsd };
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the min/max USD bounds for the amount input based on the active
|
|
7
|
-
* payment method. Fetches the inputs (min-transfer floor,
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* payment method. Fetches the inputs (min-transfer floor, global max) and
|
|
8
|
+
* delegates the per-method rules to `getCheckoutAmountLimitsUsd` in
|
|
9
|
+
* `@funkit/connect-core`.
|
|
10
10
|
*/
|
|
11
11
|
export declare const useCheckoutAmountLimits: ({ checkoutConfig, paymentMethod, }: {
|
|
12
12
|
checkoutConfig: FunkitCheckoutConfig;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodAccountInfo, type
|
|
2
|
+
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
|
|
3
3
|
import { type CheckoutModalCommonState, FunCheckoutStep } from './stepTransition.shared';
|
|
4
4
|
import { type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
|
|
5
5
|
export type LoadingAccountState = CheckoutModalCommonState;
|
|
6
6
|
export type LoadingAccountNext = {
|
|
7
7
|
chosenPaymentMethod: PaymentMethod.ACCOUNT_BALANCE;
|
|
8
8
|
paymentMethodInfo: PaymentMethodAccountInfo;
|
|
9
|
-
} | {
|
|
10
|
-
chosenPaymentMethod: PaymentMethod.BROKERAGE;
|
|
11
|
-
paymentMethodInfo: PaymentMethodBrokerageInfo;
|
|
12
9
|
} | {
|
|
13
10
|
chosenPaymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
14
11
|
paymentMethodInfo: PaymentMethodVirtualBankInfo;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { IndexedDynamicRoutingConfig } from '@funkit/fun-relay';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type PaymentMethodAccountInfo
|
|
3
|
+
import { type PaymentMethodAccountInfo } from '../../../domains/paymentMethods';
|
|
4
4
|
import type { AssetHoldingsItem } from '../../../domains/wallet';
|
|
5
5
|
import type { TransferTokenDefault } from '../../../hooks/useTokenAndChainDropdown';
|
|
6
6
|
import { type DynamicTargetAssetCandidate } from '../../../providers/FunkitCheckoutContext';
|
|
7
7
|
import { type CheckoutModalCommonState, FunCheckoutStep } from '../stepTransition.shared';
|
|
8
8
|
import { type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
9
9
|
export type SelectAssetState = CheckoutModalCommonState & {
|
|
10
|
-
paymentMethodInfo:
|
|
10
|
+
paymentMethodInfo: PaymentMethodAccountInfo;
|
|
11
11
|
};
|
|
12
12
|
export type SelectAssetNext = {
|
|
13
|
-
paymentMethodInfo?:
|
|
14
|
-
disconnectedBrokerage?: boolean;
|
|
13
|
+
paymentMethodInfo?: PaymentMethodAccountInfo;
|
|
15
14
|
transferToken?: TransferTokenDefault;
|
|
16
15
|
};
|
|
17
16
|
export declare const SelectAssetInfo: ModalStepInfo<FunCheckoutStep.SELECT_ASSET>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import { type PaymentMethodInfo } from '../../../domains/paymentMethods';
|
|
3
2
|
import type { AssetHoldingsItem } from '../../../domains/wallet';
|
|
4
3
|
interface AssetOption {
|
|
5
4
|
asset: AssetHoldingsItem;
|
|
@@ -13,7 +12,6 @@ interface SelectAssetListProps {
|
|
|
13
12
|
isLoading: boolean;
|
|
14
13
|
assetOptions: AssetOption[];
|
|
15
14
|
selectedChainTokenSymbol: string | undefined;
|
|
16
|
-
paymentMethodInfo: PaymentMethodInfo;
|
|
17
15
|
navigateOnAssetClick: boolean;
|
|
18
16
|
onBalanceTopUpSwitch?: () => void;
|
|
19
17
|
onClose?: () => void;
|
|
@@ -24,34 +24,25 @@ export type SourceChangeState = CheckoutModalCommonState & {
|
|
|
24
24
|
export type SourceChangeNext = {
|
|
25
25
|
connectNew: false;
|
|
26
26
|
paymentMethodInfo: ConnectablePaymentMethodInfo;
|
|
27
|
-
brokerageFailed: false;
|
|
28
27
|
} | {
|
|
29
28
|
connectNew: true;
|
|
30
29
|
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK | PaymentMethod.BITCOIN_LIGHTNING | PaymentMethod.CASH_APP_LIGHTNING>;
|
|
31
|
-
brokerageFailed: false;
|
|
32
30
|
} | {
|
|
33
31
|
connectNew: true;
|
|
34
32
|
paymentMethod: PaymentMethod.BITCOIN_LIGHTNING;
|
|
35
33
|
paymentMethodInfo: PaymentMethodBitcoinLightningInfo;
|
|
36
|
-
brokerageFailed: false;
|
|
37
34
|
} | {
|
|
38
35
|
connectNew: true;
|
|
39
36
|
paymentMethod: PaymentMethod.CASH_APP_LIGHTNING;
|
|
40
37
|
paymentMethodInfo: PaymentMethodCashAppLightningInfo;
|
|
41
|
-
brokerageFailed: false;
|
|
42
38
|
} | {
|
|
43
39
|
connectNew: true;
|
|
44
40
|
paymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
45
41
|
paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
|
|
46
|
-
brokerageFailed: false;
|
|
47
42
|
} | {
|
|
48
43
|
connectNew: true;
|
|
49
44
|
paymentMethod: PaymentMethod.CARD;
|
|
50
45
|
paymentMethodInfo: PaymentMethodCardInfo;
|
|
51
|
-
brokerageFailed: false;
|
|
52
|
-
} | {
|
|
53
|
-
brokerageFailed: true;
|
|
54
|
-
paymentMethodInfo: ConnectablePaymentMethodInfo;
|
|
55
46
|
} | {
|
|
56
47
|
/** Navigate to Swapped iframe with a selected payment option */
|
|
57
48
|
swappedIframe: true;
|
|
@@ -9,9 +9,6 @@ import { type PerpsTransferNext, type PerpsTransferState } from '../PolymarketPe
|
|
|
9
9
|
import { type ConvertSelectDestinationNext, type ConvertSelectDestinationState } from './Convert/ConvertSelectDestinationStep';
|
|
10
10
|
import { type ConvertSelectSourceNext, type ConvertSelectSourceState } from './Convert/ConvertSelectSourceStep';
|
|
11
11
|
import { type ConvertNext, type ConvertState } from './Convert/ConvertStep';
|
|
12
|
-
import { type BrokerageSuccessState } from './Brokerage/BrokerageSuccessModal';
|
|
13
|
-
import { type BrokerageTwoFANext, type BrokerageTwoFAState } from './Brokerage/BrokerageTwoFA';
|
|
14
|
-
import { type ConnectExchangeNext, type ConnectExchangeState } from './Brokerage/ConnectExchange';
|
|
15
12
|
import { type SelectBrokerageNext, type SelectBrokerageState } from './Brokerage/SelectBrokerage';
|
|
16
13
|
import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
|
|
17
14
|
import { type ConfirmationStepNext, type ConfirmationStepState } from './ConfirmationStep/ConfirmationStep';
|
|
@@ -109,9 +106,6 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
109
106
|
[FunCheckoutStep.MELD_REDIRECT]: MeldRedirectState;
|
|
110
107
|
[FunCheckoutStep.MELD_CURRENCY_SELECT]: MeldCurrencySelectState;
|
|
111
108
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageState;
|
|
112
|
-
[FunCheckoutStep.CONNECT_EXCHANGE]: ConnectExchangeState;
|
|
113
|
-
[FunCheckoutStep.BROKERAGE_TWO_FA]: BrokerageTwoFAState;
|
|
114
|
-
[FunCheckoutStep.BROKERAGE_SUCCESS]: BrokerageSuccessState;
|
|
115
109
|
[FunCheckoutStep.SWAPPED_IFRAME]: SwappedIframeState;
|
|
116
110
|
[FunCheckoutStep.PERPS_TRANSFER]: PerpsTransferState;
|
|
117
111
|
[FunCheckoutStep.CONVERT]: ConvertState;
|
|
@@ -143,9 +137,6 @@ export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
143
137
|
[FunCheckoutStep.MELD_REDIRECT]: MeldRedirectNext;
|
|
144
138
|
[FunCheckoutStep.MELD_CURRENCY_SELECT]: MeldCurrencySelectNext;
|
|
145
139
|
[FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageNext;
|
|
146
|
-
[FunCheckoutStep.CONNECT_EXCHANGE]: ConnectExchangeNext;
|
|
147
|
-
[FunCheckoutStep.BROKERAGE_TWO_FA]: BrokerageTwoFANext;
|
|
148
|
-
[FunCheckoutStep.BROKERAGE_SUCCESS]: null;
|
|
149
140
|
[FunCheckoutStep.SWAPPED_IFRAME]: SwappedIframeNext;
|
|
150
141
|
[FunCheckoutStep.PERPS_TRANSFER]: PerpsTransferNext;
|
|
151
142
|
[FunCheckoutStep.CONVERT]: ConvertNext;
|
|
@@ -4,7 +4,7 @@ import type { Address, Hex } from 'viem';
|
|
|
4
4
|
import { type ApplyDynamicRoutingPath } from '../../domains/dynamicRouting';
|
|
5
5
|
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
6
6
|
import type { AssetHoldingsItem } from '../../utils/assets';
|
|
7
|
-
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
7
|
+
import type { WithdrawalClient, WithdrawalSignContext, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
8
8
|
import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
|
|
9
9
|
import type { DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, MultiSourceWithdrawalConfig, PolymarketPerpsTransferPending, SingleWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
|
|
10
10
|
export * from './types';
|
|
@@ -27,7 +27,7 @@ interface FunkitCheckoutContextInterface {
|
|
|
27
27
|
}): void;
|
|
28
28
|
updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
|
|
29
29
|
updateCustomRecipient: (recipient: Address) => void;
|
|
30
|
-
confirmCheckout(quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient, preWithdrawalTxs?: WithdrawalTransaction[]): Promise<CheckoutConfirmationResult>;
|
|
30
|
+
confirmCheckout(quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient, preWithdrawalTxs?: WithdrawalTransaction[], withdrawalSignContext?: WithdrawalSignContext): Promise<CheckoutConfirmationResult>;
|
|
31
31
|
cancelCheckout(depositAddress: Address): Promise<boolean>;
|
|
32
32
|
/**
|
|
33
33
|
* Partial-update the active checkout item. Exposed for direct-execution
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type ComponentType, type
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { BluvoExchangeType } from '../consts/bluvo';
|
|
4
3
|
import type { PaymentMethod } from '../domains/paymentMethods';
|
|
5
4
|
import type { SourceChangeTopComponentProps } from '../modals/CheckoutModal/stepTransition';
|
|
6
5
|
export interface FunkitTextCustomizationsConfig {
|
|
@@ -202,17 +201,6 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
202
201
|
/** Function that returns a custom React component to render before other UIs in the select brokerage screen */
|
|
203
202
|
customTopComponent?: () => ReactNode;
|
|
204
203
|
};
|
|
205
|
-
connectExchangeScreen?: {
|
|
206
|
-
/** Function that returns a custom React component to render before other UIs in the connect exchange screen */
|
|
207
|
-
customTopComponent?: () => ReactNode;
|
|
208
|
-
/** Function that returns a custom React component to render instead of the normal page */
|
|
209
|
-
CustomComponent?: ComponentType<{
|
|
210
|
-
appName: string;
|
|
211
|
-
exchangeIcon: JSX.Element | null;
|
|
212
|
-
exchangeName: string;
|
|
213
|
-
exchangeType: BluvoExchangeType | null;
|
|
214
|
-
}>;
|
|
215
|
-
};
|
|
216
204
|
sourceChangeScreen?: {
|
|
217
205
|
bottomBarCloseButton?: {
|
|
218
206
|
/** Whether the bottom bar close button is visible - defaults to false */
|
|
@@ -276,7 +264,6 @@ export type FunkitUiCustomizationsConfigInternal = Required<FunkitUiCustomizatio
|
|
|
276
264
|
transferCryptoScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['transferCryptoScreen']>;
|
|
277
265
|
withdrawalScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['withdrawalScreen']>;
|
|
278
266
|
selectBrokerageScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['selectBrokerageScreen']>;
|
|
279
|
-
connectExchangeScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['connectExchangeScreen']>;
|
|
280
267
|
sourceChangeScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['sourceChangeScreen']> & {
|
|
281
268
|
bottomBarCloseButton: Required<Required<FunkitUiCustomizationsConfig['sourceChangeScreen'] & {}>['bottomBarCloseButton']>;
|
|
282
269
|
};
|
|
@@ -2,15 +2,15 @@ import React, { type ReactNode } from 'react';
|
|
|
2
2
|
import type { SolanaAddress } from '@funkit/api-base';
|
|
3
3
|
import type { SolanaWalletConnection } from '../interfaces/solanaWallet';
|
|
4
4
|
/**
|
|
5
|
-
* A host wallet that cleared validation,
|
|
6
|
-
* `SolanaAddress` rather than the string the host handed us.
|
|
5
|
+
* A host wallet that cleared validation, carrying its adapter's address as a
|
|
6
|
+
* real `SolanaAddress` rather than the string the host handed us.
|
|
7
7
|
*/
|
|
8
8
|
export type ValidatedSolanaWallet = SolanaWalletConnection & {
|
|
9
9
|
address: SolanaAddress;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Owns the host-supplied Solana wallet: validates the address once,
|
|
13
|
-
* exposes the whole wallet or nothing.
|
|
12
|
+
* Owns the host-supplied Solana wallet: validates the adapter's address once,
|
|
13
|
+
* then exposes the whole wallet or nothing.
|
|
14
14
|
*
|
|
15
15
|
* Rejecting the wallet wholesale — rather than only keeping its address out of
|
|
16
16
|
* the session identity — is what stops execution signing against an address we
|
|
@@ -23,6 +23,6 @@ export declare function SolanaWalletProvider({ children, solanaWallet, }: {
|
|
|
23
23
|
}): React.JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* The host's Solana wallet, or `undefined` when none was supplied or its
|
|
26
|
-
*
|
|
26
|
+
* adapter failed `validateSolanaAdapter`.
|
|
27
27
|
*/
|
|
28
28
|
export declare const useSolanaWallet: () => ValidatedSolanaWallet | undefined;
|
package/dist/utils/checkout.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
|
8
8
|
import type { Config, UseConfigReturnType } from '../wagmi/hooks';
|
|
9
9
|
import { type FunkitCheckoutActionParams, type FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext/types';
|
|
10
10
|
export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
|
|
11
|
-
export declare const BROKERAGE_TIME_ESTIMATE_MS = 0;
|
|
12
11
|
export declare const BANK_TIME_ESTIMATE_MS = 0;
|
|
13
12
|
export declare const DUMMY_TRANSFER_PARAMS: {
|
|
14
13
|
toAddress: '0x000000000000000000000000000000000000dEaD';
|
|
@@ -73,12 +72,6 @@ export declare function getCheckoutItemDisplay({ checkoutConfig, hideAmount, ove
|
|
|
73
72
|
hideAmount?: boolean;
|
|
74
73
|
overrideAmount?: number;
|
|
75
74
|
}): string;
|
|
76
|
-
/**
|
|
77
|
-
* Given the result of a quote, calculate the effective fees (in source asset).
|
|
78
|
-
*
|
|
79
|
-
* _These are only the fees from our base quote, **not** including the initial transfer / brokerage / card processing fees._
|
|
80
|
-
*/
|
|
81
|
-
export declare function getBaseQuoteTotalFeesFromAmount(baseQuote: CheckoutQuoteResponse): number;
|
|
82
75
|
/**
|
|
83
76
|
* Given the result of a quote, calculate the effective exchange rate (target asset / source asset).
|
|
84
77
|
*/
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { SolanaAddress } from '@funkit/api-base';
|
|
3
|
-
import type { SolanaWalletSigner } from '../interfaces/solanaWallet';
|
|
1
|
+
import type { FunkitSolanaAdapter, SolanaWallet } from '@funkit/fun-relay';
|
|
4
2
|
import type { ValidatedSolanaWallet } from '../providers/SolanaWalletProvider';
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function createSolanaRelayWallet(wallet: SolanaWalletSigner & {
|
|
7
|
-
address: SolanaAddress;
|
|
8
|
-
}): SolanaWallet;
|
|
3
|
+
export declare function createSolanaRelayWallet(adapter: FunkitSolanaAdapter): SolanaWallet;
|
|
9
4
|
/**
|
|
10
5
|
* The provider's relay wallet for a Solana-source deposit, or undefined for any
|
|
11
6
|
* other source. A withdrawal client brings its own wallet and never reaches this.
|
package/dist/wallets/Wallet.d.ts
CHANGED
|
@@ -107,6 +107,17 @@ export type WithdrawalTransaction = {
|
|
|
107
107
|
data: string;
|
|
108
108
|
value: string;
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* Withdrawal context sent with the batch so the integrator can check what it
|
|
112
|
+
* signs. `targetChainId` is Fun's chain id: Solana and Tron destinations use
|
|
113
|
+
* Fun's own ids and their native address formats, so a host check must not
|
|
114
|
+
* assume an EVM chain id or run `isAddress` on every destination.
|
|
115
|
+
*/
|
|
116
|
+
export type WithdrawalSignContext = {
|
|
117
|
+
/** The format follows `targetChainId`: 0x hex for EVM, native for Solana and Tron. */
|
|
118
|
+
destinationAddress: string;
|
|
119
|
+
targetChainId: number;
|
|
120
|
+
};
|
|
110
121
|
/** EIP-712 payload passed to {@link WithdrawalClient.signTypedData}. */
|
|
111
122
|
export type WithdrawalTypedData = {
|
|
112
123
|
domain: TypedDataDomain;
|
|
@@ -134,8 +145,12 @@ export interface WithdrawalClient {
|
|
|
134
145
|
* Implementations using `wallet_sendCalls` should map the calls-id back to
|
|
135
146
|
* the underlying tx hash via `waitForCallsStatus` →
|
|
136
147
|
* `receipts[0].transactionHash`.
|
|
148
|
+
*
|
|
149
|
+
* `signContext` is sent with batched sends only. Gasless and
|
|
150
|
+
* single-transaction steps (`sendTransaction`, `signTypedData`,
|
|
151
|
+
* `signMessage`) omit it.
|
|
137
152
|
*/
|
|
138
|
-
sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[]) => Promise<string>;
|
|
153
|
+
sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[], signContext?: WithdrawalSignContext) => Promise<string>;
|
|
139
154
|
confirmTransaction: (txHash: string, chainId: number) => Promise<TransactionReceipt>;
|
|
140
155
|
address: () => string;
|
|
141
156
|
/**
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { SolanaAddress } from '@funkit/api-base';
|
|
2
|
+
import type { FunkitSolanaAdapter } from '@funkit/fun-relay';
|
|
2
3
|
import type { NATIVE_TOKEN } from '../consts/funkit';
|
|
3
|
-
import type { SolanaWalletSigner } from '../interfaces/solanaWallet';
|
|
4
4
|
import type { WalletWithdrawalConfig, WithdrawalConfigBase } from '../providers/FunkitCheckoutContext/types';
|
|
5
5
|
export interface SolanaWithdrawalConfig extends Omit<WithdrawalConfigBase, 'sourceChainId' | 'sourceTokenAddress'> {
|
|
6
|
-
/** Signs the withdrawal
|
|
7
|
-
|
|
6
|
+
/** Signs the withdrawal. Built with `@funkit/solana-kit` or `@funkit/solana-web3`. */
|
|
7
|
+
adapter: FunkitSolanaAdapter;
|
|
8
8
|
/** Base58 mint of the SPL token to withdraw, or `NATIVE_TOKEN` for SOL. */
|
|
9
9
|
sourceTokenAddress: SolanaAddress | typeof NATIVE_TOKEN;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* `null`
|
|
13
|
-
*
|
|
12
|
+
* `null` until the adapter passes `validateSolanaAdapter`, so a bad host value
|
|
13
|
+
* disables the flow instead of throwing in render or failing at confirm.
|
|
14
14
|
*
|
|
15
15
|
* `params` is compared by identity, so pass a stable object.
|
|
16
16
|
*/
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
xdefiWallet
|
|
4
4
|
} from "./chunk-HXX4PRE2.js";
|
|
5
|
-
import {
|
|
6
|
-
zerionWallet
|
|
7
|
-
} from "./chunk-34B7OJNT.js";
|
|
8
5
|
import {
|
|
9
6
|
zealWallet
|
|
10
7
|
} from "./chunk-GLX5FULK.js";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
zerionWallet
|
|
10
|
+
} from "./chunk-34B7OJNT.js";
|
|
11
|
+
import {
|
|
12
|
+
safepalWallet
|
|
13
|
+
} from "./chunk-BBB2J3US.js";
|
|
14
14
|
import {
|
|
15
15
|
tahoWallet
|
|
16
16
|
} from "./chunk-U74RFZOL.js";
|
|
@@ -23,6 +23,9 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
tokenaryWallet
|
|
25
25
|
} from "./chunk-TPM5PUJD.js";
|
|
26
|
+
import {
|
|
27
|
+
trustWallet
|
|
28
|
+
} from "./chunk-SR5CZR3L.js";
|
|
26
29
|
import {
|
|
27
30
|
uniswapWallet
|
|
28
31
|
} from "./chunk-UNDWHCDH.js";
|
|
@@ -30,41 +33,35 @@ import {
|
|
|
30
33
|
walletConnectWallet
|
|
31
34
|
} from "./chunk-DUX4XCDV.js";
|
|
32
35
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
oneKeyWallet
|
|
37
|
-
} from "./chunk-KN32ITJ7.js";
|
|
36
|
+
phantomWallet
|
|
37
|
+
} from "./chunk-Q27YVDDH.js";
|
|
38
38
|
import {
|
|
39
39
|
rabbyWallet
|
|
40
40
|
} from "./chunk-RQ2GXOJL.js";
|
|
41
41
|
import {
|
|
42
42
|
ramperWallet
|
|
43
43
|
} from "./chunk-GPXIBTWN.js";
|
|
44
|
+
import {
|
|
45
|
+
roninWallet
|
|
46
|
+
} from "./chunk-IA5432IR.js";
|
|
44
47
|
import {
|
|
45
48
|
rainbowWallet
|
|
46
49
|
} from "./chunk-ZSSSLFQF.js";
|
|
47
50
|
import {
|
|
48
51
|
safeWallet
|
|
49
52
|
} from "./chunk-IR3PJMVM.js";
|
|
50
|
-
import {
|
|
51
|
-
safepalWallet
|
|
52
|
-
} from "./chunk-BBB2J3US.js";
|
|
53
53
|
import {
|
|
54
54
|
subWallet
|
|
55
55
|
} from "./chunk-XODA5ESL.js";
|
|
56
56
|
import {
|
|
57
|
-
|
|
58
|
-
} from "./chunk-
|
|
57
|
+
safeheronWallet
|
|
58
|
+
} from "./chunk-UN3ONVNC.js";
|
|
59
59
|
import {
|
|
60
60
|
kresusWallet
|
|
61
61
|
} from "./chunk-V77ATGZT.js";
|
|
62
62
|
import {
|
|
63
63
|
metaMaskWallet
|
|
64
64
|
} from "./chunk-RXRYHMRI.js";
|
|
65
|
-
import {
|
|
66
|
-
mewWallet
|
|
67
|
-
} from "./chunk-DSPQXAB2.js";
|
|
68
65
|
import {
|
|
69
66
|
okxWallet
|
|
70
67
|
} from "./chunk-CU5J53XR.js";
|
|
@@ -72,41 +69,41 @@ import {
|
|
|
72
69
|
oktoWallet
|
|
73
70
|
} from "./chunk-V4M3SNPS.js";
|
|
74
71
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
72
|
+
mewWallet
|
|
73
|
+
} from "./chunk-DSPQXAB2.js";
|
|
77
74
|
import {
|
|
78
75
|
omniWallet
|
|
79
76
|
} from "./chunk-2TAUCVX7.js";
|
|
80
77
|
import {
|
|
81
|
-
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import {
|
|
84
|
-
foxWallet
|
|
85
|
-
} from "./chunk-U52QO5HF.js";
|
|
78
|
+
oneInchWallet
|
|
79
|
+
} from "./chunk-GFS2AVAH.js";
|
|
86
80
|
import {
|
|
87
|
-
|
|
88
|
-
} from "./chunk-
|
|
81
|
+
oneKeyWallet
|
|
82
|
+
} from "./chunk-KN32ITJ7.js";
|
|
89
83
|
import {
|
|
90
84
|
frameWallet
|
|
91
85
|
} from "./chunk-B572YIAQ.js";
|
|
92
86
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
87
|
+
foxWallet
|
|
88
|
+
} from "./chunk-U52QO5HF.js";
|
|
95
89
|
import {
|
|
96
|
-
|
|
97
|
-
} from "./chunk-
|
|
90
|
+
desigWallet
|
|
91
|
+
} from "./chunk-DFHP75HV.js";
|
|
98
92
|
import {
|
|
99
93
|
frontierWallet
|
|
100
94
|
} from "./chunk-IWOMSW64.js";
|
|
95
|
+
import {
|
|
96
|
+
imTokenWallet
|
|
97
|
+
} from "./chunk-YY2JA23M.js";
|
|
98
|
+
import {
|
|
99
|
+
gateWallet
|
|
100
|
+
} from "./chunk-YRMBR6NA.js";
|
|
101
101
|
import {
|
|
102
102
|
injectedWallet
|
|
103
103
|
} from "./chunk-M75V7OL3.js";
|
|
104
104
|
import {
|
|
105
105
|
ledgerWallet
|
|
106
106
|
} from "./chunk-BL4OC2EJ.js";
|
|
107
|
-
import {
|
|
108
|
-
braveWallet
|
|
109
|
-
} from "./chunk-U2XXV45G.js";
|
|
110
107
|
import {
|
|
111
108
|
clvWallet
|
|
112
109
|
} from "./chunk-4FHNLTR3.js";
|
|
@@ -119,6 +116,9 @@ import {
|
|
|
119
116
|
import {
|
|
120
117
|
coin98Wallet
|
|
121
118
|
} from "./chunk-RFCZYLNR.js";
|
|
119
|
+
import {
|
|
120
|
+
bloomWallet
|
|
121
|
+
} from "./chunk-PNHDOC77.js";
|
|
122
122
|
import {
|
|
123
123
|
customWallet
|
|
124
124
|
} from "./chunk-VKM5M5UK.js";
|
|
@@ -126,14 +126,17 @@ import {
|
|
|
126
126
|
dawnWallet
|
|
127
127
|
} from "./chunk-LV6YV3DE.js";
|
|
128
128
|
import {
|
|
129
|
-
|
|
130
|
-
} from "./chunk-
|
|
129
|
+
enkryptWallet
|
|
130
|
+
} from "./chunk-Z6LDN2AN.js";
|
|
131
131
|
import {
|
|
132
132
|
argentWallet
|
|
133
133
|
} from "./chunk-XSDTNMQY.js";
|
|
134
134
|
import {
|
|
135
135
|
bitgetWallet
|
|
136
136
|
} from "./chunk-HOCKAU5H.js";
|
|
137
|
+
import {
|
|
138
|
+
bitskiWallet
|
|
139
|
+
} from "./chunk-NPITCCJE.js";
|
|
137
140
|
import {
|
|
138
141
|
bifrostWallet
|
|
139
142
|
} from "./chunk-ALGPGI6V.js";
|
|
@@ -141,15 +144,12 @@ import {
|
|
|
141
144
|
bitverseWallet
|
|
142
145
|
} from "./chunk-5AEWIKRA.js";
|
|
143
146
|
import {
|
|
144
|
-
|
|
145
|
-
} from "./chunk-
|
|
147
|
+
braveWallet
|
|
148
|
+
} from "./chunk-U2XXV45G.js";
|
|
146
149
|
import {
|
|
147
150
|
bybitWallet
|
|
148
151
|
} from "./chunk-BBDNB5TQ.js";
|
|
149
152
|
import "./chunk-AALSJCUR.js";
|
|
150
|
-
import {
|
|
151
|
-
bitskiWallet
|
|
152
|
-
} from "./chunk-NPITCCJE.js";
|
|
153
153
|
import "./chunk-EYWGX5LT.js";
|
|
154
154
|
import "./chunk-B454LLKJ.js";
|
|
155
155
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -45,25 +45,14 @@
|
|
|
45
45
|
"author": "https://fun.xyz/",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@solana/spl-token": ">=0.4.0 <1",
|
|
49
|
-
"@solana/web3.js": ">=1.98.0",
|
|
50
48
|
"@tanstack/react-query": ">=5.0.0",
|
|
51
49
|
"react": ">=19",
|
|
52
50
|
"react-dom": ">=19",
|
|
53
51
|
"viem": ">=2.22.14",
|
|
54
52
|
"wagmi": ">=2.0.0 <=3.6.1"
|
|
55
53
|
},
|
|
56
|
-
"peerDependenciesMeta": {
|
|
57
|
-
"@solana/spl-token": {
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
|
-
"@solana/web3.js": {
|
|
61
|
-
"optional": true
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
54
|
"devDependencies": {
|
|
65
55
|
"@chromatic-com/storybook": "^5.1.2",
|
|
66
|
-
"@solana/spl-token": "0.4.14",
|
|
67
56
|
"@statsig/statsig-node-core": "^0.11.1",
|
|
68
57
|
"@storybook/addon-docs": "^10.3.6",
|
|
69
58
|
"@storybook/addon-links": "^10.3.6",
|
|
@@ -101,13 +90,11 @@
|
|
|
101
90
|
"dependencies": {
|
|
102
91
|
"@aave-dao/aave-address-book": "^4.49.9",
|
|
103
92
|
"@aave/client": "^0.9.3",
|
|
104
|
-
"@bluvo/react": "3.0.0-beta.1",
|
|
105
|
-
"@bluvo/sdk-ts": "3.0.0-beta.1",
|
|
106
93
|
"@datadog/browser-logs": "5.22.0",
|
|
107
94
|
"@funkit/api-base": "10.2.1",
|
|
108
95
|
"@funkit/chains": "2.6.1",
|
|
109
|
-
"@funkit/connect-core": "
|
|
110
|
-
"@funkit/fun-relay": "
|
|
96
|
+
"@funkit/connect-core": "15.0.0",
|
|
97
|
+
"@funkit/fun-relay": "4.0.0",
|
|
111
98
|
"@funkit/utils": "5.1.2",
|
|
112
99
|
"@number-flow/react": "^0.5.5",
|
|
113
100
|
"@radix-ui/react-dropdown-menu": "^2.1.7",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/consts/funkit.ts
|
|
4
|
-
import { FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS } from "@funkit/chains";
|
|
5
|
-
var FUN_BRAND_NAME = "Fun";
|
|
6
|
-
var PLACEHOLDER_FUNKIT_USER_INFO = {
|
|
7
|
-
id: "0x",
|
|
8
|
-
address: "0x",
|
|
9
|
-
solanaAddress: void 0,
|
|
10
|
-
name: "Guest",
|
|
11
|
-
nameTruncated: "Guest",
|
|
12
|
-
type: "unknown",
|
|
13
|
-
typeLabel: "",
|
|
14
|
-
iconSrc: "",
|
|
15
|
-
isConnected: false
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
FUN_BRAND_NAME,
|
|
20
|
-
PLACEHOLDER_FUNKIT_USER_INFO
|
|
21
|
-
};
|