@funkit/connect 12.19.0 → 12.20.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 (76) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/clients/{chunk-FOXMRDKD.js → chunk-2BBOZQLZ.js} +1 -1
  3. package/dist/clients/{chunk-R25GIAD5.js → chunk-PZSKO3BJ.js} +1 -0
  4. package/dist/clients/{chunk-YSAAJSWT.js → chunk-R5VAX6YA.js} +8 -0
  5. package/dist/clients/{chunk-L6JL2XJY.js → chunk-TFIJZTGQ.js} +1 -1
  6. package/dist/clients/{chunk-KH2HLTHP.js → chunk-TLFE74BL.js} +4 -4
  7. package/dist/clients/{chunk-AELXD5XA.js → chunk-VFKEUHZT.js} +1 -1
  8. package/dist/clients/fanatics.js +2 -2
  9. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  10. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  11. package/dist/clients/internal/nado/withdrawalForm.js +4 -4
  12. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  13. package/dist/clients/lighter.css +8 -1
  14. package/dist/clients/lighter.js +4 -4
  15. package/dist/clients/lighterRh.d.ts +44 -0
  16. package/dist/clients/lighterRh.js +51 -0
  17. package/dist/clients/mallard.js +2 -2
  18. package/dist/clients/nado.js +5 -5
  19. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
  20. package/dist/components/TokenSwapWidget/TokenSelectButton/TokenSelectButton.d.ts +1 -1
  21. package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +14 -4
  22. package/dist/components/TokenSwapWidget/TokenSwapPercentOptions/TokenSwapPercentOptions.d.ts +9 -0
  23. package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +4 -2
  24. package/dist/components/TokenSwapWidget/TokenSwapWidgetSkeleton/TokenSwapWidgetSkeleton.d.ts +3 -0
  25. package/dist/consts/customers.d.ts +5 -1
  26. package/dist/domains/convert/assets.d.ts +32 -0
  27. package/dist/domains/convert/inputAmount.d.ts +24 -21
  28. package/dist/domains/convert/reducer.d.ts +11 -6
  29. package/dist/domains/convert/screen.d.ts +6 -1
  30. package/dist/domains/convert/view.d.ts +4 -0
  31. package/dist/index.css +8 -1
  32. package/dist/index.js +1330 -1158
  33. package/dist/modals/CheckoutModal/Convert/ConvertAssetList.d.ts +1 -1
  34. package/dist/modals/CheckoutModal/Convert/ConvertAssetRow.d.ts +1 -19
  35. package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +1 -1
  36. package/dist/modals/CheckoutModal/Convert/ConvertSelectSourceStep.d.ts +0 -12
  37. package/dist/providers/ConvertProvider.d.ts +2 -0
  38. package/dist/shadow-css.js +1 -1
  39. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  44. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/index.js +62 -62
  49. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  50. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  51. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  52. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  53. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  54. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  55. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  56. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  57. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  58. package/package.json +4 -4
  59. package/dist/wallets/walletConnectors/{chunk-OVDCDVFX.js → chunk-34B7OJNT.js} +3 -3
  60. package/dist/wallets/walletConnectors/{chunk-JJBLW4IU.js → chunk-4FHNLTR3.js} +3 -3
  61. package/dist/wallets/walletConnectors/{chunk-TM7UBV3Q.js → chunk-ALGPGI6V.js} +3 -3
  62. package/dist/wallets/walletConnectors/{chunk-MWB6LFSG.js → chunk-BBB2J3US.js} +3 -3
  63. package/dist/wallets/walletConnectors/{chunk-IWPW26AL.js → chunk-BBDNB5TQ.js} +3 -3
  64. package/dist/wallets/walletConnectors/{chunk-53MYTA42.js → chunk-CU5J53XR.js} +3 -3
  65. package/dist/wallets/walletConnectors/{chunk-USLZMUJ3.js → chunk-HOCKAU5H.js} +3 -3
  66. package/dist/wallets/walletConnectors/{chunk-RJF2YEZ5.js → chunk-IA5432IR.js} +3 -3
  67. package/dist/wallets/walletConnectors/{chunk-ASTCNVJC.js → chunk-IWOMSW64.js} +3 -3
  68. package/dist/wallets/walletConnectors/{chunk-KE4CWI3A.js → chunk-NXWG6FG2.js} +3 -3
  69. package/dist/wallets/walletConnectors/{chunk-RQYEGJKL.js → chunk-RFCZYLNR.js} +3 -3
  70. package/dist/wallets/walletConnectors/{chunk-ANODOMIN.js → chunk-RXRYHMRI.js} +3 -3
  71. package/dist/wallets/walletConnectors/{chunk-PPQ6L4K2.js → chunk-SR5CZR3L.js} +3 -3
  72. package/dist/wallets/walletConnectors/{chunk-TIHTQ3OB.js → chunk-TRZDAXCQ.js} +3 -3
  73. package/dist/wallets/walletConnectors/{chunk-F45CUFRR.js → chunk-U52QO5HF.js} +3 -3
  74. package/dist/wallets/walletConnectors/{chunk-A5POD5SV.js → chunk-XODA5ESL.js} +3 -3
  75. package/dist/wallets/walletConnectors/{chunk-FYPQ3HP4.js → chunk-YRMBR6NA.js} +3 -3
  76. package/dist/wallets/walletConnectors/{chunk-65ULY6OC.js → chunk-ZSSSLFQF.js} +3 -3
