@coinbase/cdp-hooks 0.0.24 → 0.0.25
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 +11 -11
- package/dist/esm/index16.js +1 -1
- package/dist/esm/index19.js +2 -2
- package/dist/esm/index20.js +1 -1
- package/dist/esm/index21.js +2 -2
- package/dist/esm/index211.js +9 -12
- package/dist/esm/index212.js +16 -9
- package/dist/esm/index213.js +21 -15
- package/dist/esm/index214.js +30 -22
- package/dist/esm/index215.js +2 -31
- package/dist/esm/index216.js +14 -2
- package/dist/esm/index217.js +12 -13
- package/dist/esm/index218.js +45 -10
- package/dist/esm/index219.js +9 -47
- package/dist/esm/index22.js +1 -1
- package/dist/esm/index220.js +12 -8
- package/dist/esm/index221.js +14 -13
- package/dist/esm/index222.js +8 -14
- package/dist/esm/index223.js +13 -6
- package/dist/esm/index224.js +24 -15
- package/dist/esm/index225.js +11 -24
- package/dist/esm/index226.js +23 -10
- package/dist/esm/index227.js +51 -24
- package/dist/esm/index228.js +17 -51
- package/dist/esm/index229.js +14 -17
- package/dist/esm/index23.js +2 -2
- package/dist/esm/index230.js +11 -14
- package/dist/esm/index231.js +12 -11
- package/dist/esm/index24.js +5 -5
- package/dist/esm/index25.js +2 -2
- package/dist/esm/index32.js +4 -4
- package/dist/esm/index42.js +1 -1
- package/dist/esm/index43.js +1 -1
- package/dist/esm/index48.js +1 -1
- package/dist/esm/index56.js +3 -3
- package/dist/esm/index57.js +2 -2
- package/dist/esm/index60.js +1 -1
- package/dist/esm/index61.js +1 -1
- package/dist/esm/index68.js +3 -3
- package/dist/esm/index71.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ hooks to work correctly.
|
|
|
40
40
|
|
|
41
41
|
Update your main application file (e.g., main.tsx) to include the provider:
|
|
42
42
|
|
|
43
|
-
```tsx
|
|
43
|
+
```tsx lines
|
|
44
44
|
import { CDPHooksProvider } from "@coinbase/cdp-hooks";
|
|
45
45
|
import { App } from './App'; // Your main App component
|
|
46
46
|
|
|
@@ -62,7 +62,7 @@ function App() {
|
|
|
62
62
|
|
|
63
63
|
You can configure the provider to automatically create Smart Accounts for new users:
|
|
64
64
|
|
|
65
|
-
```tsx
|
|
65
|
+
```tsx lines
|
|
66
66
|
function App() {
|
|
67
67
|
return (
|
|
68
68
|
<CDPHooksProvider
|
|
@@ -87,7 +87,7 @@ End user authentication proceeds in two steps:
|
|
|
87
87
|
|
|
88
88
|
The following code demonstrates this flow:
|
|
89
89
|
|
|
90
|
-
```tsx
|
|
90
|
+
```tsx lines
|
|
91
91
|
import { useSignInWithEmail, useVerifyEmailOTP } from "@coinbase/cdp-hooks";
|
|
92
92
|
|
|
93
93
|
function SignIn() {
|
|
@@ -125,7 +125,7 @@ function SignIn() {
|
|
|
125
125
|
|
|
126
126
|
Once the end user has signed in, you can display their information in your application:
|
|
127
127
|
|
|
128
|
-
```tsx
|
|
128
|
+
```tsx lines
|
|
129
129
|
import { useCurrentUser, useEvmAddress } from "@coinbase/cdp-hooks";
|
|
130
130
|
|
|
131
131
|
function UserInformation() {
|
|
@@ -164,7 +164,7 @@ We support signing and sending a Blockchain transaction in a single action on th
|
|
|
164
164
|
- Optimism
|
|
165
165
|
- Polygon
|
|
166
166
|
|
|
167
|
-
```tsx
|
|
167
|
+
```tsx lines
|
|
168
168
|
import { useSendEvmTransaction, useEvmAddress } from "@coinbase/cdp-hooks";
|
|
169
169
|
|
|
170
170
|
function SendTransaction() {
|
|
@@ -202,7 +202,7 @@ function SendTransaction() {
|
|
|
202
202
|
For networks other than those supported by the CDP APIs, your end user must sign the transaction, and then
|
|
203
203
|
you must broadcast the transaction yourself. This example uses the public client from `viem` to broadcast the transaction.
|
|
204
204
|
|
|
205
|
-
```tsx
|
|
205
|
+
```tsx lines
|
|
206
206
|
import { useSignEvmTransaction, useEvmAddress } from "@coinbase/cdp-hooks";
|
|
207
207
|
import { http, createPublicClient } from "viem";
|
|
208
208
|
import { tron } from "viem/chains";
|
|
@@ -254,7 +254,7 @@ function CrossChainTransaction() {
|
|
|
254
254
|
|
|
255
255
|
End users can sign EVM messages, hashes, and typed data to generate signatures for various onchain applications.
|
|
256
256
|
|
|
257
|
-
```tsx
|
|
257
|
+
```tsx lines
|
|
258
258
|
import { useSignEvmMessage, useSignEvmTypedData, useEvmAddress } from "@coinbase/cdp-hooks";
|
|
259
259
|
|
|
260
260
|
function SignData() {
|
|
@@ -327,7 +327,7 @@ function SignData() {
|
|
|
327
327
|
|
|
328
328
|
End users can export their private keys from their embedded wallet, allowing them to import it into an EVM-compatible wallet of their choice.
|
|
329
329
|
|
|
330
|
-
```tsx
|
|
330
|
+
```tsx lines
|
|
331
331
|
import { useExportEvmAccount, useEvmAddress } from "@coinbase/cdp-hooks";
|
|
332
332
|
|
|
333
333
|
function ExportKey() {
|
|
@@ -361,7 +361,7 @@ Smart Accounts provide advanced account abstraction features with React hooks.
|
|
|
361
361
|
|
|
362
362
|
Send user operations from Smart Accounts with support for multiple calls and paymaster sponsorship. The hook returns a method to execute the user operation and `status`, `data`, and `error` properties to read the result of the user operation:
|
|
363
363
|
|
|
364
|
-
```tsx
|
|
364
|
+
```tsx lines
|
|
365
365
|
import { useSendUserOperation, useCurrentUser } from "@coinbase/cdp-hooks";
|
|
366
366
|
|
|
367
367
|
function SendUserOperation() {
|
|
@@ -428,7 +428,7 @@ function SendUserOperation() {
|
|
|
428
428
|
|
|
429
429
|
Use the `useWaitForUserOperation` hook to poll for user operation status and provide real-time updates. This hook immediately fires off a query to get the result of the user operation:
|
|
430
430
|
|
|
431
|
-
```tsx
|
|
431
|
+
```tsx lines
|
|
432
432
|
import { useWaitForUserOperation, useState } from "react";
|
|
433
433
|
|
|
434
434
|
function WaitForUserOperation() {
|
|
@@ -472,7 +472,7 @@ function WaitForUserOperation() {
|
|
|
472
472
|
|
|
473
473
|
You can control when the `useWaitForUserOperation` hook should start polling using the `enabled` parameter:
|
|
474
474
|
|
|
475
|
-
```tsx
|
|
475
|
+
```tsx lines
|
|
476
476
|
function ConditionalWaitForUserOperation() {
|
|
477
477
|
const [shouldPoll, setShouldPoll] = useState(false);
|
|
478
478
|
|
package/dist/esm/index16.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TimeoutError as m, HttpRequestError as i } from "./index13.js";
|
|
2
2
|
import { withTimeout as j } from "./index177.js";
|
|
3
3
|
import { stringify as c } from "./index103.js";
|
|
4
|
-
import { idCache as y } from "./
|
|
4
|
+
import { idCache as y } from "./index231.js";
|
|
5
5
|
function E(s, o = {}) {
|
|
6
6
|
return {
|
|
7
7
|
async request(p) {
|
package/dist/esm/index19.js
CHANGED
|
@@ -4,10 +4,10 @@ import { encodeFunctionData as R } from "./index137.js";
|
|
|
4
4
|
import { getChainContractAddress as b } from "./index173.js";
|
|
5
5
|
import { trim as w } from "./index122.js";
|
|
6
6
|
import { toHex as C } from "./index109.js";
|
|
7
|
-
import { isNullUniversalResolverError as y } from "./
|
|
7
|
+
import { isNullUniversalResolverError as y } from "./index211.js";
|
|
8
8
|
import { localBatchGatewayUrl as x } from "./index163.js";
|
|
9
9
|
import { namehash as i } from "./index112.js";
|
|
10
|
-
import { packetToBytes as N } from "./
|
|
10
|
+
import { packetToBytes as N } from "./index212.js";
|
|
11
11
|
import { getAction as B } from "./index206.js";
|
|
12
12
|
import { readContract as T } from "./index55.js";
|
|
13
13
|
async function J(a, o) {
|
package/dist/esm/index20.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAvatarRecord as m } from "./
|
|
1
|
+
import { parseAvatarRecord as m } from "./index213.js";
|
|
2
2
|
import { getAction as u } from "./index206.js";
|
|
3
3
|
import { getEnsText as f } from "./index23.js";
|
|
4
4
|
async function y(t, { blockNumber: a, blockTag: e, assetGatewayUrls: n, name: o, gatewayUrls: c, strict: i, universalResolverAddress: s }) {
|
package/dist/esm/index21.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { universalResolverReverseAbi as f } from "./index72.js";
|
|
2
2
|
import { getChainContractAddress as u } from "./index173.js";
|
|
3
3
|
import { toHex as h } from "./index109.js";
|
|
4
|
-
import { isNullUniversalResolverError as p } from "./
|
|
5
|
-
import { packetToBytes as C } from "./
|
|
4
|
+
import { isNullUniversalResolverError as p } from "./index211.js";
|
|
5
|
+
import { packetToBytes as C } from "./index212.js";
|
|
6
6
|
import { getAction as w } from "./index206.js";
|
|
7
7
|
import { readContract as A } from "./index55.js";
|
|
8
8
|
async function b(e, { address: t, blockNumber: s, blockTag: i, gatewayUrls: a, strict: c, universalResolverAddress: d }) {
|
package/dist/esm/index211.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
};
|
|
1
|
+
import { panicReasons as a } from "./index86.js";
|
|
2
|
+
import { BaseError as s } from "./index82.js";
|
|
3
|
+
import { ContractFunctionRevertedError as t } from "./index85.js";
|
|
4
|
+
function d(e, o) {
|
|
5
|
+
if (!(e instanceof s))
|
|
6
|
+
return !1;
|
|
7
|
+
const r = e.walk((n) => n instanceof t);
|
|
8
|
+
return r instanceof t ? !!(r.data?.errorName === "ResolverNotFound" || r.data?.errorName === "ResolverWildcardNotSupported" || r.data?.errorName === "ResolverNotContract" || r.data?.errorName === "ResolverError" || r.data?.errorName === "HttpError" || r.reason?.includes("Wildcard on non-extended resolvers is not supported") || o === "reverse" && r.reason === a[50]) : !1;
|
|
11
9
|
}
|
|
12
|
-
const t = /* @__PURE__ */ r();
|
|
13
10
|
export {
|
|
14
|
-
|
|
11
|
+
d as isNullUniversalResolverError
|
|
15
12
|
};
|
package/dist/esm/index212.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { stringToBytes as i } from "./index108.js";
|
|
2
|
+
import { encodeLabelhash as h } from "./index244.js";
|
|
3
|
+
import { labelhash as f } from "./index107.js";
|
|
4
|
+
function y(s) {
|
|
5
|
+
const o = s.replace(/^\.|\.$/gm, "");
|
|
6
|
+
if (o.length === 0)
|
|
7
|
+
return new Uint8Array(1);
|
|
8
|
+
const e = new Uint8Array(i(o).byteLength + 2);
|
|
9
|
+
let t = 0;
|
|
10
|
+
const l = o.split(".");
|
|
11
|
+
for (let r = 0; r < l.length; r++) {
|
|
12
|
+
let n = i(l[r]);
|
|
13
|
+
n.byteLength > 255 && (n = i(h(f(l[r])))), e[t] = n.length, e.set(n, t + 1), t += n.length + 1;
|
|
14
|
+
}
|
|
15
|
+
return e.byteLength !== t + 1 ? e.slice(0, t + 1) : e;
|
|
9
16
|
}
|
|
10
17
|
export {
|
|
11
|
-
|
|
18
|
+
y as packetToBytes
|
|
12
19
|
};
|
package/dist/esm/index213.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { parseAvatarUri as o, parseNftUri as f, getNftTokenUri as v, resolveAvatarUri as l, getJsonImage as A, getMetadataAvatarUri as N } from "./index245.js";
|
|
2
|
+
async function b(r, { gatewayUrls: t, record: e }) {
|
|
3
|
+
return /eip155:/i.test(e) ? U(r, { gatewayUrls: t, record: e }) : o({ uri: e, gatewayUrls: t });
|
|
4
|
+
}
|
|
5
|
+
async function U(r, { gatewayUrls: t, record: e }) {
|
|
6
|
+
const i = f(e), s = await v(r, { nft: i }), { uri: a, isOnChain: c, isEncoded: p } = l({ uri: s, gatewayUrls: t });
|
|
7
|
+
if (c && (a.includes("data:application/json;base64,") || a.startsWith("{"))) {
|
|
8
|
+
const d = p ? (
|
|
9
|
+
// if it is encoded, decode it
|
|
10
|
+
atob(a.replace("data:application/json;base64,", ""))
|
|
11
|
+
) : (
|
|
12
|
+
// if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)
|
|
13
|
+
a
|
|
14
|
+
), u = JSON.parse(d);
|
|
15
|
+
return o({ uri: A(u), gatewayUrls: t });
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
let n = i.tokenID;
|
|
18
|
+
return i.namespace === "erc1155" && (n = n.replace("0x", "").padStart(64, "0")), N({
|
|
19
|
+
gatewayUrls: t,
|
|
20
|
+
uri: a.replace(/(?:0x)?{id}/, n)
|
|
21
|
+
});
|
|
16
22
|
}
|
|
17
23
|
export {
|
|
18
|
-
|
|
24
|
+
b as parseAvatarRecord
|
|
19
25
|
};
|
package/dist/esm/index214.js
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { fromNumber as a } from "./index246.js";
|
|
2
|
+
import { toRpc as e } from "./index247.js";
|
|
3
|
+
function n(t) {
|
|
4
|
+
return {
|
|
5
|
+
...typeof t.baseFeePerGas == "bigint" && {
|
|
6
|
+
baseFeePerGas: a(t.baseFeePerGas)
|
|
7
|
+
},
|
|
8
|
+
...typeof t.blobBaseFee == "bigint" && {
|
|
9
|
+
blobBaseFee: a(t.blobBaseFee)
|
|
10
|
+
},
|
|
11
|
+
...typeof t.feeRecipient == "string" && {
|
|
12
|
+
feeRecipient: t.feeRecipient
|
|
13
|
+
},
|
|
14
|
+
...typeof t.gasLimit == "bigint" && {
|
|
15
|
+
gasLimit: a(t.gasLimit)
|
|
16
|
+
},
|
|
17
|
+
...typeof t.number == "bigint" && {
|
|
18
|
+
number: a(t.number)
|
|
19
|
+
},
|
|
20
|
+
...typeof t.prevRandao == "bigint" && {
|
|
21
|
+
prevRandao: a(t.prevRandao)
|
|
22
|
+
},
|
|
23
|
+
...typeof t.time == "bigint" && {
|
|
24
|
+
time: a(t.time)
|
|
25
|
+
},
|
|
26
|
+
...t.withdrawals && {
|
|
27
|
+
withdrawals: t.withdrawals.map(e)
|
|
28
|
+
}
|
|
29
|
+
};
|
|
22
30
|
}
|
|
23
31
|
export {
|
|
24
|
-
|
|
32
|
+
n as toRpc
|
|
25
33
|
};
|
package/dist/esm/index215.js
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { toRpc as e } from "./index247.js";
|
|
3
|
-
function n(t) {
|
|
4
|
-
return {
|
|
5
|
-
...typeof t.baseFeePerGas == "bigint" && {
|
|
6
|
-
baseFeePerGas: a(t.baseFeePerGas)
|
|
7
|
-
},
|
|
8
|
-
...typeof t.blobBaseFee == "bigint" && {
|
|
9
|
-
blobBaseFee: a(t.blobBaseFee)
|
|
10
|
-
},
|
|
11
|
-
...typeof t.feeRecipient == "string" && {
|
|
12
|
-
feeRecipient: t.feeRecipient
|
|
13
|
-
},
|
|
14
|
-
...typeof t.gasLimit == "bigint" && {
|
|
15
|
-
gasLimit: a(t.gasLimit)
|
|
16
|
-
},
|
|
17
|
-
...typeof t.number == "bigint" && {
|
|
18
|
-
number: a(t.number)
|
|
19
|
-
},
|
|
20
|
-
...typeof t.prevRandao == "bigint" && {
|
|
21
|
-
prevRandao: a(t.prevRandao)
|
|
22
|
-
},
|
|
23
|
-
...typeof t.time == "bigint" && {
|
|
24
|
-
time: a(t.time)
|
|
25
|
-
},
|
|
26
|
-
...t.withdrawals && {
|
|
27
|
-
withdrawals: t.withdrawals.map(e)
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
1
|
+
const a = "0x82ad56cb";
|
|
31
2
|
export {
|
|
32
|
-
|
|
3
|
+
a as aggregate3Signature
|
|
33
4
|
};
|
package/dist/esm/index216.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { CallExecutionError as c } from "./index85.js";
|
|
2
|
+
import { UnknownNodeError as i } from "./index101.js";
|
|
3
|
+
import { getNodeError as u } from "./index224.js";
|
|
4
|
+
function a(r, { docsPath: t, ...o }) {
|
|
5
|
+
const e = (() => {
|
|
6
|
+
const n = u(r, o);
|
|
7
|
+
return n instanceof i ? r : n;
|
|
8
|
+
})();
|
|
9
|
+
return new c(e, {
|
|
10
|
+
docsPath: t,
|
|
11
|
+
...o
|
|
12
|
+
});
|
|
13
|
+
}
|
|
2
14
|
export {
|
|
3
|
-
a as
|
|
15
|
+
a as getCallError
|
|
4
16
|
};
|
package/dist/esm/index217.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
1
|
+
function y(t, { format: r }) {
|
|
2
|
+
if (!r)
|
|
3
|
+
return {};
|
|
4
|
+
const e = {};
|
|
5
|
+
function i(c) {
|
|
6
|
+
const s = Object.keys(c);
|
|
7
|
+
for (const n of s)
|
|
8
|
+
n in t && (e[n] = t[n]), c[n] && typeof c[n] == "object" && !Array.isArray(c[n]) && i(c[n]);
|
|
9
|
+
}
|
|
10
|
+
const o = r(t || {});
|
|
11
|
+
return i(o), e;
|
|
13
12
|
}
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
y as extract
|
|
16
15
|
};
|
package/dist/esm/index218.js
CHANGED
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
import { InvalidAddressError as a } from "./index104.js";
|
|
2
|
+
import { InvalidBytesLengthError as d } from "./index105.js";
|
|
3
|
+
import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index92.js";
|
|
4
|
+
import { isAddress as l } from "./index131.js";
|
|
5
|
+
import { numberToHex as c } from "./index109.js";
|
|
6
|
+
function s(r) {
|
|
7
|
+
if (!(!r || r.length === 0))
|
|
8
|
+
return r.reduce((t, { slot: e, value: n }) => {
|
|
9
|
+
if (e.length !== 66)
|
|
10
|
+
throw new d({
|
|
11
|
+
size: e.length,
|
|
12
|
+
targetSize: 66,
|
|
13
|
+
type: "hex"
|
|
14
|
+
});
|
|
15
|
+
if (n.length !== 66)
|
|
16
|
+
throw new d({
|
|
17
|
+
size: n.length,
|
|
18
|
+
targetSize: 66,
|
|
19
|
+
type: "hex"
|
|
20
|
+
});
|
|
21
|
+
return t[e] = n, t;
|
|
22
|
+
}, {});
|
|
23
|
+
}
|
|
24
|
+
function m(r) {
|
|
25
|
+
const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
|
|
26
|
+
if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
|
|
27
|
+
if (i.state)
|
|
28
|
+
throw new h();
|
|
29
|
+
i.stateDiff = s(o);
|
|
30
|
+
}
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
function A(r) {
|
|
2
34
|
if (!r)
|
|
3
|
-
return
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
35
|
+
return;
|
|
36
|
+
const t = {};
|
|
37
|
+
for (const { address: e, ...n } of r) {
|
|
38
|
+
if (!l(e, { strict: !1 }))
|
|
39
|
+
throw new a({ address: e });
|
|
40
|
+
if (t[e])
|
|
41
|
+
throw new u({ address: e });
|
|
42
|
+
t[e] = m(n);
|
|
9
43
|
}
|
|
10
|
-
|
|
11
|
-
return i(o), e;
|
|
44
|
+
return t;
|
|
12
45
|
}
|
|
13
46
|
export {
|
|
14
|
-
|
|
47
|
+
m as serializeAccountStateOverride,
|
|
48
|
+
s as serializeStateMapping,
|
|
49
|
+
A as serializeStateOverride
|
|
15
50
|
};
|
package/dist/esm/index219.js
CHANGED
|
@@ -1,50 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (e.length !== 66)
|
|
10
|
-
throw new d({
|
|
11
|
-
size: e.length,
|
|
12
|
-
targetSize: 66,
|
|
13
|
-
type: "hex"
|
|
14
|
-
});
|
|
15
|
-
if (n.length !== 66)
|
|
16
|
-
throw new d({
|
|
17
|
-
size: n.length,
|
|
18
|
-
targetSize: 66,
|
|
19
|
-
type: "hex"
|
|
20
|
-
});
|
|
21
|
-
return t[e] = n, t;
|
|
22
|
-
}, {});
|
|
23
|
-
}
|
|
24
|
-
function m(r) {
|
|
25
|
-
const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
|
|
26
|
-
if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
|
|
27
|
-
if (i.state)
|
|
28
|
-
throw new h();
|
|
29
|
-
i.stateDiff = s(o);
|
|
30
|
-
}
|
|
31
|
-
return i;
|
|
32
|
-
}
|
|
33
|
-
function A(r) {
|
|
34
|
-
if (!r)
|
|
35
|
-
return;
|
|
36
|
-
const t = {};
|
|
37
|
-
for (const { address: e, ...n } of r) {
|
|
38
|
-
if (!l(e, { strict: !1 }))
|
|
39
|
-
throw new a({ address: e });
|
|
40
|
-
if (t[e])
|
|
41
|
-
throw new u({ address: e });
|
|
42
|
-
t[e] = m(n);
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
1
|
+
import { recoverAddress as i } from "./index149.js";
|
|
2
|
+
import { hashAuthorization as e } from "./index248.js";
|
|
3
|
+
async function a(o) {
|
|
4
|
+
const { authorization: r, signature: t } = o;
|
|
5
|
+
return i({
|
|
6
|
+
hash: e(r),
|
|
7
|
+
signature: t ?? r
|
|
8
|
+
});
|
|
45
9
|
}
|
|
46
10
|
export {
|
|
47
|
-
|
|
48
|
-
s as serializeStateMapping,
|
|
49
|
-
A as serializeStateOverride
|
|
11
|
+
a as recoverAuthorizationAddress
|
|
50
12
|
};
|
package/dist/esm/index22.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getChainContractAddress as l } from "./index173.js";
|
|
2
2
|
import { toHex as u } from "./index109.js";
|
|
3
|
-
import { packetToBytes as v } from "./
|
|
3
|
+
import { packetToBytes as v } from "./index212.js";
|
|
4
4
|
import { getAction as f } from "./index206.js";
|
|
5
5
|
import { readContract as m } from "./index55.js";
|
|
6
6
|
async function A(o, r) {
|
package/dist/esm/index220.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { EstimateGasExecutionError as i } from "./index100.js";
|
|
2
|
+
import { UnknownNodeError as m } from "./index101.js";
|
|
3
|
+
import { getNodeError as s } from "./index224.js";
|
|
4
|
+
function a(r, { docsPath: e, ...o }) {
|
|
5
|
+
const n = (() => {
|
|
6
|
+
const t = s(r, o);
|
|
7
|
+
return t instanceof m ? r : t;
|
|
8
|
+
})();
|
|
9
|
+
return new i(n, {
|
|
10
|
+
docsPath: e,
|
|
11
|
+
...o
|
|
8
12
|
});
|
|
9
13
|
}
|
|
10
14
|
export {
|
|
11
|
-
a as
|
|
15
|
+
a as getEstimateGasError
|
|
12
16
|
};
|
package/dist/esm/index221.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { BaseError as t } from "./index82.js";
|
|
2
|
+
class r extends t {
|
|
3
|
+
constructor({ address: o }) {
|
|
4
|
+
super(`No EIP-712 domain found on contract "${o}".`, {
|
|
5
|
+
metaMessages: [
|
|
6
|
+
"Ensure that:",
|
|
7
|
+
`- The contract is deployed at the address "${o}".`,
|
|
8
|
+
"- `eip712Domain()` function exists on the contract.",
|
|
9
|
+
"- `eip712Domain()` function matches signature to ERC-5267 specification."
|
|
10
|
+
],
|
|
11
|
+
name: "Eip712DomainNotFoundError"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
13
14
|
}
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
r as Eip712DomainNotFoundError
|
|
16
17
|
};
|
package/dist/esm/index222.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"- `eip712Domain()` function exists on the contract.",
|
|
9
|
-
"- `eip712Domain()` function matches signature to ERC-5267 specification."
|
|
10
|
-
],
|
|
11
|
-
name: "Eip712DomainNotFoundError"
|
|
12
|
-
});
|
|
13
|
-
}
|
|
1
|
+
function r(a) {
|
|
2
|
+
return {
|
|
3
|
+
baseFeePerGas: a.baseFeePerGas.map((e) => BigInt(e)),
|
|
4
|
+
gasUsedRatio: a.gasUsedRatio,
|
|
5
|
+
oldestBlock: BigInt(a.oldestBlock),
|
|
6
|
+
reward: a.reward?.map((e) => e.map((t) => BigInt(t)))
|
|
7
|
+
};
|
|
14
8
|
}
|
|
15
9
|
export {
|
|
16
|
-
r as
|
|
10
|
+
r as formatFeeHistory
|
|
17
11
|
};
|
package/dist/esm/index223.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { hexToNumber as a } from "./index142.js";
|
|
2
|
+
function t(e) {
|
|
3
|
+
return e.map((n) => ({
|
|
4
|
+
...n,
|
|
5
|
+
value: BigInt(n.value)
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
function o(e) {
|
|
2
9
|
return {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
...e,
|
|
11
|
+
balance: e.balance ? BigInt(e.balance) : void 0,
|
|
12
|
+
nonce: e.nonce ? a(e.nonce) : void 0,
|
|
13
|
+
storageProof: e.storageProof ? t(e.storageProof) : void 0
|
|
7
14
|
};
|
|
8
15
|
}
|
|
9
16
|
export {
|
|
10
|
-
|
|
17
|
+
o as formatProof
|
|
11
18
|
};
|
package/dist/esm/index224.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
import { BaseError as a } from "./index82.js";
|
|
2
|
+
import { ExecutionRevertedError as s, FeeCapTooHighError as r, FeeCapTooLowError as i, NonceTooHighError as c, NonceTooLowError as u, NonceMaxValueError as d, InsufficientFundsError as f, IntrinsicGasTooHighError as w, IntrinsicGasTooLowError as E, TransactionTypeNotSupportedError as m, TipAboveFeeCapError as g, UnknownNodeError as F } from "./index101.js";
|
|
3
|
+
function G(e, n) {
|
|
4
|
+
const o = (e.details || "").toLowerCase(), t = e instanceof a ? e.walk((x) => x?.code === s.code) : e;
|
|
5
|
+
return t instanceof a ? new s({
|
|
6
|
+
cause: e,
|
|
7
|
+
message: t.details
|
|
8
|
+
}) : s.nodeMessage.test(o) ? new s({
|
|
9
|
+
cause: e,
|
|
10
|
+
message: e.details
|
|
11
|
+
}) : r.nodeMessage.test(o) ? new r({
|
|
12
|
+
cause: e,
|
|
13
|
+
maxFeePerGas: n?.maxFeePerGas
|
|
14
|
+
}) : i.nodeMessage.test(o) ? new i({
|
|
15
|
+
cause: e,
|
|
16
|
+
maxFeePerGas: n?.maxFeePerGas
|
|
17
|
+
}) : c.nodeMessage.test(o) ? new c({ cause: e, nonce: n?.nonce }) : u.nodeMessage.test(o) ? new u({ cause: e, nonce: n?.nonce }) : d.nodeMessage.test(o) ? new d({ cause: e, nonce: n?.nonce }) : f.nodeMessage.test(o) ? new f({ cause: e }) : w.nodeMessage.test(o) ? new w({ cause: e, gas: n?.gas }) : E.nodeMessage.test(o) ? new E({ cause: e, gas: n?.gas }) : m.nodeMessage.test(o) ? new m({ cause: e }) : g.nodeMessage.test(o) ? new g({
|
|
18
|
+
cause: e,
|
|
19
|
+
maxFeePerGas: n?.maxFeePerGas,
|
|
20
|
+
maxPriorityFeePerGas: n?.maxPriorityFeePerGas
|
|
21
|
+
}) : new F({
|
|
22
|
+
cause: e
|
|
23
|
+
});
|
|
15
24
|
}
|
|
16
25
|
export {
|
|
17
|
-
|
|
26
|
+
G as getNodeError
|
|
18
27
|
};
|
package/dist/esm/index225.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
message: e.details
|
|
11
|
-
}) : r.nodeMessage.test(o) ? new r({
|
|
12
|
-
cause: e,
|
|
13
|
-
maxFeePerGas: n?.maxFeePerGas
|
|
14
|
-
}) : i.nodeMessage.test(o) ? new i({
|
|
15
|
-
cause: e,
|
|
16
|
-
maxFeePerGas: n?.maxFeePerGas
|
|
17
|
-
}) : c.nodeMessage.test(o) ? new c({ cause: e, nonce: n?.nonce }) : u.nodeMessage.test(o) ? new u({ cause: e, nonce: n?.nonce }) : d.nodeMessage.test(o) ? new d({ cause: e, nonce: n?.nonce }) : f.nodeMessage.test(o) ? new f({ cause: e }) : w.nodeMessage.test(o) ? new w({ cause: e, gas: n?.gas }) : E.nodeMessage.test(o) ? new E({ cause: e, gas: n?.gas }) : m.nodeMessage.test(o) ? new m({ cause: e }) : g.nodeMessage.test(o) ? new g({
|
|
18
|
-
cause: e,
|
|
19
|
-
maxFeePerGas: n?.maxFeePerGas,
|
|
20
|
-
maxPriorityFeePerGas: n?.maxPriorityFeePerGas
|
|
21
|
-
}) : new F({
|
|
22
|
-
cause: e
|
|
23
|
-
});
|
|
1
|
+
import { from as t } from "./index249.js";
|
|
2
|
+
import { encode as m } from "./index250.js";
|
|
3
|
+
import { concat as c } from "./index246.js";
|
|
4
|
+
function s(o, e) {
|
|
5
|
+
const { bytecode: r, args: n } = e;
|
|
6
|
+
return c(r, o.inputs?.length && n?.length ? m(o.inputs, n) : "0x");
|
|
7
|
+
}
|
|
8
|
+
function u(o) {
|
|
9
|
+
return t(o);
|
|
24
10
|
}
|
|
25
11
|
export {
|
|
26
|
-
|
|
12
|
+
s as encode,
|
|
13
|
+
u as from
|
|
27
14
|
};
|
package/dist/esm/index226.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { from as
|
|
2
|
-
import { encode as
|
|
3
|
-
import { concat as
|
|
4
|
-
function
|
|
5
|
-
const {
|
|
6
|
-
|
|
1
|
+
import { from as c, fromAbi as m, NotFoundError as i, getSelector as s } from "./index249.js";
|
|
2
|
+
import { encode as u } from "./index250.js";
|
|
3
|
+
import { concat as d } from "./index246.js";
|
|
4
|
+
function S(o, ...t) {
|
|
5
|
+
const { overloads: r } = o, e = r ? p([o, ...r], o.name, {
|
|
6
|
+
args: t[0]
|
|
7
|
+
}) : o, n = l(e), f = t.length > 0 ? u(e.inputs, t[0]) : void 0;
|
|
8
|
+
return f ? d(n, f) : n;
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
+
function $(o, t = {}) {
|
|
11
|
+
return c(o, t);
|
|
12
|
+
}
|
|
13
|
+
function p(o, t, r) {
|
|
14
|
+
const e = m(o, t, r);
|
|
15
|
+
if (e.type !== "function")
|
|
16
|
+
throw new i({ name: t, type: "function" });
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function l(o) {
|
|
20
|
+
return s(o);
|
|
10
21
|
}
|
|
11
22
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
S as encodeData,
|
|
24
|
+
$ as from,
|
|
25
|
+
p as fromAbi,
|
|
26
|
+
l as getSelector
|
|
14
27
|
};
|
package/dist/esm/index227.js
CHANGED
|
@@ -1,27 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { universalSignatureValidatorAbi as d } from "./index72.js";
|
|
2
|
+
import { universalSignatureValidatorByteCode as l } from "./index74.js";
|
|
3
|
+
import { CallExecutionError as g } from "./index85.js";
|
|
4
|
+
import { encodeDeployData as y } from "./index134.js";
|
|
5
|
+
import { getAddress as S } from "./index119.js";
|
|
6
|
+
import { isAddressEqual as h } from "./index141.js";
|
|
7
|
+
import { isHex as v } from "./index145.js";
|
|
8
|
+
import { bytesToHex as x } from "./index109.js";
|
|
9
|
+
import { getAction as b } from "./index206.js";
|
|
10
|
+
import { isErc6492Signature as A } from "./index155.js";
|
|
11
|
+
import { recoverAddress as w } from "./index149.js";
|
|
12
|
+
import { serializeErc6492Signature as E } from "./index156.js";
|
|
13
|
+
import { serializeSignature as V } from "./index153.js";
|
|
14
|
+
import { call as D } from "./index24.js";
|
|
15
|
+
import { encodeFunctionData as H } from "./index137.js";
|
|
16
|
+
import { hexToBool as z } from "./index142.js";
|
|
17
|
+
async function Q(o, p) {
|
|
18
|
+
const { address: i, factory: n, factoryData: s, hash: a, signature: r, universalSignatureVerifierAddress: f = o.chain?.contracts?.universalSignatureVerifier?.address, ...m } = p, t = v(r) ? r : typeof r == "object" && "r" in r && "s" in r ? V(r) : x(r), c = await (async () => !n && !s || A(t) ? t : E({
|
|
19
|
+
address: n,
|
|
20
|
+
data: s,
|
|
21
|
+
signature: t
|
|
22
|
+
}))();
|
|
23
|
+
try {
|
|
24
|
+
const e = f ? {
|
|
25
|
+
to: f,
|
|
26
|
+
data: H({
|
|
27
|
+
abi: d,
|
|
28
|
+
functionName: "isValidSig",
|
|
29
|
+
args: [i, a, c]
|
|
30
|
+
}),
|
|
31
|
+
...m
|
|
32
|
+
} : {
|
|
33
|
+
data: y({
|
|
34
|
+
abi: d,
|
|
35
|
+
args: [i, a, c],
|
|
36
|
+
bytecode: l
|
|
37
|
+
}),
|
|
38
|
+
...m
|
|
39
|
+
}, { data: u } = await b(o, D, "call")(e);
|
|
40
|
+
return z(u ?? "0x0");
|
|
41
|
+
} catch (e) {
|
|
42
|
+
try {
|
|
43
|
+
if (h(S(i), await w({ hash: a, signature: r })))
|
|
44
|
+
return !0;
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
if (e instanceof g)
|
|
48
|
+
return !1;
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
21
51
|
}
|
|
22
52
|
export {
|
|
23
|
-
|
|
24
|
-
$ as from,
|
|
25
|
-
p as fromAbi,
|
|
26
|
-
l as getSelector
|
|
53
|
+
Q as verifyHash
|
|
27
54
|
};
|
package/dist/esm/index228.js
CHANGED
|
@@ -1,54 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { hexToBool as z } from "./index142.js";
|
|
17
|
-
async function Q(o, p) {
|
|
18
|
-
const { address: i, factory: n, factoryData: s, hash: a, signature: r, universalSignatureVerifierAddress: f = o.chain?.contracts?.universalSignatureVerifier?.address, ...m } = p, t = v(r) ? r : typeof r == "object" && "r" in r && "s" in r ? V(r) : x(r), c = await (async () => !n && !s || A(t) ? t : E({
|
|
19
|
-
address: n,
|
|
20
|
-
data: s,
|
|
21
|
-
signature: t
|
|
22
|
-
}))();
|
|
23
|
-
try {
|
|
24
|
-
const e = f ? {
|
|
25
|
-
to: f,
|
|
26
|
-
data: H({
|
|
27
|
-
abi: d,
|
|
28
|
-
functionName: "isValidSig",
|
|
29
|
-
args: [i, a, c]
|
|
30
|
-
}),
|
|
31
|
-
...m
|
|
32
|
-
} : {
|
|
33
|
-
data: y({
|
|
34
|
-
abi: d,
|
|
35
|
-
args: [i, a, c],
|
|
36
|
-
bytecode: l
|
|
37
|
-
}),
|
|
38
|
-
...m
|
|
39
|
-
}, { data: u } = await b(o, D, "call")(e);
|
|
40
|
-
return z(u ?? "0x0");
|
|
41
|
-
} catch (e) {
|
|
42
|
-
try {
|
|
43
|
-
if (h(S(i), await w({ hash: a, signature: r })))
|
|
44
|
-
return !0;
|
|
45
|
-
} catch {
|
|
46
|
-
}
|
|
47
|
-
if (e instanceof g)
|
|
48
|
-
return !1;
|
|
49
|
-
throw e;
|
|
50
|
-
}
|
|
1
|
+
function x(e) {
|
|
2
|
+
const { scheme: n, statement: t, ...c } = e.match(f)?.groups ?? {}, { chainId: s, expirationTime: i, issuedAt: o, notBefore: r, requestId: a, ...d } = e.match(p)?.groups ?? {}, u = e.split("Resources:")[1]?.split(`
|
|
3
|
+
- `).slice(1);
|
|
4
|
+
return {
|
|
5
|
+
...c,
|
|
6
|
+
...d,
|
|
7
|
+
...s ? { chainId: Number(s) } : {},
|
|
8
|
+
...i ? { expirationTime: new Date(i) } : {},
|
|
9
|
+
...o ? { issuedAt: new Date(o) } : {},
|
|
10
|
+
...r ? { notBefore: new Date(r) } : {},
|
|
11
|
+
...a ? { requestId: a } : {},
|
|
12
|
+
...u ? { resources: u } : {},
|
|
13
|
+
...n ? { scheme: n } : {},
|
|
14
|
+
...t ? { statement: t } : {}
|
|
15
|
+
};
|
|
51
16
|
}
|
|
17
|
+
const f = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/, p = /(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;
|
|
52
18
|
export {
|
|
53
|
-
|
|
19
|
+
x as parseSiweMessage
|
|
54
20
|
};
|
package/dist/esm/index229.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
...t ? { statement: t } : {}
|
|
15
|
-
};
|
|
1
|
+
import { isAddress as f } from "./index131.js";
|
|
2
|
+
import { isAddressEqual as o } from "./index141.js";
|
|
3
|
+
function l(n) {
|
|
4
|
+
const { address: r, domain: s, message: e, nonce: t, scheme: a, time: i = /* @__PURE__ */ new Date() } = n;
|
|
5
|
+
if (s && e.domain !== s || t && e.nonce !== t || a && e.scheme !== a || e.expirationTime && i >= e.expirationTime || e.notBefore && i < e.notBefore)
|
|
6
|
+
return !1;
|
|
7
|
+
try {
|
|
8
|
+
if (!e.address || !f(e.address, { strict: !1 }) || r && !o(e.address, r))
|
|
9
|
+
return !1;
|
|
10
|
+
} catch {
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
return !0;
|
|
16
14
|
}
|
|
17
|
-
const f = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/, p = /(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;
|
|
18
15
|
export {
|
|
19
|
-
|
|
16
|
+
l as validateSiweMessage
|
|
20
17
|
};
|
package/dist/esm/index23.js
CHANGED
|
@@ -3,10 +3,10 @@ import { decodeFunctionResult as p } from "./index130.js";
|
|
|
3
3
|
import { encodeFunctionData as A } from "./index137.js";
|
|
4
4
|
import { getChainContractAddress as R } from "./index173.js";
|
|
5
5
|
import { toHex as b } from "./index109.js";
|
|
6
|
-
import { isNullUniversalResolverError as g } from "./
|
|
6
|
+
import { isNullUniversalResolverError as g } from "./index211.js";
|
|
7
7
|
import { localBatchGatewayUrl as w } from "./index163.js";
|
|
8
8
|
import { namehash as x } from "./index112.js";
|
|
9
|
-
import { packetToBytes as C } from "./
|
|
9
|
+
import { packetToBytes as C } from "./index212.js";
|
|
10
10
|
import { getAction as y } from "./index206.js";
|
|
11
11
|
import { readContract as N } from "./index55.js";
|
|
12
12
|
async function j(n, e) {
|
package/dist/esm/index230.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} catch {
|
|
11
|
-
return !1;
|
|
12
|
-
}
|
|
13
|
-
return !0;
|
|
1
|
+
import { LruMap as u } from "./index179.js";
|
|
2
|
+
const t = /* @__PURE__ */ new u(8192);
|
|
3
|
+
function s(r, { enabled: o = !0, id: e }) {
|
|
4
|
+
if (!o || !e)
|
|
5
|
+
return r();
|
|
6
|
+
if (t.get(e))
|
|
7
|
+
return t.get(e);
|
|
8
|
+
const n = r().finally(() => t.delete(e));
|
|
9
|
+
return t.set(e, n), n;
|
|
14
10
|
}
|
|
15
11
|
export {
|
|
16
|
-
|
|
12
|
+
t as promiseCache,
|
|
13
|
+
s as withDedupe
|
|
17
14
|
};
|
package/dist/esm/index231.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
function r() {
|
|
2
|
+
return {
|
|
3
|
+
current: 0,
|
|
4
|
+
take() {
|
|
5
|
+
return this.current++;
|
|
6
|
+
},
|
|
7
|
+
reset() {
|
|
8
|
+
this.current = 0;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
10
11
|
}
|
|
12
|
+
const t = /* @__PURE__ */ r();
|
|
11
13
|
export {
|
|
12
|
-
t as
|
|
13
|
-
s as withDedupe
|
|
14
|
+
t as idCache
|
|
14
15
|
};
|
package/dist/esm/index24.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toRpc as $ } from "./
|
|
1
|
+
import { toRpc as $ } from "./index214.js";
|
|
2
2
|
import { parseAccount as W } from "./index11.js";
|
|
3
3
|
import { multicall3Abi as O } from "./index72.js";
|
|
4
|
-
import { aggregate3Signature as I } from "./
|
|
4
|
+
import { aggregate3Signature as I } from "./index215.js";
|
|
5
5
|
import { deploylessCallViaBytecodeBytecode as J, deploylessCallViaFactoryBytecode as K } from "./index74.js";
|
|
6
6
|
import { BaseError as N } from "./index82.js";
|
|
7
7
|
import { ClientChainNotConfiguredError as P, ChainDoesNotSupportContract as Q } from "./index97.js";
|
|
@@ -11,11 +11,11 @@ import { encodeDeployData as T } from "./index134.js";
|
|
|
11
11
|
import { encodeFunctionData as Z } from "./index137.js";
|
|
12
12
|
import { getChainContractAddress as tt } from "./index173.js";
|
|
13
13
|
import { numberToHex as V } from "./index109.js";
|
|
14
|
-
import { getCallError as at } from "./
|
|
15
|
-
import { extract as et } from "./
|
|
14
|
+
import { getCallError as at } from "./index216.js";
|
|
15
|
+
import { extract as et } from "./index217.js";
|
|
16
16
|
import { formatTransactionRequest as rt } from "./index144.js";
|
|
17
17
|
import { createBatchScheduler as ot } from "./index15.js";
|
|
18
|
-
import { serializeStateOverride as ct } from "./
|
|
18
|
+
import { serializeStateOverride as ct } from "./index218.js";
|
|
19
19
|
import { assertRequest as nt } from "./index157.js";
|
|
20
20
|
import { parseAbi as z } from "./index196.js";
|
|
21
21
|
async function Et(t, a) {
|
package/dist/esm/index25.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseAccount as P } from "./index11.js";
|
|
2
2
|
import { numberToHex as y } from "./index109.js";
|
|
3
|
-
import { getCallError as F } from "./
|
|
4
|
-
import { extract as L } from "./
|
|
3
|
+
import { getCallError as F } from "./index216.js";
|
|
4
|
+
import { extract as L } from "./index217.js";
|
|
5
5
|
import { formatTransactionRequest as A } from "./index144.js";
|
|
6
6
|
import { assertRequest as G } from "./index157.js";
|
|
7
7
|
async function _(t, e) {
|
package/dist/esm/index32.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { parseAccount as R } from "./index11.js";
|
|
2
2
|
import { BaseError as _ } from "./index82.js";
|
|
3
|
-
import { recoverAuthorizationAddress as A } from "./
|
|
3
|
+
import { recoverAuthorizationAddress as A } from "./index219.js";
|
|
4
4
|
import { numberToHex as x } from "./index109.js";
|
|
5
|
-
import { getEstimateGasError as E } from "./
|
|
6
|
-
import { extract as N } from "./
|
|
5
|
+
import { getEstimateGasError as E } from "./index220.js";
|
|
6
|
+
import { extract as N } from "./index217.js";
|
|
7
7
|
import { formatTransactionRequest as S } from "./index144.js";
|
|
8
|
-
import { serializeStateOverride as I } from "./
|
|
8
|
+
import { serializeStateOverride as I } from "./index218.js";
|
|
9
9
|
import { assertRequest as V } from "./index157.js";
|
|
10
10
|
import { prepareTransactionRequest as C } from "./index69.js";
|
|
11
11
|
import { getBalance as j } from "./index34.js";
|
package/dist/esm/index42.js
CHANGED
package/dist/esm/index43.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as o } from "./index109.js";
|
|
2
|
-
import { formatFeeHistory as f } from "./
|
|
2
|
+
import { formatFeeHistory as f } from "./index222.js";
|
|
3
3
|
async function u(r, { blockCount: i, blockNumber: e, blockTag: n = "latest", rewardPercentiles: s }) {
|
|
4
4
|
const t = typeof e == "bigint" ? o(e) : void 0, a = await r.request({
|
|
5
5
|
method: "eth_feeHistory",
|
package/dist/esm/index48.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as c } from "./index109.js";
|
|
2
|
-
import { formatProof as s } from "./
|
|
2
|
+
import { formatProof as s } from "./index223.js";
|
|
3
3
|
async function d(t, { address: e, blockNumber: o, blockTag: r, storageKeys: n }) {
|
|
4
4
|
const f = r ?? "latest", a = o !== void 0 ? c(o) : void 0, m = await t.request({
|
|
5
5
|
method: "eth_getProof",
|
package/dist/esm/index56.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toRpc as R } from "./
|
|
1
|
+
import { toRpc as R } from "./index214.js";
|
|
2
2
|
import { parseAccount as q } from "./index11.js";
|
|
3
3
|
import { AbiDecodingZeroDataError as D } from "./index79.js";
|
|
4
4
|
import { RawContractError as S } from "./index85.js";
|
|
@@ -8,11 +8,11 @@ import { encodeFunctionData as C } from "./index137.js";
|
|
|
8
8
|
import { concat as F } from "./index113.js";
|
|
9
9
|
import { numberToHex as H } from "./index109.js";
|
|
10
10
|
import { getContractError as U } from "./index180.js";
|
|
11
|
-
import { getNodeError as A } from "./
|
|
11
|
+
import { getNodeError as A } from "./index224.js";
|
|
12
12
|
import { formatBlock as _ } from "./index114.js";
|
|
13
13
|
import { formatLog as z } from "./index117.js";
|
|
14
14
|
import { formatTransactionRequest as I } from "./index144.js";
|
|
15
|
-
import { serializeStateOverride as L } from "./
|
|
15
|
+
import { serializeStateOverride as L } from "./index218.js";
|
|
16
16
|
import { assertRequest as V } from "./index157.js";
|
|
17
17
|
async function nr(p, g) {
|
|
18
18
|
const { blockNumber: b, blockTag: x = p.experimental_blockTag ?? "latest", blocks: k, returnFullTransactions: v, traceTransfers: w, validation: N } = g;
|
package/dist/esm/index57.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { encode as J, from as K } from "./
|
|
2
|
-
import { encodeData as M, from as o } from "./
|
|
1
|
+
import { encode as J, from as K } from "./index225.js";
|
|
2
|
+
import { encodeData as M, from as o } from "./index226.js";
|
|
3
3
|
import { parseAccount as Q } from "./index11.js";
|
|
4
4
|
import { zeroAddress as t, ethAddress as S } from "./index73.js";
|
|
5
5
|
import { deploylessCallViaBytecodeBytecode as W } from "./index74.js";
|
package/dist/esm/index60.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hashMessage as h } from "./index182.js";
|
|
2
|
-
import { verifyHash as i } from "./
|
|
2
|
+
import { verifyHash as i } from "./index227.js";
|
|
3
3
|
async function m(r, { address: a, message: o, factory: s, factoryData: t, signature: e, ...f }) {
|
|
4
4
|
const c = h(o);
|
|
5
5
|
return i(r, {
|
package/dist/esm/index61.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hashTypedData as m } from "./index147.js";
|
|
2
|
-
import { verifyHash as d } from "./
|
|
2
|
+
import { verifyHash as d } from "./index227.js";
|
|
3
3
|
async function D(a, t) {
|
|
4
4
|
const { address: r, factory: e, factoryData: o, signature: s, message: y, primaryType: c, types: f, domain: i, ...n } = t, p = m({ message: y, primaryType: c, types: f, domain: i });
|
|
5
5
|
return d(a, {
|
package/dist/esm/index68.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hashMessage as g } from "./index182.js";
|
|
2
|
-
import { parseSiweMessage as l } from "./
|
|
3
|
-
import { validateSiweMessage as p } from "./
|
|
4
|
-
import { verifyHash as h } from "./
|
|
2
|
+
import { parseSiweMessage as l } from "./index228.js";
|
|
3
|
+
import { validateSiweMessage as p } from "./index229.js";
|
|
4
|
+
import { verifyHash as h } from "./index227.js";
|
|
5
5
|
async function S(a, r) {
|
|
6
6
|
const { address: i, domain: t, message: s, nonce: o, scheme: n, signature: d, time: m = /* @__PURE__ */ new Date(), ...f } = r, e = l(s);
|
|
7
7
|
if (!e.address || !p({
|
package/dist/esm/index71.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BaseError as $ } from "./index82.js";
|
|
|
2
2
|
import { HttpRequestError as M } from "./index13.js";
|
|
3
3
|
import { MethodNotSupportedRpcError as c, UnknownRpcError as g, UserRejectedRequestError as s, AtomicityNotSupportedError as h, AtomicReadyWalletRejectedUpgradeError as p, BundleTooLargeError as f, UnknownBundleIdError as E, DuplicateIdError as m, UnsupportedChainIdError as l, UnsupportedNonOptionalCapabilityError as R, SwitchChainError as y, ChainDisconnectedError as I, ProviderDisconnectedError as U, UnsupportedProviderMethodError as v, UnauthorizedProviderError as b, JsonRpcVersionUnsupportedError as N, LimitExceededRpcError as u, TransactionRejectedRpcError as q, ResourceUnavailableRpcError as C, ResourceNotFoundRpcError as D, InvalidInputRpcError as P, InternalRpcError as a, InvalidParamsRpcError as x, MethodNotFoundRpcError as A, InvalidRequestRpcError as j, ParseRpcError as B } from "./index96.js";
|
|
4
4
|
import { stringToHex as z } from "./index109.js";
|
|
5
|
-
import { withDedupe as J } from "./
|
|
5
|
+
import { withDedupe as J } from "./index230.js";
|
|
6
6
|
import { withRetry as O } from "./index175.js";
|
|
7
7
|
import { stringify as V } from "./index103.js";
|
|
8
8
|
function ee(r, S = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"react": ">=18.2.0",
|
|
17
|
-
"@coinbase/cdp-core": "^0.0.
|
|
17
|
+
"@coinbase/cdp-core": "^0.0.25"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@size-limit/webpack": "^11.2.0",
|
|
30
30
|
"@size-limit/webpack-why": "^11.2.0",
|
|
31
31
|
"size-limit": "^11.2.0",
|
|
32
|
-
"@coinbase/cdp-core": "^0.0.
|
|
32
|
+
"@coinbase/cdp-core": "^0.0.25"
|
|
33
33
|
},
|
|
34
34
|
"size-limit": [
|
|
35
35
|
{
|