@funkit/connect 12.16.0 → 12.18.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 (97) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/dist/clients/axiom.d.ts +1 -5
  3. package/dist/clients/{chunk-BKK2BFIP.js → chunk-AELXD5XA.js} +1 -1
  4. package/dist/clients/{chunk-6IH7AWFA.js → chunk-FOXMRDKD.js} +1 -1
  5. package/dist/clients/{chunk-UZ3NA7HN.js → chunk-G6A62MZO.js} +3 -3
  6. package/dist/clients/{chunk-OB5GKTP2.js → chunk-L6JL2XJY.js} +1 -1
  7. package/dist/clients/{chunk-I5VRAFH6.js → chunk-LCYJLY4X.js} +1 -1
  8. package/dist/clients/chunk-R25GIAD5.js +59 -0
  9. package/dist/clients/{chunk-7JYLS7IF.js → chunk-YSAAJSWT.js} +272 -48
  10. package/dist/clients/fanatics.js +2 -2
  11. package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
  12. package/dist/clients/internal/nado/withdrawalConfig.js +2 -2
  13. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  14. package/dist/clients/internal/nado/withdrawalForm.js +6 -6
  15. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  16. package/dist/clients/lighter.css +8 -8
  17. package/dist/clients/lighter.d.ts +29 -16
  18. package/dist/clients/lighter.js +149 -68
  19. package/dist/clients/mallard.js +2 -2
  20. package/dist/clients/nado.js +4 -4
  21. package/dist/components/LargeAmountInput/LargeAmountInput.d.ts +3 -1
  22. package/dist/components/TokenSwapWidget/TokenSelectButton/TokenSelectButton.d.ts +5 -2
  23. package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +7 -3
  24. package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +7 -2
  25. package/dist/consts/customers.d.ts +12 -1
  26. package/dist/domains/convert/assets.d.ts +30 -0
  27. package/dist/domains/convert/balances.d.ts +44 -24
  28. package/dist/domains/convert/errors.d.ts +38 -0
  29. package/dist/domains/convert/execution.d.ts +39 -0
  30. package/dist/domains/convert/hostTimeout.d.ts +8 -0
  31. package/dist/domains/convert/inputAmount.d.ts +53 -0
  32. package/dist/domains/convert/quote.d.ts +33 -0
  33. package/dist/domains/convert/recipient.d.ts +2 -1
  34. package/dist/domains/convert/reducer.d.ts +112 -0
  35. package/dist/domains/convert/screen.d.ts +169 -0
  36. package/dist/domains/convert/settlement.d.ts +52 -0
  37. package/dist/domains/convert/sourceWallet.d.ts +5 -4
  38. package/dist/domains/convert/submit.d.ts +67 -0
  39. package/dist/domains/convert/types.d.ts +52 -27
  40. package/dist/domains/convert/view.d.ts +111 -0
  41. package/dist/domains/nativeFeeReserve.d.ts +29 -0
  42. package/dist/domains/quote.d.ts +14 -1
  43. package/dist/hooks/queries/useWithdrawFops.d.ts +6 -0
  44. package/dist/hooks/queries/useWithdrawalQuote.d.ts +4 -1
  45. package/dist/hooks/track/CheckoutModalEvent.d.ts +2 -0
  46. package/dist/hooks/track/WithdrawModalEvent.d.ts +1 -0
  47. package/dist/hooks/track/analytics/events.d.ts +59 -1
  48. package/dist/hooks/track/analytics/mappers.d.ts +5 -4
  49. package/dist/hooks/track/analytics/resolveIframeStepNavigation.d.ts +18 -0
  50. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +2 -2
  51. package/dist/hooks/track/analytics/useTrackSwappedIframeEvents.d.ts +5 -0
  52. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +2 -2
  53. package/dist/hooks/track/useQuoteAttemptCounter.d.ts +2 -0
  54. package/dist/hooks/useConvertAssetList.d.ts +23 -0
  55. package/dist/hooks/useConvertAssets.d.ts +11 -0
  56. package/dist/hooks/useConvertBalances.d.ts +50 -0
  57. package/dist/hooks/useConvertExecute.d.ts +33 -0
  58. package/dist/hooks/useConvertQuote.d.ts +53 -0
  59. package/dist/hooks/useConvertSelectionWallets.d.ts +34 -0
  60. package/dist/hooks/useConvertTransactionStatus.d.ts +17 -0
  61. package/dist/hooks/useMaxSpendableAmount.d.ts +19 -0
  62. package/dist/hooks/useStepQueryReadiness.d.ts +45 -15
  63. package/dist/index.css +8 -8
  64. package/dist/index.d.ts +3 -2
  65. package/dist/index.js +8169 -3491
  66. package/dist/modals/CheckoutModal/Convert/ConvertAssetList.d.ts +16 -0
  67. package/dist/modals/CheckoutModal/Convert/ConvertAssetRow.d.ts +21 -0
  68. package/dist/modals/CheckoutModal/Convert/ConvertChainPills.d.ts +14 -0
  69. package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +30 -0
  70. package/dist/modals/CheckoutModal/Convert/ConvertSelectSourceStep.d.ts +18 -0
  71. package/dist/modals/CheckoutModal/Convert/ConvertStep.d.ts +4 -2
  72. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +2 -0
  73. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +5 -3
  74. package/dist/modals/CheckoutModal/SwappedIframe/swappedIframeReady.track.d.ts +8 -0
  75. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +5 -2
  76. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +4 -2
  77. package/dist/modals/CheckoutModal/stepTransition.d.ts +7 -2
  78. package/dist/modals/CheckoutModal/stepTransition.shared.d.ts +0 -1
  79. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +48 -15
  80. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +17 -4
  81. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +10 -7
  82. package/dist/modals/WithdrawalModal/useMaxWithdrawableAmount.d.ts +10 -0
  83. package/dist/modals/WithdrawalModal/useMultiSourceWithdrawal.d.ts +41 -0
  84. package/dist/modals/WithdrawalModal/withdrawalFormHelpers.d.ts +28 -8
  85. package/dist/providers/ConvertProvider.d.ts +40 -0
  86. package/dist/providers/FunkitCheckoutContext/index.d.ts +2 -2
  87. package/dist/providers/FunkitCheckoutContext/types.d.ts +36 -2
  88. package/dist/providers/FunkitQuoteContext.track.d.ts +23 -3
  89. package/dist/providers/SwappedProvider.d.ts +7 -0
  90. package/dist/shadow-css.js +1 -1
  91. package/dist/utils/customer.d.ts +34 -4
  92. package/dist/utils/withdrawal.d.ts +28 -1
  93. package/dist/wallets/multiSourceWithdrawal.d.ts +36 -0
  94. package/dist/wallets/walletConnectors/index.js +42 -42
  95. package/package.json +6 -6
  96. package/dist/clients/chunk-6EU6CXNH.js +0 -20
  97. /package/dist/clients/{chunk-4DBUYTEE.js → chunk-LICTGZXW.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,91 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 12.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d23a235: Convert: pick the source and destination tokens on their own screens, with sources ordered by USD value.
8
+
9
+ Migration: each entry `convert.getBalances` returns now requires `unitPriceUsd`, the USD price of one whole token.
10
+ - 12aff0e: Withdrawals can offer sources on different chains and wallets, picked from one dropdown, each with its own balance and limits.
11
+
12
+ ### Patch Changes
13
+
14
+ - 3816333: Convert: enter an amount and see a live quote with its fees, with errors for low balance, the $1 minimum and failed quotes.
15
+ - eaf253f: Clicking the source balance on the Convert screen fills in the max amount.
16
+ - 5031269: Convert's editable "from" card is now outlined and the read-only "to" card is filled, so the input no longer looks disabled.
17
+ - 31a3c5f: Convert: tokens listed without an icon show Fun's standard token logos.
18
+ - 1952655: Convert: pressing Convert signs and sends the conversion and shows its progress and any error.
19
+ - ff2bfe0: Convert: balances and quotes stop refreshing while the Deposit tab is open.
20
+ - f910796: Prepare Convert to show transaction fee summaries.
21
+ - 5a0c458: Update polling interval on convert quotes
22
+ - 0e01e9d: Convert: the source wallet callback now receives the resolved source token asset instead of the chain id.
23
+ - 5a0c458: Convert resets for another conversion after success, or closes the modal with `closeOnSuccess`.
24
+ - 63de8f7: Convert: the swap-direction button now flips the From and To tokens and clears the amount.
25
+ - 5031269: The swap icon between Convert's from and to cards is now decorative instead of a button.
26
+ - f16e5b6: Convert's token screens keep a steadier height when switching chains, and drop the token heading when the list fails to load or is empty.
27
+ - 2282e6b: Convert: add the token rows, chain picker and "Select token" button for picking Convert tokens.
28
+ - 6cd3035: Tighten the gap above the Crypto / Cash toggle when header tabs and the destination token selector are both shown.
29
+ - 4147c6b: Make the whole empty space of the token swap amount field clickable, not just the digits.
30
+ - 0db4969: Checkout now follows the selected destination's chain for the receive icon and wallet balance checks.
31
+
32
+ ## 12.17.0
33
+
34
+ ### Minor Changes
35
+
36
+ - 411309d: Resolve assets and poll balances for the Convert widget; the balance getter is now one call for every listed asset and leaves out what it can't read instead of throwing
37
+ - 72658f7: Add conversion execution and settlement tracking for the Convert widget. Updated convert error stages.
38
+ - 719b75e: Lighter withdrawals take an optional `chainId` on `LighterWithdrawalConfig` (mainnet by default); under the Lighter Robinhood API key, `useLighterWithdrawalConfig` offers Fast withdrawals of USDG (Perps) from Lighter on Robinhood.
39
+ - 017c993: Lighter on Robinhood withdrawals offer Secure (USDG to Robinhood Chain) alongside Fast under the Lighter Robinhood API key, and the Secure withdrawal callback receives the Lighter instance to sign on.
40
+ - 0fbc19f: Track Swapped iframe step navigation via a new `fc_iframe_step_viewed` analytics event (deposit and withdrawal).
41
+
42
+ ### Patch Changes
43
+
44
+ - bd81739: Add Max for the Convert widget, keeping room for network fees on native-token sources
45
+ - 31e87b4: Re-check the balance and quote before a Convert is signed
46
+ - 5faac1f: Add live quotes for the Convert widget, refreshed while shown
47
+ - 5ef2971: Lighter RH wallet deposits take their recipient from the user's RH Lighter account and wait while that lookup is in flight.
48
+ - 81d1231: Lighter Robinhood checkouts deposit to the user's Robinhood Lighter account and show Robinhood Lighter as the receive chain.
49
+ - 81d1231: Recognize the Lighter Robinhood API key as its own Lighter customer: each Lighter key only looks up, stores and withdraws from its own Lighter instance.
50
+ - 7e45a8b: Keep deposit method-selection analytics consistent across Connect SDKs, including saved methods and direct crypto entry on mobile.
51
+ - 5cda130: Maintain mainnet Lighter withdrawals with the instance-aware core APIs.
52
+ - 78576f2: Lighter account lookups stay on the mainnet Lighter instance (no behavior change).
53
+ - 4e96bf5: Max on native-token withdrawals (SOL, ETH, BNB, POL) now leaves enough of the token to cover network fees.
54
+ - 94db347: No consumer-facing changes.
55
+ - 017c993: Support Lighter on Robinhood Secure withdrawals for supported spot assets and separate USDG spot balances while keeping Fast withdrawals perps-only.
56
+ - fab5649: Track Swapped iframe ready timing for checkout perf analysis.
57
+ - e12934d: Include quote attempt numbers in checkout and withdrawal performance analytics.
58
+ - b6e25e6: Track checkout quote timing for checkout perf analysis.
59
+ - 71a5174: Track per-step query load timing for checkout perf analysis.
60
+ - b1bfc18: Track fc_perf_step_ready timing for the withdrawal FOPS call, both in the withdrawal modal and the checkout modal's cashier withdraw-cash flow.
61
+ - be39ed3: Withdrawal USD limit callbacks now receive the selected source token, and withdrawals from non-stablecoin sources wait for a live price before they can be submitted.
62
+ - Updated dependencies [f6273ef]
63
+ - Updated dependencies [81d1231]
64
+ - Updated dependencies [1849e07]
65
+ - Updated dependencies [e005b0d]
66
+ - Updated dependencies [719b75e]
67
+ - Updated dependencies [78576f2]
68
+ - Updated dependencies [5cda130]
69
+ - Updated dependencies [d41c7b0]
70
+ - Updated dependencies [27f5a31]
71
+ - Updated dependencies [5ef2971]
72
+ - Updated dependencies [017c993]
73
+ - Updated dependencies [31e87b4]
74
+ - Updated dependencies [5faac1f]
75
+ - Updated dependencies [72658f7]
76
+ - Updated dependencies [27f5a31]
77
+ - Updated dependencies [5ef2971]
78
+ - Updated dependencies [4cf331b]
79
+ - Updated dependencies [ec98e8e]
80
+ - Updated dependencies [63aad8d]
81
+ - Updated dependencies [017c993]
82
+ - Updated dependencies [be39ed3]
83
+ - @funkit/api-base@9.1.0
84
+ - @funkit/utils@5.1.0
85
+ - @funkit/chains@2.6.0
86
+ - @funkit/connect-core@10.0.0
87
+ - @funkit/fun-relay@3.2.0
88
+
3
89
  ## 12.16.0
4
90
 
5
91
  ### Minor Changes
@@ -1,20 +1,16 @@
1
1
  import type { ConvertConfig } from '../domains/convert/types';
2
2
  import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext/types';
3
- export type { ConvertAsset, ConvertConfig, ConvertErrorResult, ConvertErrorStage, ConvertRecipientAddresses, ConvertResolvedAsset, ConvertSourceBalances, ConvertSourceWallet, ConvertSuccessResult, ConvertTransaction, ConvertVm, GetConvertSourceBalances, GetConvertSourceWallet, } from '../domains/convert/types';
3
+ export type { ConvertAsset, ConvertConfig, ConvertErrorResult, ConvertErrorStage, ConvertRecipientAddresses, ConvertResolvedAsset, ConvertAssetBalance, ConvertSourceWallet, ConvertSuccessResult, ConvertTransaction, ConvertVm, GetConvertBalances, GetConvertSourceWallet, } from '../domains/convert/types';
4
4
  export interface CreateAxiomDepositConfigParams {
5
5
  /** The checkout config the Deposit tab runs. */
6
6
  checkoutConfig: FunkitCheckoutConfig;
7
7
  /**
8
8
  * Source wallets, balances, recipients and callbacks for the Convert tab.
9
- * The screen doesn't read them yet, so passing them changes nothing today.
10
9
  * @experimental
11
10
  */
12
11
  convert?: ConvertConfig;
13
12
  }
14
13
  /**
15
14
  * Adds Axiom's Deposit | Convert header tabs to a checkout config.
16
- *
17
- * Convert is in development: it shows an empty swap screen until the
18
- * contracts in `convert` are wired to it.
19
15
  */
20
16
  export declare function createAxiomDepositConfig({ checkoutConfig, convert, }: CreateAxiomDepositConfigParams): FunkitCheckoutConfig;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  i18n_default
4
- } from "./chunk-7JYLS7IF.js";
4
+ } from "./chunk-YSAAJSWT.js";
5
5
 
