@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.
Files changed (61) hide show
  1. package/README.md +87 -73
  2. package/dist/esm/index15.js +1 -1
  3. package/dist/esm/index16.js +1 -1
  4. package/dist/esm/index19.js +3 -3
  5. package/dist/esm/index20.js +1 -1
  6. package/dist/esm/index206.js +36 -7
  7. package/dist/esm/index207.js +15 -6
  8. package/dist/esm/index208.js +8 -36
  9. package/dist/esm/index209.js +12 -15
  10. package/dist/esm/index21.js +3 -3
  11. package/dist/esm/index210.js +9 -8
  12. package/dist/esm/index211.js +16 -9
  13. package/dist/esm/index212.js +7 -16
  14. package/dist/esm/index216.js +1 -1
  15. package/dist/esm/index219.js +6 -9
  16. package/dist/esm/index22.js +2 -2
  17. package/dist/esm/index220.js +8 -12
  18. package/dist/esm/index221.js +13 -14
  19. package/dist/esm/index222.js +14 -8
  20. package/dist/esm/index223.js +6 -13
  21. package/dist/esm/index224.js +15 -24
  22. package/dist/esm/index225.js +24 -11
  23. package/dist/esm/index226.js +10 -23
  24. package/dist/esm/index227.js +24 -51
  25. package/dist/esm/index228.js +51 -17
  26. package/dist/esm/index229.js +17 -14
  27. package/dist/esm/index23.js +3 -3
  28. package/dist/esm/index230.js +14 -11
  29. package/dist/esm/index231.js +11 -12
  30. package/dist/esm/index26.js +1 -1
  31. package/dist/esm/index27.js +1 -1
  32. package/dist/esm/index28.js +1 -1
  33. package/dist/esm/index29.js +1 -1
  34. package/dist/esm/index3.js +105 -105
  35. package/dist/esm/index30.js +1 -1
  36. package/dist/esm/index31.js +1 -1
  37. package/dist/esm/index32.js +2 -2
  38. package/dist/esm/index33.js +1 -1
  39. package/dist/esm/index41.js +1 -1
  40. package/dist/esm/index42.js +2 -2
  41. package/dist/esm/index43.js +1 -1
  42. package/dist/esm/index48.js +1 -1
  43. package/dist/esm/index51.js +1 -1
  44. package/dist/esm/index54.js +1 -1
  45. package/dist/esm/index55.js +1 -1
  46. package/dist/esm/index56.js +1 -1
  47. package/dist/esm/index57.js +2 -2
  48. package/dist/esm/index58.js +1 -1
  49. package/dist/esm/index60.js +1 -1
  50. package/dist/esm/index61.js +1 -1
  51. package/dist/esm/index62.js +3 -3
  52. package/dist/esm/index63.js +3 -3
  53. package/dist/esm/index64.js +3 -3
  54. package/dist/esm/index65.js +3 -3
  55. package/dist/esm/index66.js +3 -3
  56. package/dist/esm/index67.js +3 -3
  57. package/dist/esm/index68.js +3 -3
  58. package/dist/esm/index69.js +1 -1
  59. package/dist/esm/index71.js +1 -1
  60. package/dist/types/index.d.ts +22 -19
  61. package/package.json +3 -3
