@coinbase/cdp-core 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 +52 -0
- package/dist/esm/index12.js +14 -7
- package/dist/esm/index16.js +124 -82
- package/dist/esm/index17.js +6 -3
- package/dist/esm/index3.js +57 -55
- package/dist/esm/index4.js +1 -1
- package/dist/esm/index70.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -200,4 +200,56 @@ const { privateKey } = await exportEvmAccount({
|
|
|
200
200
|
|
|
201
201
|
// WARNING: Handle private keys with extreme care!
|
|
202
202
|
console.log("Private Key:", privateKey);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### EIP-1193 Provider
|
|
206
|
+
|
|
207
|
+
The core package includes an EIP-1193 compatible provider. This provider can be used to sign and send transactions.
|
|
208
|
+
|
|
209
|
+
The provider is created by calling `createCDPEmbeddedWallet`, which exposes a `.provider` attribute. `createCDPEmbeddedWallet` must be called with the desired chains to support as well as the transports for these chains.
|
|
210
|
+
|
|
211
|
+
The provider will initially connect to the first chain in the `chains` array. The transports are typically HTTP RPC endpoints, which are used internally for broadcasting non-Base transactions. For more information on transports, see [Wagmi's `createConfig` setup](https://wagmi.sh/react/api/createConfig).
|
|
212
|
+
```typescript
|
|
213
|
+
import { base, mainnet } from "viem/chains";
|
|
214
|
+
import { http } from "viem"
|
|
215
|
+
|
|
216
|
+
// Basic usage with default configuration
|
|
217
|
+
const wallet = createCDPEmbeddedWallet({
|
|
218
|
+
chains:[base, mainnet],
|
|
219
|
+
transports: {
|
|
220
|
+
[base.id]: http(),
|
|
221
|
+
[mainnet.id]: http()
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const provider = wallet.provider;
|
|
225
|
+
|
|
226
|
+
// Request account access
|
|
227
|
+
const accounts = await provider.request({
|
|
228
|
+
method: "eth_requestAccounts"
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// Sign a message
|
|
232
|
+
const signature = await provider.request({
|
|
233
|
+
method: "personal_sign",
|
|
234
|
+
params: ["Hello, World!", accounts[0]]
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// Send a transaction
|
|
238
|
+
const txHash = await provider.request({
|
|
239
|
+
method: "eth_sendTransaction",
|
|
240
|
+
params: [{
|
|
241
|
+
from: accounts[0],
|
|
242
|
+
to: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
|
|
243
|
+
value: "0x1000000000000000000"
|
|
244
|
+
}]
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// Listen for connection events
|
|
248
|
+
provider.on("connect", (connectInfo) => {
|
|
249
|
+
console.log("Connected to chain:", connectInfo.chainId);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
provider.on("disconnect", () => {
|
|
253
|
+
console.log("Disconnected from wallet");
|
|
254
|
+
});
|
|
203
255
|
```
|
package/dist/esm/index12.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { SendEvmTransactionWithEndUserAccountBodyNetwork as
|
|
2
|
-
const n = (
|
|
3
|
-
(
|
|
1
|
+
import { SendEvmTransactionWithEndUserAccountBodyNetwork as i } from "@coinbase/cdp-api-client";
|
|
2
|
+
const n = (e) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map(n) : Object.keys(e).sort().reduce(
|
|
3
|
+
(r, t) => (r[t] = n(e[t]), r),
|
|
4
4
|
{}
|
|
5
|
-
),
|
|
6
|
-
|
|
7
|
-
)
|
|
5
|
+
), o = (e) => Object.values(i).includes(
|
|
6
|
+
e
|
|
7
|
+
), s = {
|
|
8
|
+
"base-sepolia": 84532,
|
|
9
|
+
base: 8453
|
|
10
|
+
}, c = Object.fromEntries(
|
|
11
|
+
Object.entries(s).map(([e, r]) => [r, e])
|
|
12
|
+
), p = (e) => Object.values(s).includes(e);
|
|
8
13
|
export {
|
|
9
|
-
|
|
14
|
+
c as chainIdToNameMapping,
|
|
15
|
+
p as isChainIdSupportedForCDPSends,
|
|
16
|
+
o as isChainSupportedForCDPSends,
|
|
10
17
|
n as sortKeys
|
|
11
18
|
};
|
package/dist/esm/index16.js
CHANGED
|
@@ -1,107 +1,149 @@
|
|
|
1
|
-
import { Provider as
|
|
2
|
-
import {
|
|
1
|
+
import { Provider as y, Hex as I } from "ox";
|
|
2
|
+
import { createWalletClient as E } from "viem";
|
|
3
|
+
import { signEvmTypedData as S, signEvmHash as T, getCurrentUser as f, signOut as P, sendEvmTransaction as R, signEvmTransaction as A, signEvmMessage as x } from "./index2.js";
|
|
3
4
|
import "./index3.js";
|
|
4
|
-
import { validateUserOwnsAddress as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
return
|
|
5
|
+
import { validateUserOwnsAddress as m, EIP1193ProviderError as l, STANDARD_ERROR_CODES as s, RPCRequestError as c, validateUserHasEvmAccount as C, validateUserConnected as D } from "./index4.js";
|
|
6
|
+
import { isChainIdSupportedForCDPSends as b, chainIdToNameMapping as j } from "./index12.js";
|
|
7
|
+
function g(e) {
|
|
8
|
+
return {
|
|
9
|
+
to: e.to,
|
|
10
|
+
data: e.data,
|
|
11
|
+
value: e.value ? BigInt(e.value) : void 0,
|
|
12
|
+
nonce: e.nonce ? Number(e.nonce) : void 0,
|
|
13
|
+
gas: e.gas ? BigInt(e.gas) : void 0,
|
|
14
|
+
maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
|
|
15
|
+
maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
|
|
16
|
+
type: "eip1559"
|
|
17
|
+
};
|
|
8
18
|
}
|
|
9
|
-
async function
|
|
10
|
-
|
|
11
|
-
return t.emit("connect", {
|
|
12
|
-
chainId: u.fromNumber(e.getState().chainId)
|
|
13
|
-
}), a.evmAccounts;
|
|
19
|
+
async function U() {
|
|
20
|
+
return (await f())?.evmAccounts || [];
|
|
14
21
|
}
|
|
15
|
-
async function
|
|
16
|
-
const
|
|
17
|
-
|
|
22
|
+
async function M(e, a) {
|
|
23
|
+
const n = await D();
|
|
24
|
+
return e.emit("connect", {
|
|
25
|
+
chainId: I.fromNumber(a.getState().chainId)
|
|
26
|
+
}), n.evmAccounts;
|
|
27
|
+
}
|
|
28
|
+
async function _(e) {
|
|
29
|
+
const [a, n] = e;
|
|
30
|
+
await m(n);
|
|
31
|
+
const t = Buffer.from(a.slice(2), "hex").toString();
|
|
18
32
|
try {
|
|
19
|
-
return (await
|
|
20
|
-
evmAccount:
|
|
21
|
-
message:
|
|
33
|
+
return (await x({
|
|
34
|
+
evmAccount: n,
|
|
35
|
+
message: t
|
|
22
36
|
})).signature;
|
|
23
|
-
} catch (
|
|
24
|
-
throw new
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
} catch (o) {
|
|
38
|
+
throw new l(
|
|
39
|
+
s.provider.userRejectedRequest,
|
|
40
|
+
o instanceof Error ? o.message : "Signing failed"
|
|
27
41
|
);
|
|
28
42
|
}
|
|
29
43
|
}
|
|
30
|
-
async function
|
|
31
|
-
const [
|
|
32
|
-
await
|
|
44
|
+
async function k(e) {
|
|
45
|
+
const [a, n] = e;
|
|
46
|
+
await m(n);
|
|
33
47
|
try {
|
|
34
|
-
const
|
|
35
|
-
return (await
|
|
36
|
-
evmAccount:
|
|
37
|
-
typedData:
|
|
48
|
+
const t = JSON.parse(a);
|
|
49
|
+
return (await S({
|
|
50
|
+
evmAccount: n,
|
|
51
|
+
typedData: t
|
|
38
52
|
})).signature;
|
|
39
|
-
} catch (
|
|
40
|
-
throw new
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
} catch (t) {
|
|
54
|
+
throw new l(
|
|
55
|
+
s.provider.userRejectedRequest,
|
|
56
|
+
t instanceof Error ? t.message : "Signing failed"
|
|
43
57
|
);
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
|
-
async function
|
|
47
|
-
const [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
to: e.to,
|
|
53
|
-
value: BigInt(e.value),
|
|
54
|
-
data: e.data,
|
|
55
|
-
// Include data field for contract interactions
|
|
56
|
-
nonce: e.nonce ? Number(e.nonce) : void 0,
|
|
57
|
-
gas: e.gas ? BigInt(e.gas) : void 0,
|
|
58
|
-
maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
|
|
59
|
-
maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
|
|
60
|
-
chainId: e.chainId ? Number(e.chainId) : p.id,
|
|
61
|
-
type: "eip1559"
|
|
62
|
-
},
|
|
63
|
-
network: "base-sepolia"
|
|
64
|
-
})).transactionHash;
|
|
65
|
-
} catch (r) {
|
|
66
|
-
throw console.log("Transaction failed", r), new s(
|
|
67
|
-
i.provider.userRejectedRequest,
|
|
68
|
-
r instanceof Error ? r.message : "Transaction failed"
|
|
60
|
+
async function z(e, a, n) {
|
|
61
|
+
const [t] = e;
|
|
62
|
+
if (!t || typeof t != "object")
|
|
63
|
+
throw new c(
|
|
64
|
+
s.rpc.invalidParams,
|
|
65
|
+
"Transaction parameter must be an object"
|
|
69
66
|
);
|
|
70
|
-
|
|
67
|
+
if (!t.to)
|
|
68
|
+
throw new c(
|
|
69
|
+
s.rpc.invalidParams,
|
|
70
|
+
"Transaction must include 'to' field"
|
|
71
|
+
);
|
|
72
|
+
const d = (await C()).evmAccounts[0], u = a.getState(), i = t.chainId ? Number(t.chainId) : u.chainId;
|
|
73
|
+
if (b(i))
|
|
74
|
+
try {
|
|
75
|
+
return (await R({
|
|
76
|
+
evmAccount: d,
|
|
77
|
+
transaction: { ...g(t), chainId: i },
|
|
78
|
+
network: j[i]
|
|
79
|
+
})).transactionHash;
|
|
80
|
+
} catch (r) {
|
|
81
|
+
throw console.log("Transaction failed", r), new c(
|
|
82
|
+
s.rpc.transactionRejected,
|
|
83
|
+
r instanceof Error ? r.message : "Transaction failed"
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
else
|
|
87
|
+
try {
|
|
88
|
+
const r = E({
|
|
89
|
+
// Safe as we check before calling this handler that chainId is configured
|
|
90
|
+
chain: u.chains.find((h) => h.id === i),
|
|
91
|
+
transport: n[i],
|
|
92
|
+
account: d
|
|
93
|
+
}), p = u.chains.find((h) => h.id === i), w = await r.prepareTransactionRequest({
|
|
94
|
+
...g(t),
|
|
95
|
+
chain: p
|
|
96
|
+
}), v = await A({
|
|
97
|
+
evmAccount: d,
|
|
98
|
+
transaction: {
|
|
99
|
+
...w,
|
|
100
|
+
type: "eip1559"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return await r.sendRawTransaction({
|
|
104
|
+
serializedTransaction: v.signedTransaction
|
|
105
|
+
});
|
|
106
|
+
} catch (r) {
|
|
107
|
+
throw new c(
|
|
108
|
+
s.rpc.transactionRejected,
|
|
109
|
+
r instanceof Error ? r.message : "Transaction failed"
|
|
110
|
+
);
|
|
111
|
+
}
|
|
71
112
|
}
|
|
72
|
-
async function
|
|
73
|
-
const [
|
|
74
|
-
await
|
|
113
|
+
async function J(e) {
|
|
114
|
+
const [a, n] = e;
|
|
115
|
+
await m(n);
|
|
75
116
|
try {
|
|
76
|
-
return (await
|
|
77
|
-
evmAccount:
|
|
78
|
-
hash:
|
|
117
|
+
return (await T({
|
|
118
|
+
evmAccount: n,
|
|
119
|
+
hash: a
|
|
79
120
|
})).signature;
|
|
80
|
-
} catch (
|
|
81
|
-
throw new
|
|
82
|
-
|
|
83
|
-
|
|
121
|
+
} catch (t) {
|
|
122
|
+
throw new l(
|
|
123
|
+
s.provider.userRejectedRequest,
|
|
124
|
+
t instanceof Error ? t.message : "Signing failed"
|
|
84
125
|
);
|
|
85
126
|
}
|
|
86
127
|
}
|
|
87
|
-
async function
|
|
88
|
-
return `0x${
|
|
128
|
+
async function W(e) {
|
|
129
|
+
return `0x${e.getState().chainId.toString(16)}`;
|
|
89
130
|
}
|
|
90
|
-
async function
|
|
91
|
-
await
|
|
131
|
+
async function $(e) {
|
|
132
|
+
await f() && await P(), e.emit("disconnect", new y.DisconnectedError());
|
|
92
133
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
|
|
134
|
+
function K(e, a) {
|
|
135
|
+
const n = Number.parseInt(e[0].chainId, 16);
|
|
136
|
+
a.getState().setChainId(n);
|
|
96
137
|
}
|
|
97
138
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
139
|
+
U as handleAccounts,
|
|
140
|
+
W as handleChainId,
|
|
141
|
+
$ as handleDisconnect,
|
|
142
|
+
J as handleEthSign,
|
|
143
|
+
_ as handlePersonalSign,
|
|
144
|
+
M as handleRequestAccounts,
|
|
145
|
+
z as handleSendTransaction,
|
|
146
|
+
k as handleSignTypedData,
|
|
147
|
+
K as handleSwitchEthereumChain,
|
|
148
|
+
g as shimProviderTxRequest
|
|
107
149
|
};
|
package/dist/esm/index17.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { chainConfig as a } from "./index77.js";
|
|
2
|
-
import { defineChain as
|
|
3
|
-
const e = 11155111,
|
|
2
|
+
import { defineChain as t } from "./index22.js";
|
|
3
|
+
const e = 11155111, r = /* @__PURE__ */ t({
|
|
4
4
|
...a,
|
|
5
5
|
id: 84532,
|
|
6
6
|
network: "base-sepolia",
|
|
@@ -50,6 +50,9 @@ const e = 11155111, o = /* @__PURE__ */ s({
|
|
|
50
50
|
testnet: !0,
|
|
51
51
|
sourceId: e
|
|
52
52
|
});
|
|
53
|
+
({
|
|
54
|
+
...r
|
|
55
|
+
});
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
r as baseSepolia
|
|
55
58
|
};
|
package/dist/esm/index3.js
CHANGED
|
@@ -1,91 +1,92 @@
|
|
|
1
|
-
import { Provider as
|
|
2
|
-
import { http as
|
|
3
|
-
import { create as
|
|
4
|
-
import { subscribeWithSelector as
|
|
5
|
-
import { validateRequest as
|
|
6
|
-
import { EventEmitter as
|
|
7
|
-
import { handleChainId as
|
|
8
|
-
import { onAuthStateChange as
|
|
1
|
+
import { Provider as m } from "ox";
|
|
2
|
+
import { http as l } from "viem";
|
|
3
|
+
import { create as p } from "zustand";
|
|
4
|
+
import { subscribeWithSelector as f, persist as g } from "./index14.js";
|
|
5
|
+
import { validateRequest as I, EIP1193ProviderError as S, STANDARD_ERROR_CODES as w } from "./index4.js";
|
|
6
|
+
import { EventEmitter as b } from "./index15.js";
|
|
7
|
+
import { handleChainId as A, handleSignTypedData as C, handleEthSign as _, handleSwitchEthereumChain as v, handleDisconnect as D, handleSendTransaction as P, handlePersonalSign as R, handleRequestAccounts as E, handleAccounts as T } from "./index16.js";
|
|
8
|
+
import { onAuthStateChange as q } from "./index2.js";
|
|
9
9
|
import { baseSepolia as h } from "./index17.js";
|
|
10
|
-
function
|
|
10
|
+
function y(e, r, a) {
|
|
11
11
|
r.subscribe(
|
|
12
|
-
(
|
|
13
|
-
(
|
|
14
|
-
|
|
12
|
+
(n) => n.chainId,
|
|
13
|
+
(n, t) => {
|
|
14
|
+
n !== t && e.emit("chainChanged", n);
|
|
15
15
|
}
|
|
16
16
|
), r.subscribe(
|
|
17
|
-
(
|
|
18
|
-
(
|
|
19
|
-
if (!(
|
|
20
|
-
if (!
|
|
21
|
-
|
|
17
|
+
(n) => n.user,
|
|
18
|
+
(n, t) => {
|
|
19
|
+
if (!(n?.userId === t?.userId && n?.evmAccounts?.length === t?.evmAccounts?.length)) {
|
|
20
|
+
if (!n && t) {
|
|
21
|
+
e.emit("disconnect");
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
if (n && n.evmAccounts?.length && (!t || t.evmAccounts?.length === 0)) {
|
|
25
|
+
const u = r.getState().chainId;
|
|
26
|
+
e.emit("connect", { chainId: u });
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
|
-
const { chainId:
|
|
33
|
-
return
|
|
34
|
-
request: async (
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
switch (
|
|
32
|
+
const { chainId: s, setChainId: i } = r.getState(), c = s || a.chains[0].id;
|
|
33
|
+
return s || i(c), m.from({
|
|
34
|
+
request: async (n) => {
|
|
35
|
+
I(n, a);
|
|
36
|
+
const t = n;
|
|
37
|
+
switch (t.method) {
|
|
38
38
|
case "eth_accounts":
|
|
39
|
-
return
|
|
39
|
+
return T();
|
|
40
40
|
case "eth_requestAccounts":
|
|
41
|
-
return
|
|
41
|
+
return E(e, r);
|
|
42
42
|
case "personal_sign":
|
|
43
|
-
return
|
|
43
|
+
return R(t.params);
|
|
44
44
|
case "eth_sendTransaction":
|
|
45
|
-
return
|
|
45
|
+
return P(t.params, r, a.transports);
|
|
46
46
|
case "wallet_disconnect":
|
|
47
|
-
return
|
|
47
|
+
return D(e);
|
|
48
48
|
case "wallet_switchEthereumChain":
|
|
49
|
-
return
|
|
49
|
+
return v(t.params, r);
|
|
50
50
|
case "eth_sign":
|
|
51
|
-
return _(
|
|
51
|
+
return _(t.params);
|
|
52
52
|
case "eth_signTypedData_v4":
|
|
53
|
-
return
|
|
53
|
+
return C(t.params);
|
|
54
54
|
case "eth_chainId":
|
|
55
|
-
return
|
|
55
|
+
return A(r);
|
|
56
56
|
// Catch-all for any unknown method
|
|
57
57
|
default:
|
|
58
|
-
throw new
|
|
59
|
-
|
|
60
|
-
`Method ${
|
|
58
|
+
throw new S(
|
|
59
|
+
w.provider.unsupportedMethod,
|
|
60
|
+
`Method ${t.method} not supported`
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
// Event emitter methods - only the ones required by the interface
|
|
65
|
-
on:
|
|
66
|
-
removeListener:
|
|
65
|
+
on: e.on.bind(e),
|
|
66
|
+
removeListener: e.removeListener.bind(e)
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const d = {
|
|
70
70
|
chains: [h],
|
|
71
71
|
transports: {
|
|
72
|
-
[h.id]:
|
|
72
|
+
[h.id]: l()
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
function z(
|
|
76
|
-
if (
|
|
75
|
+
function z(e) {
|
|
76
|
+
if (e?.chains.length === 0)
|
|
77
77
|
throw new Error("At least one chain must be configured");
|
|
78
|
-
const r =
|
|
78
|
+
const r = e?.chains ?? d.chains, a = e?.transports ?? d.transports;
|
|
79
79
|
if (r.length === 0)
|
|
80
80
|
throw new Error("No chains found in configuration");
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
(
|
|
81
|
+
const s = new b(), i = p()(
|
|
82
|
+
f(
|
|
83
|
+
g(
|
|
84
|
+
(o) => ({
|
|
85
85
|
chainId: r[0].id,
|
|
86
|
-
setChainId: (
|
|
86
|
+
setChainId: (n) => o({ chainId: n }),
|
|
87
|
+
chains: r,
|
|
87
88
|
user: null,
|
|
88
|
-
setUser: (
|
|
89
|
+
setUser: (n) => o({ user: n })
|
|
89
90
|
}),
|
|
90
91
|
{
|
|
91
92
|
name: "cdp-provider-store"
|
|
@@ -94,11 +95,12 @@ function z(t) {
|
|
|
94
95
|
)
|
|
95
96
|
)
|
|
96
97
|
);
|
|
97
|
-
return
|
|
98
|
-
|
|
98
|
+
return q((o) => {
|
|
99
|
+
i.getState().setUser(o);
|
|
99
100
|
}), {
|
|
100
|
-
provider:
|
|
101
|
-
chains: r
|
|
101
|
+
provider: y(s, i, {
|
|
102
|
+
chains: r,
|
|
103
|
+
transports: a
|
|
102
104
|
})
|
|
103
105
|
};
|
|
104
106
|
}
|
package/dist/esm/index4.js
CHANGED
package/dist/esm/index70.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -114,6 +114,7 @@ export declare type ProviderRequest = AccountsRequest | RequestAccountsRequest |
|
|
|
114
114
|
export declare type ProviderState = {
|
|
115
115
|
chainId: number;
|
|
116
116
|
setChainId: (chainId: number) => void;
|
|
117
|
+
chains: readonly [Chain_2, ...Chain_2[]];
|
|
117
118
|
user: User | null;
|
|
118
119
|
setUser: (user: User | null) => void;
|
|
119
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"jose": "^6.0.11",
|
|
17
17
|
"ox": "0.8.1",
|
|
18
|
-
"viem": "2.
|
|
18
|
+
"viem": "^2.33.0",
|
|
19
19
|
"zustand": "^5.0.6",
|
|
20
|
-
"@coinbase/cdp-api-client": "^0.0.
|
|
20
|
+
"@coinbase/cdp-api-client": "^0.0.5"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"name": "full-package",
|
|
31
31
|
"path": "./dist/esm/index.js",
|
|
32
32
|
"import": "*",
|
|
33
|
-
"limit": "
|
|
33
|
+
"limit": "60 KB"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"name": "auth-only",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"name": "provider-only",
|
|
55
55
|
"path": "./dist/esm/index.js",
|
|
56
56
|
"import": "{ createCDPEmbeddedWallet }",
|
|
57
|
-
"limit": "
|
|
57
|
+
"limit": "55 KB"
|
|
58
58
|
}
|
|
59
59
|
],
|
|
60
60
|
"scripts": {
|