@funkit/connect 9.12.0 → 9.14.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 +39 -0
- package/README.md +21 -0
- package/dist/__generated__/default_configs.d.ts +3 -0
- package/dist/clients/lighter.js +4 -0
- package/dist/clients/polymarket.js +6 -0
- package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +16 -0
- package/dist/components/Icons/CashAppIcon.d.ts +4 -0
- package/dist/consts/customers.d.ts +8 -0
- package/dist/domains/paymentMethods.d.ts +9 -1
- package/dist/hooks/queries/useRecentDeposits.d.ts +39 -49
- package/dist/hooks/usePaymentSources.d.ts +1 -0
- package/dist/index.css +11 -11
- package/dist/index.js +3081 -2627
- package/dist/modals/CheckoutModal/SourceChange/FlatList.d.ts +31 -0
- package/dist/modals/CheckoutModal/SourceChange/GroupedList.d.ts +25 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +8 -0
- package/dist/modals/CheckoutModal/SourceChange/SourceList.d.ts +23 -9
- package/dist/modals/CheckoutModal/SourceChange/buildSourceGroups.d.ts +70 -0
- package/dist/modals/CheckoutModal/TransferToken/types.d.ts +1 -2
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.d.ts +1 -1
- package/dist/modals/WithdrawalModal/ErrorMessage.d.ts +4 -0
- package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +11 -0
- package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +10 -4
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +32 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -0
- package/dist/providers/FunkitConfigContext.d.ts +4 -0
- package/dist/providers/GeneralWalletProvider.d.ts +2 -4
- package/dist/utils/userInfo.d.ts +36 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +44 -44
- 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 +9 -5
- package/dist/wallets/walletConnectors/{chunk-5TN5Z2WY.js → chunk-3ZJN3PXP.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-V6UOWTEZ.js → chunk-55VS2NKG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-DEFRRPXB.js → chunk-7IEUTLHY.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-LCIPVVH5.js → chunk-AZYMJ4C6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-T4ROGPMF.js → chunk-FWM4KTOV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YIEASHLS.js → chunk-IMNI4AGV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-7V33VJAL.js → chunk-IRHK6SOW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UDTBQV4Q.js → chunk-J3PJOMO7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VJZWNQOF.js → chunk-LEAZMT5Y.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-6DRCY52E.js → chunk-OD6B2ISG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-FG2LDVXL.js → chunk-OSOB6QYX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XVBSJCW5.js → chunk-RZQ4B4Z7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KWX2SYU2.js → chunk-UFYNHHDU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HXWUH73P.js → chunk-UYW6MV74.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-34HACM5U.js → chunk-VMMROPXK.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZPSPK6LH.js → chunk-YGMU5VWD.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-APHCF4DT.js → chunk-ZJJWGKB6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HRDPUW3V.js → chunk-ZL6XCMV5.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 9.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c32bc92: feat(connect): Aave source-select renders Native + Use other assets sections; Native row fast-paths to InputAmount when wallet holds the target asset.
|
|
8
|
+
- ccd1855: Register Bitcoin on Cash App as a payment source on the crypto tab of the checkout modal.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- bc5ce6f: test(connect): add checkout transfer init coverage
|
|
13
|
+
- b69e713: Fix CopyAddress button border-radius to account for parent 1px border.
|
|
14
|
+
- c097446: Fix withdrawal modal conflating source-token amount with USD value. No-op for
|
|
15
|
+
1:1 stablecoin sources; corrects target-amount, receive-fiat, and min-amount
|
|
16
|
+
math for non-stable sources.
|
|
17
|
+
- beb12ee: test(connect): add unit test coverage
|
|
18
|
+
- Updated dependencies [d67a842]
|
|
19
|
+
- Updated dependencies [e9e960a]
|
|
20
|
+
- @funkit/api-base@4.2.3
|
|
21
|
+
- @funkit/chains@1.2.0
|
|
22
|
+
|
|
23
|
+
## 9.13.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- ac8b104: Add `showWalletConnect` option to `uiCustomizations.sourceChangeScreen` to allow hiding the wallet connect payment method
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 01826fb: chore(connect): bump postcss
|
|
32
|
+
- ab86ca3: refactor(connect): split `SourceList` into a thin composer + `FlatList`/`GroupedList` layout primitives. Internal-only; no public API change; rendered DOM unchanged.
|
|
33
|
+
- 6039a1b: When `externalUserId` is set for Lighter customers, use it directly as `userId` and `walletAddress` instead of wrapping via `generateSyntheticUserId`
|
|
34
|
+
- 3719658: Split useRecentDeposits into a raw API hook and a pure testable transform function
|
|
35
|
+
- ce7e633: Internal: add `testId` prop to `SourceList` for testability.
|
|
36
|
+
- 7743d5b: Extract withdrawal error notification helpers into ErrorMessage module
|
|
37
|
+
- 7743d5b: Extract WithdrawRecipientAddress into its own module and allow multi-method config to disable connected wallet
|
|
38
|
+
- 7743d5b: Use config source chain for withdrawal source token price lookup
|
|
39
|
+
- Updated dependencies [ec97ba2]
|
|
40
|
+
- @funkit/fun-relay@2.7.2
|
|
41
|
+
|
|
3
42
|
## 9.12.0
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -10,3 +10,24 @@ The `@funkit/connect` package elevates decentralize applications via web2 & web3
|
|
|
10
10
|
### 📝 Note
|
|
11
11
|
|
|
12
12
|
This package is currently in closed beta. To learn more, reach out to [developers@fun.xyz](mailto:developers@fun.xyz).
|
|
13
|
+
|
|
14
|
+
## Development
|
|
15
|
+
|
|
16
|
+
### Running tests
|
|
17
|
+
|
|
18
|
+
From the monorepo root:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Run all connect tests once
|
|
22
|
+
pnpm --filter=@funkit/connect test
|
|
23
|
+
|
|
24
|
+
# Run with coverage (terminal summary + lcov + HTML report)
|
|
25
|
+
pnpm --filter=@funkit/connect test:coverage
|
|
26
|
+
|
|
27
|
+
# Open the Vitest UI (interactive dashboard with live coverage heatmap)
|
|
28
|
+
pnpm --filter=@funkit/connect test:ui
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
After `test:coverage`, open `packages/connect/coverage/index.html` to browse the HTML report. The `coverage/` directory is gitignored.
|
|
32
|
+
|
|
33
|
+
Coverage is collected by [`@vitest/coverage-v8`](https://vitest.dev/guide/coverage) and excludes generated files, Storybook stories, vanilla-extract style files (`*.css.ts`), and translation JSON. Update the `coverage` block in `vitest.config.ts` to tweak include/exclude patterns.
|
package/dist/clients/lighter.js
CHANGED
|
@@ -48,6 +48,7 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
48
48
|
|
|
49
49
|
// src/consts/customers.ts
|
|
50
50
|
import {
|
|
51
|
+
AAVE_API_KEY,
|
|
51
52
|
AVANTIS_API_KEY,
|
|
52
53
|
BASED_API_KEY,
|
|
53
54
|
BSX_API_KEY,
|
|
@@ -82,6 +83,7 @@ var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
|
82
83
|
sourceMethodTitle: "Your source",
|
|
83
84
|
tokensListTitle: "Your tokens",
|
|
84
85
|
transferTokens: "Transfer Crypto",
|
|
86
|
+
bitcoinLightning: "Bitcoin on Cash App",
|
|
85
87
|
receiveDropdownTitle: "",
|
|
86
88
|
// Default to empty
|
|
87
89
|
receiveDropdownLabel: "Asset to Receive",
|
|
@@ -120,6 +122,7 @@ var DEFAULT_UI_CUSTOMIZATIONS = {
|
|
|
120
122
|
},
|
|
121
123
|
showTargetAssetSelection: false,
|
|
122
124
|
showWalletOnInsufficientBalance: false,
|
|
125
|
+
showWalletConnect: true,
|
|
123
126
|
paymentMethodIcons: {}
|
|
124
127
|
},
|
|
125
128
|
inputAmountScreen: {
|
|
@@ -164,6 +167,7 @@ function useFunkitConfig() {
|
|
|
164
167
|
sourceMethodTitle: t("textCustomizations.sourceMethodTitle"),
|
|
165
168
|
tokensListTitle: t("textCustomizations.tokensListTitle"),
|
|
166
169
|
transferTokens: t("textCustomizations.transferTokens"),
|
|
170
|
+
bitcoinLightning: t("textCustomizations.bitcoinLightning"),
|
|
167
171
|
receiveDropdownTitle: t("textCustomizations.receiveDropdownTitle"),
|
|
168
172
|
receiveDropdownLabel: t("textCustomizations.receiveDropdownLabel"),
|
|
169
173
|
confirmationScreen: {
|
|
@@ -286,6 +286,12 @@ function createPaymentMethodInfo(params) {
|
|
|
286
286
|
title: "QR Code Transfer",
|
|
287
287
|
description: ""
|
|
288
288
|
};
|
|
289
|
+
case "bitcoin_lightning" /* BITCOIN_LIGHTNING */:
|
|
290
|
+
return {
|
|
291
|
+
paymentMethod: "bitcoin_lightning" /* BITCOIN_LIGHTNING */,
|
|
292
|
+
title: "Bitcoin on Cash App",
|
|
293
|
+
description: ""
|
|
294
|
+
};
|
|
289
295
|
case "virtual_bank" /* VIRTUAL_BANK */:
|
|
290
296
|
return {
|
|
291
297
|
paymentMethod: "virtual_bank" /* VIRTUAL_BANK */,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const funOptionBoxStyle: Record<"
|
|
1
|
+
export declare const funOptionBoxStyle: Record<"baseStyle" | "compactListStyle" | "defaultBorder" | "defaultModeNotActiveBorder" | "activeBorder" | "disabledOptionBorder" | "defaultBackground" | "activeBackground" | "uninteractiveBackground", string>;
|
|
@@ -2,6 +2,7 @@ import { type SwappedFormOfPayment } from '@funkit/api-base';
|
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
3
|
import { type FunkitPaymentMethodIconsConfig } from '../../providers/FunkitConfigContext';
|
|
4
4
|
import { PaymentMethod, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
|
|
5
|
+
import type { AssetHoldingsItem } from '../../domains/wallet';
|
|
5
6
|
/**
|
|
6
7
|
* Get a custom icon passed in from UI customization config
|
|
7
8
|
* These icons are passed in from client to support enhanced branding+design
|
|
@@ -38,6 +39,7 @@ interface ConnectedPaymentMethodItemProps {
|
|
|
38
39
|
disabled?: boolean;
|
|
39
40
|
}
|
|
40
41
|
export declare const AccountBalancePaymentMethodItem: ({ isSelected, showSelectedCheckmark, onSelect, targetChainId, testId, disabled, }: ConnectedPaymentMethodItemProps) => React.JSX.Element;
|
|
42
|
+
export declare const BitcoinLightningPaymentMethodItem: ({ isActive, onClick, isClickable, customValueIcon, paymentIcon, }: PaymentMethodItemProps) => React.JSX.Element;
|
|
41
43
|
export declare const ActiveFiatAccountPaymentMethodItem: ({ isActive, onClick, paymentMethodInfo, customValueIcon, testId, disabled, }: BasePaymentMethodItemProps & {
|
|
42
44
|
paymentMethodInfo: PaymentMethodVirtualBankInfo;
|
|
43
45
|
testId?: string;
|
|
@@ -50,10 +52,24 @@ type BasePaymentMethodItemProps = {
|
|
|
50
52
|
customValueIcon?: ReactNode;
|
|
51
53
|
testId?: string;
|
|
52
54
|
};
|
|
55
|
+
type PaymentMethodItemProps = BasePaymentMethodItemProps & {
|
|
56
|
+
paymentIcon: ReactNode;
|
|
57
|
+
};
|
|
53
58
|
export declare function AddPaymentMethodItem({ paymentMethod, isClickable, isActive, onClick, customValueIcon, testId, }: BasePaymentMethodItemProps & {
|
|
54
59
|
paymentMethod: PaymentMethod;
|
|
55
60
|
dynamicLimit?: string;
|
|
56
61
|
}): React.JSX.Element | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Source-list row for the underlying asset a customer is supplying
|
|
64
|
+
* (e.g. USDT for an Aave aUSDT checkout) when the user already holds
|
|
65
|
+
* it. Click pre-selects the asset as the source and skips
|
|
66
|
+
* asset-select via SourceChange's `skipAssetSelect` routing.
|
|
67
|
+
*/
|
|
68
|
+
export declare function NativeAssetItem({ asset, label, onClick, }: {
|
|
69
|
+
asset: AssetHoldingsItem;
|
|
70
|
+
label: string;
|
|
71
|
+
onClick: () => void;
|
|
72
|
+
}): React.JSX.Element;
|
|
57
73
|
export declare function PayPalPaymentMethodItem({ isActive, isClickable, onClick, isLoading, }: BasePaymentMethodItemProps & {
|
|
58
74
|
isLoading: boolean;
|
|
59
75
|
}): React.JSX.Element;
|
|
@@ -12,5 +12,13 @@ export declare function isAvantisCustomer(apiKey: string): apiKey is "6TUi99Tq3O
|
|
|
12
12
|
export declare function isPerplCustomer(apiKey: string): apiKey is "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu";
|
|
13
13
|
export declare function isLighterxyzCustomer(apiKey: string): apiKey is "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2";
|
|
14
14
|
export declare function isFanaticsCustomer(apiKey: string): apiKey is "lI7amueGK94QtGa7sGGVf8n0XhIcn4sHFAZRu5Jj";
|
|
15
|
+
export declare function isAaveCustomer(apiKey: string): apiKey is "EWzSv8tWnQ7UcZ2IsDqFw1dYo3Df56FX6KBJ5ztS";
|
|
16
|
+
/**
|
|
17
|
+
* Gates the source-select "Native" fast-path: when the connected wallet
|
|
18
|
+
* already holds `checkoutConfig.targetAsset`, surface a one-click row
|
|
19
|
+
* that skips asset-select and lands on InputAmount. Currently Aave-only;
|
|
20
|
+
* extend by OR-ing additional `is<Customer>Customer` predicates.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isCustomerNativeFastPathEnabled(apiKey: string): apiKey is "EWzSv8tWnQ7UcZ2IsDqFw1dYo3Df56FX6KBJ5ztS";
|
|
15
23
|
export declare function isLighterEthSpot(apiKey: string, checkoutConfig: FunkitCheckoutConfig | undefined): boolean | undefined;
|
|
16
24
|
export declare function isLighterSlowDeposit(apiKey: string, checkoutConfig: Pick<FunkitCheckoutConfig, 'targetChain'> | undefined): boolean;
|
|
@@ -9,6 +9,7 @@ export declare enum PaymentMethod {
|
|
|
9
9
|
/** Bluvo - Exchange / Brokerage **/
|
|
10
10
|
BROKERAGE = "brokerage",
|
|
11
11
|
TOKEN_TRANSFER = "token_transfer",
|
|
12
|
+
BITCOIN_LIGHTNING = "bitcoin_lightning",
|
|
12
13
|
VIRTUAL_BANK = "virtual_bank",
|
|
13
14
|
SWAPPED_CARD = "swapped_card",
|
|
14
15
|
SEPA = "sepa",
|
|
@@ -38,6 +39,9 @@ export interface PaymentMethodAccountInfo extends PaymentMethodInfoBase {
|
|
|
38
39
|
export interface PaymentMethodTokenTransferInfo extends PaymentMethodInfoBase {
|
|
39
40
|
paymentMethod: PaymentMethod.TOKEN_TRANSFER;
|
|
40
41
|
}
|
|
42
|
+
export interface PaymentMethodBitcoinLightningInfo extends PaymentMethodInfoBase {
|
|
43
|
+
paymentMethod: PaymentMethod.BITCOIN_LIGHTNING;
|
|
44
|
+
}
|
|
41
45
|
export interface PaymentMethodVirtualBankIncompleteInfo extends PaymentMethodInfoBase {
|
|
42
46
|
paymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
43
47
|
matchingFiatAccount: BridgeVirtualBankAccount | undefined;
|
|
@@ -48,7 +52,7 @@ export interface PaymentMethodVirtualBankInfo extends PaymentMethodVirtualBankIn
|
|
|
48
52
|
}
|
|
49
53
|
export type ConnectablePaymentMethodInfo = PaymentMethodAccountInfo | PaymentMethodBrokerageInfo | PaymentMethodVirtualBankInfo;
|
|
50
54
|
export declare function isConnectablePaymentMethodInfo(value: unknown): value is ConnectablePaymentMethodInfo;
|
|
51
|
-
export type PaymentMethodInfo = PaymentMethodCardInfo | PaymentMethodBrokerageInfo | PaymentMethodAccountInfo | PaymentMethodTokenTransferInfo | PaymentMethodVirtualBankIncompleteInfo;
|
|
55
|
+
export type PaymentMethodInfo = PaymentMethodCardInfo | PaymentMethodBrokerageInfo | PaymentMethodAccountInfo | PaymentMethodTokenTransferInfo | PaymentMethodBitcoinLightningInfo | PaymentMethodVirtualBankIncompleteInfo;
|
|
52
56
|
interface CardPaymentMethodParams {
|
|
53
57
|
paymentMethod: PaymentMethod.CARD;
|
|
54
58
|
/** We also store client's customization in our database :( */
|
|
@@ -66,6 +70,9 @@ interface BrokeragePaymentMethodParams {
|
|
|
66
70
|
interface TokenTransferPaymentMethodParams {
|
|
67
71
|
paymentMethod: PaymentMethod.TOKEN_TRANSFER;
|
|
68
72
|
}
|
|
73
|
+
interface BitcoinLightningPaymentMethodParams {
|
|
74
|
+
paymentMethod: PaymentMethod.BITCOIN_LIGHTNING;
|
|
75
|
+
}
|
|
69
76
|
interface VirtualBankPaymentMethodIncompleteParams {
|
|
70
77
|
paymentMethod: PaymentMethod.VIRTUAL_BANK;
|
|
71
78
|
matchingFiatAccount: undefined;
|
|
@@ -79,6 +86,7 @@ interface VirtualBankPaymentMethodParams {
|
|
|
79
86
|
export declare function createPaymentMethodInfo(params: CardPaymentMethodParams): PaymentMethodCardInfo;
|
|
80
87
|
export declare function createPaymentMethodInfo(params: AccountPaymentMethodParams): PaymentMethodAccountInfo;
|
|
81
88
|
export declare function createPaymentMethodInfo(params: TokenTransferPaymentMethodParams): PaymentMethodTokenTransferInfo;
|
|
89
|
+
export declare function createPaymentMethodInfo(params: BitcoinLightningPaymentMethodParams): PaymentMethodBitcoinLightningInfo;
|
|
82
90
|
export declare function createPaymentMethodInfo(params: VirtualBankPaymentMethodIncompleteParams): PaymentMethodVirtualBankIncompleteInfo;
|
|
83
91
|
export declare function createPaymentMethodInfo(params: VirtualBankPaymentMethodParams): PaymentMethodVirtualBankInfo;
|
|
84
92
|
export declare function createPaymentMethodInfo(params: BrokeragePaymentMethodParams): PaymentMethodBrokerageInfo;
|
|
@@ -1,47 +1,7 @@
|
|
|
1
1
|
import { type DirectExecution } from '@funkit/api-base';
|
|
2
|
+
import { type UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import type { NotificationVariant } from '../../modals/CheckoutModal/TransferToken/types';
|
|
2
4
|
import { type PurifiedCheckoutHistoryItem } from '../../utils/purifyCheckoutHistoryItem';
|
|
3
|
-
/**
|
|
4
|
-
* Query parameters for the useRecentDeposits hook.
|
|
5
|
-
*/
|
|
6
|
-
interface RecentDirectExecutionsQuery {
|
|
7
|
-
/**
|
|
8
|
-
* Controls whether the hook should fetch and return data.
|
|
9
|
-
* When false, the query is disabled and no data will be fetched.
|
|
10
|
-
*/
|
|
11
|
-
isVisible: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Optional filter function to further refine which deposits are returned.
|
|
14
|
-
* WARNING: Must be a stable reference (wrap in useMemo), otherwise the hook will constantly re-render.
|
|
15
|
-
* @param de - The DirectExecution to filter
|
|
16
|
-
* @returns true to include the deposit, false to exclude it
|
|
17
|
-
*/
|
|
18
|
-
memoizedFilterFunc?: (de: DirectExecution) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum number of deposits to fetch from the API.
|
|
21
|
-
* @default 5
|
|
22
|
-
*/
|
|
23
|
-
fetchSize?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Custom cutoff time in milliseconds for determining which deposits are "recent".
|
|
26
|
-
* Deposits created after this timestamp will be included.
|
|
27
|
-
* If not provided, uses Fun's default strategy.
|
|
28
|
-
*/
|
|
29
|
-
cutOffTimeMs?: number;
|
|
30
|
-
/**
|
|
31
|
-
* API key for authenticating requests to Fun's API server.
|
|
32
|
-
*/
|
|
33
|
-
apiKey: string;
|
|
34
|
-
/**
|
|
35
|
-
* User ID for which to fetch direct executions.
|
|
36
|
-
* Usually user's connected wallet address.
|
|
37
|
-
*/
|
|
38
|
-
userId: string;
|
|
39
|
-
/**
|
|
40
|
-
* Interval in milliseconds for how often to refetch the data.
|
|
41
|
-
* Determines the polling frequency for keeping deposit data up to date.
|
|
42
|
-
*/
|
|
43
|
-
refreshIntervalMs: number;
|
|
44
|
-
}
|
|
45
5
|
export interface MergedMultiStepDirectExecution extends DirectExecution {
|
|
46
6
|
/**
|
|
47
7
|
* In a multi-step DE chain, represents the latest **present** DE of the chain.
|
|
@@ -53,15 +13,45 @@ export interface MergedMultiStepDirectExecution extends DirectExecution {
|
|
|
53
13
|
export declare function mergeMultiStepDirectExecutions(directExecutions: DirectExecution[]): MergedMultiStepDirectExecution[];
|
|
54
14
|
export declare function isTokenTransferDirectExecution(de: DirectExecution): boolean;
|
|
55
15
|
export declare function isWithdrawalDirectExecution(de: DirectExecution): boolean;
|
|
56
|
-
type DefaultDEQueryKey = 'apiKey' | 'userId' | 'refreshIntervalMs';
|
|
57
|
-
export type RecentDEQuerySimplified = Omit<RecentDirectExecutionsQuery, DefaultDEQueryKey>;
|
|
58
16
|
/**
|
|
59
|
-
*
|
|
17
|
+
* Pure transform: filters, merges multi-step chains, and sorts direct executions.
|
|
18
|
+
* Testable without React.
|
|
60
19
|
*/
|
|
61
|
-
export declare
|
|
62
|
-
|
|
63
|
-
|
|
20
|
+
export declare function processRecentDepositsForNotifications(directExecutions: DirectExecution[] | undefined, { createdAfterMs, cutOffTimeMs, variant, }?: {
|
|
21
|
+
createdAfterMs?: number;
|
|
22
|
+
cutOffTimeMs?: number;
|
|
23
|
+
variant?: NotificationVariant;
|
|
24
|
+
}): MergedMultiStepDirectExecution[] | undefined;
|
|
25
|
+
interface RecentDepositsApiQuery {
|
|
26
|
+
isVisible: boolean;
|
|
27
|
+
fetchSize?: number;
|
|
28
|
+
apiKey: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
refreshIntervalMs: number;
|
|
31
|
+
}
|
|
32
|
+
type DefaultDEQueryKey = 'apiKey' | 'userId' | 'refreshIntervalMs';
|
|
33
|
+
export type RecentDEQuerySimplified = {
|
|
34
|
+
isVisible: boolean;
|
|
35
|
+
fetchSize?: number;
|
|
64
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* @returns raw direct executions for the current user (no filtering or transforms applied)
|
|
39
|
+
*/
|
|
40
|
+
export declare const useRecentDeposits: ({ isVisible, fetchSize, }: RecentDEQuerySimplified) => UseQueryResult<DirectExecution[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Full explicit-params version of `useRecentDeposits` for use outside FunkitProvider context.
|
|
43
|
+
* Used by SDK wrappers.
|
|
44
|
+
*/
|
|
45
|
+
interface RecentDirectExecutionsQuery extends RecentDepositsApiQuery {
|
|
46
|
+
cutOffTimeMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Optional filter function to further refine which deposits are returned.
|
|
49
|
+
* WARNING: Must be a stable reference (wrap in useMemo), otherwise the hook will constantly re-render.
|
|
50
|
+
* @param de - The DirectExecution to filter
|
|
51
|
+
* @returns true to include the deposit, false to exclude it
|
|
52
|
+
*/
|
|
53
|
+
memoizedFilterFunc?: (de: DirectExecution) => boolean;
|
|
54
|
+
}
|
|
65
55
|
/**
|
|
66
56
|
* Hook for SDK users to fetch recent deposits/direct executions with automatic context integration.
|
|
67
57
|
*
|
|
@@ -85,7 +75,7 @@ export declare const useRecentDeposits: ({ isVisible, memoizedFilterFunc, fetchS
|
|
|
85
75
|
* }
|
|
86
76
|
* ```
|
|
87
77
|
*/
|
|
88
|
-
export declare function useFunkitRecentDeposits(query:
|
|
78
|
+
export declare function useFunkitRecentDeposits(query: Omit<RecentDirectExecutionsQuery, DefaultDEQueryKey>): {
|
|
89
79
|
data: PurifiedCheckoutHistoryItem[] | undefined;
|
|
90
80
|
};
|
|
91
81
|
/**
|
|
@@ -5,6 +5,7 @@ export declare function usePaymentMethodEnablement(): {
|
|
|
5
5
|
isTokenTransferEnabled: boolean;
|
|
6
6
|
isMeldEnabled: boolean;
|
|
7
7
|
isBrokerageEnabled: boolean;
|
|
8
|
+
isLightningEnabled: boolean;
|
|
8
9
|
};
|
|
9
10
|
export type PaymentMethodType = 'crypto' | 'fiat';
|
|
10
11
|
export type UnavailablePaymentSource = {
|
package/dist/index.css
CHANGED
|
@@ -15203,6 +15203,14 @@
|
|
|
15203
15203
|
opacity: 0;
|
|
15204
15204
|
}
|
|
15205
15205
|
|
|
15206
|
+
/* vanilla-extract-css-ns:src/components/FunAssetAvatar/FunAssetAvatar.css.ts.vanilla.css?source=LnV3cmRjMjAgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKfQoudXdyZGMyMiB7CiAgcG9zaXRpb246IGFic29sdXRlOwp9 */
|
|
15207
|
+
[data-rk] .uwrdc20 {
|
|
15208
|
+
position: relative;
|
|
15209
|
+
}
|
|
15210
|
+
[data-rk] .uwrdc22 {
|
|
15211
|
+
position: absolute;
|
|
15212
|
+
}
|
|
15213
|
+
|
|
15206
15214
|
/* vanilla-extract-css-ns:src/components/FunBadge/FunBadge.css.ts.vanilla.css?source=QGtleWZyYW1lcyBiYzJ1enkwIHsKICAwJSB7CiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoLTIwMCUpOwogIH0KICAzNSUsIDEwMCUgewogICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKDIwMCUpOwogIH0KfQouYmMydXp5MSB7CiAgZGlzcGxheTogZmxleDsKICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIHdpZHRoOiBmaXQtY29udGVudDsKICB3aGl0ZS1zcGFjZTogbm93cmFwOwp9Ci5iYzJ1enkyIHsKICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgb3ZlcmZsb3c6IGhpZGRlbjsKfQouYmMydXp5Mjo6YmVmb3JlIHsKICBjb250ZW50OiAiIjsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgaW5zZXQ6IDA7CiAgZGlzcGxheTogYmxvY2s7CiAgd2lkdGg6IDEwMCU7CiAgaGVpZ2h0OiAxMDAlOwogIGJhY2tncm91bmQ6IGxpbmVhci1ncmFkaWVudCg5MGRlZywgdHJhbnNwYXJlbnQgMzAlLCB3aGl0ZSA0NSUsIHdoaXRlIDU1JSwgdHJhbnNwYXJlbnQgNzAlKSBuby1yZXBlYXQ7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKC0yMDAlKTsKICBiYWNrZ3JvdW5kLXNpemU6IDIwMCUgMTAwJTsKICBvcGFjaXR5OiAwLjk7CiAgZmlsdGVyOiBibHVyKDJweCk7CiAgYW5pbWF0aW9uOiBiYzJ1enkwIDVzIGxpbmVhciBpbmZpbml0ZSAxczsKICBtaXgtYmxlbmQtbW9kZTogc29mdC1saWdodDsKfQ== */
|
|
15207
15215
|
@keyframes bc2uzy0 {
|
|
15208
15216
|
0% {
|
|
@@ -15501,14 +15509,6 @@
|
|
|
15501
15509
|
flex: 1;
|
|
15502
15510
|
}
|
|
15503
15511
|
|
|
15504
|
-
/* vanilla-extract-css-ns:src/components/FunAssetAvatar/FunAssetAvatar.css.ts.vanilla.css?source=LnV3cmRjMjAgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKfQoudXdyZGMyMiB7CiAgcG9zaXRpb246IGFic29sdXRlOwp9 */
|
|
15505
|
-
[data-rk] .uwrdc20 {
|
|
15506
|
-
position: relative;
|
|
15507
|
-
}
|
|
15508
|
-
[data-rk] .uwrdc22 {
|
|
15509
|
-
position: absolute;
|
|
15510
|
-
}
|
|
15511
|
-
|
|
15512
15512
|
/* vanilla-extract-css-ns:src/components/FunCountdown/FunCountdown.css.ts.vanilla.css?source=Ll8xdDBiYzExMSB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIGxlZnQ6IDA7CiAgdG9wOiAwOwogIGJvdHRvbTogMDsKICB0cmFuc2Zvcm06IHJvdGF0ZSgtOTBkZWcpOwp9Ci5fMXQwYmMxMTMgewogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICBsZWZ0OiAwOwogIHRvcDogMDsKICBib3R0b206IDA7CiAgdHJhbnNmb3JtOiByb3RhdGUoLTkwZGVnKTsKfQ== */
|
|
15513
15513
|
[data-rk] ._1t0bc111 {
|
|
15514
15514
|
position: absolute;
|
|
@@ -15620,7 +15620,7 @@
|
|
|
15620
15620
|
inset: 0;
|
|
15621
15621
|
}
|
|
15622
15622
|
|
|
15623
|
-
/* vanilla-extract-css-ns:src/components/CopyAddress/CopyInputDisplayedAddress.css.ts.vanilla.css?source=#
|
|
15623
|
+
/* vanilla-extract-css-ns:src/components/CopyAddress/CopyInputDisplayedAddress.css.ts.vanilla.css?source=#H4sIAAAAAAAAA81W247bNhB9368YBFhABkSBsiMnq7wEST8i7UtBUSObME0KJL3rTbH/XpC6WJQcx02BojBgibeZwzNHh/x8wNfGsCNa+DM/VN9RPCH89QBAH8MDwBmmbKPNkWgjdkKVUNBHoI+f4tGye5XM4e8JXYHRjjn8ltAadyuwnElM8lW3SLeMC/daQu7bbw8AeTGkW45t6WKMZu+7SI2QDk0JlTyZZN2eV2NA+q82sKWPly2QzXQT2Xa+C3oFy3bE8vbweclx03OcTnZ+HaffyC2kJIJ6D1JPz8clp/nd1P0M0j+s/ttDNtCyCXn1yUmhkHAttSnhmZmEEHPo2pYw7oRWX33jN2FZJbEOkSttajSk0s7pI5HYOGJYLU62BM4kT8Y4vlcQrpVC7r6cnNNqBQTyvmRxHCN2+18MFCgRHmwJTErIC3q0wE+V4KTC7wJNQrNNCjQFmtFtCp6hCRvvAxuE8D3yAxFcK1KjZK8lZHlhPy3GmN0T3TQWXelrtJjQjQ0xaIjQ6gGhQcmceEbf+yJqty8h37Zn39yjJ+HSroVtQ4ydEXWIIhlHIhwePUeoHJp4J2VZYaNNZy1cK4fKlfDuXQyBVVbLkwsQnG5LWHf5fC3HRo/tKYbWN/vaDeVaD71nYves1i8lCGXRAQ2/PCvaM/CTMahcENS8bKPAIVsXNu2S9+9d6r4RJQ59caiB9U4784rO5EKcOAq1I81J8Q7HTDTrIkgmCKegKeQZpas546xxaO4n3HREjpR59f93pHMpWtIyn6TV8nWnlbdQ/2kEOxqe/i/1Qfrntj2n/g+2028ucqxx3c9q2/vS/6B4RajaxFwnfh5N84SFudYZfcBgAYMDLMFe/CGwGXBPFjJj/CZz2pGdDh7ST+klsM6KOZGL5JBtFj73g13fRfPUuGIKtlcscmqD6ys2GPnfDYPM1jbOFZnYYJEbL+fIJMee2Xfxoeu9dmYmJPtQeCl3z9U87+VTXoiiI3F6wk+WfrysuSr6xWE0KRJdFGkG+o9kJtunOcJx6rdkTdvz6sZaFtZeP43G40aocC9oJJ6jxdWNxS0a2yL3zaDtWRGIda8SS2gNWjTPSDZ1FJqH0HMEldT84OMwJY4saFexIw7SjXtTUFrhKp4eSX3WnQK18+knw7q90cGeLoO/aDjTEI2Qkhx1jSU02rwwU9tIVnOc/cDiylL/UAL33FRvXzdv3BPo5ZZA78Md5Pc3djwXAf0MAAA= */
|
|
15624
15624
|
@keyframes _1kbzei9e {
|
|
15625
15625
|
0% {
|
|
15626
15626
|
transform-origin: 50% 0%;
|
|
@@ -15658,8 +15658,8 @@
|
|
|
15658
15658
|
}
|
|
15659
15659
|
[data-rk] ._1kbzei93 {
|
|
15660
15660
|
outline-color: var(--rk-colors-actionColorDisabled);
|
|
15661
|
-
border-bottom-left-radius: var(--rk-radii-connectButton);
|
|
15662
|
-
border-bottom-right-radius: var(--rk-radii-connectButton);
|
|
15661
|
+
border-bottom-left-radius: calc(var(--rk-radii-connectButton) - 1px);
|
|
15662
|
+
border-bottom-right-radius: calc(var(--rk-radii-connectButton) - 1px);
|
|
15663
15663
|
transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
|
|
15664
15664
|
}
|
|
15665
15665
|
[data-rk] ._1kbzei94 {
|