@coinbase/cdp-wagmi 0.0.4 → 0.0.5
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 +12 -3
- package/dist/esm/index2.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -34,8 +34,9 @@ npm install @coinbase/cdp-wagmi @coinbase/cdp-core @tanstack/react-query viem wa
|
|
|
34
34
|
Next, you must configure your WagmiProvider with the `CDPEmbeddedWalletConnector`.
|
|
35
35
|
|
|
36
36
|
`CDPEmbeddedWalletConnector` provides the necessary context Wagmi to work correctly with
|
|
37
|
-
the CDP Frontend SDK.
|
|
38
|
-
|
|
37
|
+
the CDP Frontend SDK. The `providerConfig` must be provided and is responsible for
|
|
38
|
+
configuring the EIP-1193 provider's transports which are used to broadcast non-Base
|
|
39
|
+
transactions.
|
|
39
40
|
|
|
40
41
|
```tsx
|
|
41
42
|
import React from 'react';
|
|
@@ -44,6 +45,7 @@ import { App } from './App'; // Your main App component
|
|
|
44
45
|
import { Config }from '@coinbase/cdp-core';
|
|
45
46
|
import { createCDPEmbeddedWalletConector } from '@coinbase/cdp-wagmi';
|
|
46
47
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
48
|
+
import { http }from "viem";
|
|
47
49
|
import { baseSepolia, base } from 'viem/chains';
|
|
48
50
|
import { WagmiProvider, createConfig, http } from 'wagmi';
|
|
49
51
|
|
|
@@ -54,6 +56,13 @@ const cdpConfig: Config = {
|
|
|
54
56
|
|
|
55
57
|
const connector = createCDPEmbeddedWalletConnector({
|
|
56
58
|
cdpConfig: cdpConfig,
|
|
59
|
+
providerConfig:{
|
|
60
|
+
chains: [base, baseSepolia],
|
|
61
|
+
transports: {
|
|
62
|
+
[base.id]: http(),
|
|
63
|
+
[baseSepolia.id]: http()
|
|
64
|
+
}
|
|
65
|
+
}
|
|
57
66
|
});
|
|
58
67
|
|
|
59
68
|
const wagmiConfig = createConfig({
|
|
@@ -69,7 +78,7 @@ const queryClient = new QueryClient(); // For use with react-query
|
|
|
69
78
|
|
|
70
79
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
71
80
|
<React.StrictMode>
|
|
72
|
-
<WagmiProvider config=
|
|
81
|
+
<WagmiProvider config={wagmiConfig} >
|
|
73
82
|
<QueryClientProvider client={ queryClient }>
|
|
74
83
|
<App />
|
|
75
84
|
</QueryClientProvider>
|
package/dist/esm/index2.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { createConnector } from 'wagmi';
|
|
|
4
4
|
|
|
5
5
|
export declare function createCDPEmbeddedWalletConnector(parameters: {
|
|
6
6
|
cdpConfig: Config;
|
|
7
|
-
providerConfig
|
|
7
|
+
providerConfig: CDPEmbeddedWalletConfig;
|
|
8
8
|
}): ReturnType<typeof createConnector>;
|
|
9
9
|
|
|
10
10
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-wagmi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@tanstack/react-query": "^5.0.0",
|
|
18
18
|
"react": ">=18.2.0",
|
|
19
|
-
"viem": "2.
|
|
20
|
-
"wagmi": "^2.
|
|
21
|
-
"@coinbase/cdp-core": "^0.0.
|
|
19
|
+
"viem": "^2.33.0",
|
|
20
|
+
"wagmi": "^2.16.0",
|
|
21
|
+
"@coinbase/cdp-core": "^0.0.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@size-limit/webpack": "^11.2.0",
|
|
35
35
|
"@size-limit/webpack-why": "^11.2.0",
|
|
36
36
|
"size-limit": "^11.2.0",
|
|
37
|
-
"@coinbase/cdp-core": "^0.0.
|
|
37
|
+
"@coinbase/cdp-core": "^0.0.5"
|
|
38
38
|
},
|
|
39
39
|
"size-limit": [
|
|
40
40
|
{
|