@privy-io/wagmi 0.2.1 → 0.2.2-beta-20240320003232
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 +3 -3
- package/dist/esm/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -47,9 +47,9 @@ const queryClient = new QueryClient();
|
|
|
47
47
|
|
|
48
48
|
export const Providers = ({children}: {children: ReactNode}) => (
|
|
49
49
|
<PrivyProvider appId="<your-app-id">
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
</
|
|
50
|
+
<QueryClientProvider client={queryClient}>
|
|
51
|
+
<WagmiProvider config={config}>{children}</WagmiProvider>
|
|
52
|
+
</QueryClientProvider>
|
|
53
53
|
</PrivyProvider>
|
|
54
54
|
);
|
|
55
55
|
```
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WagmiProvider as A}from"wagmi";import{useEffect as u}from"react";import{useReconnect as v}from"wagmi";import{usePrivy as l,useWallets as P}from"@privy-io/react-auth";var a=()=>{let{ready:e}=l(),{ready:t}=P(),{reconnect:o,connectors:r}=v();u(()=>{e&&t&&o()},[e&&t,r])};import{useEffect as g}from"react";import{useConfig as y}from"wagmi";import{injected as W}from"wagmi/connectors";import{useWallets as C}from"@privy-io/react-auth";var m=()=>{let{wallets:e}=C(),t=y();g(()=>{let o=e.map(async r=>{let i=await r.getEthereumProvider(),n=t.connectors.find(d=>d.id===r.meta.id);if(n)return n;let
|
|
1
|
+
import{WagmiProvider as A}from"wagmi";import{useEffect as u}from"react";import{useReconnect as v}from"wagmi";import{usePrivy as l,useWallets as P}from"@privy-io/react-auth";var a=()=>{let{ready:e}=l(),{ready:t}=P(),{reconnect:o,connectors:r}=v();u(()=>{e&&t&&o()},[e&&t,r])};import{useEffect as g}from"react";import{useConfig as y}from"wagmi";import{injected as W}from"wagmi/connectors";import{useWallets as C}from"@privy-io/react-auth";var m=()=>{let{wallets:e}=C(),t=y();g(()=>{let o=e.map(async r=>{let i=await r.getEthereumProvider(),n=t.connectors.find(d=>d.id===r.meta.id);if(n)return n;let c=W({target:{provider:i,id:r.meta.id,name:r.meta.name,icon:r.meta.icon}});return t._internal.connectors.setup(c)});Promise.all(o).then(t._internal.connectors.setState)},[e])};import{Fragment as h,jsx as x}from"react/jsx-runtime";var p=({children:e})=>(m(),a(),x(h,{children:e}));import{jsx as f}from"react/jsx-runtime";var R=({children:e,...t})=>f(A,{...t,reconnectOnMount:!1,children:f(p,{children:e})});import{createConfig as S}from"wagmi";var E=e=>S({ssr:!0,...e,connectors:e.connectors?.filter(t=>t.type==="mock"),multiInjectedProviderDiscovery:!1});import{useCallback as b}from"react";import{useSwitchAccount as w,useConfig as I,useConnect as k}from"wagmi";var s=()=>{let{switchAccount:e}=w(),{connect:t}=k(),o=I();return{setActiveWallet:b(async i=>{for(let n of o.connectors)if(n.id===i.meta.id&&(await n.getAccounts()).includes(i.address)){o.state.connections.get(n.uid)?e({connector:n}):t({connector:n});return}},[o.connectors,o.state.connections,t,e])}};var B=()=>{let{setActiveWallet:e}=s();return{setActiveWallet:e,activeWallet:void 0}};export{R as WagmiProvider,E as createConfig,B as usePrivyWagmi,s as useSetActiveWallet};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.2-beta-20240320003232",
|
|
3
3
|
"name": "@privy-io/wagmi",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Wagmi bindings for the react client",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": "^5.0.4"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@privy-io/react-auth": "
|
|
49
|
+
"@privy-io/react-auth": "1.59.6-beta-20240320003232",
|
|
50
50
|
"viem": "^2",
|
|
51
51
|
"wagmi": "^2",
|
|
52
52
|
"react": "^18",
|