@funkit/connect 9.15.0 → 9.16.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 +40 -0
- package/dist/__generated__/default_feature_gates.d.ts +1 -0
- package/dist/{chunk-76E6MOLR.js → chunk-C2DLTEP2.js} +1 -0
- package/dist/{chunk-AVVB5AIE.js → chunk-PPNE44RL.js} +1 -0
- package/dist/clients/aave.d.ts +15 -0
- package/dist/clients/aave.js +29 -4
- package/dist/clients/{chunk-H6F75ULR.js → chunk-3QHYYLVM.js} +59 -39
- package/dist/clients/chunk-JOBMGIG4.js +290 -0
- package/dist/clients/fanatics.css +3458 -3395
- package/dist/clients/fanatics.js +3 -3
- package/dist/clients/lighter.css +3458 -3395
- package/dist/clients/lighter.js +10 -4
- package/dist/clients/polymarket.js +2 -1
- package/dist/components/ApprovalMethodToggle/ApprovalMethodToggle.d.ts +3 -6
- package/dist/components/Box/Box.d.ts +21 -21
- package/dist/components/Dialog/Dialog.d.ts +11 -1
- package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +7 -1
- package/dist/components/Dropdown/BaseDropdown.d.ts +1 -1
- package/dist/components/FunCheckoutHistory/AddTokenToWalletButton.css.d.ts +1 -0
- package/dist/components/FunCheckoutHistory/AddTokenToWalletButton.d.ts +47 -0
- package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryDetail.d.ts +1 -1
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunTransactionSummary/DestinationYieldRows.d.ts +16 -0
- package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +7 -1
- package/dist/components/Icons/CaretDownIcon.d.ts +6 -1
- package/dist/components/ModalErrorState/ModalErrorState.d.ts +24 -0
- package/dist/consts/funkit.d.ts +0 -4
- package/dist/css/sprinkles.css.d.ts +32 -21
- package/dist/domains/checkoutNotifications.d.ts +46 -0
- package/dist/domains/meld.d.ts +0 -2
- package/dist/hooks/queries/useLightningQuote.d.ts +11 -0
- package/dist/hooks/queries/useRecentCheckouts.d.ts +0 -1
- package/dist/hooks/queries/useRecentDeposits.d.ts +0 -21
- package/dist/hooks/track/CheckoutModalEvent.d.ts +5 -1
- package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -1
- package/dist/hooks/useIsCheckoutComplete.d.ts +13 -0
- package/dist/index.css +3547 -3466
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3675 -3085
- package/dist/interfaces/identity.d.ts +41 -0
- package/dist/interfaces/logTransport.d.ts +51 -0
- package/dist/interfaces/swapped-transport.d.ts +78 -0
- package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +1 -0
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +3 -5
- package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoice.d.ts +10 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +7 -2
- package/dist/modals/CheckoutModal/TransferToken/CheckoutNotifications.d.ts +0 -6
- package/dist/modals/CheckoutModal/TransferToken/DirectExecutionNotification.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/types.d.ts +2 -2
- package/dist/modals/CheckoutModal/selectSuccessScreenBackground.d.ts +29 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -0
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +41 -0
- package/dist/providers/FunkitConfigContext.d.ts +9 -2
- package/dist/providers/FunkitHistoryContext.d.ts +1 -1
- package/dist/providers/FunkitQuoteContext.d.ts +1 -1
- package/dist/providers/FunkitThemeProvider.d.ts +3 -0
- package/dist/providers/GeneralWalletProvider.d.ts +18 -0
- package/dist/providers/SwappedProvider.d.ts +2 -0
- package/dist/themes/darkTheme.js +1 -1
- package/dist/themes/lightTheme.js +1 -1
- package/dist/transports/iframeSwappedTransport.d.ts +16 -0
- package/dist/utils/address.d.ts +5 -0
- package/dist/utils/assets.d.ts +0 -7
- package/dist/utils/datadogBrowserLogsTransport.d.ts +17 -0
- package/dist/utils/directExecution.d.ts +1 -2
- package/dist/utils/funLogger.d.ts +8 -2
- package/dist/utils/purifyCheckoutHistoryItem.d.ts +1 -1
- package/dist/utils/swapped.d.ts +14 -1
- package/dist/wagmi/hooks.d.ts +1 -1
- package/dist/wallets/walletConnectors/argentWallet/argentWallet.js +3 -3
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +4 -4
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +4 -4
- package/dist/wallets/walletConnectors/bitskiWallet/bitskiWallet.js +3 -3
- package/dist/wallets/walletConnectors/bitverseWallet/bitverseWallet.js +3 -3
- package/dist/wallets/walletConnectors/bloomWallet/bloomWallet.js +3 -3
- package/dist/wallets/walletConnectors/braveWallet/braveWallet.js +3 -3
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +4 -4
- package/dist/wallets/walletConnectors/{chunk-G3RQSCYR.js → chunk-2CX7LX4J.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-OUM6H3WU.js → chunk-2DLDAZRH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-O7ZCUI2Y.js → chunk-3FCWJRI4.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-T3VMQBBI.js → chunk-4DCO3TGL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-V6UOWTEZ.js → chunk-4NV5BYRP.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-A5EZBNME.js → chunk-52QXXLDS.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-AM5MSNVQ.js → chunk-76S7R2ND.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-Y36HPFB3.js → chunk-7HRFUZFX.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-KS5MJNGD.js → chunk-7ZYCBDQ4.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-UDTBQV4Q.js → chunk-AVDUNQUW.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-MTJIPVYB.js → chunk-BU3ZAT5X.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-XVH4JIXB.js → chunk-DS73TZ6O.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-TNVLCMJD.js → chunk-FW3WZETT.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-PARFRRNI.js → chunk-G2PHTVL6.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ZPSPK6LH.js → chunk-GUQM4QSL.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-2DKNXOPL.js → chunk-HBQK5RD5.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-3K2MFXCO.js → chunk-IGKXZBTA.js} +1 -0
- package/dist/wallets/walletConnectors/{chunk-6DRCY52E.js → chunk-IULPZP2Q.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-KSNA53EX.js → chunk-JN5I3DNC.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-VJZWNQOF.js → chunk-JPN6TWIT.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-T4ROGPMF.js → chunk-KCRO2AGO.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-HRDPUW3V.js → chunk-KI5Y2BBF.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-DP5ICBEB.js → chunk-MQM45ADF.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-FMVNQKZL.js → chunk-N4IJLYFY.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-APHCF4DT.js → chunk-NR2OGDHQ.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-RZH4FSX7.js → chunk-NSK6A7TI.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-XTD6OMZP.js → chunk-NTMBEOR2.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-5TN5Z2WY.js → chunk-OEEGYENV.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-YYYRPQHB.js → chunk-OLZ7626J.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-P4E2ZFQB.js → chunk-OQB55QXP.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-DEFRRPXB.js → chunk-OX37G4YT.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-S6R4B763.js → chunk-PJ7Y57EH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-EUMOVTRQ.js → chunk-QG6ZHI7B.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-57GN4W23.js → chunk-QY53O7WG.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-7PVUEV4M.js → chunk-RB66PKPA.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-BHAPTB57.js → chunk-RCY66YHF.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-O4IDLNBH.js → chunk-RICTB3FA.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-V4EXM3KB.js → chunk-RPV27V2Y.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-KWX2SYU2.js → chunk-SWFF3TWJ.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-HPUEYLLS.js → chunk-T6LGKC3F.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-YIEASHLS.js → chunk-TKB2OY6G.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-R7X5RIO7.js → chunk-VH3THHJY.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-LCIPVVH5.js → chunk-W2LCLDPX.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-XVBSJCW5.js → chunk-WAHGI5L7.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-HXWUH73P.js → chunk-WKNQMP4A.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-BWLMNATA.js → chunk-WNAGGFMG.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-E3NZE4UP.js → chunk-WVT6BBJH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-34HACM5U.js → chunk-XCNHV3HS.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-7V33VJAL.js → chunk-YO2K4MBH.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-FG2LDVXL.js → chunk-YQFGVZGR.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-BBPTPMH7.js → chunk-YWOVAU6O.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-UKSIXGWC.js → chunk-Z3PPW6NC.js} +1 -1
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +4 -4
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +4 -4
- package/dist/wallets/walletConnectors/coinbaseWallet/coinbaseWallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +4 -4
- package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +3 -3
- package/dist/wallets/walletConnectors/desigWallet/desigWallet.js +3 -3
- package/dist/wallets/walletConnectors/enkryptWallet/enkryptWallet.js +3 -3
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +4 -4
- package/dist/wallets/walletConnectors/frameWallet/frameWallet.js +3 -3
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +4 -4
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +4 -4
- package/dist/wallets/walletConnectors/imTokenWallet/imTokenWallet.js +3 -3
- package/dist/wallets/walletConnectors/index.js +73 -73
- package/dist/wallets/walletConnectors/injectedWallet/injectedWallet.js +3 -3
- package/dist/wallets/walletConnectors/kresusWallet/kresusWallet.js +3 -3
- package/dist/wallets/walletConnectors/ledgerWallet/ledgerWallet.js +3 -3
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +4 -4
- package/dist/wallets/walletConnectors/mewWallet/mewWallet.js +3 -3
- package/dist/wallets/walletConnectors/oktoWallet/oktoWallet.js +3 -3
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +4 -4
- package/dist/wallets/walletConnectors/omniWallet/omniWallet.js +3 -3
- package/dist/wallets/walletConnectors/oneInchWallet/oneInchWallet.js +3 -3
- package/dist/wallets/walletConnectors/oneKeyWallet/oneKeyWallet.js +3 -3
- package/dist/wallets/walletConnectors/phantomWallet/phantomWallet.js +3 -3
- package/dist/wallets/walletConnectors/rabbyWallet/rabbyWallet.js +3 -3
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +4 -4
- package/dist/wallets/walletConnectors/ramperWallet/ramperWallet.js +3 -3
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +4 -4
- package/dist/wallets/walletConnectors/safeWallet/safeWallet.js +2 -2
- package/dist/wallets/walletConnectors/safeheronWallet/safeheronWallet.js +3 -3
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +4 -4
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +4 -4
- package/dist/wallets/walletConnectors/tahoWallet/tahoWallet.js +3 -3
- package/dist/wallets/walletConnectors/talismanWallet/talismanWallet.js +3 -3
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +4 -4
- package/dist/wallets/walletConnectors/tokenaryWallet/tokenaryWallet.js +3 -3
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +4 -4
- package/dist/wallets/walletConnectors/uniswapWallet/uniswapWallet.js +3 -3
- package/dist/wallets/walletConnectors/walletConnectWallet/walletConnectWallet.js +3 -3
- package/dist/wallets/walletConnectors/xdefiWallet/xdefiWallet.js +3 -3
- package/dist/wallets/walletConnectors/zealWallet/zealWallet.js +3 -3
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +4 -4
- package/package.json +4 -5
- package/dist/clients/chunk-PLDXBAAH.js +0 -290
- package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +0 -4
- package/dist/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.d.ts +0 -4
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedErrorMessage.d.ts +0 -6
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { LoginType } from '../utils/userInfo';
|
|
3
|
+
/**
|
|
4
|
+
* Platform-agnostic **user** identity surface consumed by core hooks.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately scoped to who the *end user* is — `apiKey` (the *customer*
|
|
7
|
+
* identity, set by the integrator) is kept on `useFunkitConfig` so the two
|
|
8
|
+
* concerns don't get conflated. Core hooks that need both read each from its
|
|
9
|
+
* own seam.
|
|
10
|
+
*
|
|
11
|
+
* On web this is derived from wagmi + `GeneralWalletProvider`; on React Native
|
|
12
|
+
* it will be derived from host-app props. Widen this surface only when a core
|
|
13
|
+
* hook genuinely needs more — keep it free of DOM- and wagmi-bound types so it
|
|
14
|
+
* can move to `@funkit/connect-core` untouched.
|
|
15
|
+
*/
|
|
16
|
+
export interface FunkitIdentity {
|
|
17
|
+
/**
|
|
18
|
+
* Stable user id used to key user-scoped API calls. Equals the configured
|
|
19
|
+
* `externalUserId` (or a synthetic namespaced id derived from it) when one is
|
|
20
|
+
* present, otherwise the connected wallet address, or the `'0x'` placeholder
|
|
21
|
+
* when neither is present. Mirrors `userInfo.id`.
|
|
22
|
+
*/
|
|
23
|
+
userId: string;
|
|
24
|
+
/**
|
|
25
|
+
* Effective wallet address user-scoped flows transact against, or `''` when
|
|
26
|
+
* there is no connected/trusted address. Distinct from a display address:
|
|
27
|
+
* this is the resolved address (`effectiveAddress`), not `userInfo.address`,
|
|
28
|
+
* which carries the `'0x'` placeholder for guests.
|
|
29
|
+
*/
|
|
30
|
+
walletAddress: Address | '';
|
|
31
|
+
/** How the user authenticated (guest vs web3). */
|
|
32
|
+
loginType: LoginType;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Contract a platform implements to feed identity into core. Each platform
|
|
36
|
+
* supplies a `useIdentity` hook: web wraps wagmi + `GeneralWalletProvider`
|
|
37
|
+
* (see `useIdentity` there); React Native will wrap host-app-provided props.
|
|
38
|
+
*/
|
|
39
|
+
export interface IdentityProvider {
|
|
40
|
+
useIdentity(): FunkitIdentity;
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Severity levels emitted by `FunLogger`. */
|
|
2
|
+
export type LogLevel = 'info' | 'debug' | 'warn' | 'error';
|
|
3
|
+
/** User tracking consent, mirroring the Datadog browser SDK's values. */
|
|
4
|
+
export type TrackingConsent = 'granted' | 'not-granted';
|
|
5
|
+
/**
|
|
6
|
+
* The structured context `FunLogger` assembles for every record: the caller's
|
|
7
|
+
* data plus the logger's resolved user/session fields. Concrete (rather than
|
|
8
|
+
* `object`) so transport implementors get property access and autocomplete.
|
|
9
|
+
*/
|
|
10
|
+
export interface LogContext {
|
|
11
|
+
/** Caller-supplied structured data for this log line, if any. */
|
|
12
|
+
data?: object;
|
|
13
|
+
apiKey: string | null;
|
|
14
|
+
userId: string | null;
|
|
15
|
+
userName: string | null;
|
|
16
|
+
userAddress: string | null;
|
|
17
|
+
userLoginType: string | null;
|
|
18
|
+
typeLabel: string | null;
|
|
19
|
+
sdkVersion: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** A single fully-assembled log record handed to a transport. */
|
|
22
|
+
export interface LogRecord {
|
|
23
|
+
level: LogLevel;
|
|
24
|
+
title: string;
|
|
25
|
+
/** Assembled by `FunLogger` so transports stay dumb sinks. */
|
|
26
|
+
context: LogContext;
|
|
27
|
+
/** Present only for `error`-level records. */
|
|
28
|
+
error?: Error;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Platform sink for `FunLogger`. The logger (queueing, env detection, level
|
|
32
|
+
* routing, console fallback, context tracking) is platform-agnostic; everything
|
|
33
|
+
* platform-specific about *emitting* lives behind this interface.
|
|
34
|
+
*
|
|
35
|
+
* Part of the React Native split (see docs/connect-rn-architecture.md): web
|
|
36
|
+
* implements it with `DatadogBrowserLogsTransport`, React Native will implement
|
|
37
|
+
* it with a Datadog React Native transport (`@datadog/mobile-react-native`).
|
|
38
|
+
* Kept free of DOM/`@datadog/browser-logs` types so it can move to
|
|
39
|
+
* `@funkit/connect-core` untouched.
|
|
40
|
+
*/
|
|
41
|
+
export interface LogTransport {
|
|
42
|
+
/** Emit one record to the platform sink. */
|
|
43
|
+
log(record: LogRecord): void;
|
|
44
|
+
/**
|
|
45
|
+
* Reflect the resolved environment (e.g. `'development'` | `'production'`).
|
|
46
|
+
* Optional — sinks that don't segment by environment can omit it.
|
|
47
|
+
*/
|
|
48
|
+
setEnv?(environment: string): void;
|
|
49
|
+
/** Reflect user tracking consent. Optional. */
|
|
50
|
+
setTrackingConsent?(consent: TrackingConsent): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { PaymentGroupType } from '@funkit/api-base';
|
|
2
|
+
import type { SwappedTheme } from '../utils/swapped';
|
|
3
|
+
/**
|
|
4
|
+
* Typed contract for the message bridge between the SDK and the embedded
|
|
5
|
+
* Swapped flow. On web this is bridged over an `<iframe>` + `window.postMessage`
|
|
6
|
+
* (see {@link createIframeSwappedTransport}); React Native will bridge the same
|
|
7
|
+
* messages over a `WebView`. Freezing the event catalog here lets both
|
|
8
|
+
* platforms share the `SwappedProvider` state machine and turns any drift in
|
|
9
|
+
* the message shapes into a compile-time error.
|
|
10
|
+
*
|
|
11
|
+
* Reference: the inbound switch in `SwappedIframeController` and the sends in
|
|
12
|
+
* `SwappedProvider`.
|
|
13
|
+
*
|
|
14
|
+
* This module is platform-agnostic and is slated to move to
|
|
15
|
+
* `@funkit/connect-core/interfaces/` during the RN extraction.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Navigation steps reported by the Swapped embed. Open-ended — the embed may
|
|
19
|
+
* emit steps we don't enumerate, which fall through to the default handler.
|
|
20
|
+
*/
|
|
21
|
+
export type SwappedStep = 'EMPTY' | 'KYC_ADDRESS' | 'KYC_AWAITING_IDENTITY' | 'KYC_IDENTITY' | 'KYC_PERSONAL' | 'KYC_SUMSUB' | 'LOGIN_EMAIL' | 'LOGIN_EMAIL_VERIFICATION' | 'PAYMENT' | 'ORDER_CONFIRMATION' | (string & {});
|
|
22
|
+
/**
|
|
23
|
+
* Opaque payloads — the SDK never introspects these, it only forwards them to
|
|
24
|
+
* analytics via `JSON.stringify`. Typed as `unknown` so callers must stringify
|
|
25
|
+
* rather than read fields.
|
|
26
|
+
*/
|
|
27
|
+
export type SwappedErrorPayload = unknown;
|
|
28
|
+
export type SwappedTxPayload = unknown;
|
|
29
|
+
/** embed → parent */
|
|
30
|
+
export type SwappedInboundMessage = {
|
|
31
|
+
type: 'SWAPPED_READY';
|
|
32
|
+
} | {
|
|
33
|
+
type: 'SWAPPED_GO_BACK';
|
|
34
|
+
} | {
|
|
35
|
+
type: 'SWAPPED_CLOSE';
|
|
36
|
+
} | {
|
|
37
|
+
type: 'SWAPPED_NEW_DEPOSIT';
|
|
38
|
+
} | {
|
|
39
|
+
type: 'SWAPPED_ERROR';
|
|
40
|
+
data?: SwappedErrorPayload;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'SWAPPED_NAVIGATION';
|
|
43
|
+
data?: {
|
|
44
|
+
step?: SwappedStep;
|
|
45
|
+
};
|
|
46
|
+
} | {
|
|
47
|
+
type: 'SWAPPED_ORDER_DATA';
|
|
48
|
+
data?: unknown;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'SWAPPED_TRANSACTION_SUCCESSFUL';
|
|
51
|
+
data?: SwappedTxPayload;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'SWAPPED_LOGOUT';
|
|
54
|
+
};
|
|
55
|
+
/** parent → embed */
|
|
56
|
+
export type SwappedOutboundMessage = {
|
|
57
|
+
type: 'SWAPPED_METHOD';
|
|
58
|
+
method: PaymentGroupType;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'SWAPPED_THEME';
|
|
61
|
+
data: SwappedTheme;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'SWAPPED_FOCUS';
|
|
64
|
+
};
|
|
65
|
+
export interface SwappedTransport {
|
|
66
|
+
/**
|
|
67
|
+
* Send a message to the embed. Returns `true` if the message was dispatched,
|
|
68
|
+
* `false` if the embed isn't reachable yet (so callers can mirror today's
|
|
69
|
+
* behavior of logging only on a successful send).
|
|
70
|
+
*/
|
|
71
|
+
send(msg: SwappedOutboundMessage): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Subscribe to messages from the embed. The handler is only invoked for
|
|
74
|
+
* messages whose origin has already been validated by the transport. Returns
|
|
75
|
+
* an unsubscribe function.
|
|
76
|
+
*/
|
|
77
|
+
onMessage(handler: (msg: SwappedInboundMessage) => void): () => void;
|
|
78
|
+
}
|
|
@@ -7,6 +7,7 @@ export declare enum FunCheckoutStep {
|
|
|
7
7
|
CHECKOUT_COMPLETE = "checkout_complete",
|
|
8
8
|
CHECKOUT_HELP = "checkout_help",
|
|
9
9
|
TRANSFER_TOKEN = "transfer_token",
|
|
10
|
+
LIGHTNING_INVOICE = "lightning_invoice",
|
|
10
11
|
CREATE_FIAT_ACCOUNT = "create_fiat_account",
|
|
11
12
|
BRIDGE_CUSTOMER = "bridge_customer",
|
|
12
13
|
BRIDGE_KYC = "bridge_kyc",
|
|
@@ -14,5 +14,5 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
|
|
|
14
14
|
/** Live gas price in wei for native token gas buffer, null for ERC-20s */
|
|
15
15
|
gasPriceWei: bigint | null;
|
|
16
16
|
}
|
|
17
|
-
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext,
|
|
17
|
+
export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, setModalState, sourceHolding, unitPrice, defaultFiatCurrency, textCustomizations, gasPriceWei, }: InputAmountLoadedProps): React.JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MeldQuote } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
|
|
4
4
|
import { FunCheckoutStep, type NextPayload } from '../stepTransition';
|
|
5
|
-
export declare function useMeldUI({ meldEnabled, manuallySelectedQuote, fiatAmount, fiatCurrency, onNext,
|
|
5
|
+
export declare function useMeldUI({ meldEnabled, manuallySelectedQuote, fiatAmount, fiatCurrency, onNext, }: {
|
|
6
6
|
meldEnabled: boolean;
|
|
7
7
|
manuallySelectedQuote: MeldQuote | undefined;
|
|
8
8
|
fiatAmount: number | undefined;
|
|
9
9
|
fiatCurrency: string | undefined;
|
|
10
10
|
onNext: (data: NextPayload<FunCheckoutStep.INPUT_AMOUNT>) => void;
|
|
11
|
-
onClose: () => void;
|
|
12
11
|
}): {
|
|
13
12
|
getMeldFooter: () => React.JSX.Element;
|
|
14
13
|
handleMeldContinue: () => Promise<void>;
|
|
@@ -20,7 +19,7 @@ export declare function useMeld(meldEnabled: boolean, manuallySelectedQuote: Mel
|
|
|
20
19
|
meldQuotesQuery: import("@tanstack/react-query").UseQueryResult<MeldQuote[]> & {
|
|
21
20
|
isOutdated: boolean;
|
|
22
21
|
};
|
|
23
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@funkit/api-base").MeldCreateCryptoWidgetResponse, Error, MeldServiceProvider, unknown>;
|
|
22
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@funkit/api-base").MeldCreateCryptoWidgetResponse, Error, import("@funkit/api-base").MeldServiceProvider, unknown>;
|
|
24
23
|
isMeldLinkPending: boolean;
|
|
25
24
|
meldLimitError: {
|
|
26
25
|
issue: string;
|
|
@@ -29,7 +28,6 @@ export declare function useMeld(meldEnabled: boolean, manuallySelectedQuote: Mel
|
|
|
29
28
|
bestRateQuote: MeldQuote | undefined;
|
|
30
29
|
selectedQuote: MeldQuote | undefined;
|
|
31
30
|
isSelectedQuoteUnavailable: boolean | undefined;
|
|
32
|
-
isMeldMoonpaySelected: boolean;
|
|
33
31
|
isMeldContinueDisabled: boolean | undefined;
|
|
34
32
|
getMeldError: () => ErrorNotification | undefined;
|
|
35
33
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PaymentMethodBitcoinLightningInfo } from '../../../domains/paymentMethods';
|
|
3
|
+
import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
|
|
4
|
+
export declare function usdToSats(usd: number | undefined, btcPrice: number | undefined): bigint | undefined;
|
|
5
|
+
export type LightningInvoiceState = CheckoutModalCommonState & {
|
|
6
|
+
paymentMethodInfo: PaymentMethodBitcoinLightningInfo;
|
|
7
|
+
};
|
|
8
|
+
export type LightningInvoiceNext = Record<string, never>;
|
|
9
|
+
export declare const LightningInvoiceInfo: ModalStepInfo<FunCheckoutStep.LIGHTNING_INVOICE>;
|
|
10
|
+
export declare function LightningInvoice(_props: ModalStepComponentProps<FunCheckoutStep.LIGHTNING_INVOICE>): React.JSX.Element;
|
|
@@ -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 PaymentMethodCardInfo, type PaymentMethodVirtualBankIncompleteInfo } from '../../../domains/paymentMethods';
|
|
3
|
+
import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodBitcoinLightningInfo, type PaymentMethodCardInfo, 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,7 +14,12 @@ export type SourceChangeNext = {
|
|
|
14
14
|
brokerageFailed: false;
|
|
15
15
|
} | {
|
|
16
16
|
connectNew: true;
|
|
17
|
-
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK>;
|
|
17
|
+
paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK | PaymentMethod.BITCOIN_LIGHTNING>;
|
|
18
|
+
brokerageFailed: false;
|
|
19
|
+
} | {
|
|
20
|
+
connectNew: true;
|
|
21
|
+
paymentMethod: PaymentMethod.BITCOIN_LIGHTNING;
|
|
22
|
+
paymentMethodInfo: PaymentMethodBitcoinLightningInfo;
|
|
18
23
|
brokerageFailed: false;
|
|
19
24
|
} | {
|
|
20
25
|
connectNew: true;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import type { DirectExecution } from '@funkit/api-base';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { type MergedMultiStepDirectExecution } from '../../../hooks/queries/useRecentDeposits';
|
|
4
2
|
import type { CheckoutNotificationsProps } from './types';
|
|
5
3
|
export declare const CheckoutNotifications: ({ onHelp, isVisible, variant, }: CheckoutNotificationsProps) => React.JSX.Element | null;
|
|
6
|
-
/**
|
|
7
|
-
* @returns checkouts that are either not present in the initial checkouts or the data changed somehow
|
|
8
|
-
*/
|
|
9
|
-
export declare const getUpdatedDirectExecutions: (directExecutions: MergedMultiStepDirectExecution[], initialDirectExecutions?: DirectExecution[]) => MergedMultiStepDirectExecution[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { Address } from 'viem';
|
|
4
|
-
import type { MergedMultiStepDirectExecution } from '../../../
|
|
4
|
+
import type { MergedMultiStepDirectExecution } from '../../../domains/checkoutNotifications';
|
|
5
5
|
interface DirectExecutionNotificationProps {
|
|
6
6
|
directExecution: MergedMultiStepDirectExecution;
|
|
7
7
|
onClose: (id: string) => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CheckoutHistoryItem } from '@funkit/api-base';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { MergedMultiStepDirectExecution } from '../../../
|
|
3
|
+
import type { MergedMultiStepDirectExecution, NotificationVariant } from '../../../domains/checkoutNotifications';
|
|
4
|
+
export type { NotificationVariant };
|
|
4
5
|
export type NotificationItem = (MergedMultiStepDirectExecution & {
|
|
5
6
|
isDirectExecution: true;
|
|
6
7
|
}) | (CheckoutHistoryItem & {
|
|
7
8
|
isDirectExecution: false;
|
|
8
9
|
});
|
|
9
|
-
export type NotificationVariant = 'deposit' | 'withdrawal' | 'token_transfer';
|
|
10
10
|
export interface CheckoutNotificationsProps {
|
|
11
11
|
onHelp: (depositAddress: Address) => void;
|
|
12
12
|
/** To control notifications visibility on specific pages, without changing internal dismissal state */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FunCheckoutStep } from './FunCheckoutStep';
|
|
2
|
+
/**
|
|
3
|
+
* Decide whether the checkout-complete success background should paint.
|
|
4
|
+
*
|
|
5
|
+
* The post-checkout `CHECKOUT_COMPLETE` step is the *page*, which also covers
|
|
6
|
+
* pending and failed states — so step alone is not enough. We additionally
|
|
7
|
+
* require:
|
|
8
|
+
* - the Statsig feature gate to be ON (kill-switch / per-customer rollout),
|
|
9
|
+
* - and the underlying checkout/direct-execution to have actually settled.
|
|
10
|
+
*
|
|
11
|
+
* Pure function (no hooks) so the gating contract is easy to unit-test.
|
|
12
|
+
* The caller is responsible for deriving `isCompleted` from whichever hook
|
|
13
|
+
* is appropriate for the path (deposit-address checkout vs direct execution).
|
|
14
|
+
*/
|
|
15
|
+
export declare function selectSuccessScreenBackground({ step, isCompleted, isFeatureGateEnabled, themeBackgroundOverlay, }: {
|
|
16
|
+
step: FunCheckoutStep;
|
|
17
|
+
/** Whether the underlying checkout/direct-execution has reached COMPLETED. */
|
|
18
|
+
isCompleted: boolean;
|
|
19
|
+
/** Statsig gate (`enable-checkout-success-screen-background`). */
|
|
20
|
+
isFeatureGateEnabled: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The theme variable reference for the success-screen overlay
|
|
23
|
+
* (`themeVars.colors.modalBackgroundCheckoutComplete`). Resolves at runtime
|
|
24
|
+
* to whatever the active theme defines — Aave's translucent gradient
|
|
25
|
+
* stack, or by default the regular modal background (which renders as a
|
|
26
|
+
* no-op overlay).
|
|
27
|
+
*/
|
|
28
|
+
themeBackgroundOverlay: string;
|
|
29
|
+
}): string | undefined;
|
|
@@ -14,6 +14,7 @@ import { type CheckoutHelpState } from './CheckoutHelp/CheckoutHelp';
|
|
|
14
14
|
import { type ConfirmationStepNext, type ConfirmationStepState } from './ConfirmationStep/ConfirmationStep';
|
|
15
15
|
import { FunCheckoutStep } from './FunCheckoutStep';
|
|
16
16
|
import { type InputAmountNext, type InputAmountState } from './InputAmount/InputAmount';
|
|
17
|
+
import { type LightningInvoiceNext, type LightningInvoiceState } from './LightningInvoice/LightningInvoice';
|
|
17
18
|
import { type LoadingAccountNext, type LoadingAccountState } from './LoadingAccount';
|
|
18
19
|
import { type MeldCurrencySelectNext, type MeldCurrencySelectState } from './MeldCurrencySelect/MeldCurrencySelect';
|
|
19
20
|
import { type MeldQuotesNext, type MeldQuotesState } from './MeldQuotes/MeldQuotes';
|
|
@@ -82,6 +83,7 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
82
83
|
[FunCheckoutStep.SELECT_ASSET]: SelectAssetState;
|
|
83
84
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeState;
|
|
84
85
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenState;
|
|
86
|
+
[FunCheckoutStep.LIGHTNING_INVOICE]: LightningInvoiceState;
|
|
85
87
|
[FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountState;
|
|
86
88
|
[FunCheckoutStep.BRIDGE_KYC]: BridgeKycState;
|
|
87
89
|
[FunCheckoutStep.KYC_IFRAME]: KycIframeState;
|
|
@@ -110,6 +112,7 @@ export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
|
|
|
110
112
|
[FunCheckoutStep.SELECT_ASSET]: SelectAssetNext;
|
|
111
113
|
[FunCheckoutStep.SOURCE_CHANGE]: SourceChangeNext;
|
|
112
114
|
[FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenNext;
|
|
115
|
+
[FunCheckoutStep.LIGHTNING_INVOICE]: LightningInvoiceNext;
|
|
113
116
|
[FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountNext;
|
|
114
117
|
[FunCheckoutStep.BRIDGE_KYC]: BridgeKycNext;
|
|
115
118
|
[FunCheckoutStep.KYC_IFRAME]: KycIframeNext;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const baseStyles: string;
|
|
2
|
-
export declare const homeCheckoutDisplayRowStyle: Record<"
|
|
2
|
+
export declare const homeCheckoutDisplayRowStyle: Record<"hoverBackground" | "defaultBorder" | "defaultBackground", string>;
|
|
@@ -27,6 +27,26 @@ export interface DynamicTargetAssetCandidate extends TokenInfo {
|
|
|
27
27
|
finalizedTokenRate?: number;
|
|
28
28
|
dynamicRoutingId?: string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A token to offer adding to the user's wallet (EIP-747 `wallet_watchAsset`) on
|
|
32
|
+
* the post-checkout success screen.
|
|
33
|
+
*
|
|
34
|
+
* Set this when the token the user ends up holding differs from the checkout's
|
|
35
|
+
* destination token — e.g. a vault receipt token (Aave's aUSDT) minted by a
|
|
36
|
+
* post-swap supply action, where the checkout's `toTokenAddress` is the
|
|
37
|
+
* intermediate underlying (USDT), not the token the wallet should track.
|
|
38
|
+
*
|
|
39
|
+
* Purely a post-checkout UX affordance: nothing in quoting, routing, or amount
|
|
40
|
+
* display reads this field, so setting it cannot perturb a checkout's quote.
|
|
41
|
+
*/
|
|
42
|
+
export interface AddToWalletToken extends TokenInfo {
|
|
43
|
+
/** Symbol shown in the wallet prompt (e.g. "aUSDT"). */
|
|
44
|
+
tokenSymbol: string;
|
|
45
|
+
/** Token decimals. If omitted, the button reads `decimals()` on-chain. */
|
|
46
|
+
decimals?: number;
|
|
47
|
+
/** Optional token icon, passed to the wallet as `image`. */
|
|
48
|
+
iconSrc?: string;
|
|
49
|
+
}
|
|
30
50
|
export declare enum FunCheckoutStartingStep {
|
|
31
51
|
SOURCE_CHANGE = "source_change",
|
|
32
52
|
CONFIRMATION = "confirmation",
|
|
@@ -47,6 +67,20 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
|
|
|
47
67
|
modalTitle?: string | ((asset: TokenInfo) => string);
|
|
48
68
|
/** Additional information to show in the title of the checkout modal. Blank by default **/
|
|
49
69
|
modalTitleMeta?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Integrator-provided, display-only yield metadata for the destination
|
|
72
|
+
* (e.g. an Aave/Felix/Benqi supply). The SDK never computes these — the
|
|
73
|
+
* integrator resolves them from their own data source and passes a snapshot
|
|
74
|
+
* at checkout-init time. When present, the confirmation screen renders it as
|
|
75
|
+
* Supply APY / Collateralization rows (`DestinationYieldRows`). Omitted
|
|
76
|
+
* segments are simply not rendered.
|
|
77
|
+
*/
|
|
78
|
+
destinationYieldInfo?: {
|
|
79
|
+
/** Supply APY as a display string without the % sign (e.g. "2.79"). */
|
|
80
|
+
supplyApy?: string;
|
|
81
|
+
/** Whether the supply is/will be enabled as collateral for the user. */
|
|
82
|
+
collateralizationEnabled?: boolean;
|
|
83
|
+
};
|
|
50
84
|
/** Icon to show in the checkout modal (50px x 50px). If not specified, no icon will be shown. **/
|
|
51
85
|
iconSrc?: null | string;
|
|
52
86
|
/** Title of the item being checked out. e.g. Staked Ether, XYZ Option, Solar Bond ABC **/
|
|
@@ -86,6 +120,13 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
|
|
|
86
120
|
* Set via dynamic routing rules.
|
|
87
121
|
*/
|
|
88
122
|
bridgeOverride?: 'across' | 'relay';
|
|
123
|
+
/**
|
|
124
|
+
* Token to offer adding to the user's wallet on the post-checkout success
|
|
125
|
+
* screen via EIP-747 `wallet_watchAsset`. Set when the held token differs
|
|
126
|
+
* from the checkout's destination token (e.g. an Aave aUSDT receipt). See
|
|
127
|
+
* {@link AddToWalletToken}.
|
|
128
|
+
*/
|
|
129
|
+
addToWalletToken?: AddToWalletToken;
|
|
89
130
|
}
|
|
90
131
|
export interface WithdrawalConfigBase {
|
|
91
132
|
/** Title to show in the checkout modal. Defaults to "Checkout" **/
|
|
@@ -127,8 +127,15 @@ export interface FunkitUiCustomizationsConfig {
|
|
|
127
127
|
/** Whether to show "Instant" instead of "< 1 min" for time estimates under 1 minute - defaults to false */
|
|
128
128
|
showInstantTimeEstimate?: boolean;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
130
|
+
* Whether to show the "Selected Route" row (Relay / Across / passthrough).
|
|
131
|
+
* Defaults to false. Providing {@link selectedRouteConfig} also shows the
|
|
132
|
+
* row, for passthrough-branding back-compat.
|
|
133
|
+
*/
|
|
134
|
+
showSelectedRoute?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Passthrough-route branding (image + label) for the "Selected Route" row.
|
|
137
|
+
* Defining it also shows the row; to show the row without passthrough
|
|
138
|
+
* branding, use {@link showSelectedRoute} instead.
|
|
132
139
|
*/
|
|
133
140
|
selectedRouteConfig?: FunkitUiSelectedRouteConfig;
|
|
134
141
|
/**
|
|
@@ -38,7 +38,7 @@ export declare function useCheckoutListenerByCheckoutId(checkoutId: Hex | undefi
|
|
|
38
38
|
/**
|
|
39
39
|
* Internal hook to handle post-checkout, PER-BACKEND-CHECKOUT ITEM.
|
|
40
40
|
*/
|
|
41
|
-
export declare const useFunkitPostCheckoutInternal: (checkoutId: string) => {
|
|
41
|
+
export declare const useFunkitPostCheckoutInternal: (checkoutId: string | undefined) => {
|
|
42
42
|
isLoading: boolean;
|
|
43
43
|
checkoutHistoryInfo: CheckoutHistoryItem | undefined;
|
|
44
44
|
directExecutionInfo: DirectExecution | undefined;
|
|
@@ -45,7 +45,7 @@ interface FunkitQuoteContextInterface extends CheckoutQuoteState {
|
|
|
45
45
|
usePermit: boolean | undefined;
|
|
46
46
|
preferredApprovalMethod: ApprovalMethod;
|
|
47
47
|
setPreferredApprovalMethod: (next: ApprovalMethod) => void;
|
|
48
|
-
|
|
48
|
+
showApprovalMethodToggle: boolean;
|
|
49
49
|
}
|
|
50
50
|
export declare function FunkitQuoteProvider({ children }: {
|
|
51
51
|
children: ReactNode;
|
|
@@ -38,6 +38,7 @@ export declare const useActiveTheme: () => {
|
|
|
38
38
|
chainIconBorder: string;
|
|
39
39
|
modalBackdrop: string;
|
|
40
40
|
modalBackground: string;
|
|
41
|
+
modalBackgroundCheckoutComplete: string;
|
|
41
42
|
modalBorder: string;
|
|
42
43
|
offBackground: string;
|
|
43
44
|
offBackgroundInverse: string;
|
|
@@ -563,6 +564,7 @@ export declare const useActiveTheme: () => {
|
|
|
563
564
|
chainIconBorder: string;
|
|
564
565
|
modalBackdrop: string;
|
|
565
566
|
modalBackground: string;
|
|
567
|
+
modalBackgroundCheckoutComplete: string;
|
|
566
568
|
modalBorder: string;
|
|
567
569
|
offBackground: string;
|
|
568
570
|
offBackgroundInverse: string;
|
|
@@ -1086,6 +1088,7 @@ export declare const useActiveTheme: () => {
|
|
|
1086
1088
|
chainIconBorder: string;
|
|
1087
1089
|
modalBackdrop: string;
|
|
1088
1090
|
modalBackground: string;
|
|
1091
|
+
modalBackgroundCheckoutComplete: string;
|
|
1089
1092
|
modalBorder: string;
|
|
1090
1093
|
offBackground: string;
|
|
1091
1094
|
offBackgroundInverse: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AssetBalanceInfo } from '@funkit/api-base';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
3
|
import type { Address } from 'viem';
|
|
4
|
+
import type { IdentityProvider } from '../interfaces/identity';
|
|
4
5
|
import { type UseDisconnectReturnType, type UseReconnectReturnType } from '../wagmi/hooks';
|
|
5
6
|
import { type FunkitUserInfo } from '../consts/funkit';
|
|
6
7
|
import { LoginType } from '../utils/userInfo';
|
|
@@ -22,6 +23,23 @@ export declare function GeneralWalletProvider({ children }: {
|
|
|
22
23
|
children: ReactNode;
|
|
23
24
|
}): React.JSX.Element;
|
|
24
25
|
export declare const useGeneralWallet: () => GeneralWalletContextProps;
|
|
26
|
+
/**
|
|
27
|
+
* Web implementation of the {@link IdentityProvider} contract: exposes the
|
|
28
|
+
* connected-wallet **user** identity (`GeneralWalletProvider`) as the
|
|
29
|
+
* platform-agnostic {@link FunkitIdentity} consumed by core hooks. React Native
|
|
30
|
+
* supplies its own implementation from host props.
|
|
31
|
+
*
|
|
32
|
+
* Customer identity (`apiKey`) is deliberately *not* included — it lives on
|
|
33
|
+
* `useFunkitConfig` so user identity and customer identity stay separable.
|
|
34
|
+
*
|
|
35
|
+
* `userId` is `userInfo.id` (not `userInfo.address`). `walletAddress` is the
|
|
36
|
+
* resolved `effectiveAddress` from context, normalized to the contract's `''`
|
|
37
|
+
* sentinel when absent — `GeneralWalletProvider` types the field `Address | ''`
|
|
38
|
+
* but leaks `undefined` for guests via a `@ts-expect-error`, so we coalesce
|
|
39
|
+
* here to keep web aligned with the contract (and with the eventual React
|
|
40
|
+
* Native implementation).
|
|
41
|
+
*/
|
|
42
|
+
export declare const useIdentity: IdentityProvider['useIdentity'];
|
|
25
43
|
/**
|
|
26
44
|
* Replacement for wagmi's `useAccount`
|
|
27
45
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type FormOfPaymentType } from '@funkit/api-base';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import type { SwappedTransport } from '../interfaces/swapped-transport';
|
|
3
4
|
import { type SwappedTheme } from '../utils/swapped';
|
|
4
5
|
interface SwappedContextValue {
|
|
5
6
|
iframeUrl: string | null;
|
|
@@ -12,6 +13,7 @@ interface SwappedContextValue {
|
|
|
12
13
|
setIframeRef: (el: HTMLIFrameElement | null) => void;
|
|
13
14
|
focusAmountInput: () => void;
|
|
14
15
|
swappedTheme: SwappedTheme;
|
|
16
|
+
swappedTransport: SwappedTransport;
|
|
15
17
|
}
|
|
16
18
|
export declare function SwappedProvider({ children }: {
|
|
17
19
|
children: React.ReactNode;
|
package/dist/themes/darkTheme.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SwappedTransport } from '../interfaces/swapped-transport';
|
|
2
|
+
interface IframeSwappedTransportOptions {
|
|
3
|
+
/** The embed's content window, or `null` if it isn't mounted/loaded yet. */
|
|
4
|
+
getContentWindow: () => Window | null;
|
|
5
|
+
/** The validated target origin for `postMessage`, or `null` if unavailable. */
|
|
6
|
+
getTargetOrigin: () => string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Web {@link SwappedTransport}: bridges the typed Swapped message contract over
|
|
10
|
+
* an `<iframe>` + `window.postMessage`. React Native ships a `WebView`-backed
|
|
11
|
+
* equivalent against the same interface. The DOM-bound pieces (`window`,
|
|
12
|
+
* `postMessage`, the `message` event) live here so the contract and the
|
|
13
|
+
* provider state machine stay platform-agnostic.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createIframeSwappedTransport({ getContentWindow, getTargetOrigin, }: IframeSwappedTransportOptions): SwappedTransport;
|
|
16
|
+
export {};
|
package/dist/utils/address.d.ts
CHANGED
|
@@ -7,3 +7,8 @@ export declare function isWithdrawalAddressSupported(address: string): boolean;
|
|
|
7
7
|
* Supports EVM, Solana, and Tron chains for withdrawal.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isAddressCompatibleWithChain(address: string, chainId: number): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* True for any positive-integer (string-encoded) chain id that isn't a known
|
|
12
|
+
* non-EVM chain. Used to gate EVM-only flows (EIP-747, etc.).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isEvmChainId(chainId: string): boolean;
|
package/dist/utils/assets.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { DynamicTargetAssetCandidate, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
|
|
2
2
|
export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '../domains/wallet';
|
|
3
3
|
export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {FunkitCheckoutConfig} checkoutConfig
|
|
7
|
-
* @param mockedChains optional array of additional chains we want to replace with FALLBACK_CHAIN_ID
|
|
8
|
-
* @returns targetChain either from the provided config or Base chainId for non-evm chains processed with evm tech
|
|
9
|
-
*/
|
|
10
|
-
export declare const getMockedTargetChainId: ({ targetChain }: FunkitCheckoutConfig, mockedChains?: string[]) => string;
|
|
11
4
|
export declare const getDefaultDynamicTargetAsset: (checkoutConfig: FunkitCheckoutConfig | undefined) => DynamicTargetAssetCandidate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LogRecord, LogTransport, TrackingConsent } from '../interfaces/logTransport';
|
|
2
|
+
/**
|
|
3
|
+
* Web `LogTransport` backed by `@datadog/browser-logs`. Owns Datadog
|
|
4
|
+
* initialization, global-context/consent wiring, and the browser-only emit.
|
|
5
|
+
*
|
|
6
|
+
* This is the platform half of the logger that stays in `@funkit/connect` when
|
|
7
|
+
* `FunLogger` moves to `@funkit/connect-core`; React Native ships a Datadog
|
|
8
|
+
* React Native transport (`@datadog/mobile-react-native`) instead. Constructing
|
|
9
|
+
* it runs `datadogLogs.init` once (the global singleton does this on import,
|
|
10
|
+
* matching prior behavior).
|
|
11
|
+
*/
|
|
12
|
+
export declare class DatadogBrowserLogsTransport implements LogTransport {
|
|
13
|
+
constructor();
|
|
14
|
+
setEnv(environment: string): void;
|
|
15
|
+
setTrackingConsent(consent: TrackingConsent): void;
|
|
16
|
+
log({ level, title, context, error }: LogRecord): void;
|
|
17
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DirectExecution } from '@funkit/api-base';
|
|
2
2
|
import type { WalletClient } from 'viem';
|
|
3
|
-
import type { MergedMultiStepDirectExecution } from '../hooks/queries/useRecentDeposits';
|
|
4
3
|
export declare function getDirectExecutionCreatedTimeMs(directExecution: DirectExecution): number;
|
|
5
4
|
export declare function getDirectExecutionUpdatedTimeMs(directExecution: DirectExecution): number;
|
|
6
5
|
/**
|
|
@@ -10,7 +9,7 @@ export declare function getDirectExecutionUpdatedTimeMs(directExecution: DirectE
|
|
|
10
9
|
* changes but triggeringTxHash stays the same. Preferring triggeringTxHash keeps
|
|
11
10
|
* the identity stable across that swap, avoiding a flash/remount of the notification.
|
|
12
11
|
*/
|
|
13
|
-
export declare function getDirectExecutionNotificationKey(item:
|
|
12
|
+
export declare function getDirectExecutionNotificationKey(item: DirectExecution): string;
|
|
14
13
|
export declare function getDirectExecutionRunTimeSeconds(directExecution: DirectExecution): number;
|
|
15
14
|
/**
|
|
16
15
|
* Resolves the completion transaction chain, hash, and explorer URL for a direct execution.
|