@@ -1,145 +1,145 @@
1
- import { getAccessToken as v, sendUserOperation as f, signInWithEmail as T, signInWithSms as O, verifyEmailOTP as y, verifySmsOTP as A, signOut as U, signEvmHash as I, signEvmTransaction as k, sendEvmTransaction as P, signEvmMessage as C, signEvmTypedData as W, exportEvmAccount as H, getUserOperation as x } from "@coinbase/cdp-core";
2
- import { useState as p, useEffect as F, useMemo as w, useCallback as E } from "react";
3
- import { useCDP as c } from "./index2.js";
4
- import { useAutoPolling as M } from "./index4.js";
5
- import { getPublicClient as D } from "./index5.js";
6
- const q = () => {
7
- const { config: e } = c();
1
+ import { getAccessToken as y, sendUserOperation as O, signInWithEmail as I, signInWithSms as U, verifyEmailOTP as A, verifySmsOTP as P, signOut as k, signEvmHash as C, signEvmTransaction as W, sendEvmTransaction as H, signEvmMessage as x, signEvmTypedData as b, exportEvmAccount as D, getUserOperation as M } from "@coinbase/cdp-core";
2
+ import { useState as u, useEffect as w, useMemo as V, useCallback as f } from "react";
3
+ import { useCDP as p } from "./index2.js";
4
+ import { useAutoPolling as F } from "./index4.js";
5
+ import { getPublicClient as z } from "./index5.js";
6
+ const L = () => {
7
+ const { config: e } = p();
8
8
  return { config: e };
9
- }, B = () => {
10
- const { isInitialized: e } = c();
9
+ }, N = () => {
10
+ const { isInitialized: e } = p();
11
11
  return { isInitialized: e };
12
- }, J = () => ({ signInWithEmail: d(T) }), K = () => ({ signInWithSms: d(O) }), L = () => ({ verifyEmailOTP: d(y) }), Q = () => ({ verifySmsOTP: d(A) }), X = () => {
13
- const { isSignedIn: e } = c();
12
+ }, Q = () => ({ signInWithEmail: E(I) }), X = () => ({ signInWithSms: E(U) }), Y = () => ({ verifyEmailOTP: E(A) }), Z = () => ({ verifySmsOTP: E(P) }), _ = () => {
13
+ const { isSignedIn: e } = p();
14
14
  return { isSignedIn: e };
15
- }, S = () => {
16
- const { currentUser: e } = c();
15
+ }, h = () => {
16
+ const { currentUser: e } = p();
17
17
  return { currentUser: e };
18
- }, Y = () => ({ signOut: i(U) }), Z = () => ({ getAccessToken: v }), _ = () => {
19
- const { currentUser: e } = S();
18
+ }, $ = () => ({ signOut: c(k) }), R = () => ({ getAccessToken: y }), ee = () => {
19
+ const { currentUser: e } = h();
20
20
  return {
21
21
  evmAddress: e?.evmSmartAccounts?.[0] ?? e?.evmAccounts?.[0] ?? null
22
22
  };
23
- }, $ = () => ({ signEvmHash: i(I) }), R = () => ({ signEvmTransaction: i(k) }), ee = () => {
24
- const [e, r] = p(null), [s, n] = p(null), [a, u] = p(null), { config: m } = c(), l = i(
25
- async (t) => {
26
- const o = await P(t);
27
- return r({ hash: o.transactionHash, network: t.network }), u(null), n(null), o;
23
+ }, ne = () => ({ signEvmHash: c(C) }), te = () => ({ signEvmTransaction: c(W) }), re = () => {
24
+ const [e, n] = u(null), [s, t] = u(null), [o, g] = u(null), { config: a } = p(), d = c(
25
+ async (l) => {
26
+ const i = await H(l);
27
+ return n({ hash: i.transactionHash, network: l.network }), g(null), t(null), i;
28
28
  }
29
29
  );
30
- F(() => {
30
+ w(() => {
31
31
  if (!e) return;
32
32
  (async () => {
33
33
  try {
34
- const h = await D(e.network, m).waitForTransactionReceipt({
34
+ const S = await z(e.network, a).waitForTransactionReceipt({
35
35
  hash: e.hash
36
36
  });
37
- n(h);
38
- } catch (o) {
39
- u(o instanceof Error ? o : new Error(String(o)));
37
+ t(S);
38
+ } catch (i) {
39
+ g(i instanceof Error ? i : new Error(String(i)));
40
40
  }
41
41
  })();
42
42
  }, [e]);
43
- const g = w(() => e ? s ? { status: "success", receipt: s } : a ? { status: "error", error: a } : { status: "pending", hash: e.hash } : { status: "idle" }, [e, s, a]);
43
+ const m = V(() => e ? s ? { status: "success", receipt: s } : o ? { status: "error", error: o } : { status: "pending", hash: e.hash } : { status: "idle" }, [e, s, o]);
44
44
  return {
45
- sendEvmTransaction: l,
46
- data: g
45
+ sendEvmTransaction: d,
46
+ data: m
47
47
  };
48
- }, te = () => ({ signEvmMessage: i(C) }), ne = () => ({ signEvmTypedData: i(W) }), re = () => ({ exportEvmAccount: i(H) }), i = (e) => {
49
- const { isSignedIn: r } = c();
50
- return E(
51
- async (...n) => {
52
- if (!r)
48
+ }, se = () => ({ signEvmMessage: c(x) }), ae = () => ({ signEvmTypedData: c(b) }), ie = () => ({ exportEvmAccount: c(D) }), c = (e) => {
49
+ const { isSignedIn: n } = p();
50
+ return f(
51
+ async (...t) => {
52
+ if (!n)
53
53
  throw new Error("User is not authenticated");
54
- return e(...n);
54
+ return e(...t);
55
55
  },
56
- [r, e]
56
+ [n, e]
57
57
  );
58
- }, d = (e) => {
59
- const { isSignedIn: r } = c();
60
- return E(
61
- async (...n) => {
62
- if (r)
58
+ }, E = (e) => {
59
+ const { isSignedIn: n } = p();
60
+ return f(
61
+ async (...t) => {
62
+ if (n)
63
63
  throw new Error("User is already authenticated. Please sign out first.");
64
- return e(...n);
64
+ return e(...t);
65
65
  },
66
- [r, e]
66
+ [n, e]
67
67
  );
68
- }, se = () => {
69
- const { waitForUserOperation: e, data: r } = V();
68
+ }, oe = () => {
69
+ const [e, n] = u(void 0), { status: s, data: t, error: o } = G(e);
70
70
  return {
71
- sendUserOperation: i(
72
- async (n) => {
73
- const a = await f(n);
74
- return e({
75
- userOperationHash: a.userOperationHash,
76
- evmSmartAccount: n.evmSmartAccount,
77
- network: n.network
78
- }), a;
71
+ sendUserOperation: c(
72
+ async (a) => {
73
+ const d = await O(a);
74
+ return n({
75
+ userOperationHash: d.userOperationHash,
76
+ evmSmartAccount: a.evmSmartAccount,
77
+ network: a.network
78
+ }), d;
79
79
  }
80
80
  ),
81
- data: r
81
+ data: t,
82
+ error: o,
83
+ status: s
82
84
  };
83
- }, V = () => {
84
- const [e, r] = p(null), [s, n] = p(null), [a, u] = p(null), { currentUser: m } = S(), l = E((t) => {
85
- r({
86
- hash: t.userOperationHash,
87
- evmSmartAccount: t.evmSmartAccount,
88
- network: t.network
89
- }), u(null), n(null);
90
- }, []);
91
- M(
85
+ }, G = (e = {}) => {
86
+ const { userOperationHash: n, evmSmartAccount: s, network: t, enabled: o } = e, [g, a] = u("idle"), [d, m] = u(void 0), [l, i] = u(void 0), { currentUser: S } = h();
87
+ w(() => {
88
+ n && s && t && (a(o !== !1 ? "pending" : "idle"), m(void 0), i(void 0));
89
+ }, [n, s, t, o]);
90
+ const v = o !== !1 && !!(n && s && t && S);
91
+ return F(
92
92
  {
93
93
  pollFn: async () => {
94
- if (!e)
95
- throw new Error("No user operation to poll");
96
- return await x({
97
- userOperationHash: e.hash,
98
- evmSmartAccount: e.evmSmartAccount,
99
- network: e.network
94
+ const r = await M({
95
+ userOperationHash: n,
96
+ evmSmartAccount: s,
97
+ network: t
100
98
  });
99
+ return m(r), r;
101
100
  },
102
- shouldStop: (t) => t.status === "complete" || t.status === "dropped" || t.status === "failed",
103
- enabled: !!(e && m),
104
- onSuccess: (t) => {
105
- if (t.status === "complete")
106
- n(t);
107
- else if (t.status === "failed") {
108
- const o = t.receipts?.[0]?.revert?.message || "User operation failed";
109
- u(new Error(o));
101
+ shouldStop: (r) => r.status === "complete" || r.status === "dropped" || r.status === "failed",
102
+ enabled: v,
103
+ onSuccess: (r) => {
104
+ if (r.status === "complete")
105
+ m(r), a("success");
106
+ else if (r.status === "failed") {
107
+ const T = r.receipts?.[0]?.revert?.message || "User operation failed";
108
+ i(new Error(T)), a("error");
110
109
  } else
111
- n(t);
110
+ m(r), a("error");
112
111
  },
113
- onError: u
112
+ onError: (r) => {
113
+ i(r), a("error");
114
+ }
114
115
  },
115
- [e, m]
116
- );
117
- const g = w(() => e ? s ? { status: "success", result: s } : a ? { status: "error", error: a } : { status: "pending", hash: e.hash } : { status: "idle" }, [e, s, a]);
118
- return {
119
- waitForUserOperation: l,
120
- data: g
116
+ [n, s, t, v]
117
+ ), {
118
+ status: g,
119
+ data: d,
120
+ error: l
121
121
  };
122
122
  };
123
123
  export {
124
- q as useConfig,
125
- S as useCurrentUser,
126
- i as useEnforceAuthenticated,
127
- d as useEnforceUnauthenticated,
128
- _ as useEvmAddress,
129
- re as useExportEvmAccount,
130
- Z as useGetAccessToken,
131
- B as useIsInitialized,
132
- X as useIsSignedIn,
133
- ee as useSendEvmTransaction,
134
- se as useSendUserOperation,
135
- $ as useSignEvmHash,
136
- te as useSignEvmMessage,
137
- R as useSignEvmTransaction,
138
- ne as useSignEvmTypedData,
139
- J as useSignInWithEmail,
140
- K as useSignInWithSms,
141
- Y as useSignOut,
142
- L as useVerifyEmailOTP,
143
- Q as useVerifySmsOTP,
144
- V as useWaitForUserOperation
124
+ L as useConfig,
125
+ h as useCurrentUser,
126
+ c as useEnforceAuthenticated,
127
+ E as useEnforceUnauthenticated,
128
+ ee as useEvmAddress,
129
+ ie as useExportEvmAccount,
130
+ R as useGetAccessToken,
131
+ N as useIsInitialized,
132
+ _ as useIsSignedIn,
133
+ re as useSendEvmTransaction,
134
+ oe as useSendUserOperation,
135
+ ne as useSignEvmHash,
136
+ se as useSignEvmMessage,
137
+ te as useSignEvmTransaction,
138
+ ae as useSignEvmTypedData,
139
+ Q as useSignInWithEmail,
140
+ X as useSignInWithSms,
141
+ $ as useSignOut,
142
+ Y as useVerifyEmailOTP,
143
+ Z as useVerifySmsOTP,
144
+ G as useWaitForUserOperation
145
145
  };
@@ -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 "./index206.js";
4
+ import { getAction as g } from "./index212.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 "./index206.js";
2
+ import { getAction as l } from "./index212.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";
@@ -1,8 +1,8 @@
1
1
  import { parseAccount as R } from "./index11.js";
2
2
  import { BaseError as _ } from "./index82.js";
3
- import { recoverAuthorizationAddress as A } from "./index219.js";
3
+ import { recoverAuthorizationAddress as A } from "./index220.js";
4
4
  import { numberToHex as x } from "./index109.js";
5
- import { getEstimateGasError as E } from "./index220.js";
5
+ import { getEstimateGasError as E } from "./index221.js";
6
6
  import { extract as N } from "./index217.js";
7
7
  import { formatTransactionRequest as S } from "./index144.js";
8
8
  import { serializeStateOverride as I } from "./index218.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 "./index206.js";
3
+ import { getAction as s } from "./index212.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 "./index206.js";
2
+ import { getAction as v } from "./index212.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
- import { Eip712DomainNotFoundError as u } from "./index221.js";
2
- import { getAction as d } from "./index206.js";
1
+ import { Eip712DomainNotFoundError as u } from "./index222.js";
2
+ import { getAction as d } from "./index212.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,5 +1,5 @@
1
1
  import { numberToHex as o } from "./index109.js";
2
- import { formatFeeHistory as f } from "./index222.js";
2
+ import { formatFeeHistory as f } from "./index223.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",
@@ -1,5 +1,5 @@
1
1
  import { numberToHex as c } from "./index109.js";
2
- import { formatProof as s } from "./index223.js";
2
+ import { formatProof as s } from "./index224.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",
@@ -1,4 +1,4 @@
1
- import { getAction as n } from "./index206.js";
1
+ import { getAction as n } from "./index212.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 "./index206.js";
9
+ import { getAction as T } from "./index212.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 "./index206.js";
4
+ import { getAction as l } from "./index212.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({
@@ -8,7 +8,7 @@ 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 "./index224.js";
11
+ 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";
@@ -1,5 +1,5 @@
1
- import { encode as J, from as K } from "./index225.js";
2
- import { encodeData as M, from as o } from "./index226.js";
1
+ import { encode as J, from as K } from "./index226.js";
2
+ import { encodeData as M, from as o } from "./index227.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";
@@ -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 "./index206.js";
5
+ import { getAction as g } from "./index212.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,5 +1,5 @@
1
1
  import { hashMessage as h } from "./index182.js";
2
- import { verifyHash as i } from "./index227.js";
2
+ import { verifyHash as i } from "./index228.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, {
@@ -1,5 +1,5 @@
1
1
  import { hashTypedData as m } from "./index147.js";
2
- import { verifyHash as d } from "./index227.js";
2
+ import { verifyHash as d } from "./index228.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, {
@@ -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 "./index206.js";
4
- import { observe as q } from "./index208.js";
5
- import { withResolvers as z } from "./index210.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";
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 "./index206.js";
3
- import { observe as k } from "./index208.js";
4
- import { poll as h } from "./index209.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";
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 "./index206.js";
2
- import { observe as h } from "./index208.js";
3
- import { poll as v } from "./index209.js";
1
+ import { getAction as p } from "./index212.js";
2
+ import { observe as h } from "./index206.js";
3
+ import { poll as v } from "./index207.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 "./index206.js";
7
- import { observe as F } from "./index208.js";
8
- import { poll as O } from "./index209.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";
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 "./index208.js";
3
- import { poll as C } from "./index209.js";
2
+ import { observe as B } from "./index206.js";
3
+ import { poll as C } from "./index207.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 "./index206.js";
9
+ import { getAction as u } from "./index212.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 "./index206.js";
2
- import { observe as p } from "./index208.js";
3
- import { poll as b } from "./index209.js";
1
+ import { getAction as c } from "./index212.js";
2
+ import { observe as p } from "./index206.js";
3
+ import { poll as b } from "./index207.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";
@@ -1,7 +1,7 @@
1
1
  import { hashMessage as g } from "./index182.js";
2
- import { parseSiweMessage as l } from "./index228.js";
3
- import { validateSiweMessage as p } from "./index229.js";
4
- import { verifyHash as h } from "./index227.js";
2
+ import { parseSiweMessage as l } from "./index229.js";
3
+ import { validateSiweMessage as p } from "./index230.js";
4
+ import { verifyHash as h } from "./index228.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({
@@ -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 "./index206.js";
11
+ import { getAction as p } from "./index212.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";
@@ -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 "./index230.js";
5
+ import { withDedupe as J } from "./index231.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 = {}) {
@@ -9,13 +9,13 @@ import { EIP712TypedData } from '@coinbase/cdp-core';
9
9
  import { EvmAddress } from '@coinbase/cdp-core';
10
10
  import { ExportEvmAccountOptions } from '@coinbase/cdp-core';
11
11
  import { ExportEvmAccountResult } from '@coinbase/cdp-core';
12
- import { GetUserOperationOptions } from '@coinbase/cdp-core';
13
12
  import { GetUserOperationResult } from '@coinbase/cdp-core';
14
13
  import { Hex } from '@coinbase/cdp-core';
15
14
  import { JSX } from 'react/jsx-runtime';
16
15
  import { ReactNode } from 'react';
17
16
  import { SendEvmTransactionOptions } from '@coinbase/cdp-core';
18
17
  import { SendEvmTransactionResult } from '@coinbase/cdp-core';
18
+ import { SendEvmTransactionWithEndUserAccountBodyNetwork } from '@coinbase/cdp-core';
19
19
  import { SendUserOperationOptions } from '@coinbase/cdp-core';
20
20
  import { SendUserOperationResult } from '@coinbase/cdp-core';
21
21
  import { SignEvmHashOptions } from '@coinbase/cdp-core';
@@ -100,6 +100,8 @@ export { SignInWithEmailOptions }
100
100
 
101
101
  export { SignInWithEmailResult }
102
102
 
103
+ export declare type Status = "idle" | "pending" | "success" | "error";
104
+
103
105
  export declare type TransactionState = {
104
106
  status: "idle";
105
107
  } | {
@@ -147,27 +149,18 @@ export declare const useIsSignedIn: () => {
147
149
 
148
150
  export { User }
149
151
 
150
- export declare type UserOperationState = {
151
- status: "idle";
152
- } | {
153
- status: "pending";
154
- hash: Hex;
155
- } | {
156
- status: "success";
157
- result: GetUserOperationResult;
158
- } | {
159
- status: "error";
160
- error: Error;
161
- };
162
-
163
152
  export declare const useSendEvmTransaction: () => {
164
153
  sendEvmTransaction: (options: SendEvmTransactionOptions) => Promise<SendEvmTransactionResult>;
165
154
  data: TransactionState;
166
155
  };
167
156
 
168
- export declare const useSendUserOperation: () => {
157
+ export declare const useSendUserOperation: () => UseSendUserOperationReturnType;
158
+
159
+ export declare type UseSendUserOperationReturnType = {
169
160
  sendUserOperation: (options: SendUserOperationOptions) => Promise<SendUserOperationResult>;
170
- data: UserOperationState;
161
+ data: GetUserOperationResult | undefined;
162
+ error: Error | undefined;
163
+ status: Status;
171
164
  };
172
165
 
173
166
  export declare const useSignEvmHash: () => {
@@ -206,9 +199,19 @@ export declare const useVerifySmsOTP: () => {
206
199
  verifySmsOTP: (options: VerifySmsOTPOptions) => Promise<VerifySmsOTPResult>;
207
200
  };
208
201
 
209
- export declare const useWaitForUserOperation: () => {
210
- waitForUserOperation: (options: GetUserOperationOptions) => void;
211
- data: UserOperationState;
202
+ export declare const useWaitForUserOperation: (parameters?: UseWaitForUserOperationParameters) => UseWaitForUserOperationReturnType;
203
+
204
+ export declare type UseWaitForUserOperationParameters = {
205
+ userOperationHash?: Hex;
206
+ evmSmartAccount?: EvmAddress;
207
+ network?: SendEvmTransactionWithEndUserAccountBodyNetwork;
208
+ enabled?: boolean;
209
+ };
210
+
211
+ export declare type UseWaitForUserOperationReturnType = {
212
+ status: Status;
213
+ data: GetUserOperationResult | undefined;
214
+ error: Error | undefined;
212
215
  };
213
216
 
214
217
  export { VerifyEmailOTPOptions }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-hooks",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
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.21"
17
+ "@coinbase/cdp-core": "^0.0.22"
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.21"
32
+ "@coinbase/cdp-core": "^0.0.22"
33
33
  },
34
34
  "size-limit": [
35
35
  {