@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/dist/esm/index3.js
CHANGED
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
import { getAccessToken as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useCDP as
|
|
4
|
-
import { useAutoPolling as
|
|
5
|
-
import { getPublicClient as
|
|
6
|
-
const
|
|
7
|
-
const { config: e } =
|
|
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
|
-
},
|
|
10
|
-
const { isInitialized: e } =
|
|
9
|
+
}, N = () => {
|
|
10
|
+
const { isInitialized: e } = p();
|
|
11
11
|
return { isInitialized: e };
|
|
12
|
-
},
|
|
13
|
-
const { isSignedIn: e } =
|
|
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
|
-
},
|
|
16
|
-
const { currentUser: e } =
|
|
15
|
+
}, h = () => {
|
|
16
|
+
const { currentUser: e } = p();
|
|
17
17
|
return { currentUser: e };
|
|
18
|
-
},
|
|
19
|
-
const { currentUser: e } =
|
|
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
|
-
},
|
|
24
|
-
const [e,
|
|
25
|
-
async (
|
|
26
|
-
const
|
|
27
|
-
return
|
|
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
|
-
|
|
30
|
+
w(() => {
|
|
31
31
|
if (!e) return;
|
|
32
32
|
(async () => {
|
|
33
33
|
try {
|
|
34
|
-
const
|
|
34
|
+
const S = await z(e.network, a).waitForTransactionReceipt({
|
|
35
35
|
hash: e.hash
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
} catch (
|
|
39
|
-
|
|
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
|
|
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:
|
|
46
|
-
data:
|
|
45
|
+
sendEvmTransaction: d,
|
|
46
|
+
data: m
|
|
47
47
|
};
|
|
48
|
-
},
|
|
49
|
-
const { isSignedIn:
|
|
50
|
-
return
|
|
51
|
-
async (...
|
|
52
|
-
if (!
|
|
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(...
|
|
54
|
+
return e(...t);
|
|
55
55
|
},
|
|
56
|
-
[
|
|
56
|
+
[n, e]
|
|
57
57
|
);
|
|
58
|
-
},
|
|
59
|
-
const { isSignedIn:
|
|
60
|
-
return
|
|
61
|
-
async (...
|
|
62
|
-
if (
|
|
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(...
|
|
64
|
+
return e(...t);
|
|
65
65
|
},
|
|
66
|
-
[
|
|
66
|
+
[n, e]
|
|
67
67
|
);
|
|
68
|
-
},
|
|
69
|
-
const {
|
|
68
|
+
}, oe = () => {
|
|
69
|
+
const [e, n] = u(void 0), { status: s, data: t, error: o } = G(e);
|
|
70
70
|
return {
|
|
71
|
-
sendUserOperation:
|
|
72
|
-
async (
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
userOperationHash:
|
|
76
|
-
evmSmartAccount:
|
|
77
|
-
network:
|
|
78
|
-
}),
|
|
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:
|
|
81
|
+
data: t,
|
|
82
|
+
error: o,
|
|
83
|
+
status: s
|
|
82
84
|
};
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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: (
|
|
103
|
-
enabled:
|
|
104
|
-
onSuccess: (
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
else if (
|
|
108
|
-
const
|
|
109
|
-
|
|
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
|
-
|
|
110
|
+
m(r), a("error");
|
|
112
111
|
},
|
|
113
|
-
onError:
|
|
112
|
+
onError: (r) => {
|
|
113
|
+
i(r), a("error");
|
|
114
|
+
}
|
|
114
115
|
},
|
|
115
|
-
[
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
};
|
package/dist/esm/index30.js
CHANGED
|
@@ -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 "./
|
|
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({
|
package/dist/esm/index31.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseFeeScalarError as p, Eip1559FeesNotSupportedError as F } from "./index95.js";
|
|
2
|
-
import { getAction as l } from "./
|
|
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";
|
package/dist/esm/index32.js
CHANGED
|
@@ -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 "./
|
|
3
|
+
import { recoverAuthorizationAddress as A } from "./index220.js";
|
|
4
4
|
import { numberToHex as x } from "./index109.js";
|
|
5
|
-
import { getEstimateGasError as E } from "./
|
|
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";
|
package/dist/esm/index33.js
CHANGED
|
@@ -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 "./
|
|
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) {
|
package/dist/esm/index41.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAbiItem as p } from "./index89.js";
|
|
2
|
-
import { getAction as v } from "./
|
|
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");
|
package/dist/esm/index42.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Eip712DomainNotFoundError as u } from "./
|
|
2
|
-
import { getAction as d } from "./
|
|
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;
|
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 "./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",
|
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 "./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",
|
package/dist/esm/index51.js
CHANGED
package/dist/esm/index54.js
CHANGED
|
@@ -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 "./
|
|
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);
|
package/dist/esm/index55.js
CHANGED
|
@@ -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 "./
|
|
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({
|
package/dist/esm/index56.js
CHANGED
|
@@ -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 "./
|
|
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";
|
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 "./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";
|
package/dist/esm/index58.js
CHANGED
|
@@ -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 "./
|
|
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 });
|
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 "./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, {
|
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 "./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, {
|
package/dist/esm/index62.js
CHANGED
|
@@ -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 "./
|
|
4
|
-
import { observe as q } from "./
|
|
5
|
-
import { withResolvers as z } from "./
|
|
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";
|
package/dist/esm/index63.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexToBigInt as w } from "./index142.js";
|
|
2
|
-
import { getAction as g } from "./
|
|
3
|
-
import { observe as k } from "./
|
|
4
|
-
import { poll as h } from "./
|
|
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 }) {
|
package/dist/esm/index64.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getAction as p } from "./
|
|
2
|
-
import { observe as h } from "./
|
|
3
|
-
import { poll as v } from "./
|
|
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 }) {
|
package/dist/esm/index65.js
CHANGED
|
@@ -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 "./
|
|
7
|
-
import { observe as F } from "./
|
|
8
|
-
import { poll as O } from "./
|
|
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";
|
package/dist/esm/index66.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { encodeEventTopics as S } from "./index136.js";
|
|
2
|
-
import { observe as B } from "./
|
|
3
|
-
import { poll as C } from "./
|
|
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 "./
|
|
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";
|
package/dist/esm/index67.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getAction as c } from "./
|
|
2
|
-
import { observe as p } from "./
|
|
3
|
-
import { poll as b } from "./
|
|
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";
|
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 "./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({
|
package/dist/esm/index69.js
CHANGED
|
@@ -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 "./
|
|
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";
|
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 "./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 = {}) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
211
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
32
|
+
"@coinbase/cdp-core": "^0.0.22"
|
|
33
33
|
},
|
|
34
34
|
"size-limit": [
|
|
35
35
|
{
|