@funkit/connect 9.16.0 → 9.17.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/CopyAddress/CopyAddressButton.d.ts +1 -1
  3. package/dist/components/CopyAddress/OldCopyAddressButton.d.ts +1 -1
  4. package/dist/components/FunInfoBanner/ChainInfoBanners.d.ts +1 -1
  5. package/dist/hooks/queries/useLightningQuote.d.ts +13 -3
  6. package/dist/hooks/useAssetPrice.d.ts +9 -3
  7. package/dist/index.js +1543 -1227
  8. package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +7 -0
  9. package/dist/modals/CheckoutModal/InputAmount/useAaveNativeSupply.d.ts +77 -9
  10. package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoice.d.ts +0 -1
  11. package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoiceQrCode.d.ts +8 -0
  12. package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +4 -0
  13. package/dist/modals/CheckoutModal/SourceChange/SourceChangeLoading.d.ts +1 -1
  14. package/dist/providers/FunkitQuoteContext.d.ts +16 -0
  15. package/dist/utils/purifyCheckoutHistoryItem.d.ts +14 -0
  16. package/dist/wagmi/chains.d.ts +1 -1
  17. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  18. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  19. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  20. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  21. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  22. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  23. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  24. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  25. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  26. package/dist/wallets/walletConnectors/index.js +42 -42
  27. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  28. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  29. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  30. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  31. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  32. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  33. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  34. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  35. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  36. package/package.json +4 -4
  37. package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
  38. package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
  39. package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
  40. package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
  41. package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
  42. package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
  43. package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
  44. package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
  45. package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
  46. package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
  47. package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
  48. package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
  49. package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
  50. package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
  51. package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
  52. package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
  53. package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
  54. package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 9.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d7f8e35: Aave native supply honors the approval-method toggle: `supplyWithPermit` when the user picks "Signed message" and the reserve supports EIP-2612, else `approve + supply` (with USDT zero-reset on stale allowance). The toggle is hidden for native assets that can't permit (USDT, WBTC).
8
+ - 4c7b8b5: Add isWithdrawal and Lighter fast/secure withdrawal type to purified checkout history items
9
+
10
+ ### Patch Changes
11
+
12
+ - 20ed7f5: Record the real supply amount, USD value, and deposit timestamp on Aave native Direct Execution records (was `$0` total and a negative run time in fits).
13
+ - 20ed7f5: Persist the supplied amount on Aave native Direct Execution records so the checkout success screen's "You receive" shows the real amount instead of 0.
14
+ - 3e6c69d: test(connect): test SelectAsset component
15
+ - 0fc5f37: feat: integrate lightning quote prefetch
16
+ - 62c6bab: test(connect): test useCheckoutTimeEstimate
17
+ - dc5f538: test(connect): test useBluvo
18
+ - e9ae127: test(connect): test stepTransition
19
+ - cd5b590: test(connect): test usePostCheckout
20
+ - 59b02dd: test(connect): test useAccountBalancePostCheckout
21
+ - a4d5a9b: Reformat packages with oxfmt
22
+ - aa9f1ee: test(connect): test useAvailableBalanceForCheckout
23
+ - 769bae0: test(connect): stabilize useBluvo with getTokenDecimals mock
24
+ - 3e588fc: test(connect): test useSourceAssetConfirm
25
+ - 7076a2a: test(connect): test useCheckoutQuote
26
+ - 7690c31: test(connect): test useTokenTransfer
27
+ - Updated dependencies [20ed7f5]
28
+ - Updated dependencies [a4d5a9b]
29
+ - @funkit/api-base@4.4.1
30
+ - @funkit/utils@3.0.2
31
+ - @funkit/fun-relay@2.7.4
32
+
3
33
  ## 9.16.0
4
34
 
