@funkit/connect 11.4.0 → 11.5.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 (80) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/clients/{chunk-5MY7WMEJ.js → chunk-3U55HYGJ.js} +2 -2
  3. package/dist/clients/{chunk-BPDLF2R6.js → chunk-DSZHYQPX.js} +1 -1
  4. package/dist/clients/chunk-MSLPLXR2.js +30 -0
  5. package/dist/clients/{chunk-3Y5EIONT.js → chunk-UMU5S2WF.js} +30 -39
  6. package/dist/clients/chunk-WCQ6HJ27.js +13 -0
  7. package/dist/clients/{chunk-XJTRLB7W.js → chunk-ZEDRWRYA.js} +15 -13
  8. package/dist/clients/fanatics.js +4 -4
  9. package/dist/clients/internal/nado/withdrawalCallback.js +2 -9
  10. package/dist/clients/internal/nado/withdrawalConfig.d.ts +4 -9
  11. package/dist/clients/internal/nado/withdrawalConfig.js +3 -7
  12. package/dist/clients/internal/nado/withdrawalErrors.d.ts +6 -10
  13. package/dist/clients/internal/nado/withdrawalErrors.js +1 -2
  14. package/dist/clients/internal/nado/withdrawalForm.css +82 -74
  15. package/dist/clients/internal/nado/withdrawalForm.d.ts +1 -1
  16. package/dist/clients/internal/nado/withdrawalForm.js +12 -45
  17. package/dist/clients/internal/nado/withdrawalStatus.d.ts +1 -15
  18. package/dist/clients/internal/nado/withdrawalStatus.js +11 -61
  19. package/dist/clients/lighter.css +260 -252
  20. package/dist/clients/lighter.js +6 -9
  21. package/dist/clients/nado.d.ts +2 -2
  22. package/dist/clients/nado.js +10 -16
  23. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +263 -255
  24. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +3 -3
  25. package/dist/clients/polymarket/index.css +263 -255
  26. package/dist/clients/polymarket/index.js +3 -3
  27. package/dist/components/Dropdown/BaseDropdown.css.d.ts +1 -0
  28. package/dist/components/Dropdown/BaseDropdown.d.ts +0 -1
  29. package/dist/consts/funkit.d.ts +2 -0
  30. package/dist/hooks/track/analytics/events.d.ts +35 -3
  31. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +1 -0
  32. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +11 -3
  33. package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +1 -0
  34. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +24 -1
  35. package/dist/hooks/useBluvo.d.ts +7 -2
  36. package/dist/hooks/useSwappedTheme.d.ts +3 -0
  37. package/dist/index.css +93 -85
  38. package/dist/index.js +12822 -12797
  39. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +5 -11
  40. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +3 -1
  41. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
  42. package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -1
  43. package/dist/providers/FunkitProvider.d.ts +1 -0
  44. package/dist/shadow/adoptStyles.d.ts +5 -0
  45. package/dist/shadow-css.d.ts +1 -0
  46. package/dist/shadow-css.js +2 -0
  47. package/dist/utils/swapped.d.ts +8 -6
  48. package/dist/wallets/walletConnectors/index.js +9 -9
  49. package/package.json +11 -6
  50. package/shadow-css/package.json +3 -0
  51. package/dist/clients/chunk-2576N7PQ.js +0 -44
  52. package/dist/clients/chunk-3P2C436B.js +0 -20
  53. package/dist/clients/chunk-63XTVHO3.js +0 -19
  54. package/dist/clients/chunk-6T6URLBM.js +0 -33
  55. package/dist/clients/chunk-EQFVPSR2.js +0 -40
  56. package/dist/clients/chunk-FM7SFGAV.js +0 -106
  57. package/dist/clients/chunk-JFDRLSYM.js +0 -42
  58. package/dist/clients/chunk-TZGKB6WY.js +0 -160
  59. package/dist/clients/chunk-VIAEAD75.js +0 -61
  60. package/dist/clients/chunk-WZRW6WUM.js +0 -112
  61. package/dist/clients/chunk-Z7HTQFEO.js +0 -69
  62. package/dist/clients/internal/nado/consts.d.ts +0 -22
  63. package/dist/clients/internal/nado/consts.js +0 -15
  64. package/dist/clients/internal/nado/encoding.d.ts +0 -25
  65. package/dist/clients/internal/nado/encoding.js +0 -11
  66. package/dist/clients/internal/nado/errors.d.ts +0 -68
  67. package/dist/clients/internal/nado/errors.js +0 -19
  68. package/dist/clients/internal/nado/fetch.d.ts +0 -15
  69. package/dist/clients/internal/nado/fetch.js +0 -9
  70. package/dist/clients/internal/nado/gateway.d.ts +0 -61
  71. package/dist/clients/internal/nado/gateway.js +0 -17
  72. package/dist/clients/internal/nado/hooks.d.ts +0 -208
  73. package/dist/clients/internal/nado/hooks.js +0 -21
  74. package/dist/clients/internal/nado/indexer.d.ts +0 -43
  75. package/dist/clients/internal/nado/indexer.js +0 -13
  76. package/dist/clients/internal/nado/typedData.d.ts +0 -80
  77. package/dist/clients/internal/nado/typedData.js +0 -10
  78. package/dist/clients/internal/nado/withdrawalTypes.d.ts +0 -49
  79. package/dist/clients/internal/nado/withdrawalTypes.js +0 -1
  80. package/dist/utils/safeBigInt.d.ts +0 -5
