@coinbase/cdp-hooks 0.0.22 → 0.0.24

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.
Files changed (47) hide show
  1. package/dist/esm/index15.js +1 -1
  2. package/dist/esm/index16.js +1 -1
  3. package/dist/esm/index19.js +3 -3
  4. package/dist/esm/index20.js +2 -2
  5. package/dist/esm/index206.js +7 -36
  6. package/dist/esm/index207.js +6 -15
  7. package/dist/esm/index208.js +36 -8
  8. package/dist/esm/index209.js +15 -12
  9. package/dist/esm/index21.js +3 -3
  10. package/dist/esm/index210.js +8 -9
  11. package/dist/esm/index211.js +12 -16
  12. package/dist/esm/index212.js +9 -7
  13. package/dist/esm/index213.js +15 -21
  14. package/dist/esm/index214.js +22 -30
  15. package/dist/esm/index215.js +31 -2
  16. package/dist/esm/index216.js +2 -14
  17. package/dist/esm/index217.js +13 -12
  18. package/dist/esm/index218.js +10 -45
  19. package/dist/esm/index219.js +46 -5
  20. package/dist/esm/index22.js +2 -2
  21. package/dist/esm/index228.js +1 -1
  22. package/dist/esm/index23.js +3 -3
  23. package/dist/esm/index24.js +5 -5
  24. package/dist/esm/index25.js +2 -2
  25. package/dist/esm/index26.js +1 -1
  26. package/dist/esm/index27.js +1 -1
  27. package/dist/esm/index28.js +1 -1
  28. package/dist/esm/index29.js +1 -1
  29. package/dist/esm/index30.js +1 -1
  30. package/dist/esm/index31.js +1 -1
  31. package/dist/esm/index32.js +2 -2
  32. package/dist/esm/index33.js +1 -1
  33. package/dist/esm/index41.js +1 -1
  34. package/dist/esm/index42.js +1 -1
  35. package/dist/esm/index51.js +1 -1
  36. package/dist/esm/index54.js +1 -1
  37. package/dist/esm/index55.js +1 -1
  38. package/dist/esm/index56.js +2 -2
  39. package/dist/esm/index58.js +1 -1
  40. package/dist/esm/index62.js +3 -3
  41. package/dist/esm/index63.js +3 -3
  42. package/dist/esm/index64.js +3 -3
  43. package/dist/esm/index65.js +3 -3
  44. package/dist/esm/index66.js +3 -3
  45. package/dist/esm/index67.js +3 -3
  46. package/dist/esm/index69.js +1 -1
  47. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { withResolvers as d } from "./index208.js";
1
+ import { withResolvers as d } from "./index210.js";
2
2
  const h = /* @__PURE__ */ new Map();
3
3
  function S({ fn: p, id: o, shouldSplitBatch: a, wait: g = 0, sort: l }) {
4
4
  const u = async () => {
@@ -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 "./index209.js";
4
+ import { idCache as y } from "./index211.js";
5
5
  function E(s, o = {}) {
6
6
  return {
7
7
  async request(p) {
@@ -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 "./index210.js";
7
+ import { isNullUniversalResolverError as y } from "./index212.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 "./index211.js";
11
- import { getAction as B } from "./index212.js";
10
+ import { packetToBytes as N } from "./index213.js";
11
+ import { getAction as B } from "./index206.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 = (() => {
@@ -1,5 +1,5 @@
1
- import { parseAvatarRecord as m } from "./index213.js";
2
- import { getAction as u } from "./index212.js";
1
+ import { parseAvatarRecord as m } from "./index214.js";
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 }) {
5
5
  const r = await u(t, f, "getEnsText")({
@@ -1,39 +1,10 @@
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;
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);
34
7
  }
35
8
  export {
36
- p as cleanupCache,
37
- f as listenersCache,
38
- C as observe
9
+ f as getAction
39
10
  };
@@ -1,18 +1,9 @@
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;
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;
15
6
  }
16
7
  export {
17
- p as poll
8
+ u as createFilterRequestScope
18
9
  };
@@ -1,11 +1,39 @@
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 };
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;
8
34
  }
9
35
  export {
10
- i as withResolvers
36
+ p as cleanupCache,
37
+ f as listenersCache,
38
+ C as observe
11
39
  };
@@ -1,15 +1,18 @@
1
- function r() {
2
- return {
3
- current: 0,
4
- take() {
5
- return this.current++;
6
- },
7
- reset() {
8
- this.current = 0;
9
- }
10
- };
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;
11
15
  }
12
- const t = /* @__PURE__ */ r();
13
16
  export {
14
- t as idCache
17
+ p as poll
15
18
  };
@@ -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 "./index210.js";
5
- import { packetToBytes as C } from "./index211.js";
6
- import { getAction as w } from "./index212.js";
4
+ import { isNullUniversalResolverError as p } from "./index212.js";
5
+ import { packetToBytes as C } from "./index213.js";
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 }) {
9
9
  let o = d;
@@ -1,12 +1,11 @@
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;
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 };
9
8
  }
