@coinbase/cdp-hooks 0.0.21 → 0.0.22
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 +87 -73
- package/dist/esm/index15.js +1 -1
- package/dist/esm/index16.js +1 -1
- package/dist/esm/index19.js +3 -3
- package/dist/esm/index20.js +1 -1
- package/dist/esm/index206.js +36 -7
- package/dist/esm/index207.js +15 -6
- package/dist/esm/index208.js +8 -36
- package/dist/esm/index209.js +12 -15
- package/dist/esm/index21.js +3 -3
- package/dist/esm/index210.js +9 -8
- package/dist/esm/index211.js +16 -9
- package/dist/esm/index212.js +7 -16
- package/dist/esm/index216.js +1 -1
- package/dist/esm/index219.js +6 -9
- package/dist/esm/index22.js +2 -2
- package/dist/esm/index220.js +8 -12
- package/dist/esm/index221.js +13 -14
- package/dist/esm/index222.js +14 -8
- package/dist/esm/index223.js +6 -13
- package/dist/esm/index224.js +15 -24
- package/dist/esm/index225.js +24 -11
- package/dist/esm/index226.js +10 -23
- package/dist/esm/index227.js +24 -51
- package/dist/esm/index228.js +51 -17
- package/dist/esm/index229.js +17 -14
- package/dist/esm/index23.js +3 -3
- package/dist/esm/index230.js +14 -11
- package/dist/esm/index231.js +11 -12
- package/dist/esm/index26.js +1 -1
- package/dist/esm/index27.js +1 -1
- package/dist/esm/index28.js +1 -1
- package/dist/esm/index29.js +1 -1
- package/dist/esm/index3.js +105 -105
- package/dist/esm/index30.js +1 -1
- package/dist/esm/index31.js +1 -1
- package/dist/esm/index32.js +2 -2
- package/dist/esm/index33.js +1 -1
- package/dist/esm/index41.js +1 -1
- package/dist/esm/index42.js +2 -2
- package/dist/esm/index43.js +1 -1
- package/dist/esm/index48.js +1 -1
- package/dist/esm/index51.js +1 -1
- package/dist/esm/index54.js +1 -1
- package/dist/esm/index55.js +1 -1
- package/dist/esm/index56.js +1 -1
- package/dist/esm/index57.js +2 -2
- package/dist/esm/index58.js +1 -1
- package/dist/esm/index60.js +1 -1
- package/dist/esm/index61.js +1 -1
- package/dist/esm/index62.js +3 -3
- package/dist/esm/index63.js +3 -3
- package/dist/esm/index64.js +3 -3
- package/dist/esm/index65.js +3 -3
- package/dist/esm/index66.js +3 -3
- package/dist/esm/index67.js +3 -3
- package/dist/esm/index68.js +3 -3
- package/dist/esm/index69.js +1 -1
- package/dist/esm/index71.js +1 -1
- package/dist/types/index.d.ts +22 -19
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -359,13 +359,13 @@ Smart Accounts provide advanced account abstraction features with React hooks.
|
|
|
359
359
|
|
|
360
360
|
#### Send User Operations
|
|
361
361
|
|
|
362
|
-
Send user operations from Smart Accounts with support for multiple calls and paymaster sponsorship:
|
|
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
364
|
```tsx
|
|
365
365
|
import { useSendUserOperation, useCurrentUser } from "@coinbase/cdp-hooks";
|
|
366
366
|
|
|
367
367
|
function SendUserOperation() {
|
|
368
|
-
const { sendUserOperation, data } = useSendUserOperation();
|
|
368
|
+
const { sendUserOperation, status, data, error } = useSendUserOperation();
|
|
369
369
|
const { currentUser } = useCurrentUser();
|
|
370
370
|
|
|
371
371
|
const handleSendUserOperation = async () => {
|
|
@@ -392,36 +392,32 @@ function SendUserOperation() {
|
|
|
392
392
|
|
|
393
393
|
return (
|
|
394
394
|
<div>
|
|
395
|
-
{
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
</div>
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
})()}
|
|
395
|
+
{status === "idle" && <p>Ready to send user operation</p>}
|
|
396
|
+
|
|
397
|
+
{status === "pending" && (
|
|
398
|
+
<div>
|
|
399
|
+
<p>User operation pending...</p>
|
|
400
|
+
{data && <p>User Op Hash: {data.userOpHash}</p>}
|
|
401
|
+
</div>
|
|
402
|
+
)}
|
|
403
|
+
|
|
404
|
+
{status === "success" && data && (
|
|
405
|
+
<div>
|
|
406
|
+
<p>User operation successful!</p>
|
|
407
|
+
<p>Transaction Hash: {data.transactionHash}</p>
|
|
408
|
+
<p>Status: {data.status}</p>
|
|
409
|
+
</div>
|
|
410
|
+
)}
|
|
411
|
+
|
|
412
|
+
{status === "error" && (
|
|
413
|
+
<div>
|
|
414
|
+
<p>User operation failed</p>
|
|
415
|
+
<p>Error: {error?.message}</p>
|
|
416
|
+
</div>
|
|
417
|
+
)}
|
|
422
418
|
|
|
423
|
-
<button onClick={handleSendUserOperation}>
|
|
424
|
-
Send User Operation
|
|
419
|
+
<button onClick={handleSendUserOperation} disabled={status === "pending"}>
|
|
420
|
+
{status === "pending" ? "Sending..." : "Send User Operation"}
|
|
425
421
|
</button>
|
|
426
422
|
</div>
|
|
427
423
|
);
|
|
@@ -430,57 +426,75 @@ function SendUserOperation() {
|
|
|
430
426
|
|
|
431
427
|
#### Track User Operation Status
|
|
432
428
|
|
|
433
|
-
Use the `useWaitForUserOperation` hook to poll for user operation status and provide real-time updates:
|
|
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:
|
|
434
430
|
|
|
435
431
|
```tsx
|
|
436
|
-
import { useWaitForUserOperation,
|
|
432
|
+
import { useWaitForUserOperation, useState } from "react";
|
|
437
433
|
|
|
438
434
|
function WaitForUserOperation() {
|
|
439
|
-
const {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
435
|
+
const { status, data, error } = useWaitForUserOperation({
|
|
436
|
+
userOperationHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
|
|
437
|
+
evmSmartAccount: "0x1234567890123456789012345678901234567890",
|
|
438
|
+
network: "base-sepolia"
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
return (
|
|
442
|
+
<div>
|
|
443
|
+
{status === "idle" && <p>No user operation being tracked</p>}
|
|
444
|
+
|
|
445
|
+
{status === "pending" && (
|
|
446
|
+
<div>
|
|
447
|
+
<p>User operation pending...</p>
|
|
448
|
+
{data && <p>User Op Hash: {data.userOpHash}</p>}
|
|
449
|
+
</div>
|
|
450
|
+
)}
|
|
451
|
+
|
|
452
|
+
{status === "success" && data && (
|
|
453
|
+
<div>
|
|
454
|
+
<p>User operation successful!</p>
|
|
455
|
+
<p>Transaction Hash: {data.transactionHash}</p>
|
|
456
|
+
<p>Status: {data.status}</p>
|
|
457
|
+
</div>
|
|
458
|
+
)}
|
|
459
|
+
|
|
460
|
+
{status === "error" && (
|
|
461
|
+
<div>
|
|
462
|
+
<p>User operation failed</p>
|
|
463
|
+
<p>Error: {error?.message}</p>
|
|
464
|
+
</div>
|
|
465
|
+
)}
|
|
466
|
+
</div>
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
#### Conditional Polling
|
|
472
|
+
|
|
473
|
+
You can control when the `useWaitForUserOperation` hook should start polling using the `enabled` parameter:
|
|
474
|
+
|
|
475
|
+
```tsx
|
|
476
|
+
function ConditionalWaitForUserOperation() {
|
|
477
|
+
const [shouldPoll, setShouldPoll] = useState(false);
|
|
478
|
+
|
|
479
|
+
const { status, data, error } = useWaitForUserOperation({
|
|
480
|
+
userOperationHash: "0x1234...",
|
|
481
|
+
evmSmartAccount: "0x5678...",
|
|
482
|
+
network: "base-sepolia",
|
|
483
|
+
enabled: shouldPoll // Only poll when this is true
|
|
484
|
+
});
|
|
449
485
|
|
|
450
486
|
return (
|
|
451
487
|
<div>
|
|
452
|
-
<button onClick={
|
|
453
|
-
|
|
488
|
+
<button onClick={() => setShouldPoll(true)}>
|
|
489
|
+
Start Polling
|
|
490
|
+
</button>
|
|
491
|
+
<button onClick={() => setShouldPoll(false)}>
|
|
492
|
+
Stop Polling
|
|
454
493
|
</button>
|
|
455
494
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
return <p>No user operation being tracked</p>;
|
|
460
|
-
case "pending":
|
|
461
|
-
return (
|
|
462
|
-
<div>
|
|
463
|
-
<p>User operation pending...</p>
|
|
464
|
-
<p>Hash: {data.hash}</p>
|
|
465
|
-
</div>
|
|
466
|
-
);
|
|
467
|
-
case "success":
|
|
468
|
-
return (
|
|
469
|
-
<div>
|
|
470
|
-
<p>User operation successful!</p>
|
|
471
|
-
<p>Transaction Hash: {data.result.transactionHash}</p>
|
|
472
|
-
<p>Status: {data.result.status}</p>
|
|
473
|
-
</div>
|
|
474
|
-
);
|
|
475
|
-
case "error":
|
|
476
|
-
return (
|
|
477
|
-
<div>
|
|
478
|
-
<p>User operation failed</p>
|
|
479
|
-
<p>Error: {data.error.message}</p>
|
|
480
|
-
</div>
|
|
481
|
-
);
|
|
482
|
-
}
|
|
483
|
-
})()}
|
|
495
|
+
<p>Status: {status}</p>
|
|
496
|
+
{data && <p>User Operation Status: {data.status}</p>}
|
|
497
|
+
{error && <p>Error: {error.message}</p>}
|
|
484
498
|
</div>
|
|
485
499
|
);
|
|
486
500
|
}
|
package/dist/esm/index15.js
CHANGED
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 "./index209.js";
|
|
5
5
|
function E(s, o = {}) {
|
|
6
6
|
return {
|
|
7
7
|
async request(p) {
|
package/dist/esm/index19.js
CHANGED
|
@@ -4,11 +4,11 @@ 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 "./index210.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 "./
|
|
11
|
-
import { getAction as B } from "./
|
|
10
|
+
import { packetToBytes as N } from "./index211.js";
|
|
11
|
+
import { getAction as B } from "./index212.js";
|
|
12
12
|
import { readContract as T } from "./index55.js";
|
|
13
13
|
async function J(a, o) {
|
|
14
14
|
const { blockNumber: l, blockTag: m, coinType: t, name: e, gatewayUrls: f, strict: v } = o, { chain: n } = a, p = (() => {
|
package/dist/esm/index20.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAvatarRecord as m } from "./index213.js";
|
|
2
|
-
import { getAction as u } from "./
|
|
2
|
+
import { getAction as u } from "./index212.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 }) {
|
|
5
5
|
const r = await u(t, f, "getEnsText")({
|
package/dist/esm/index206.js
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
2
|
+
let w = 0;
|
|
3
|
+
function C(s, l, h) {
|
|
4
|
+
const i = ++w, c = () => f.get(s) || [], g = () => {
|
|
5
|
+
const n = c();
|
|
6
|
+
f.set(s, n.filter((e) => e.id !== i));
|
|
7
|
+
}, r = () => {
|
|
8
|
+
const n = c();
|
|
9
|
+
if (!n.some((t) => t.id === i))
|
|
10
|
+
return;
|
|
11
|
+
const e = p.get(s);
|
|
12
|
+
if (n.length === 1 && e) {
|
|
13
|
+
const t = e();
|
|
14
|
+
t instanceof Promise && t.catch(() => {
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
g();
|
|
18
|
+
}, o = c();
|
|
19
|
+
if (f.set(s, [
|
|
20
|
+
...o,
|
|
21
|
+
{ id: i, fns: l }
|
|
22
|
+
]), o && o.length > 0)
|
|
23
|
+
return r;
|
|
24
|
+
const u = {};
|
|
25
|
+
for (const n in l)
|
|
26
|
+
u[n] = (...e) => {
|
|
27
|
+
const t = c();
|
|
28
|
+
if (t.length !== 0)
|
|
29
|
+
for (const m of t)
|
|
30
|
+
m.fns[n]?.(...e);
|
|
31
|
+
};
|
|
32
|
+
const a = h(u);
|
|
33
|
+
return typeof a == "function" && p.set(s, a), r;
|
|
7
34
|
}
|
|
8
35
|
export {
|
|
9
|
-
|
|
36
|
+
p as cleanupCache,
|
|
37
|
+
f as listenersCache,
|
|
38
|
+
C as observe
|
|
10
39
|
};
|
package/dist/esm/index207.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { wait as l } from "./index176.js";
|
|
2
|
+
function p(a, { emitOnBegin: e, initialWaitTime: w, interval: i }) {
|
|
3
|
+
let n = !0;
|
|
4
|
+
const t = () => n = !1;
|
|
5
|
+
return (async () => {
|
|
6
|
+
let o;
|
|
7
|
+
e && (o = await a({ unpoll: t }));
|
|
8
|
+
const u = await w?.(o) ?? i;
|
|
9
|
+
await l(u);
|
|
10
|
+
const c = async () => {
|
|
11
|
+
n && (await a({ unpoll: t }), await l(i), c());
|
|
12
|
+
};
|
|
13
|
+
c();
|
|
14
|
+
})(), t;
|
|
6
15
|
}
|
|
7
16
|
export {
|
|
8
|
-
|
|
17
|
+
p as poll
|
|
9
18
|
};
|
package/dist/esm/index208.js
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
let
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
const n = c();
|
|
9
|
-
if (!n.some((t) => t.id === i))
|
|
10
|
-
return;
|
|
11
|
-
const e = p.get(s);
|
|
12
|
-
if (n.length === 1 && e) {
|
|
13
|
-
const t = e();
|
|
14
|
-
t instanceof Promise && t.catch(() => {
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
g();
|
|
18
|
-
}, o = c();
|
|
19
|
-
if (f.set(s, [
|
|
20
|
-
...o,
|
|
21
|
-
{ id: i, fns: l }
|
|
22
|
-
]), o && o.length > 0)
|
|
23
|
-
return r;
|
|
24
|
-
const u = {};
|
|
25
|
-
for (const n in l)
|
|
26
|
-
u[n] = (...e) => {
|
|
27
|
-
const t = c();
|
|
28
|
-
if (t.length !== 0)
|
|
29
|
-
for (const m of t)
|
|
30
|
-
m.fns[n]?.(...e);
|
|
31
|
-
};
|
|
32
|
-
const a = h(u);
|
|
33
|
-
return typeof a == "function" && p.set(s, a), r;
|
|
1
|
+
function i() {
|
|
2
|
+
let e = () => {
|
|
3
|
+
}, n = () => {
|
|
4
|
+
};
|
|
5
|
+
return { promise: new Promise((r, o) => {
|
|
6
|
+
e = r, n = o;
|
|
7
|
+
}), resolve: e, reject: n };
|
|
34
8
|
}
|
|
35
9
|
export {
|
|
36
|
-
|
|
37
|
-
f as listenersCache,
|
|
38
|
-
C as observe
|
|
10
|
+
i as withResolvers
|
|
39
11
|
};
|
package/dist/esm/index209.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
n && (await a({ unpoll: t }), await l(i), c());
|
|
12
|
-
};
|
|
13
|
-
c();
|
|
14
|
-
})(), t;
|
|
1
|
+
function r() {
|
|
2
|
+
return {
|
|
3
|
+
current: 0,
|
|
4
|
+
take() {
|
|
5
|
+
return this.current++;
|
|
6
|
+
},
|
|
7
|
+
reset() {
|
|
8
|
+
this.current = 0;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
15
11
|
}
|
|
12
|
+
const t = /* @__PURE__ */ r();
|
|
16
13
|
export {
|
|
17
|
-
|
|
14
|
+
t as idCache
|
|
18
15
|
};
|
package/dist/esm/index21.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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 "./
|
|
6
|
-
import { getAction as w } from "./
|
|
4
|
+
import { isNullUniversalResolverError as p } from "./index210.js";
|
|
5
|
+
import { packetToBytes as C } from "./index211.js";
|
|
6
|
+
import { getAction as w } from "./index212.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 }) {
|
|
9
9
|
let o = d;
|
package/dist/esm/index210.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
d as isNullUniversalResolverError
|
|
11
12
|
};
|
package/dist/esm/index211.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/index212.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const o =
|
|
6
|
-
|
|
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;
|
|
1
|
+
function f(t, n, c) {
|
|
2
|
+
const i = t[n.name];
|
|
3
|
+
if (typeof i == "function")
|
|
4
|
+
return i;
|
|
5
|
+
const o = t[c];
|
|
6
|
+
return typeof o == "function" ? o : (e) => n(t, e);
|
|
16
7
|
}
|
|
17
8
|
export {
|
|
18
|
-
|
|
9
|
+
f as getAction
|
|
19
10
|
};
|
package/dist/esm/index216.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallExecutionError as c } from "./index85.js";
|
|
2
2
|
import { UnknownNodeError as i } from "./index101.js";
|
|
3
|
-
import { getNodeError as u } from "./
|
|
3
|
+
import { getNodeError as u } from "./index225.js";
|
|
4
4
|
function a(r, { docsPath: t, ...o }) {
|
|
5
5
|
const e = (() => {
|
|
6
6
|
const n = u(r, o);
|
package/dist/esm/index219.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
hash: e(r),
|
|
7
|
-
signature: t ?? r
|
|
8
|
-
});
|
|
1
|
+
function u(e, { method: r }) {
|
|
2
|
+
const t = {};
|
|
3
|
+
return e.transport.type === "fallback" && e.transport.onResponse?.(({ method: s, response: o, status: p, transport: n }) => {
|
|
4
|
+
p === "success" && r === s && (t[o] = n.request);
|
|
5
|
+
}), (s) => t[s] || e.request;
|
|
9
6
|
}
|
|
10
7
|
export {
|
|
11
|
-
|
|
8
|
+
u as createFilterRequestScope
|
|
12
9
|
};
|
package/dist/esm/index22.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getChainContractAddress as l } from "./index173.js";
|
|
2
2
|
import { toHex as u } from "./index109.js";
|
|
3
|
-
import { packetToBytes as v } from "./
|
|
4
|
-
import { getAction as f } from "./
|
|
3
|
+
import { packetToBytes as v } from "./index211.js";
|
|
4
|
+
import { getAction as f } from "./index212.js";
|
|
5
5
|
import { readContract as m } from "./index55.js";
|
|
6
6
|
async function A(o, r) {
|
|
7
7
|
const { blockNumber: n, blockTag: i, name: s } = r, { chain: e } = o, a = (() => {
|
package/dist/esm/index220.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})();
|
|
9
|
-
return new i(n, {
|
|
10
|
-
docsPath: e,
|
|
11
|
-
...o
|
|
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
|
|
12
8
|
});
|
|
13
9
|
}
|
|
14
10
|
export {
|
|
15
|
-
a as
|
|
11
|
+
a as recoverAuthorizationAddress
|
|
16
12
|
};
|
package/dist/esm/index221.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
import { EstimateGasExecutionError as i } from "./index100.js";
|
|
2
|
+
import { UnknownNodeError as m } from "./index101.js";
|
|
3
|
+
import { getNodeError as s } from "./index225.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
|
|
12
|
+
});
|
|
14
13
|
}
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
a as getEstimateGasError
|
|
17
16
|
};
|
package/dist/esm/index222.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
}
|
|
8
14
|
}
|
|
9
15
|
export {
|
|
10
|
-
r as
|
|
16
|
+
r as Eip712DomainNotFoundError
|
|
11
17
|
};
|
package/dist/esm/index223.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
function t(e) {
|
|
3
|
-
return e.map((n) => ({
|
|
4
|
-
...n,
|
|
5
|
-
value: BigInt(n.value)
|
|
6
|
-
}));
|
|
7
|
-
}
|
|
8
|
-
function o(e) {
|
|
1
|
+
function r(a) {
|
|
9
2
|
return {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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)))
|
|
14
7
|
};
|
|
15
8
|
}
|
|
16
9
|
export {
|
|
17
|
-
|
|
10
|
+
r as formatFeeHistory
|
|
18
11
|
};
|