6
6
  // src/clients/internal/nado/withdrawalErrors.ts
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitTranslation
4
- } from "./chunk-OB5GKTP2.js";
4
+ } from "./chunk-L6JL2XJY.js";
5
5
 
6
6
  // src/providers/FunkitConfigContext.tsx
7
7
  import {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  isExpectedNadoWithdrawalFailure,
4
4
  toNadoWithdrawalErrorMessage
5
- } from "./chunk-BKK2BFIP.js";
5
+ } from "./chunk-AELXD5XA.js";
6
6
  import {
7
7
  toWithdrawalAmountBaseUnit
8
- } from "./chunk-4DBUYTEE.js";
8
+ } from "./chunk-LICTGZXW.js";
9
9
  import {
10
10
  getAccount,
11
11
  signTypedData,
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-OODIKHYE.js";
14
14
  import {
15
15
  i18n_default
16
- } from "./chunk-7JYLS7IF.js";
16
+ } from "./chunk-YSAAJSWT.js";
17
17
  import {
18
18
  generateClientMetadataForTokenTransfer
19
19
  } from "./chunk-TKEBGMVW.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  i18n_default
4
- } from "./chunk-7JYLS7IF.js";
4
+ } from "./chunk-YSAAJSWT.js";
5
5
 
6
6
  // src/hooks/useFunkitTranslation.ts