10
9
  export {
11
- d as isNullUniversalResolverError
10
+ i as withResolvers
12
11
  };
@@ -1,19 +1,15 @@
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;
1
+ function r() {
2
+ return {
3
+ current: 0,
4
+ take() {
5
+ return this.current++;
6
+ },
7
+ reset() {
8
+ this.current = 0;
9
+ }
10
+ };
16
11
  }
12
+ const t = /* @__PURE__ */ r();
17
13
  export {
18
- y as packetToBytes
14
+ t as idCache
19
15
  };
@@ -1,10 +1,12 @@
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);
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;
7
9
  }
8
10
  export {
9
- f as getAction
11
+ d as isNullUniversalResolverError
10
12
  };
@@ -1,25 +1,19 @@
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 });
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;
16
14
  }
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
- });
15
+ return e.byteLength !== t + 1 ? e.slice(0, t + 1) : e;
22
16
  }
23
17
  export {
24
- b as parseAvatarRecord
18
+ y as packetToBytes
25
19
  };
@@ -1,33 +1,25 @@
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
- };
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 });
16
+ }
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
+ });
30
22
  }
31
23
  export {
32
- n as toRpc
24
+ b as parseAvatarRecord
33
25
  };
@@ -1,4 +1,33 @@
1
- const a = "0x82ad56cb";
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
+ };
30
+ }
2
31
  export {
3
- a as aggregate3Signature
32
+ n as toRpc
4
33
  };
@@ -1,16 +1,4 @@
1
- import { CallExecutionError as c } from "./index85.js";
2
- import { UnknownNodeError as i } from "./index101.js";
3
- import { getNodeError as u } from "./index225.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
- }
1
+ const a = "0x82ad56cb";
14
2
  export {
15
- a as getCallError
3
+ a as aggregate3Signature
16
4
  };
@@ -1,15 +1,16 @@
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;
1
+ import { CallExecutionError as c } from "./index85.js";
2
+ import { UnknownNodeError as i } from "./index101.js";
3
+ import { getNodeError as u } from "./index225.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
+ });
12
13
  }
13
14
  export {
14
- y as extract
15
+ a as getCallError
15
16
  };
@@ -1,50 +1,15 @@
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) {
1
+ function y(t, { format: r }) {
34
2
  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);
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]);
43
9
  }
44
- return t;
10
+ const o = r(t || {});
11
+ return i(o), e;
45
12
  }
46
13
  export {
47
- m as serializeAccountStateOverride,
48
- s as serializeStateMapping,
49
- A as serializeStateOverride
14
+ y as extract
50
15
  };
@@ -1,9 +1,50 @@
1
- function u(e, { method: r }) {
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) {
34
+ if (!r)
35
+ return;
2
36
  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;
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;
6
45
  }
7
46
  export {
8
- u as createFilterRequestScope
47
+ m as serializeAccountStateOverride,
48
+ s as serializeStateMapping,
49
+ A as serializeStateOverride
9
50
  };
@@ -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 "./index211.js";
4
- import { getAction as f } from "./index212.js";
3
+ import { packetToBytes as v } from "./index213.js";
4
+ import { getAction as f } from "./index206.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 = (() => {
@@ -6,7 +6,7 @@ import { getAddress as S } from "./index119.js";
6
6
  import { isAddressEqual as h } from "./index141.js";
7
7
  import { isHex as v } from "./index145.js";
8
8
  import { bytesToHex as x } from "./index109.js";
9
- import { getAction as b } from "./index212.js";
9
+ import { getAction as b } from "./index206.js";
10
10
  import { isErc6492Signature as A } from "./index155.js";
11
11
  import { recoverAddress as w } from "./index149.js";
12
12
  import { serializeErc6492Signature as E } from "./index156.js";
@@ -3,11 +3,11 @@ 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 "./index210.js";
6
+ import { isNullUniversalResolverError as g } from "./index212.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 "./index211.js";
10
- import { getAction as y } from "./index212.js";
9
+ import { packetToBytes as C } from "./index213.js";
10
+ import { getAction as y } from "./index206.js";
11
11
  import { readContract as N } from "./index55.js";
