@coinbase/cdp-core 0.0.4 → 0.0.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.
- package/README.md +52 -0
- package/dist/esm/index100.js +1 -1
- package/dist/esm/index12.js +14 -7
- package/dist/esm/index14.js +39 -158
- package/dist/esm/index15.js +16 -47
- package/dist/esm/index16.js +4 -104
- package/dist/esm/index17.js +5 -53
- package/dist/esm/index18.js +158 -39
- package/dist/esm/index19.js +47 -16
- package/dist/esm/index20.js +146 -4
- package/dist/esm/index21.js +56 -5
- package/dist/esm/index3.js +58 -56
- package/dist/esm/index4.js +1 -1
- package/dist/esm/index5.js +4 -4
- package/dist/esm/index67.js +1 -1
- package/dist/esm/index69.js +4 -4
- package/dist/esm/index70.js +1 -1
- package/dist/esm/index77.js +55 -10
- package/dist/esm/index78.js +10 -54
- package/dist/esm/index79.js +2 -11
- package/dist/esm/index80.js +45 -2
- package/dist/esm/index81.js +13 -44
- package/dist/esm/index82.js +9 -13
- package/dist/esm/index85.js +20 -12
- package/dist/esm/index86.js +9 -35
- package/dist/esm/index87.js +19 -41
- package/dist/esm/index88.js +93 -20
- package/dist/esm/index89.js +20 -9
- package/dist/esm/index90.js +114 -16
- package/dist/esm/index91.js +11 -92
- package/dist/esm/index92.js +35 -20
- package/dist/esm/index93.js +41 -117
- 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/index100.js
CHANGED
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/index14.js
CHANGED
|
@@ -1,162 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const u = c(f);
|
|
10
|
-
if (!g(v, u)) {
|
|
11
|
-
const y = v;
|
|
12
|
-
i(v = u, y);
|
|
13
|
-
}
|
|
14
|
-
}, a?.fireImmediately && i(v, v);
|
|
15
|
-
}
|
|
16
|
-
return s(l);
|
|
17
|
-
}, m(h, n, r);
|
|
18
|
-
}, R = H;
|
|
19
|
-
function F(m, h) {
|
|
20
|
-
let n;
|
|
21
|
-
try {
|
|
22
|
-
n = m();
|
|
23
|
-
} catch {
|
|
24
|
-
return;
|
|
1
|
+
import { CompactSign as i } from "./index67.js";
|
|
2
|
+
import { JWTInvalid as r } from "./index68.js";
|
|
3
|
+
import { JWTClaimsBuilder as n } from "./index69.js";
|
|
4
|
+
class d {
|
|
5
|
+
#s;
|
|
6
|
+
#t;
|
|
7
|
+
constructor(t = {}) {
|
|
8
|
+
this.#t = new n(t);
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
then(r) {
|
|
41
|
-
return p(r)(n);
|
|
42
|
-
},
|
|
43
|
-
catch(r) {
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
} catch (n) {
|
|
48
|
-
return {
|
|
49
|
-
then(r) {
|
|
50
|
-
return this;
|
|
51
|
-
},
|
|
52
|
-
catch(r) {
|
|
53
|
-
return p(r)(n);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
10
|
+
setIssuer(t) {
|
|
11
|
+
return this.#t.iss = t, this;
|
|
12
|
+
}
|
|
13
|
+
setSubject(t) {
|
|
14
|
+
return this.#t.sub = t, this;
|
|
15
|
+
}
|
|
16
|
+
setAudience(t) {
|
|
17
|
+
return this.#t.aud = t, this;
|
|
18
|
+
}
|
|
19
|
+
setJti(t) {
|
|
20
|
+
return this.#t.jti = t, this;
|
|
21
|
+
}
|
|
22
|
+
setNotBefore(t) {
|
|
23
|
+
return this.#t.nbf = t, this;
|
|
56
24
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
console.warn(
|
|
74
|
-
`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`
|
|
75
|
-
), n(...t);
|
|
76
|
-
},
|
|
77
|
-
r,
|
|
78
|
-
s
|
|
79
|
-
);
|
|
80
|
-
const g = () => {
|
|
81
|
-
const t = e.partialize({ ...r() });
|
|
82
|
-
return l.setItem(e.name, {
|
|
83
|
-
state: t,
|
|
84
|
-
version: e.version
|
|
85
|
-
});
|
|
86
|
-
}, v = s.setState;
|
|
87
|
-
s.setState = (t, S) => {
|
|
88
|
-
v(t, S), g();
|
|
89
|
-
};
|
|
90
|
-
const f = m(
|
|
91
|
-
(...t) => {
|
|
92
|
-
n(...t), g();
|
|
93
|
-
},
|
|
94
|
-
r,
|
|
95
|
-
s
|
|
96
|
-
);
|
|
97
|
-
s.getInitialState = () => f;
|
|
98
|
-
let u;
|
|
99
|
-
const y = () => {
|
|
100
|
-
var t, S;
|
|
101
|
-
if (!l) return;
|
|
102
|
-
c = !1, i.forEach((o) => {
|
|
103
|
-
var d;
|
|
104
|
-
return o((d = r()) != null ? d : f);
|
|
105
|
-
});
|
|
106
|
-
const b = ((S = e.onRehydrateStorage) == null ? void 0 : S.call(e, (t = r()) != null ? t : f)) || void 0;
|
|
107
|
-
return p(l.getItem.bind(l))(e.name).then((o) => {
|
|
108
|
-
if (o)
|
|
109
|
-
if (typeof o.version == "number" && o.version !== e.version) {
|
|
110
|
-
if (e.migrate) {
|
|
111
|
-
const d = e.migrate(
|
|
112
|
-
o.state,
|
|
113
|
-
o.version
|
|
114
|
-
);
|
|
115
|
-
return d instanceof Promise ? d.then((I) => [!0, I]) : [!0, d];
|
|
116
|
-
}
|
|
117
|
-
console.error(
|
|
118
|
-
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
119
|
-
);
|
|
120
|
-
} else
|
|
121
|
-
return [!1, o.state];
|
|
122
|
-
return [!1, void 0];
|
|
123
|
-
}).then((o) => {
|
|
124
|
-
var d;
|
|
125
|
-
const [I, _] = o;
|
|
126
|
-
if (u = e.merge(
|
|
127
|
-
_,
|
|
128
|
-
(d = r()) != null ? d : f
|
|
129
|
-
), n(u, !0), I)
|
|
130
|
-
return g();
|
|
131
|
-
}).then(() => {
|
|
132
|
-
b?.(u, void 0), u = r(), c = !0, a.forEach((o) => o(u));
|
|
133
|
-
}).catch((o) => {
|
|
134
|
-
b?.(void 0, o);
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
return s.persist = {
|
|
138
|
-
setOptions: (t) => {
|
|
139
|
-
e = {
|
|
140
|
-
...e,
|
|
141
|
-
...t
|
|
142
|
-
}, t.storage && (l = t.storage);
|
|
143
|
-
},
|
|
144
|
-
clearStorage: () => {
|
|
145
|
-
l?.removeItem(e.name);
|
|
146
|
-
},
|
|
147
|
-
getOptions: () => e,
|
|
148
|
-
rehydrate: () => y(),
|
|
149
|
-
hasHydrated: () => c,
|
|
150
|
-
onHydrate: (t) => (i.add(t), () => {
|
|
151
|
-
i.delete(t);
|
|
152
|
-
}),
|
|
153
|
-
onFinishHydration: (t) => (a.add(t), () => {
|
|
154
|
-
a.delete(t);
|
|
155
|
-
})
|
|
156
|
-
}, e.skipHydration || y(), u || f;
|
|
157
|
-
}, w = O;
|
|
25
|
+
setExpirationTime(t) {
|
|
26
|
+
return this.#t.exp = t, this;
|
|
27
|
+
}
|
|
28
|
+
setIssuedAt(t) {
|
|
29
|
+
return this.#t.iat = t, this;
|
|
30
|
+
}
|
|
31
|
+
setProtectedHeader(t) {
|
|
32
|
+
return this.#s = t, this;
|
|
33
|
+
}
|
|
34
|
+
async sign(t, e) {
|
|
35
|
+
const s = new i(this.#t.data());
|
|
36
|
+
if (s.setProtectedHeader(this.#s), Array.isArray(this.#s?.crit) && this.#s.crit.includes("b64") && this.#s.b64 === !1)
|
|
37
|
+
throw new r("JWTs MUST NOT use unencoded payload");
|
|
38
|
+
return s.sign(t, e);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
158
41
|
export {
|
|
159
|
-
|
|
160
|
-
w as persist,
|
|
161
|
-
R as subscribeWithSelector
|
|
42
|
+
d as SignJWT
|
|
162
43
|
};
|
package/dist/esm/index15.js
CHANGED
|
@@ -1,50 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param listener - The function to remove from the event listeners.
|
|
17
|
-
*/
|
|
18
|
-
removeListener(e, s) {
|
|
19
|
-
if (!this.events[e])
|
|
20
|
-
return;
|
|
21
|
-
const t = this.events[e].indexOf(s);
|
|
22
|
-
t > -1 && this.events[e].splice(t, 1);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Emit an event.
|
|
26
|
-
*
|
|
27
|
-
* @param event - The name of the event to emit.
|
|
28
|
-
* @param args - The arguments to pass to the event listeners.
|
|
29
|
-
*/
|
|
30
|
-
emit(e, ...s) {
|
|
31
|
-
this.events[e] && this.events[e].forEach((t) => {
|
|
32
|
-
try {
|
|
33
|
-
t(...s);
|
|
34
|
-
} catch (i) {
|
|
35
|
-
console.error(`Error in event listener for ${e}:`, i);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Remove all listeners for an event.
|
|
41
|
-
*
|
|
42
|
-
* @param event - The name of the event to remove all listeners from. If not provided, removes all listeners for all events.
|
|
43
|
-
*/
|
|
44
|
-
removeAllListeners(e) {
|
|
45
|
-
e ? delete this.events[e] : this.events = {};
|
|
46
|
-
}
|
|
1
|
+
async function n() {
|
|
2
|
+
const e = await window.crypto.subtle.generateKey(
|
|
3
|
+
{
|
|
4
|
+
name: "ECDSA",
|
|
5
|
+
namedCurve: "P-256"
|
|
6
|
+
// secp256r1
|
|
7
|
+
},
|
|
8
|
+
!1,
|
|
9
|
+
// Do not allow key export.
|
|
10
|
+
["sign", "verify"]
|
|
11
|
+
// Key usages
|
|
12
|
+
), r = await window.crypto.subtle.exportKey("spki", e.publicKey), t = new Uint8Array(r), a = btoa(
|
|
13
|
+
Array.from(t).map((i) => String.fromCharCode(i)).join("")
|
|
14
|
+
);
|
|
15
|
+
return { privateKey: e.privateKey, publicKeyBase64: a };
|
|
47
16
|
}
|
|
48
17
|
export {
|
|
49
|
-
n as
|
|
18
|
+
n as createKeyPair
|
|
50
19
|
};
|
package/dist/esm/index16.js
CHANGED
|
@@ -1,107 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { validateUserOwnsAddress as o, EIP1193ProviderError as s, STANDARD_ERROR_CODES as i, validateUserHasEvmAccount as f, validateUserConnected as w } from "./index4.js";
|
|
5
|
-
import { baseSepolia as p } from "./index17.js";
|
|
6
|
-
async function P() {
|
|
7
|
-
return (await c())?.evmAccounts || [];
|
|
8
|
-
}
|
|
9
|
-
async function R(t, e) {
|
|
10
|
-
const a = await w();
|
|
11
|
-
return t.emit("connect", {
|
|
12
|
-
chainId: u.fromNumber(e.getState().chainId)
|
|
13
|
-
}), a.evmAccounts;
|
|
14
|
-
}
|
|
15
|
-
async function D(t) {
|
|
16
|
-
const [e, a] = t;
|
|
17
|
-
await o(a);
|
|
18
|
-
try {
|
|
19
|
-
return (await v({
|
|
20
|
-
evmAccount: a,
|
|
21
|
-
message: e
|
|
22
|
-
})).signature;
|
|
23
|
-
} catch (n) {
|
|
24
|
-
throw new s(
|
|
25
|
-
i.provider.userRejectedRequest,
|
|
26
|
-
n instanceof Error ? n.message : "Signing failed"
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async function x(t) {
|
|
31
|
-
const [e, a] = t;
|
|
32
|
-
await o(a);
|
|
33
|
-
try {
|
|
34
|
-
const n = JSON.parse(e);
|
|
35
|
-
return (await m({
|
|
36
|
-
evmAccount: a,
|
|
37
|
-
typedData: n
|
|
38
|
-
})).signature;
|
|
39
|
-
} catch (n) {
|
|
40
|
-
throw new s(
|
|
41
|
-
i.provider.userRejectedRequest,
|
|
42
|
-
n instanceof Error ? n.message : "Signing failed"
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async function T(t) {
|
|
47
|
-
const [e] = t, n = (await f()).evmAccounts[0];
|
|
48
|
-
try {
|
|
49
|
-
return (await l({
|
|
50
|
-
evmAccount: n,
|
|
51
|
-
transaction: {
|
|
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"
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async function b(t) {
|
|
73
|
-
const [e, a] = t;
|
|
74
|
-
await o(a);
|
|
75
|
-
try {
|
|
76
|
-
return (await h({
|
|
77
|
-
evmAccount: a,
|
|
78
|
-
hash: e
|
|
79
|
-
})).signature;
|
|
80
|
-
} catch (n) {
|
|
81
|
-
throw new s(
|
|
82
|
-
i.provider.userRejectedRequest,
|
|
83
|
-
n instanceof Error ? n.message : "Signing failed"
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
async function C(t) {
|
|
88
|
-
return `0x${t.getState().chainId.toString(16)}`;
|
|
89
|
-
}
|
|
90
|
-
async function F(t) {
|
|
91
|
-
await c() && await g(), t.emit("disconnect", new d.DisconnectedError());
|
|
92
|
-
}
|
|
93
|
-
function G(t, e) {
|
|
94
|
-
const a = Number.parseInt(t[0].chainId, 16);
|
|
95
|
-
e.getState().setChainId(a);
|
|
1
|
+
async function t() {
|
|
2
|
+
const r = new Uint8Array(16);
|
|
3
|
+
return window.crypto.getRandomValues(r), Array.from(r, (n) => n.toString(16).padStart(2, "0")).join("");
|
|
96
4
|
}
|
|
97
5
|
export {
|
|
98
|
-
|
|
99
|
-
C as handleChainId,
|
|
100
|
-
F as handleDisconnect,
|
|
101
|
-
b as handleEthSign,
|
|
102
|
-
D as handlePersonalSign,
|
|
103
|
-
R as handleRequestAccounts,
|
|
104
|
-
T as handleSendTransaction,
|
|
105
|
-
x as handleSignTypedData,
|
|
106
|
-
G as handleSwitchEthereumChain
|
|
6
|
+
t as generateRandomId
|
|
107
7
|
};
|
package/dist/esm/index17.js
CHANGED
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id: 84532,
|
|
6
|
-
network: "base-sepolia",
|
|
7
|
-
name: "Base Sepolia",
|
|
8
|
-
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
9
|
-
rpcUrls: {
|
|
10
|
-
default: {
|
|
11
|
-
http: ["https://sepolia.base.org"]
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
blockExplorers: {
|
|
15
|
-
default: {
|
|
16
|
-
name: "Basescan",
|
|
17
|
-
url: "https://sepolia.basescan.org",
|
|
18
|
-
apiUrl: "https://api-sepolia.basescan.org/api"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
contracts: {
|
|
22
|
-
...a.contracts,
|
|
23
|
-
disputeGameFactory: {
|
|
24
|
-
[e]: {
|
|
25
|
-
address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
l2OutputOracle: {
|
|
29
|
-
[e]: {
|
|
30
|
-
address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
portal: {
|
|
34
|
-
[e]: {
|
|
35
|
-
address: "0x49f53e41452c74589e85ca1677426ba426459e85",
|
|
36
|
-
blockCreated: 4446677
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
l1StandardBridge: {
|
|
40
|
-
[e]: {
|
|
41
|
-
address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120",
|
|
42
|
-
blockCreated: 4446677
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
multicall3: {
|
|
46
|
-
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
47
|
-
blockCreated: 1059647
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
testnet: !0,
|
|
51
|
-
sourceId: e
|
|
52
|
-
});
|
|
1
|
+
const h = async (t) => {
|
|
2
|
+
const a = await window.crypto.subtle.digest("SHA-256", t), r = new Uint8Array(a);
|
|
3
|
+
return Array.from(r).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
4
|
+
};
|
|
53
5
|
export {
|
|
54
|
-
|
|
6
|
+
h as hash
|
|
55
7
|
};
|