7
7
  import { useTranslation } from "react-i18next";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  isCustomWithdrawalConfig
4
- } from "./chunk-4DBUYTEE.js";
4
+ } from "./chunk-LICTGZXW.js";
5
5
 
6
6
  // src/clients/internal/nado/withdrawalConfig.ts
7
7
  function isNadoWithdrawalConfig(config) {
@@ -0,0 +1,59 @@
1
+ "use client";
2
+
3
+ // src/consts/customers.ts
4
+ import {
5
+ AAVE_API_KEY,
6
+ AVANTIS_API_KEY,
7
+ BASED_API_KEY,
8
+ BETMOAR_API_KEY,
9
+ BSX_API_KEY,
10
+ FANATICS_API_KEY,
11
+ HYPERDASH_API_KEY,
12
+ LIGHTERXYZ_API_KEY,
13
+ LIGHTER_RH_API_KEY,
14
+ MALLARD_API_KEY,
15
+ MONAD_API_KEY,
16
+ MONKEY_TILT_API_KEY,
17
+ NADO_API_KEY,
18
+ OSTIUM_API_KEY,
19
+ PERPL_API_KEY,
20
+ POLYMARKET_API_KEY,
21
+ POLYMTRADE_API_KEY
22
+ } from "@funkit/api-base";
23
+ import {
24
+ LIGHTER_CHAIN_ID,
25
+ LIGHTER_CHAIN_IDS,
26
+ LIGHTER_RH_CHAIN_ID,
27
+ ROBINHOOD_MAINNET_CHAIN_ID
28
+ } from "@funkit/chains";
29
+ import { isTokenEquivalent } from "@funkit/utils";
30
+ import { mainnet } from "viem/chains";
31
+ var LIGHTER_API_KEY_BY_CHAIN_ID = {
32
+ [LIGHTER_CHAIN_ID]: LIGHTERXYZ_API_KEY,
33
+ [LIGHTER_RH_CHAIN_ID]: LIGHTER_RH_API_KEY
34
+ };
35
+
36
+ // src/utils/customer.ts
37
+ import {
38
+ useLighterAccountQuery,
39
+ useLighterAccountsQuery
40
+ } from "@funkit/connect-core";
41
+ import {
42
+ LIGHTER_CHAIN_ID as LIGHTER_CHAIN_ID2,
43
+ LIGHTER_RH_CHAIN_ID as LIGHTER_RH_CHAIN_ID2,
44
+ toLighterChainId
45
+ } from "@funkit/chains";
46
+ import {
47
+ LIGHTER_TRADING_MODE,
48
+ getLighterAccount,
49
+ getLighterAccountsByL1Address,
50
+ useInvalidateLighterAccount,
51
+ useLighterAccountQuery as useLighterAccountQuery2,
52
+ useLighterAccountsQuery as useLighterAccountsQuery2
53
+ } from "@funkit/connect-core";
54
+
55
+ export {
56
+ LIGHTER_API_KEY_BY_CHAIN_ID,
57
+ useLighterAccountQuery2 as useLighterAccountQuery,
58
+ useLighterAccountsQuery2 as useLighterAccountsQuery
59
+ };