@volr/react 0.1.54 → 0.1.57

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
@@ -29,7 +29,7 @@ function App() {
29
29
  }
30
30
 
31
31
  function YourApp() {
32
- const { evm, isLoggedIn, logout } = useVolr();
32
+ const { evm, evmAddress, isLoggedIn, logout } = useVolr();
33
33
 
34
34
  if (!isLoggedIn) {
35
35
  return <div>Please login</div>;
@@ -40,7 +40,7 @@ function YourApp() {
40
40
  address: '0x...',
41
41
  abi: erc20Abi,
42
42
  functionName: 'balanceOf',
43
- args: [evm.address],
43
+ args: [evmAddress],
44
44
  });
45
45
 
46
46
  // Send transaction
@@ -69,7 +69,8 @@ Main hook for wallet operations.
69
69
 
70
70
  ```tsx
71
71
  const {
72
- evm, // EvmNamespace - chain client factory + address
72
+ evm, // (chainId: number) => EvmClient
73
+ evmAddress, // `0x${string}` | undefined
73
74
  email, // string | undefined
74
75
  isLoggedIn, // boolean
75
76
  signerType, // 'passkey' | 'external_wallet' | 'mpc' | undefined
@@ -77,12 +78,6 @@ const {
77
78
  isLoading, // boolean
78
79
  error, // Error | null
79
80
  } = useVolr();
80
-
81
- // Get EVM address
82
- const address = evm.address;
83
-
84
- // Get chain client
85
- const client = evm(8453);
86
81
  ```
87
82
 
88
83
  ### EvmClient
package/dist/index.cjs CHANGED
@@ -18393,7 +18393,7 @@ function useVolr() {
18393
18393
  createGetRpcUrl({ client, rpcOverrides: config.rpcOverrides }),
18394
18394
  [client, config.rpcOverrides]
18395
18395
  );
18396
- const evmFactory = react.useCallback(
18396
+ const evm = react.useCallback(
18397
18397
  (chainId) => {
18398
18398
  if (chainId === 0) {
18399
18399
  throw new Error("chainId cannot be 0");
@@ -18484,11 +18484,9 @@ function useVolr() {
18484
18484
  },
18485
18485
  [user, config, provider, precheck, relay, getRpcUrl, setProvider, client]
18486
18486
  );
18487
- const evm = Object.assign(evmFactory, {
18488
- address: user?.evmAddress
18489
- });
18490
18487
  return {
18491
18488
  evm,
18489
+ evmAddress: user?.evmAddress,
18492
18490
  email: user?.email,
18493
18491
  isLoggedIn: user !== null,
18494
18492
  signerType: user?.signerType,