5
35
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  /** Simple button to copy the provided address */
3
- export declare function CopyAddressButton({ address, }: {
3
+ export declare function CopyAddressButton({ address }: {
4
4
  address: string;
5
5
  }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  /** Use this button only in the old design components, for the future we should use `CopyAddressButton` which has a new design */
3
- export declare function OldCopyAddressButton({ address, }: {
3
+ export declare function OldCopyAddressButton({ address }: {
4
4
  address: string;
5
5
  }): React.JSX.Element;
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  /**
3
3
  * Renders only banners for currently selected chain
4
4
  */
5
- export declare const ChainInfoBanners: ({ chainId, }: {
5
+ export declare const ChainInfoBanners: ({ chainId }: {
6
6
  chainId: number;
7
7
  }) => (React.JSX.Element | null)[] | null;
@@ -1,11 +1,21 @@
1
- import type { Address } from 'viem';
1
+ import { type LightningQuoteResponse } from '@funkit/api-base';
2
+ import { type Address } from 'viem';
2
3
  import type { GeneralWalletContextProps } from '../../providers/GeneralWalletProvider';
4
+ export declare function usdToSats(usd: number | undefined, btcPrice: number | undefined): bigint | undefined;
3
5
  type UseLightningQuoteParams = {
4
6
  depositAddr: Address | undefined;
5
7
  walletAddress: GeneralWalletContextProps['walletAddress'];
6
8
  targetChain: string | undefined;
7
9
  targetAsset: Address | undefined;
8
- fromAmountSats: bigint | undefined;
10
+ fiatAmount: number | undefined;
9
11
  };
10
- export declare const useLightningQuote: ({ depositAddr, walletAddress, targetChain, targetAsset, fromAmountSats, }: UseLightningQuoteParams) => import("@tanstack/react-query").UseQueryResult<import("@funkit/api-base").LightningQuoteResponse, Error>;
12
+ /**
13
+ * Holds the displayed invoice until its real `expiresAtMs`, then reveals the
14
+ * prefetched replacement. `useLightningQuote` prefetches the next invoice early,
15
+ * so revealing it on arrival would reset the QR/timer while the current invoice
16
+ * is still valid.
17
+ *
18
+ */
19
+ export declare function useDeferredQuote(latestQuote: LightningQuoteResponse | undefined): LightningQuoteResponse | undefined;
20
+ export declare const useLightningQuote: ({ depositAddr, walletAddress, targetChain, targetAsset, fiatAmount, }: UseLightningQuoteParams) => import("@tanstack/react-query").UseQueryResult<LightningQuoteResponse, Error>;
11
21
  export {};
@@ -1,9 +1,15 @@
1
- import { type Erc20AssetInfo } from '@funkit/api-base';
1
+ import { type Erc20AssetInfo, type GetAssetPriceInfoResponse } from '@funkit/api-base';
2
2
  import type { Address } from 'viem';
3
+ export declare function getAssetPriceInfoWithFallback({ apiKey, chainId, assetTokenAddress, }: {
4
+ apiKey: string;
5
+ chainId: string;
6
+ assetTokenAddress: Address;
7
+ }): Promise<GetAssetPriceInfoResponse>;
3
8
  interface UseAssetAddressPriceParams {
4
9
  chainId: string | undefined;
5
10
  assetTokenAddress: Address | undefined;
6
- refetchInterval?: number;
11
+ /** Pass `false` to fetch once and disable interval polling. */
12
+ refetchInterval?: number | false;
7
13
  /** defaults to 1 hence price returned is unit price */
8
14
  amount?: number;
9
15
  /** Asset symbol — when provided and the symbol is a stablecoin, price is hardcoded to 1 */
@@ -21,7 +27,7 @@ export declare function useAssetAddressPrice({ chainId, assetTokenAddress, amoun
21
27
  type AssetSymbolPriceParams = {
22
28
  chainId: string | undefined;
23
29
  symbol: string | undefined;
24
- refetchInterval?: number;
30
+ refetchInterval?: number | false;
25
31
  /** Disable the query without changing other inputs. Defaults to true. */
26
32
  enabled?: boolean;
27
33
  };