@tomo-inc/wallet-connect-kit 0.0.14 → 0.0.16

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/README.md CHANGED
@@ -644,24 +644,24 @@ export function SwitchChainButton() {
644
644
  }
645
645
  ```
646
646
 
647
- ### Get Wallet Providers
647
+ ### Get Wallet Providers and Connectors
648
648
 
649
- Use the `useProviders` hook to get all available providers from the currently connected wallet. This is useful for wallets that support multiple chains (e.g., OKX Wallet supports EVM, Solana, and Aptos):
649
+ Use the `useConnectors` hook to get all available connectors from the currently connected wallet. This is useful for wallets that support multiple chains (e.g., OKX Wallet supports EVM, Solana, and Aptos):
650
650
 
651
651
  ```tsx
652
- import { useProviders } from "@tomo-inc/wallet-connect-kit";
652
+ import { useConnectors } from "@tomo-inc/wallet-connect-kit";
653
653
 
654
654
  export function ProvidersInfo() {
655
- const { providers, currentProvider } = useProviders();
655
+ const { connectors, currentProvider } = useConnectors();
656
656
 
657
- if (!providers) {
657
+ if (!connectors) {
658
658
  return <div>No wallet connected</div>;
659
659
  }
660
660
 
661
- // providers is an object with chain types as keys
661
+ // connectors is an object with chain types as keys
662
662
  // e.g., { evm: { provider, protocol, standard }, solana: { ... }, aptos: { ... } }
663
- const supportedChains = Object.keys(providers).filter(
664
- (chainType) => providers[chainType as keyof typeof providers] !== null
663
+ const supportedChains = Object.keys(connectors).filter(
664
+ (chainType) => connectors[chainType as keyof typeof connectors] !== null
665
665
  );
666
666
 
667
667
  return (
@@ -681,15 +681,15 @@ export function ProvidersInfo() {
681
681
  **Returns:**
682
682
 
683
683
  ```tsx
684
- interface UseProviders {
684
+ interface useConnectors {
685
685
  // All available providers from the current wallet, keyed by chain type
686
- providers: ConnectorProviders | null;
686
+ connectors: ConnectorProviders | null;
687
687
  // The currently active provider
688
688
  currentProvider: WalletProvider | null;
689
689
  }
690
690
  ```
691
691
 
692
- **Note:** `providers` contains all connectors supported by the current wallet. For example, if you connect OKX Wallet, `providers` may include `evm`, `solana`, and `aptos` connectors. The `currentProvider` is the provider currently being used for the active chain.
692
+ **Note:** `connectors` contains all connectors supported by the current wallet. For example, if you connect OKX Wallet, `connectors` may include `evm`, `solana`, and `aptos` connectors. The `currentProvider` is the provider currently being used for the active chain.
693
693
 
694
694
  ### Integration with Wagmi
695
695
 
@@ -805,7 +805,7 @@ type ChainType = "evm" | "solana" | "aptos" | "dogecoin";
805
805
  - `WalletConnectProvider` - Main Provider component
806
806
  - `useAccount` - Account information Hook
807
807
  - `useWalletConnect` - Connect Hook
808
- - `useProviders` - Providers information Hook (get all available providers from current wallet)
808
+ - `useConnectors` - Providers information Hook (get all available providers from current wallet)
809
809
  - `getChains` - Utility function to configure chains (can wrap backend API chains)
810
810
  - `getConnectors` - Utility function to configure connectors (from @tomo-inc/wallet-adaptor-base)
811
811
  - Types: `WalletConnectKitConfig`, `Chain`, `WalletConfig`, `UseAccount`, `ChainType`, `ModalView`, `ThemeConfig`, `UserLoginConfig`
@@ -1,4 +1,4 @@
1
- import { G as Ct, H as Z, I as Ie, d as q, J as Ee, e as Mt, K as Mn, p as Ae, N as Fn, O as Dn, Q as Rn, a as P, R as le, T as On, U as In, V as Ne, W as H, X as Ft, b as Y, Y as En, Z as Nn, f as ne, w as Dt, B as ue, n as I, c as se, _ as ce, $ as Kn, h as Bn, r as Rt, a0 as Ke, a1 as Ln, x as kn, a2 as _n, j as O, a3 as Ot, a4 as It, a5 as Et, a6 as He, a7 as Nt, E as Gn, a8 as Un, a9 as $n, aa as qe, ab as jn, ac as Wn, ad as zn, ae as Hn, af as qn, ag as Yn, ah as Xn, ai as Zn, aj as Jn, ak as Qn, al as es } from "./index-eV4PiITL.js";
1
+ import { G as Ct, H as Z, I as Ie, d as q, J as Ee, e as Mt, K as Mn, p as Ae, N as Fn, O as Dn, Q as Rn, a as P, R as le, T as On, U as In, V as Ne, W as H, X as Ft, b as Y, Y as En, Z as Nn, f as ne, w as Dt, B as ue, n as I, c as se, _ as ce, $ as Kn, h as Bn, r as Rt, a0 as Ke, a1 as Ln, x as kn, a2 as _n, j as O, a3 as Ot, a4 as It, a5 as Et, a6 as He, a7 as Nt, E as Gn, a8 as Un, a9 as $n, aa as qe, ab as jn, ac as Wn, ad as zn, ae as Hn, af as qn, ag as Yn, ah as Xn, ai as Zn, aj as Jn, ak as Qn, al as es } from "./index-DrBi1SXh.js";
2
2
  import { Fragment as ts } from "react";
3
3
  function Kt(t, e) {
4
4
  if (!Array.isArray(e))
@@ -11,10 +11,10 @@
11
11
  }
12
12
  })();
13
13
 
14
- import { f as T, a as R, c as O, b as Ot, i as F, p as z, d as le, n as M, P as he, e as Ft, L as ce, S as ue, g as de, m as Nt, h as Gt, r as Wt, j as me, s as $, k as H, l as et } from "./index-eV4PiITL.js";
15
- import { A as Zi, q as Ki, M as Ji, z as Qi, y as ts, w as es, v as is, u as ss, C as os, E as ns, t as as, o as rs, D as ls, x as hs, F as cs, B as us } from "./index-eV4PiITL.js";
16
- import { i as fe, e as _t, p as pe, a as b, s as ge, m as ye, b as v, c as J, d as y, f as ve, g as xe, h as Pe, j as zt, k as it, l as $t, n as Te, F as Ht, o as st, q as De, r as ot, t as Xt, u as Se, S as Ee, v as Ae, w as V, x as N, y as G, z as nt, A as Re, B as Le, C as Ce, D as B, E as je, G as Ve } from "./features-animation-DOhNzlMd.js";
17
- import { K as ms, N as fs, V as ps, a4 as gs, H as ys, a2 as vs, P as xs, Q as Ps, R as Ts, T as Ds, U as Ss, W as Es, J as As, _ as Rs, X as Ls, Y as Cs, Z as js, M as Vs, a1 as Bs, a3 as Ms, $ as ws, O as ks, a0 as bs, L as Us, I as Is } from "./features-animation-DOhNzlMd.js";
14
+ import { f as T, a as R, c as O, b as Ot, i as F, p as z, d as le, n as M, P as he, e as Ft, L as ce, S as ue, g as de, m as Nt, h as Gt, r as Wt, j as me, s as $, k as H, l as et } from "./index-DrBi1SXh.js";
15
+ import { A as Zi, q as Ki, M as Ji, z as Qi, y as ts, w as es, v as is, u as ss, C as os, E as ns, t as as, o as rs, D as ls, x as hs, F as cs, B as us } from "./index-DrBi1SXh.js";
16
+ import { i as fe, e as _t, p as pe, a as b, s as ge, m as ye, b as v, c as J, d as y, f as ve, g as xe, h as Pe, j as zt, k as it, l as $t, n as Te, F as Ht, o as st, q as De, r as ot, t as Xt, u as Se, S as Ee, v as Ae, w as V, x as N, y as G, z as nt, A as Re, B as Le, C as Ce, D as B, E as je, G as Ve } from "./features-animation-C9buMQ2V.js";
17
+ import { K as ms, N as fs, V as ps, a4 as gs, H as ys, a2 as vs, P as xs, Q as Ps, R as Ts, T as Ds, U as Ss, W as Es, J as As, _ as Rs, X as Ls, Y as Cs, Z as js, M as Vs, a1 as Bs, a3 as Ms, $ as ws, O as ks, a0 as bs, L as Us, I as Is } from "./features-animation-C9buMQ2V.js";
18
18
  import { jsx as Be } from "react/jsx-runtime";
19
19
  import { useContext as Q, useId as Me, useEffect as we, useCallback as ke, Component as be } from "react";
20
20
  const at = (t, e) => Math.abs(t - e);