@berachain/wagmi 0.4.2-beta.5 → 0.4.2-beta.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkPVMPBWIGcjs = require('../../chunk-PVMPBWIG.cjs');var _chunkOLYL3V2Dcjs = require('../../chunk-OLYL3V2D.cjs');var _react = require('react');var _reactquery = require('@tanstack/react-query');var _react3 = require('thirdweb/react');var _wagmi = require('wagmi');var _jsxruntime = require('react/jsx-runtime');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkPVMPBWIGcjs = require('../../chunk-PVMPBWIG.cjs');var _chunkOLYL3V2Dcjs = require('../../chunk-OLYL3V2D.cjs');var _react = require('react');var _reactquery = require('@tanstack/react-query');var _react3 = require('thirdweb/react');var _wagmi = require('wagmi');var _jsxruntime = require('react/jsx-runtime');var P=new _reactquery.QueryClient;function W({config:e,defaultChain:r,thirdweb:t,children:i,onConnect:m,onConnectError:a,publicJsonRpcUrl:n,...p}){let c=_chunkOLYL3V2Dcjs.d.call(void 0, {config:e,chain:r,publicJsonRpcUrl:n,onConnect:m,onConnectError:a});return _jsxruntime.jsx.call(void 0, _chunkOLYL3V2Dcjs.c,{...p,thirdweb:t,defaultChain:r,config:e,thirdwebResult:c,children:i})}function E({transports:e,defaultChain:r,chains:t,thirdweb:i,children:m,...a}){let n=_react.useMemo.call(void 0, ()=>_chunkPVMPBWIGcjs.a.call(void 0, {thirdweb:i,transports:e,defaultChain:r,chains:t}),[r,i,e,t]);return _jsxruntime.jsx.call(void 0, _react3.ThirdwebProvider,{children:_jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider,{config:n.wagmi,reconnectOnMount:!1,children:_jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:P,children:_jsxruntime.jsx.call(void 0, W,{...a,config:n,defaultChain:r,thirdweb:i,children:m})})})})}exports.WagmiProvider = E;
|
|
@@ -22,6 +22,6 @@ type WagmiProviderLightWeightProps = PropsWithChildren<{
|
|
|
22
22
|
onConnectError?: (error: Error) => void;
|
|
23
23
|
publicJsonRpcUrl?: string;
|
|
24
24
|
}>;
|
|
25
|
-
declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, children,
|
|
25
|
+
declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, children, ...innerProps }: WagmiProviderLightWeightProps): react_jsx_runtime.JSX.Element;
|
|
26
26
|
|
|
27
27
|
export { WagmiProvider };
|
|
@@ -22,6 +22,6 @@ type WagmiProviderLightWeightProps = PropsWithChildren<{
|
|
|
22
22
|
onConnectError?: (error: Error) => void;
|
|
23
23
|
publicJsonRpcUrl?: string;
|
|
24
24
|
}>;
|
|
25
|
-
declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, children,
|
|
25
|
+
declare function WagmiProvider({ transports, defaultChain, chains, thirdweb, children, ...innerProps }: WagmiProviderLightWeightProps): react_jsx_runtime.JSX.Element;
|
|
26
26
|
|
|
27
27
|
export { WagmiProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as
|
|
1
|
+
"use client";import{a as d}from"../../chunk-MZZ62TKM.mjs";import{c as g,d as s}from"../../chunk-FPJ6HXP4.mjs";import{useMemo as f}from"react";import{QueryClient as h,QueryClientProvider as u}from"@tanstack/react-query";import{ThirdwebProvider as v}from"thirdweb/react";import{WagmiProvider as l}from"wagmi";import{jsx as o}from"react/jsx-runtime";var P=new h;function W({config:e,defaultChain:r,thirdweb:t,children:i,onConnect:m,onConnectError:a,publicJsonRpcUrl:n,...p}){let c=s({config:e,chain:r,publicJsonRpcUrl:n,onConnect:m,onConnectError:a});return o(g,{...p,thirdweb:t,defaultChain:r,config:e,thirdwebResult:c,children:i})}function E({transports:e,defaultChain:r,chains:t,thirdweb:i,children:m,...a}){let n=f(()=>d({thirdweb:i,transports:e,defaultChain:r,chains:t}),[r,i,e,t]);return o(v,{children:o(l,{config:n.wagmi,reconnectOnMount:!1,children:o(u,{client:P,children:o(W,{...a,config:n,defaultChain:r,thirdweb:i,children:m})})})})}export{E as WagmiProvider};
|
package/package.json
CHANGED
|
@@ -31,16 +31,50 @@ type WagmiProviderLightWeightProps = PropsWithChildren<{
|
|
|
31
31
|
|
|
32
32
|
const queryClient = new QueryClient();
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Inner component that renders inside the wagmi provider tree,
|
|
36
|
+
* so that useThirdwebLightWeight can safely call wagmi hooks.
|
|
37
|
+
*/
|
|
38
|
+
function WagmiProviderInner({
|
|
39
|
+
config,
|
|
36
40
|
defaultChain,
|
|
37
|
-
chains,
|
|
38
41
|
thirdweb,
|
|
39
42
|
children,
|
|
40
43
|
onConnect,
|
|
41
44
|
onConnectError,
|
|
42
45
|
publicJsonRpcUrl,
|
|
43
46
|
...baseProps
|
|
47
|
+
}: Omit<WagmiProviderLightWeightProps, "transports" | "chains"> & {
|
|
48
|
+
config: ReturnType<typeof getConfig>;
|
|
49
|
+
}) {
|
|
50
|
+
const thirdwebResult = useThirdwebLightWeight({
|
|
51
|
+
config,
|
|
52
|
+
chain: defaultChain,
|
|
53
|
+
publicJsonRpcUrl,
|
|
54
|
+
onConnect,
|
|
55
|
+
onConnectError,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<BeraWagmiProviderBase
|
|
60
|
+
{...baseProps}
|
|
61
|
+
thirdweb={thirdweb}
|
|
62
|
+
defaultChain={defaultChain}
|
|
63
|
+
config={config}
|
|
64
|
+
thirdwebResult={thirdwebResult}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</BeraWagmiProviderBase>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function WagmiProvider({
|
|
72
|
+
transports,
|
|
73
|
+
defaultChain,
|
|
74
|
+
chains,
|
|
75
|
+
thirdweb,
|
|
76
|
+
children,
|
|
77
|
+
...innerProps
|
|
44
78
|
}: WagmiProviderLightWeightProps) {
|
|
45
79
|
const config = useMemo(() => {
|
|
46
80
|
return getConfig({
|
|
@@ -51,14 +85,6 @@ export function WagmiProvider({
|
|
|
51
85
|
});
|
|
52
86
|
}, [defaultChain, thirdweb, transports, chains]);
|
|
53
87
|
|
|
54
|
-
const thirdwebResult = useThirdwebLightWeight({
|
|
55
|
-
config,
|
|
56
|
-
chain: defaultChain,
|
|
57
|
-
publicJsonRpcUrl,
|
|
58
|
-
onConnect,
|
|
59
|
-
onConnectError,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
88
|
return (
|
|
63
89
|
<ThirdwebProvider>
|
|
64
90
|
<WagmiProviderBase
|
|
@@ -67,15 +93,14 @@ export function WagmiProvider({
|
|
|
67
93
|
reconnectOnMount={false}
|
|
68
94
|
>
|
|
69
95
|
<QueryClientProvider client={queryClient}>
|
|
70
|
-
<
|
|
71
|
-
{...
|
|
72
|
-
thirdweb={thirdweb}
|
|
73
|
-
defaultChain={defaultChain}
|
|
96
|
+
<WagmiProviderInner
|
|
97
|
+
{...innerProps}
|
|
74
98
|
config={config}
|
|
75
|
-
|
|
99
|
+
defaultChain={defaultChain}
|
|
100
|
+
thirdweb={thirdweb}
|
|
76
101
|
>
|
|
77
102
|
{children}
|
|
78
|
-
</
|
|
103
|
+
</WagmiProviderInner>
|
|
79
104
|
</QueryClientProvider>
|
|
80
105
|
</WagmiProviderBase>
|
|
81
106
|
</ThirdwebProvider>
|