@funkit/connect 9.15.1 → 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 +33 -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-55VS2NKG.js → chunk-4NV5BYRP.js} +2 -2
- 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-J3PJOMO7.js → chunk-AVDUNQUW.js} +2 -2
- 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-YGMU5VWD.js → chunk-GUQM4QSL.js} +2 -2
- 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-OD6B2ISG.js → chunk-IULPZP2Q.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-KSNA53EX.js → chunk-JN5I3DNC.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-LEAZMT5Y.js → chunk-JPN6TWIT.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-FWM4KTOV.js → chunk-KCRO2AGO.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-ZL6XCMV5.js → chunk-KI5Y2BBF.js} +2 -2
- 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-ZJJWGKB6.js → chunk-NR2OGDHQ.js} +2 -2
- 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-3ZJN3PXP.js → chunk-OEEGYENV.js} +2 -2
- 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-7IEUTLHY.js → chunk-OX37G4YT.js} +2 -2
- 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-UFYNHHDU.js → chunk-SWFF3TWJ.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-HPUEYLLS.js → chunk-T6LGKC3F.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-IMNI4AGV.js → chunk-TKB2OY6G.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-R7X5RIO7.js → chunk-VH3THHJY.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-AZYMJ4C6.js → chunk-W2LCLDPX.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-RZQ4B4Z7.js → chunk-WAHGI5L7.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-UYW6MV74.js → chunk-WKNQMP4A.js} +2 -2
- 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-VMMROPXK.js → chunk-XCNHV3HS.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-IRHK6SOW.js → chunk-YO2K4MBH.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-OSOB6QYX.js → chunk-YQFGVZGR.js} +2 -2
- 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 +82 -82
- 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 +3 -4
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 9.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 33bdcdc: Add `uiCustomizations.checkoutHistory.successScreenBackground` for custom CSS gradients on the post-checkout success screen.
|
|
8
|
+
- 85a68f3: Show supply APY and collateralization status on the checkout confirmation screen for yield destinations like Aave.
|
|
9
|
+
- 18bd8a2: feat(connect): gated "Add to wallet" button on the post-checkout success screen (EIP-747 `wallet_watchAsset`), driven by a new optional `addToWalletToken` checkout config field for vault-receipt flows (e.g. Aave aUSDT).
|
|
10
|
+
- 1d38bb4: feat: add btc lightning quoting and invoice
|
|
11
|
+
- 4753c9b: Add `confirmationScreen.showSelectedRoute` to surface the Relay/Across route row independently of passthrough branding (`selectedRouteConfig`).
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 1623974: test(connect): test useCheckoutDirectExecution
|
|
16
|
+
- bd5d863: Internal refactor: move the pure checkout-notification logic (multi-step direct-execution merging, deposit filtering, snapshot-diff derivation) into a new `domains/checkoutNotifications.ts` module. No public API or behavior change.
|
|
17
|
+
- 6cc9477: test: add snapshot coverage
|
|
18
|
+
- 33bdcdc: Skip the destination redirect on the post-checkout success screen when `destinationConfig` is set without a `url` (avoids misleading link to the user's own wallet).
|
|
19
|
+
- 7dfaeb7: Restore the post-checkout destination explorer link for customers whose `destinationConfig` sets no `url` (e.g. Polymarket). The link again falls back to the block explorer of `recipientAddr` as documented; customers whose destination is a concept rather than the recipient address should set `destinationConfig.url`.
|
|
20
|
+
- ce7dd34: Fix Lighter deposit/withdrawal recipient selecting a sub-account instead of the main account by selecting the `account_type === 0` entry from `accountsByL1Address` rather than `sub_accounts[0]`.
|
|
21
|
+
- 657a284: Internal refactor: add a platform-agnostic `IdentityProvider`/`FunkitIdentity` interface and a web `useIdentity()` implementation backed by `GeneralWalletProvider`, and route `useFops`/`useSwappedExchanges` through it. No public API or user-visible behavior change.
|
|
22
|
+
- 3f6ceb8: Internal refactor: introduce a platform-agnostic `LogTransport` interface and move the `@datadog/browser-logs` calls out of `FunLogger` into a `DatadogBrowserLogsTransport` that the global logger is wired with. `FunLogger` now emits through an injected transport instead of importing Datadog directly. No public API or behavior change.
|
|
23
|
+
- 96f9b0a: chore(security): upgrade uuid to 11.1.1
|
|
24
|
+
- 12b4059: Move approval method toggle from confirmation screen to input amount screen and add explanatory tooltip
|
|
25
|
+
- 4970a3b: Internal refactor: route `QuoteModeProvider`'s feature-gate reads through the `~/hooks/statsig` `useFeatureGate` wrapper instead of `@statsig/react-bindings` directly. No public API or behavior change.
|
|
26
|
+
- 2e869ee: Remove unused useUpdateCardSourceAsset hook tied to deprecated Moonpay card flow
|
|
27
|
+
- 2e869ee: Remove unused getMockedTargetChainId helper and DepositTokenSymbol enum from Moonpay flow
|
|
28
|
+
- 64caa75: chore(connect): remove the stale `new-token-transfer-config` feature gate
|
|
29
|
+
- 2e869ee: Remove Polymarket-specific Moonpay estimate from Meld quotes now that Polymarket uses swapped quotes
|
|
30
|
+
- d8a374e: feat: create shared component for error statem, replace instances, and remove unused tagline path
|
|
31
|
+
- 9391b6f: Internal refactor: make the Swapped theme builders (`buildSwappedTheme`, `buildSwappedThemeQueryParams`) pure by moving DOM-bound CSS-variable resolution out to the web call sites. No public API or user-visible behavior change — prep for sharing the Swapped theme path with React Native via `@funkit/connect-core`.
|
|
32
|
+
- 2265429: Internal refactor: introduce a typed `SwappedTransport` contract (the inbound/outbound postMessage event union) and route `SwappedProvider` + `SwappedIframeController` through a web `IframeSwappedTransport` instead of touching `window.postMessage`/`addEventListener` directly. No public API or user-visible behavior change — prep for sharing the Swapped state machine with React Native (which will provide a WebView-backed transport) via `@funkit/connect-core`.
|
|
33
|
+
- Updated dependencies [1d38bb4]
|
|
34
|
+
- @funkit/api-base@4.4.0
|
|
35
|
+
|
|
3
36
|
## 9.15.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
readonly 'compliance-review-blocker': false;
|
|
3
3
|
readonly 'enable-across-wallet-flow': false;
|
|
4
4
|
readonly 'enable-add-token-to-wallet': false;
|
|
5
|
+
readonly 'enable-checkout-success-screen-background': false;
|
|
5
6
|
readonly 'enable-empty-withdrawal-selection': false;
|
|
6
7
|
readonly 'enable-free-usdc-banner': false;
|
|
7
8
|
readonly 'enable-permit-toggle': false;
|
|
@@ -207,6 +207,7 @@ var lightTheme = ({
|
|
|
207
207
|
// primaryText
|
|
208
208
|
txSummaryBoxBackground: customColors?.txSummaryBoxBackground ?? customColors?.modalBackground ?? "#FFF",
|
|
209
209
|
txSummaryBoxBorder: customColors?.txSummaryBoxBorder ?? customColors?.lightStroke ?? "#F7F7F7",
|
|
210
|
+
modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#FFF",
|
|
210
211
|
counterRingColor: customColors?.counterRingColor ?? accentColor,
|
|
211
212
|
cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
|
|
212
213
|
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent"
|
|
@@ -207,6 +207,7 @@ var darkTheme = ({
|
|
|
207
207
|
// primaryText
|
|
208
208
|
txSummaryBoxBackground: customColors?.txSummaryBoxBackground ?? customColors?.modalBackground ?? "#000",
|
|
209
209
|
txSummaryBoxBorder: customColors?.txSummaryBoxBorder ?? customColors?.lightStroke ?? "#333333",
|
|
210
|
+
modalBackgroundCheckoutComplete: customColors?.modalBackgroundCheckoutComplete ?? customColors?.modalBackground ?? "#000",
|
|
210
211
|
counterRingColor: customColors?.counterRingColor ?? accentColor,
|
|
211
212
|
cryptoCashToggleContainerBorderColor: customColors?.cryptoCashToggleContainerBorderColor ?? "transparent",
|
|
212
213
|
cryptoCashToggleBackground: customColors?.cryptoCashToggleBackground ?? "transparent"
|
package/dist/clients/aave.d.ts
CHANGED
|
@@ -75,6 +75,21 @@ export interface AaveSupplyCheckoutInput {
|
|
|
75
75
|
};
|
|
76
76
|
/** Aave referral code; defaults to 0. */
|
|
77
77
|
referralCode?: number;
|
|
78
|
+
/**
|
|
79
|
+
* The aToken receipt the supply mints (Aave's `Reserve.aToken`). When
|
|
80
|
+
* provided, the post-checkout success screen offers adding it to the user's
|
|
81
|
+
* wallet via EIP-747 — necessary because the checkout's destination token is
|
|
82
|
+
* the intermediate underlying (USDT), not the aToken (aUSDT) the user holds
|
|
83
|
+
* after the supply. Resolve it from Aave reserve data (`@aave/client`'s
|
|
84
|
+
* `reserve()` → `aToken`, or `@aave-dao/aave-address-book`). Omit if
|
|
85
|
+
* unavailable — the button is simply not shown.
|
|
86
|
+
*/
|
|
87
|
+
receiptToken?: {
|
|
88
|
+
address: Address;
|
|
89
|
+
symbol: string;
|
|
90
|
+
decimals: number;
|
|
91
|
+
iconSrc?: string;
|
|
92
|
+
};
|
|
78
93
|
}
|
|
79
94
|
/**
|
|
80
95
|
* High-level builder for an Aave V3 supply checkout. Returns a
|
package/dist/clients/aave.js
CHANGED
|
@@ -125,28 +125,53 @@ function createAaveSupplyCheckoutConfig(input) {
|
|
|
125
125
|
chainId,
|
|
126
126
|
walletAddress,
|
|
127
127
|
display,
|
|
128
|
-
referralCode
|
|
128
|
+
referralCode,
|
|
129
|
+
receiptToken
|
|
129
130
|
} = input;
|
|
130
131
|
if (!isAaveSupplySupported(chainId)) {
|
|
131
132
|
return void 0;
|
|
132
133
|
}
|
|
133
134
|
const symbol = display?.symbol ?? "asset";
|
|
134
|
-
const receiptTicker = `a${symbol}`;
|
|
135
|
+
const receiptTicker = receiptToken?.symbol ?? `a${symbol}`;
|
|
135
136
|
return {
|
|
136
137
|
modalTitle: `Supply ${symbol}`,
|
|
137
138
|
modalTitleMeta: buildSupplyModalTitleMeta(display),
|
|
139
|
+
// Same integrator-provided signals as the subtitle, but structured so the
|
|
140
|
+
// confirmation screen renders them as rows (DestinationYieldRows). No extra
|
|
141
|
+
// fetch — one resolved snapshot, two surfaces. Left undefined when neither
|
|
142
|
+
// signal is present so the field stays falsy (no empty-but-truthy object).
|
|
143
|
+
destinationYieldInfo: display?.supplyAPY !== void 0 || display?.collateralizationEnabled !== void 0 ? {
|
|
144
|
+
supplyApy: display?.supplyAPY,
|
|
145
|
+
collateralizationEnabled: display?.collateralizationEnabled
|
|
146
|
+
} : void 0,
|
|
138
147
|
targetChain: chainId.toString(),
|
|
139
148
|
targetAsset: underlyingAsset,
|
|
140
149
|
targetAssetTicker: receiptTicker,
|
|
141
150
|
checkoutItemTitle: receiptTicker,
|
|
142
|
-
|
|
151
|
+
// Prefer the aToken's icon (e.g. Aave's aEthUSDC artwork) when known so
|
|
152
|
+
// the You-receive row / modal title show the receipt token's branding,
|
|
153
|
+
// not the underlying's. Falls back to the integrator-supplied underlying
|
|
154
|
+
// icon when reserve metadata isn't available.
|
|
155
|
+
iconSrc: receiptToken?.iconSrc ?? display?.iconSrc,
|
|
143
156
|
generateActionsParams: createAaveSupplyActions({
|
|
144
157
|
onBehalfOf: walletAddress,
|
|
145
158
|
underlyingAsset,
|
|
146
159
|
poolAddress,
|
|
147
160
|
chainId,
|
|
148
161
|
referralCode
|
|
149
|
-
})
|
|
162
|
+
}),
|
|
163
|
+
// The checkout delivers the underlying (USDT); the supply mints the aToken
|
|
164
|
+
// (aEthUSDT) to the wallet. Offer adding the aToken — not `targetAsset` —
|
|
165
|
+
// so the wallet tracks what the user actually holds. All fields come
|
|
166
|
+
// straight from Aave reserve data so the wallet label / icon / decimals
|
|
167
|
+
// match what users see on-chain and in explorers.
|
|
168
|
+
addToWalletToken: receiptToken ? {
|
|
169
|
+
tokenAddress: receiptToken.address,
|
|
170
|
+
tokenChainId: chainId.toString(),
|
|
171
|
+
tokenSymbol: receiptToken.symbol,
|
|
172
|
+
decimals: receiptToken.decimals,
|
|
173
|
+
iconSrc: receiptToken.iconSrc
|
|
174
|
+
} : void 0
|
|
150
175
|
};
|
|
151
176
|
}
|
|
152
177
|
export {
|
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/utils/funLogger.ts
|
|
4
|
-
import { datadogLogs } from "@datadog/browser-logs";
|
|
5
4
|
import { DEV_API_KEY } from "@funkit/api-base";
|
|
5
|
+
|
|
6
|
+
// src/utils/datadogBrowserLogsTransport.ts
|
|
7
|
+
import { datadogLogs } from "@datadog/browser-logs";
|
|
6
8
|
var DDOG_CLIENT_TOKEN = "pub4f86c6be8c792cb48dc156a8c17d9a47";
|
|
9
|
+
var DatadogBrowserLogsTransport = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
datadogLogs.init({
|
|
12
|
+
clientToken: DDOG_CLIENT_TOKEN,
|
|
13
|
+
site: "datadoghq.com",
|
|
14
|
+
forwardErrorsToLogs: false,
|
|
15
|
+
sessionSampleRate: 100,
|
|
16
|
+
service: "connect-sdk"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
setEnv(environment) {
|
|
20
|
+
datadogLogs.setGlobalContextProperty("env", environment);
|
|
21
|
+
}
|
|
22
|
+
setTrackingConsent(consent) {
|
|
23
|
+
datadogLogs.setTrackingConsent(consent);
|
|
24
|
+
}
|
|
25
|
+
log({ level, title, context, error }) {
|
|
26
|
+
if (typeof window === "undefined") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
switch (level) {
|
|
30
|
+
case "info":
|
|
31
|
+
datadogLogs.logger.info(title, context);
|
|
32
|
+
break;
|
|
33
|
+
case "debug":
|
|
34
|
+
datadogLogs.logger.debug(title, context);
|
|
35
|
+
break;
|
|
36
|
+
case "warn":
|
|
37
|
+
datadogLogs.logger.warn(title, context);
|
|
38
|
+
break;
|
|
39
|
+
case "error":
|
|
40
|
+
datadogLogs.logger.error(title, context, error);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/utils/funLogger.ts
|
|
7
47
|
var FUN_DEV_API_KEYS = [
|
|
8
48
|
"hnHevQR0y394nBprGrvNx4HgoZHUwMet5mXTOBhf",
|
|
9
49
|
"MYny3w7xJh6PRlRgkJ9604sHouY2MTke6lCPpSHq",
|
|
10
50
|
DEV_API_KEY
|
|
11
51
|
];
|
|
12
|
-
function setDdogEnv(environment) {
|
|
13
|
-
datadogLogs.setGlobalContextProperty("env", environment);
|
|
14
|
-
}
|
|
15
|
-
function setDdogTrackingConsent(consent) {
|
|
16
|
-
datadogLogs.setTrackingConsent(consent);
|
|
17
|
-
}
|
|
18
52
|
var FunLogger = class {
|
|
19
|
-
constructor() {
|
|
20
|
-
|
|
21
|
-
|
|
53
|
+
constructor(transport) {
|
|
54
|
+
this.transport = transport;
|
|
55
|
+
this.transport.setEnv?.("development" /* DEVELOPMENT */);
|
|
56
|
+
this.transport.setTrackingConsent?.("granted");
|
|
22
57
|
this.apiKey = null;
|
|
23
58
|
this.isDebugMode = false;
|
|
24
59
|
this.userId = null;
|
|
@@ -38,11 +73,9 @@ var FunLogger = class {
|
|
|
38
73
|
}
|
|
39
74
|
return "production" /* PRODUCTION */;
|
|
40
75
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
const datadogData = {
|
|
76
|
+
/** Merge caller data with the logger's resolved context for the transport. */
|
|
77
|
+
buildLogContext(data) {
|
|
78
|
+
return {
|
|
46
79
|
data,
|
|
47
80
|
apiKey: this.apiKey,
|
|
48
81
|
userId: this.userId,
|
|
@@ -52,19 +85,6 @@ var FunLogger = class {
|
|
|
52
85
|
typeLabel: this.typeLabel,
|
|
53
86
|
sdkVersion: this.sdkVersion
|
|
54
87
|
};
|
|
55
|
-
switch (level) {
|
|
56
|
-
case "info":
|
|
57
|
-
datadogLogs.logger.info(title, datadogData);
|
|
58
|
-
break;
|
|
59
|
-
case "debug":
|
|
60
|
-
datadogLogs.logger.debug(title, datadogData);
|
|
61
|
-
break;
|
|
62
|
-
case "warn":
|
|
63
|
-
datadogLogs.logger.warn(title, datadogData);
|
|
64
|
-
break;
|
|
65
|
-
case "error":
|
|
66
|
-
datadogLogs.logger.error(title, datadogData, error);
|
|
67
|
-
}
|
|
68
88
|
}
|
|
69
89
|
processLog(level, title, data, error) {
|
|
70
90
|
if (!this.isConfigured) {
|
|
@@ -79,7 +99,12 @@ var FunLogger = class {
|
|
|
79
99
|
}
|
|
80
100
|
const isProd = this.getFunLogEnv() === "production" /* PRODUCTION */;
|
|
81
101
|
if (isProd) {
|
|
82
|
-
this.
|
|
102
|
+
this.transport.log({
|
|
103
|
+
level,
|
|
104
|
+
title,
|
|
105
|
+
context: this.buildLogContext(data),
|
|
106
|
+
error
|
|
107
|
+
});
|
|
83
108
|
}
|
|
84
109
|
if (!isProd || this.isDebugMode) {
|
|
85
110
|
const formattedData = data || "";
|
|
@@ -175,8 +200,10 @@ var FunLogger = class {
|
|
|
175
200
|
this.sdkVersion = sdkVersion;
|
|
176
201
|
this.disableLogging = disableLogging;
|
|
177
202
|
this.isConfigured = true;
|
|
178
|
-
|
|
179
|
-
|
|
203
|
+
this.transport.setEnv?.(this.getFunLogEnv());
|
|
204
|
+
this.transport.setTrackingConsent?.(
|
|
205
|
+
this.disableLogging ? "not-granted" : "granted"
|
|
206
|
+
);
|
|
180
207
|
this.flushLogQueue();
|
|
181
208
|
}
|
|
182
209
|
getUserId() {
|
|
@@ -206,14 +233,7 @@ var FunLogger = class {
|
|
|
206
233
|
this.l2Address = l2Address ?? null;
|
|
207
234
|
}
|
|
208
235
|
};
|
|
209
|
-
|
|
210
|
-
clientToken: DDOG_CLIENT_TOKEN,
|
|
211
|
-
site: "datadoghq.com",
|
|
212
|
-
forwardErrorsToLogs: false,
|
|
213
|
-
sessionSampleRate: 100,
|
|
214
|
-
service: "connect-sdk"
|
|
215
|
-
});
|
|
216
|
-
var logger = new FunLogger();
|
|
236
|
+
var logger = new FunLogger(new DatadogBrowserLogsTransport());
|
|
217
237
|
|
|
218
238
|
export {
|
|
219
239
|
logger
|