@@ -11,7 +11,7 @@ import type { CustomWithdrawalConfig, LighterRouteType, TokenInfo, WalletWithdra
11
11
  /** Stable method ids for the Fast / Secure options (used for tracking + switching). */
12
12
  export declare const LIGHTER_FAST_METHOD_ID = "lighter-fast";
13
13
  export declare const LIGHTER_SECURE_METHOD_ID = "lighter-secure";
14
- export { LIGHTER_DEFAULT_SECURE_MIN_WITHDRAWAL_AMOUNTS, LIGHTER_FAST_MAX_WITHDRAWAL_USD, LIGHTER_ROUTE_TYPE, LIGHTER_SECURE_ASSETS_BY_INDEX, LIGHTER_STAKING_POOL_INDEX, LIGHTER_STAKING_THRESHOLD_LIT, LIGHTER_UNSTAKED_FEE_TOKENS, LIGHTER_USDC_SPOT_SYMBOL, getLighterBaseSymbol, getLighterSecureMainnetAddress, resolveLighterAssetIndex, resolveLighterSecureRouteType, resolveLighterSharePrice, resolveLighterUnstakedFeeTokens, } from '@funkit/connect-core/clients/lighter';
14
+ export { LIGHTER_DEFAULT_SECURE_MIN_WITHDRAWAL_AMOUNTS, LIGHTER_FAST_MAX_WITHDRAWAL_USD, LIGHTER_ROUTE_TYPE, LIGHTER_SECURE_ASSETS_BY_INDEX, LIGHTER_STAKING_POOL_INDEX, LIGHTER_STAKING_THRESHOLD_LIT, LIGHTER_UNSTAKED_FEE_TOKENS, LIGHTER_USDC_SPOT_SYMBOL, getLighterBaseSymbol, getLighterSecureMainnetAddress, resolveLighterAssetIndex, resolveLighterSecureRouteType, } from '@funkit/connect-core/clients/lighter';
15
15
  /**
16
16
  * The selected source token as identified on Lighter's own L2, rather than by
17
17
  * its mainnet bridge address — two Secure selections can share one mainnet
@@ -45,23 +45,16 @@ export declare function resolveLighterConfirmedTarget({ isLighterSecure, mainnet
45
45
  export declare function LighterFastMaxExceededMessage({ onSwitchToSecure, }: {
46
46
  onSwitchToSecure: () => void;
47
47
  }): React.JSX.Element;
48
- /**
49
- * Share price for the staking pool, read off the pool's own account. Kept a
50
- * separate query from the user's account: a user's `shares[]` carries entry
51
- * state only, so current value is unobtainable without the pool's NAV.
52
- */
53
- export declare function useLighterStakingSharePrice(enabled: boolean): number | undefined;
54
48
  /**
55
49
  * Fetches the Lighter account for the data the SDK still derives itself:
56
- * `shares` for the unstaked-fee gate, and `assets` to resolve the L2 asset index
57
- * of a Secure selection. Withdrawable balances are the integrator's to supply
58
- * (`withdrawalSourceTokenBalance`), so nothing here computes them.
50
+ * `assets`, to resolve the L2 asset index of a Secure selection. Withdrawable
51
+ * balances are the integrator's to supply (`withdrawalSourceTokenBalance`), so
52
+ * nothing here computes them.
59
53
  */
60
54
  export declare function useLighterWithdrawalBalances({ accountIndex, }: {
61
55
  accountIndex: LighterAccountIndex | undefined;
62
56
  }): {
63
57
  assets: import("@funkit/connect-core").LighterAsset[];
64
- shares: import("@funkit/connect-core").LighterShare[];
65
58
  isLoading: boolean;
66
59
  };
67
60
  type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig;
@@ -77,6 +70,7 @@ export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, set
77
70
  connectedAddress: `0x${string}` | undefined;
78
71
  lighterAssets: import("@funkit/connect-core").LighterAsset[];
79
72
  lighterFastUnstakedFee: number;
73
+ isLighterFastUnstakedFeeFetched: boolean;
80
74
  invalidateLighterAccount: () => void;
81
75
  };