12
12
  async function j(n, e) {
13
13
  const { blockNumber: s, blockTag: m, key: d, name: t, gatewayUrls: u, strict: f } = e, { chain: o } = n, v = (() => {
@@ -1,7 +1,7 @@
1
- import { toRpc as $ } from "./index214.js";
1
+ import { toRpc as $ } from "./index215.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 "./index215.js";
4
+ import { aggregate3Signature as I } from "./index216.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 "./index216.js";
15
- import { extract as et } from "./index217.js";
14
+ import { getCallError as at } from "./index217.js";
15
+ import { extract as et } from "./index218.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 "./index218.js";
18
+ import { serializeStateOverride as ct } from "./index219.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) {
@@ -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 "./index216.js";
4
- import { extract as L } from "./index217.js";
3
+ import { getCallError as F } from "./index217.js";
4
+ import { extract as L } from "./index218.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) {
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index219.js";
1
+ import { createFilterRequestScope as r } from "./index207.js";
2
2
  async function i(e) {
3
3
  const o = r(e, {
4
4
  method: "eth_newBlockFilter"
@@ -1,6 +1,6 @@
1
1
  import { encodeEventTopics as l } from "./index136.js";
2
2
  import { numberToHex as s } from "./index109.js";
3
- import { createFilterRequestScope as u } from "./index219.js";
3
+ import { createFilterRequestScope as u } from "./index207.js";
4
4
  async function h(r, a) {
5
5
  const { address: m, abi: n, args: i, eventName: e, fromBlock: t, strict: p, toBlock: o } = a, f = u(r, {
6
6
  method: "eth_newFilter"
@@ -1,6 +1,6 @@
1
1
  import { encodeEventTopics as b } from "./index136.js";
2
2
  import { numberToHex as m } from "./index109.js";
3
- import { createFilterRequestScope as h } from "./index219.js";
3
+ import { createFilterRequestScope as h } from "./index207.js";
4
4
  async function l(r, { address: p, args: a, event: e, events: c, fromBlock: n, strict: f, toBlock: i } = {}) {
5
5
  const o = c ?? (e ? [e] : void 0), u = h(r, {
6
6
  method: "eth_newFilter"
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index219.js";
1
+ import { createFilterRequestScope as r } from "./index207.js";
2
2
  async function a(e) {
3
3
  const n = r(e, {
4
4
  method: "eth_newPendingTransactionFilter"
@@ -1,7 +1,7 @@
1
1
  import { parseAccount as u } from "./index11.js";
2
2
  import { encodeFunctionData as f } from "./index137.js";
3
3
  import { getContractError as p } from "./index180.js";
4
- import { getAction as g } from "./index212.js";
4
+ import { getAction as g } from "./index206.js";
5
5
  import { estimateGas as G } from "./index32.js";
6
6
  async function A(s, i) {
7
7
  const { abi: a, address: o, args: r, functionName: c, dataSuffix: e, ...t } = i, m = f({
@@ -1,5 +1,5 @@
1
1
  import { BaseFeeScalarError as p, Eip1559FeesNotSupportedError as F } from "./index95.js";
2
- import { getAction as l } from "./index212.js";
2
+ import { getAction as l } from "./index206.js";
3
3
  import { internal_estimateMaxPriorityFeePerGas as u } from "./index33.js";
4
4
  import { getBlock as G } from "./index36.js";
5
5
  import { getGasPrice as b } from "./index46.js";
@@ -3,9 +3,9 @@ import { BaseError as _ } from "./index82.js";
3
3
  import { recoverAuthorizationAddress as A } from "./index220.js";
4
4
  import { numberToHex as x } from "./index109.js";
5
5
  import { getEstimateGasError as E } from "./index221.js";
6
- import { extract as N } from "./index217.js";
6
+ import { extract as N } from "./index218.js";
7
7
  import { formatTransactionRequest as S } from "./index144.js";
8
- import { serializeStateOverride as I } from "./index218.js";
8
+ import { serializeStateOverride as I } from "./index219.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";
@@ -1,6 +1,6 @@
1
1
  import { Eip1559FeesNotSupportedError as f } from "./index95.js";
2
2
  import { hexToBigInt as u } from "./index142.js";
3
- import { getAction as s } from "./index212.js";
3
+ import { getAction as s } from "./index206.js";
4
4
  import { getBlock as c } from "./index36.js";
5
5
  import { getGasPrice as y } from "./index46.js";
6
6
  async function h(e, o) {
@@ -1,5 +1,5 @@
1
1
  import { getAbiItem as p } from "./index89.js";
2
- import { getAction as v } from "./index212.js";
2
+ import { getAction as v } from "./index206.js";
3
3
  import { getLogs as l } from "./index47.js";
4
4
  async function y(n, r) {
5
5
  const { abi: t, address: s, args: c, blockHash: i, eventName: e, fromBlock: m, toBlock: a, strict: f } = r, o = e ? p({ abi: t, name: e }) : void 0, g = o ? void 0 : t.filter((d) => d.type === "event");
@@ -1,5 +1,5 @@
1
1
  import { Eip712DomainNotFoundError as u } from "./index222.js";
2
- import { getAction as d } from "./index212.js";
2
+ import { getAction as d } from "./index206.js";
3
3
  import { readContract as f } from "./index55.js";
4
4
  async function E(a, o) {
5
5
  const { address: e, factory: r, factoryData: i } = o;
@@ -1,4 +1,4 @@
1
- import { getAction as n } from "./index212.js";
1
+ import { getAction as n } from "./index206.js";
2
2
  import { getBlockNumber as a } from "./index37.js";
3
3
  import { getTransaction as m } from "./index50.js";
4
4
  async function f(o, { hash: r, transactionReceipt: e }) {
@@ -6,7 +6,7 @@ import { decodeFunctionResult as q } from "./index130.js";
6
6
  import { encodeFunctionData as B } from "./index137.js";
7
7
  import { getChainContractAddress as O } from "./index173.js";
8
8
  import { getContractError as E } from "./index180.js";
9
- import { getAction as T } from "./index212.js";
9
+ import { getAction as T } from "./index206.js";
10
10
  import { readContract as Z } from "./index55.js";
11
11
  async function W(n, w) {
12
12
  const { account: b, allowFailure: u = !0, batchSize: F, blockNumber: p, blockTag: j, multicallAddress: y, stateOverride: N } = w, d = w.contracts, C = F ?? (typeof n.batch?.multicall == "object" && n.batch.multicall.batchSize || 1024);
@@ -1,7 +1,7 @@
1
1
  import { decodeFunctionResult as m } from "./index130.js";
2
2
  import { encodeFunctionData as s } from "./index137.js";
3
3
  import { getContractError as f } from "./index180.js";
4
- import { getAction as l } from "./index212.js";
4
+ import { getAction as l } from "./index206.js";
5
5
  import { call as p } from "./index24.js";
6
6
  async function x(n, e) {
7
7
  const { abi: t, address: c, args: o, functionName: r, ...d } = e, i = s({
@@ -1,4 +1,4 @@
1
- import { toRpc as R } from "./index214.js";
1
+ import { toRpc as R } from "./index215.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";
@@ -12,7 +12,7 @@ import { getNodeError as A } from "./index225.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 "./index218.js";
15
+ import { serializeStateOverride as L } from "./index219.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;
@@ -2,7 +2,7 @@ import { parseAccount as p } from "./index11.js";
2
2
  import { decodeFunctionResult as h } from "./index130.js";
3
3
  import { encodeFunctionData as x } from "./index137.js";
4
4
  import { getContractError as b } from "./index180.js";
5
- import { getAction as g } from "./index212.js";
5
+ import { getAction as g } from "./index206.js";
6
6
  import { call as A } from "./index24.js";
7
7
  async function R(s, m) {
8
8
  const { abi: t, address: r, args: o, dataSuffix: n, functionName: a, ...c } = m, e = c.account ? p(c.account) : s.account, d = x({ abi: t, args: o, functionName: a });
@@ -1,8 +1,8 @@
1
1
  import { BlockNotFoundError as D } from "./index84.js";
2
2
  import { WaitForTransactionReceiptTimeoutError as M, TransactionNotFoundError as O, TransactionReceiptNotFoundError as W } from "./index93.js";
3
- import { getAction as l } from "./index212.js";
4
- import { observe as q } from "./index206.js";
5
- import { withResolvers as z } from "./index208.js";
3
+ import { getAction as l } from "./index206.js";
4
+ import { observe as q } from "./index208.js";
5
+ import { withResolvers as z } from "./index210.js";
6
6
  import { withRetry as B } from "./index175.js";
7
7
  import { stringify as G } from "./index103.js";
8
8
  import { getBlock as H } from "./index36.js";
@@ -1,7 +1,7 @@
1
1
  import { hexToBigInt as w } from "./index142.js";
2
- import { getAction as g } from "./index212.js";
3
- import { observe as k } from "./index206.js";
4
- import { poll as h } from "./index207.js";
2
+ import { getAction as g } from "./index206.js";
3
+ import { observe as k } from "./index208.js";
4
+ import { poll as h } from "./index209.js";
5
5
  import { stringify as y } from "./index103.js";
6
6
  import { getBlockNumber as v } from "./index37.js";
7
7
  function H(r, { emitOnBegin: c = !1, emitMissed: a = !1, onBlockNumber: l, onError: b, poll: i, pollingInterval: m = r.pollingInterval }) {
@@ -1,6 +1,6 @@
1
- import { getAction as p } from "./index212.js";
2
- import { observe as h } from "./index206.js";
3
- import { poll as v } from "./index207.js";
1
+ import { getAction as p } from "./index206.js";
2
+ import { observe as h } from "./index208.js";
3
+ import { poll as v } from "./index209.js";
4
4
  import { stringify as S } from "./index103.js";
5
5
  import { getBlock as i } from "./index36.js";
6
6
  function P(r, { blockTag: l = r.experimental_blockTag ?? "latest", emitMissed: y = !1, emitOnBegin: m = !1, onBlock: k, onError: f, includeTransactions: B, poll: d, pollingInterval: w = r.pollingInterval }) {
@@ -3,9 +3,9 @@ import { InvalidInputRpcError as T } from "./index96.js";
3
3
  import { decodeEventLog as z } from "./index126.js";
4
4
  import { encodeEventTopics as A } from "./index136.js";
5
5
  import { formatLog as B } from "./index117.js";
6
- import { getAction as g } from "./index212.js";
7
- import { observe as F } from "./index206.js";
8
- import { poll as O } from "./index207.js";
6
+ import { getAction as g } from "./index206.js";
7
+ import { observe as F } from "./index208.js";
8
+ import { poll as O } from "./index209.js";
9
9
  import { stringify as D } from "./index103.js";
10
10
  import { createContractEventFilter as R } from "./index27.js";
11
11
  import { getBlockNumber as U } from "./index37.js";
@@ -1,12 +1,12 @@
1
1
  import { encodeEventTopics as S } from "./index136.js";
2
- import { observe as B } from "./index206.js";
3
- import { poll as C } from "./index207.js";
2
+ import { observe as B } from "./index208.js";
3
+ import { poll as C } from "./index209.js";
4
4
  import { stringify as T } from "./index103.js";
5
5
  import { DecodeLogDataMismatch as z, DecodeLogTopicsMismatch as A } from "./index79.js";
6
6
  import { InvalidInputRpcError as O } from "./index96.js";
7
7
  import { decodeEventLog as P } from "./index126.js";
8
8
  import { formatLog as I } from "./index117.js";
9
- import { getAction as u } from "./index212.js";
9
+ import { getAction as u } from "./index206.js";
10
10
  import { createEventFilter as R } from "./index28.js";
11
11
  import { getBlockNumber as U } from "./index37.js";
12
12
  import { getFilterChanges as j } from "./index44.js";
@@ -1,6 +1,6 @@
1
- import { getAction as c } from "./index212.js";
2
- import { observe as p } from "./index206.js";
3
- import { poll as b } from "./index207.js";
1
+ import { getAction as c } from "./index206.js";
2
+ import { observe as p } from "./index208.js";
3
+ import { poll as b } from "./index209.js";
4
4
  import { stringify as m } from "./index103.js";
5
5
  import { createPendingTransactionFilter as d } from "./index29.js";
6
6
  import { getFilterChanges as h } from "./index44.js";
@@ -8,7 +8,7 @@ import { blobsToCommitments as q } from "./index164.js";
8
8
  import { blobsToProofs as V } from "./index168.js";
9
9
  import { commitmentsToVersionedHashes as _ } from "./index167.js";
10
10
  import { toBlobSidecars as B } from "./index169.js";
11
- import { getAction as p } from "./index212.js";
11
+ import { getAction as p } from "./index206.js";
12
12
  import { assertRequest as E } from "./index157.js";
13
13
  import { getTransactionType as M } from "./index146.js";
14
14
  import { getChainId as N } from "./index39.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-hooks",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
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.22"
17
+ "@coinbase/cdp-core": "^0.0.24"
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.22"
32
+ "@coinbase/cdp-core": "^0.0.24"
33
33
  },
34
34
  "size-limit": [
35
35
  {