@@ -12,42 +12,45 @@ export declare function parseConvertInputToBaseUnits({ inputValue, unit, tokenAm
12
12
  decimals: number;
13
13
  }): bigint | undefined;
14
14
  /**
15
- * Max as plain field text in the current unit, rounded down so the field never
16
- * shows more than the user has. Display only: the exact amount is kept apart.
17
- * Empty in USD mode without a price, rather than a token amount under a `$`.
15
+ * A preset amount as plain field text in the current unit, rounded down so the
16
+ * field never shows more than the user has. Display only: the exact amount is
17
+ * kept apart. Empty in USD mode without a price, rather than a token amount under a `$`.
18
18
  */
19
- export declare function formatConvertMaxInput({ baseUnits, decimals, unit, unitPriceUsd, }: {
19
+ export declare function formatConvertPresetInput({ baseUnits, decimals, unit, unitPriceUsd, }: {
20
20
  baseUnits: bigint;
21
21
  decimals: number;
22
22
  unit: AmountUnit;
23
23
  unitPriceUsd: number | undefined;
24
24
  }): string;
25
- /** The field text and converted amounts for an exact Max, at `unitPriceUsd`. */
26
- export declare function getConvertMaxDisplay({ maxBaseUnits, decimals, unit, unitPriceUsd, }: {
27
- maxBaseUnits: bigint;
28
- decimals: number;
29
- unit: AmountUnit;
30
- unitPriceUsd: number | undefined;
31
- }): AmountInUnits & {
32
- inputValue: string;
33
- };
25
+ /**
26
+ * A percentage preset's exact amount, or `undefined` when there's nothing to fill.
27
+ * - Max keeps the gas reserve, so it always fits. Like checkout, it falls back to
28
+ * the full balance while the reserve loads, and is 0 when gas takes it all.
29
+ * - The rest take a share of the full balance, so on a native token they can
30
+ * exceed Max, which raises the usual insufficient-balance issue.
31
+ * - A share that rounds to 0 (dust) fills nothing rather than a silent "0".
32
+ */
33
+ export declare function getConvertPercentBaseUnits({ percent, balanceBaseUnits, maxBaseUnits, }: {
34
+ percent: number;
35
+ balanceBaseUnits: bigint;
36
+ maxBaseUnits: bigint | null;
37
+ }): bigint | undefined;
34
38
  export interface ConvertAmount extends AmountInUnits {
35
- /** The field text; Max's rounded-down display while Max is on. */
39
+ /** The field text; the preset's rounded-down display while a preset is on. */
36
40
  inputValue: string;
37
41
  unit: AmountUnit;
38
- /** What to quote: Max's exact amount, or the typed one. */
42
+ /** What to quote: the preset's exact amount, or the typed one. */
39
43
  baseUnits: bigint | undefined;
40
- isMax: boolean;
41
44
  }
42
45
  /**
43
- * The amount a draft describes at `unitPriceUsd`. While Max is on, the field
44
- * and converted amounts derive from it, so a price change or unit flip never
45
- * leaves them stale.
46
+ * The amount a draft describes at `unitPriceUsd`. While a preset is on, the
47
+ * field and converted amounts derive from it, so a price change or unit flip
48
+ * never leaves them stale.
46
49
  */
47
- export declare function getConvertAmount({ inputValue, unit, maxBaseUnits, decimals, unitPriceUsd, }: {
50
+ export declare function getConvertAmount({ inputValue, unit, presetBaseUnits, decimals, unitPriceUsd, }: {
48
51
  inputValue: string;
49
52
  unit: AmountUnit;
50
- maxBaseUnits: bigint | undefined;
53
+ presetBaseUnits: bigint | undefined;
51
54
  decimals: number;
52
55
  unitPriceUsd: number | undefined;
53
56
  }): ConvertAmount;
@@ -9,11 +9,11 @@ import type { ConvertResolvedAsset } from './types';
9
9
  export interface ConvertDraft {
10
10
  sourceKey: string | undefined;
11
11
  destinationKey: string | undefined;
12
- /** The field text as typed; stale while Max is on, which derives its own. */
12
+ /** The field text as typed; stale while a preset is on, which derives its own. */
13
13
  inputValue: string;
14
14
  unit: AmountUnit;
15
- /** Max's exact amount; typing clears it. */
16
- maxBaseUnits: bigint | undefined;
15
+ /** A percentage preset's exact amount (Max included); typing clears it. */
16
+ presetBaseUnits: bigint | undefined;
17
17
  }
18
18
  /** What the user converted, frozen when they did; a locked screen reads only this. */
19
19
  export interface ConvertSnapshot {
@@ -51,8 +51,8 @@ export type ConvertEvent = {
51
51
  type: 'AMOUNT_EDITED';
52
52
  inputValue: string;
53
53
  } | {
54
- type: 'MAX_SET';
55
- maxBaseUnits: bigint;
54
+ type: 'PRESET_SET';
55
+ presetBaseUnits: bigint;
56
56
  }
57
57
  /** Converts the field at the live price; ignored without one. */
58
58
  | {
@@ -61,6 +61,11 @@ export type ConvertEvent = {
61
61
  } | {
62
62
  type: 'SOURCE_PICKED';
63
63
  sourceKey: string;
64
+ }
65
+ /** Balances loaded with no source picked: opens on the most valuable token. */
66
+ | {
67
+ type: 'SOURCE_PRESELECTED';
68
+ sourceKey: string;
64
69
  } | {
65
70
  type: 'DESTINATION_PICKED';
66
71
  destinationKey: string;
@@ -104,7 +109,7 @@ export declare const INITIAL_CONVERT_STATE: ConvertState;
104
109
  /**
105
110
  * Convert's draft and submission. Pure: the provider runs the wallet steps
106
111
  * and polling, and dispatches what they report.
107
- * - An edit, Max, pick or retry ends a `failed` submission; a locked one ignores them.
112
+ * - An edit, preset, pick or retry ends a `failed` submission; a locked one ignores them.
108
113
  * - `CONVERT_STARTED` freezes the snapshot; nothing live reaches it after.
109
114
  * - `untrackable` is final; `completed` ends with `SUCCESS_SHOWN`, which keeps
110
115
  * the tokens and drops the amount, since it was converted.
@@ -125,6 +125,10 @@ export type ConvertActionButton =
125
125
  | {
126
126
  action: 'converted';
127
127
  }
128
+ /** The first balance read is out, so there's no source yet. */
129
+ | {
130
+ action: 'loadingBalance';
131
+ }
128
132
  /** A native EVM source's gas price is loading, so Max and the reserve are unknown. */
129
133
  | {
130
134
  action: 'estimatingGas';
@@ -150,10 +154,11 @@ export type ConvertActionButton =
150
154
  * arrives, and waits out a refresh like checkout's confirmation screen. A
151
155
  * submission in flight overrides all of it.
152
156
  */
153
- export declare function getConvertActionButton({ submission, issue, quote, isQuoteFetching, isLookupFetching, isFeeReserveLoading, }: {
157
+ export declare function getConvertActionButton({ submission, issue, quote, isAwaitingBalances, isQuoteFetching, isLookupFetching, isFeeReserveLoading, }: {
154
158
  submission: ConvertSubmission | undefined;
155
159
  issue: ConvertScreenIssue | undefined;
156
160
  quote: ConvertQuote | undefined;
161
+ isAwaitingBalances?: boolean;
157
162
  isQuoteFetching: boolean;
158
163
  /** A source wallet, recipient or balance read is running. */
159
164
  isLookupFetching: boolean;
@@ -56,12 +56,16 @@ export interface ConvertView {
56
56
  balances: ConvertBalances | undefined;
57
57
  sourceAsset: ConvertResolvedAsset | undefined;
58
58
  destinationAsset: ConvertResolvedAsset | undefined;
59
+ /** The first balance read is out, so there's no source to show yet. */
60
+ isAwaitingBalances: boolean;
59
61
  /** Token units; `undefined` while unknown, so it never reads as 0. */
60
62
  sourceTokenBalance: number | undefined;
61
63
  destinationTokenBalance: number | undefined;
62
64
  amount: ConvertAmount;
63
65
  /** The source's Max; `null` while unknown or locked. */
64
66
  maxBaseUnits: bigint | null;
67
+ /** Shows the percentage presets: the source has a balance to take a share of. */
68
+ canSelectPercent: boolean;
65
69
  /** Shows the unit switch; off without a price to convert with. Locked, the widget disables it. */
66
70
  canToggleUnit: boolean;
67
71
  quote: ConvertQuote | undefined;
package/dist/index.css CHANGED
@@ -14701,7 +14701,7 @@
14701
14701
  }
14702
14702
  }
14703
14703
 
14704
- /* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#H4sIAAAAAAAAA7VYy27sNgzd369QcTcZoAo8D-dOHaAouu-u-4KWOLY6smTI8jxa5N8LP2NZnsS6bTcJTPGQR9IhqeT5j235lz3s9lvy9xdCCrjRHEWW24TEu7i8vfbGq-A2T8g2ii7XxtZ_H-Ko8Xn78jzGSXKonr5WujYMKctBZUhLyHDjJTh2CXxwiaasqDWgqhOaDv0j8by0vBdgzmjpDMC0sqhsQEarz6hmGdejZbOuhMqoUBctWPCGTwIs5WhByFAo0-okTAFWaBWOLUqJNpjuVdicG7iCpP9BiJPU17ANK2SW4q0T1_clLTRv2YcKpbpCWSKn4mSgWFKl60ClBi5U5meIvQy7zkeoodj2x6grQPd7AtmHQw7hkLiFlMCbnVDT8Y9eJzaJp840Qb20qFQbjmbIFZEfRFFqY0FZx_k4ZyWUsALkhBcDyZ7a_kMo2UflbfM6v7SouuRu2FX95Pj9_SRqErq2n-IHLNb1mJCIq_tOSNAVvWhVOPj8Ssdp4upo1wtyprjBvHDlo86sLtsg1AAXdZWQC5gnSs25NYiu7H_TqZC4mcHaLIG4VFurCzdj5K-7oRcchvJoVvQFTdMSE5ILzlG99qc4bNmtMggYt155QJAwH6DXi_BBgDWCewBdM_weYz-eXI9wAcNvRYgHw--DDX82_DxoGt7xeQsZlEhvUy2O1ntCoLa6sVXMaClTMDSrrUWTkMpCKtFd69PVqkK3-_MkoVdMz8LS0btlwEVVSriPmJHyS7eBFNg5M7pWnDIttZnUbftddYX76-i2-TQvtXldpNPZ9VFL2KxjYdFYAeb-O97sGgoG2Lmj8O82iJ9s8P-KnuSNSlbmqJBpxRdP5-Sq4CSxvfbmN-XCIGsKPyFMy7poxTlUQTNZ3CrIQkP5mh5F6ElaaYXz2nivmN6pK5YJpdx5V41vqKWnljNXZ2UaHuBnwsWl_7nYPx4904B8ZTmys64t5QKkzoa30RITJ4pParbsn_fQXZY6zmwidheZkC3Z-uc8Zd29-_uxO7SZ0BMULaodmKKTjS6BCXsn0fOuIggVUqGort3T-9ODgZQkeo5nEPdCdnHfrf2HwST22bvIHuWnO_Tp-lxLYX8pkAtorgRREVCcPE3mx7eXY3nrJs_7Xz_t5_z_AoS8TZ12vdPSLJpPoxl070MPuzl0tDjQwwI09qCLhNMFqEf48E747R9KAONWTxEAAA */
14704
+ /* vanilla-extract-css-ns:src/components/Dialog/DialogContent.css.ts.vanilla.css?source=#H4sIAAAAAAAAA7VYy47rNgzd369QcTcToBo4r7m5HqAouu-u-4KWGFuNLBmynEeL-ffCz7EsZ2JNezcJTPOQlHTIo-T5z3Xxt91ttmvyzxdCcrjSDEWa2ZjsN_vi-toZL4LbLCbrKDpfalv3vNtHtc_bl-chTpxB-fS11JVhSFkGKkVaQIorL8GhTeCDCzRFSa0BVR7RtOifieel5S0Hc0JLJwCmlUVlAzJafUI1ybgcLev3SqiUCnXWggUv-CjAUo4WhAyFMq2OwuRghVafwJ7R2HBYXki0wau8CJtxAxeQ9H8IcZT6ErZWhcxSvLac_FzSXPOm-lB-lRcoCuRUHA3kc2R2HajUwIVK_Qx7L8Om9RGq79HtIWr71n0eQbbhkF04ZN9ACuD1Sqhp649eRzaJx9Y0Qr00qEQbjqbPFZGfRF5oY0FZx_kwrUooYQXIUV0MJHtqxhahZBsV19Xr9NCi8py5YReNocPnx1BUJ3Rt3_d3qlg2mkIiLh5XIUEXjLCQcA9G06JQ8Jgdg565lNx03J6QtzfPsGegrNVFE4Qa4KIqY3IG80SpOTUG0U6Q33UiJK4msCZLIC7R1urczRj5793QMw59p9Vv9BlNPV1jkgnOUb12u9gv2W1YCBB8r9MgiON30Mv5fCfAEu7egS6R3_vYj0XwHi5ARxeEuKOjHyz4kY560CRcPHgD6ZlIr2MuDtZbTKCyuraVzGgpEzA0raxFE5PSQiLRfdelq1SJrpDwOKYXTE7C0sG7qYCLspBwGzBDyS_tAhJgp9ToSnHKtNRm1LfNc9k27m-D2-phXmqzKk_GMvjRSFgtq8KisQLM7Q-82iUlGGCntoT_tkB8sMAfFT3OapYszFEi04rP7s7RZcFRYnPs9TflwiCrGz8mTMsqb8jZd0GtLG4XpKGhfE4PJPQorbTCaW-8d0zn1DbLqKTMuaIN17G5W5ujq5M2DQ_wC-Hi3H3Ozo97Nz4gX1mG7KQrS7kAqdP-mjVXiRPFL2ry2t_vfrrMTZyJIrYHGZM1Wfv7PK66_QnRyW4_ZkJ3UDSoRjBFSxtdABP2RqLnTUkQSqRCUV25u_eXBwMpSfS8n0DcA9nsu2ntXwxGsU_eQXYoP92uS9flmgv7a45cQH0kiIqA4uRppB_fXg7FtVWe9x9SzeP0nwlC3sZOm85pToumajSBbn3objOFDhYHupuB7j3obMHJDNQrePde8Nu_p8xgx9ERAAA */
14705
14705
  [data-rk] ._1pzt4231 {
14706
14706
  max-height: 525px;
14707
14707
  max-width: 100vw;
@@ -14726,6 +14726,9 @@
14726
14726
  [data-rk] ._1pzt4231:has(#confirmation-page) {
14727
14727
  max-height: 825px;
14728
14728
  }
14729
+ [data-rk] ._1pzt4231:has(#convert-page) {
14730
+ max-height: 825px;
14731
+ }
14729
14732
  [data-rk] ._1pzt4231:has(#complete-page) {
14730
14733
  max-height: 825px;
14731
14734
  }
@@ -14786,6 +14789,10 @@
14786
14789
  max-height: 80vh;
14787
14790
  max-height: 95svh;
14788
14791
  }
14792
+ [data-rk] ._1pzt4238:has(#convert-page) {
14793
+ max-height: 80vh;
14794
+ max-height: 95svh;
14795
+ }
14789
14796
  [data-rk] ._1pzt423a {
14790
14797
  min-width: initial;
14791
14798
  width: 100vw;