82
76
  /**
@@ -12,7 +12,7 @@ export declare function shouldShowUseConnectedWallet({ disableConnectedWallet, i
12
12
  isConnected: boolean;
13
13
  connectedWalletAddress: string | undefined;
14
14
  }): boolean;
15
- export declare function WithdrawRecipientAddress({ config, recipientAddress, setRecipientAddress, selectedChainId, selectedToken, isValidAddress, isRiskyAddress, }: {
15
+ export declare function WithdrawRecipientAddress({ config, recipientAddress, setRecipientAddress: setRecipientAddressProp, selectedChainId, selectedToken, isValidAddress, isRiskyAddress, onAddressAutofilled, onAddressChanged, }: {
16
16
  config: FunkitWithdrawalConfig;
17
17
  recipientAddress: string;
18
18
  setRecipientAddress: (s: string) => void;
@@ -20,4 +20,6 @@ export declare function WithdrawRecipientAddress({ config, recipientAddress, set
20
20
  selectedToken: string | undefined;
21
21
  isValidAddress: boolean;
22
22
  isRiskyAddress: boolean;
23
+ onAddressAutofilled?: (address: string) => void;
24
+ onAddressChanged?: (address: string, previousAddress: string) => void;
23
25
  }): React.JSX.Element;
@@ -3,7 +3,7 @@ import type { WithdrawalAmountSelectionType } from '../../hooks/track/analytics/
3
3
  import type { FunkitWithdrawalConfig, MultiMethodWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
4
4
  import type { SourceTokenOption } from '../../providers/FunkitCheckoutContext';
5
5
  export type { SourceTokenOption };
6
- export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountTooHigh, isWithdrawAmountAboveBalance, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, onAmountSelectionChange, }: {
6
+ export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountTooHigh, isWithdrawAmountAboveBalance, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, onAmountSelectionChange, onAmountChanged, onMaxButtonClicked, }: {
7
7
  config: Exclude<FunkitWithdrawalConfig, MultiMethodWithdrawalConfig>;
8
8
  sourceTokenBalance: string;
9
9
  /** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
@@ -37,4 +37,6 @@ export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdraw
37
37
  */
38
38
  sourceTokenUsdPrice?: number;
39
39
  onAmountSelectionChange?: (selectionType: WithdrawalAmountSelectionType) => void;
40
+ onAmountChanged?: (amount: string, previousAmount: string) => void;
41
+ onMaxButtonClicked?: (amount: string) => void;
40
42
  }): React.JSX.Element;
@@ -3,7 +3,7 @@ import type { LighterRouteType } from '@funkit/connect-core/clients/lighter';
3
3
  import type { ApiCheckoutClientMetadata, ApiFunkitCheckoutActionParams, ApiFunkitCheckoutConfig } from '@funkit/utils';
4
4
  import type { ReactNode } from 'react';
5
5
  import type { Address } from 'viem';
6
- import type { NadoWithdrawalCustomerConfig, NadoWithdrawalCustomerData } from '../../clients/internal/nado/withdrawalTypes';
6
+ import type { NadoWithdrawalCustomerConfig, NadoWithdrawalCustomerData } from '@funkit/connect-core/clients/nado';
7
7
  import type { PaymentMethodInfo } from '../../domains/paymentMethods';
8
8
  import type { CheckoutBlockedReason } from '../../modals/CheckoutModal/CheckoutBlockedReason';
9
9
  import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
@@ -10,6 +10,7 @@ import { type ModalSizes } from './ModalSizeContext';
10
10
  export declare const useThemeRootProps: () => {
11
11
  "data-rk": string;
12
12
  };
13
+ export declare const useThemeRootElement: () => Element | null;
13
14
  interface FunkitProviderInnerProps {
14
15
  initialChain?: number;
15
16
  id?: string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Safe to call on every mount. Same CSS again: nothing happens. New CSS: our
3
+ * `<style>` is rewritten in place, never stacked.
4
+ */
5
+ export declare function adoptFunkitStyles(root: ShadowRoot, css: string): void;
@@ -0,0 +1 @@
1
+ export declare const funkitShadowCss: string