@coinbase/cdp-hooks 0.0.95 → 0.0.97

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 (293) hide show
  1. package/dist/esm/index100.js +35 -42
  2. package/dist/esm/index101.js +9 -88
  3. package/dist/esm/index102.js +31 -40
  4. package/dist/esm/index103.js +35 -7
  5. package/dist/esm/index104.js +7 -4
  6. package/dist/esm/index105.js +29 -16
  7. package/dist/esm/index106.js +46 -8
  8. package/dist/esm/index107.js +69 -13
  9. package/dist/esm/index108.js +40 -7
  10. package/dist/esm/index109.js +75 -9
  11. package/dist/esm/index110.js +30 -15
  12. package/dist/esm/index111.js +6 -46
  13. package/dist/esm/index112.js +16 -13
  14. package/dist/esm/index113.js +8 -16
  15. package/dist/esm/index114.js +13 -13
  16. package/dist/esm/index115.js +6 -5
  17. package/dist/esm/index116.js +9 -35
  18. package/dist/esm/index117.js +15 -8
  19. package/dist/esm/index118.js +11 -7
  20. package/dist/esm/index119.js +45 -24
  21. package/dist/esm/index120.js +13 -10
  22. package/dist/esm/index121.js +15 -13
  23. package/dist/esm/index122.js +13 -11
  24. package/dist/esm/index123.js +6 -116
  25. package/dist/esm/index124.js +34 -32
  26. package/dist/esm/index125.js +9 -79
  27. package/dist/esm/index126.js +8 -177
  28. package/dist/esm/index127.js +27 -43
  29. package/dist/esm/index128.js +10 -6
  30. package/dist/esm/index129.js +13 -12
  31. package/dist/esm/index130.js +11 -13
  32. package/dist/esm/index131.js +118 -97
  33. package/dist/esm/index132.js +32 -71
  34. package/dist/esm/index133.js +77 -84
  35. package/dist/esm/index134.js +174 -145
  36. package/dist/esm/index135.js +43 -135
  37. package/dist/esm/index136.js +6 -68
  38. package/dist/esm/index137.js +152 -21
  39. package/dist/esm/index138.js +14 -105
  40. package/dist/esm/index139.js +14 -6
  41. package/dist/esm/index140.js +98 -130
  42. package/dist/esm/index141.js +72 -275
  43. package/dist/esm/index142.js +88 -3
  44. package/dist/esm/index143.js +149 -4
  45. package/dist/esm/index144.js +137 -9
  46. package/dist/esm/index145.js +69 -2
  47. package/dist/esm/index146.js +24 -2
  48. package/dist/esm/index147.js +159 -3
  49. package/dist/esm/index148.js +6 -326
  50. package/dist/esm/index149.js +11 -13
  51. package/dist/esm/index150.js +19 -4
  52. package/dist/esm/index151.js +134 -54
  53. package/dist/esm/index152.js +79 -2
  54. package/dist/esm/index153.js +8 -6
  55. package/dist/esm/index154.js +26 -212
  56. package/dist/esm/index155.js +89 -31
  57. package/dist/esm/index156.js +351 -22
  58. package/dist/esm/index157.js +3 -6
  59. package/dist/esm/index158.js +5 -74
  60. package/dist/esm/index159.js +2 -6
  61. package/dist/esm/index160.js +3 -6
  62. package/dist/esm/index161.js +9 -36
  63. package/dist/esm/index162.js +303 -52
  64. package/dist/esm/index163.js +14 -3
  65. package/dist/esm/index164.js +4 -23
  66. package/dist/esm/index165.js +40 -436
  67. package/dist/esm/index166.js +8 -26
  68. package/dist/esm/index167.js +2 -27
  69. package/dist/esm/index168.js +6 -32
  70. package/dist/esm/index169.js +28 -32
  71. package/dist/esm/index170.js +196 -175
  72. package/dist/esm/index171.js +32 -9
  73. package/dist/esm/index172.js +22 -2
  74. package/dist/esm/index173.js +5 -12
  75. package/dist/esm/index174.js +68 -13
  76. package/dist/esm/index175.js +5 -27
  77. package/dist/esm/index176.js +5 -8
  78. package/dist/esm/index177.js +31 -51
  79. package/dist/esm/index178.js +116 -42
  80. package/dist/esm/index179.js +3 -9
  81. package/dist/esm/index180.js +18 -7
  82. package/dist/esm/index181.js +25 -15
  83. package/dist/esm/index182.js +31 -16
  84. package/dist/esm/index183.js +34 -24
  85. package/dist/esm/index184.js +23 -16
  86. package/dist/esm/index185.js +8 -54
  87. package/dist/esm/index186.js +193 -11
  88. package/dist/esm/index187.js +2 -161
  89. package/dist/esm/index188.js +467 -21
  90. package/dist/esm/index189.js +26 -126
  91. package/dist/esm/index190.js +153 -31
  92. package/dist/esm/index191.js +21 -6
  93. package/dist/esm/index192.js +127 -27
  94. package/dist/esm/index193.js +31 -184
  95. package/dist/esm/index194.js +7 -4
  96. package/dist/esm/index195.js +26 -63
  97. package/dist/esm/index196.js +56 -3
  98. package/dist/esm/index197.js +42 -17
  99. package/dist/esm/index198.js +188 -13
  100. package/dist/esm/index199.js +4 -24
  101. package/dist/esm/index2.js +2 -2
  102. package/dist/esm/index200.js +73 -11
  103. package/dist/esm/index201.js +17 -31
  104. package/dist/esm/index202.js +3 -3
  105. package/dist/esm/index203.js +15 -17
  106. package/dist/esm/index204.js +22 -26
  107. package/dist/esm/index205.js +11 -35
  108. package/dist/esm/index206.js +18 -7
  109. package/dist/esm/index207.js +32 -23
  110. package/dist/esm/index208.js +3 -29
  111. package/dist/esm/index209.js +18 -64
  112. package/dist/esm/index210.js +27 -9
  113. package/dist/esm/index211.js +34 -32
  114. package/dist/esm/index212.js +8 -27
  115. package/dist/esm/index213.js +7 -24
  116. package/dist/esm/index214.js +25 -3
  117. package/dist/esm/index215.js +28 -14
  118. package/dist/esm/index216.js +3 -103
  119. package/dist/esm/index217.js +75 -60
  120. package/dist/esm/index218.js +9 -5
  121. package/dist/esm/index219.js +12 -6
  122. package/dist/esm/index220.js +20 -26
  123. package/dist/esm/index221.js +8 -38
  124. package/dist/esm/index222.js +10 -13
  125. package/dist/esm/index223.js +11 -42
  126. package/dist/esm/index224.js +6 -5
  127. package/dist/esm/index225.js +6 -11
  128. package/dist/esm/index226.js +13 -19
  129. package/dist/esm/index227.js +30 -76
  130. package/dist/esm/index228.js +5 -2
  131. package/dist/esm/index229.js +2 -2
  132. package/dist/esm/index230.js +8 -8
  133. package/dist/esm/index231.js +3 -3
  134. package/dist/esm/index232.js +5 -5
  135. package/dist/esm/index233.js +17 -8
  136. package/dist/esm/index234.js +19 -6
  137. package/dist/esm/index235.js +42 -6
  138. package/dist/esm/index236.js +42 -11
  139. package/dist/esm/index237.js +8 -10
  140. package/dist/esm/index238.js +7 -13
  141. package/dist/esm/index239.js +15 -31
  142. package/dist/esm/index240.js +23 -5
  143. package/dist/esm/index241.js +22 -6
  144. package/dist/esm/index242.js +16 -19
  145. package/dist/esm/index243.js +52 -29
  146. package/dist/esm/index244.js +27 -20
  147. package/dist/esm/index245.js +24 -3
  148. package/dist/esm/index246.js +104 -17
  149. package/dist/esm/index247.js +3 -11
  150. package/dist/esm/index248.js +5 -21
  151. package/dist/esm/index249.js +31 -22
  152. package/dist/esm/index250.js +20 -5
  153. package/dist/esm/index251.js +3 -5
  154. package/dist/esm/index252.js +17 -8
  155. package/dist/esm/index253.js +5 -104
  156. package/dist/esm/index254.js +9 -3
  157. package/dist/esm/index255.js +102 -17
  158. package/dist/esm/index256.js +60 -167
  159. package/dist/esm/index257.js +5 -17
  160. package/dist/esm/index258.js +7 -10
  161. package/dist/esm/index259.js +27 -38
  162. package/dist/esm/index260.js +34 -2
  163. package/dist/esm/index261.js +13 -69
  164. package/dist/esm/index262.js +16 -34
  165. package/dist/esm/index263.js +77 -13
  166. package/dist/esm/index264.js +2 -41
  167. package/dist/esm/index265.js +15 -2
  168. package/dist/esm/index266.js +18 -4
  169. package/dist/esm/index267.js +170 -9
  170. package/dist/esm/index268.js +16 -18
  171. package/dist/esm/index269.js +10 -7
  172. package/dist/esm/index270.js +10 -12
  173. package/dist/esm/index271.js +2 -67
  174. package/dist/esm/index272.js +39 -64
  175. package/dist/esm/index273.js +2 -186
  176. package/dist/esm/index274.js +4 -22
  177. package/dist/esm/index275.js +9 -41
  178. package/dist/esm/index276.js +17 -74
  179. package/dist/esm/index277.js +7 -40
  180. package/dist/esm/index278.js +10 -15
  181. package/dist/esm/index279.js +72 -13
  182. package/dist/esm/index280.js +65 -7
  183. package/dist/esm/index281.js +187 -6
  184. package/dist/esm/index282.js +21 -35
  185. package/dist/esm/index283.js +42 -15
  186. package/dist/esm/index284.js +25 -8
  187. package/dist/esm/index285.js +91 -13
  188. package/dist/esm/index286.js +40 -9
  189. package/dist/esm/index287.js +15 -15
  190. package/dist/esm/index288.js +12 -21
  191. package/dist/esm/index289.js +7 -30
  192. package/dist/esm/index290.js +7 -2
  193. package/dist/esm/index291.js +36 -13
  194. package/dist/esm/index292.js +15 -12
  195. package/dist/esm/index293.js +8 -47
  196. package/dist/esm/index294.js +8 -9
  197. package/dist/esm/index295.js +16 -13
  198. package/dist/esm/index296.js +21 -13
  199. package/dist/esm/index297.js +28 -6
  200. package/dist/esm/index298.js +2 -16
  201. package/dist/esm/index299.js +12 -23
  202. package/dist/esm/index3.js +1 -1
  203. package/dist/esm/index300.js +12 -11
  204. package/dist/esm/index301.js +45 -22
  205. package/dist/esm/index302.js +9 -51
  206. package/dist/esm/index303.js +13 -17
  207. package/dist/esm/index304.js +13 -14
  208. package/dist/esm/index305.js +14 -11
  209. package/dist/esm/index306.js +8 -103
  210. package/dist/esm/index307.js +15 -5
  211. package/dist/esm/index308.js +23 -222
  212. package/dist/esm/index309.js +24 -6
  213. package/dist/esm/index310.js +32 -7
  214. package/dist/esm/index311.js +9 -26
  215. package/dist/esm/index312.js +49 -17
  216. package/dist/esm/index313.js +34 -142
  217. package/dist/esm/index314.js +18 -13
  218. package/dist/esm/index315.js +15 -36
  219. package/dist/esm/index316.js +11 -41
  220. package/dist/esm/index317.js +13 -2
  221. package/dist/esm/index318.js +19 -68
  222. package/dist/esm/index319.js +107 -3
  223. package/dist/esm/index320.js +100 -133
  224. package/dist/esm/index321.js +6 -155
  225. package/dist/esm/index322.js +7 -10
  226. package/dist/esm/index323.js +26 -16
  227. package/dist/esm/index324.js +12 -110
  228. package/dist/esm/index325.js +206 -127
  229. package/dist/esm/index326.js +12 -78
  230. package/dist/esm/index327.js +36 -2
  231. package/dist/esm/index328.js +41 -697
  232. package/dist/esm/index329.js +3 -138
  233. package/dist/esm/index330.js +68 -42
  234. package/dist/esm/index331.js +3 -200
  235. package/dist/esm/index332.js +136 -3
  236. package/dist/esm/index333.js +155 -46
  237. package/dist/esm/index334.js +9 -4
  238. package/dist/esm/index335.js +16 -40
  239. package/dist/esm/index336.js +133 -7
  240. package/dist/esm/index337.js +187 -56
  241. package/dist/esm/index338.js +2 -78
  242. package/dist/esm/index339.js +79 -4
  243. package/dist/esm/index340.js +11 -191
  244. package/dist/esm/index341.js +82 -55
  245. package/dist/esm/index342.js +159 -40
  246. package/dist/esm/index343.js +42 -4
  247. package/dist/esm/index344.js +656 -5
  248. package/dist/esm/index345.js +206 -2
  249. package/dist/esm/index346.js +174 -19
  250. package/dist/esm/index347.js +43 -0
  251. package/dist/esm/index348.js +7 -0
  252. package/dist/esm/index349.js +10 -0
  253. package/dist/esm/index350.js +65 -0
  254. package/dist/esm/index351.js +80 -0
  255. package/dist/esm/index352.js +122 -0
  256. package/dist/esm/index353.js +345 -0
  257. package/dist/esm/index354.js +163 -0
  258. package/dist/esm/index355.js +7 -0
  259. package/dist/esm/index356.js +7 -0
  260. package/dist/esm/index357.js +55 -0
  261. package/dist/esm/index358.js +7 -0
  262. package/dist/esm/index359.js +4 -0
  263. package/dist/esm/index360.js +24 -0
  264. package/dist/esm/index71.js +26 -17
  265. package/dist/esm/index73.js +2 -2
  266. package/dist/esm/index74.js +12 -40
  267. package/dist/esm/index75.js +49 -58
  268. package/dist/esm/index76.js +13 -43
  269. package/dist/esm/index77.js +28 -5
  270. package/dist/esm/index78.js +30 -48
  271. package/dist/esm/index79.js +29 -32
  272. package/dist/esm/index80.js +56 -4
  273. package/dist/esm/index81.js +54 -10
  274. package/dist/esm/index82.js +57 -67
  275. package/dist/esm/index83.js +5 -10
  276. package/dist/esm/index84.js +47 -28
  277. package/dist/esm/index85.js +37 -69
  278. package/dist/esm/index86.js +2 -20
  279. package/dist/esm/index87.js +69 -110
  280. package/dist/esm/index88.js +34 -60
  281. package/dist/esm/index89.js +13 -23
  282. package/dist/esm/index90.js +33 -39
  283. package/dist/esm/index91.js +3 -37
  284. package/dist/esm/index92.js +8 -57
  285. package/dist/esm/index93.js +118 -163
  286. package/dist/esm/index94.js +58 -36
  287. package/dist/esm/index95.js +23 -8
  288. package/dist/esm/index96.js +36 -31
  289. package/dist/esm/index97.js +38 -33
  290. package/dist/esm/index98.js +58 -9
  291. package/dist/esm/index99.js +164 -25
  292. package/dist/types/index.d.ts +1 -3
  293. package/package.json +4 -4
@@ -1,42 +1,64 @@
1
- import { parseAccount as P } from "./index80.js";
2
- import { numberToHex as y } from "./index178.js";
3
- import { getCallError as F } from "./index291.js";
4
- import { extract as L } from "./index292.js";
5
- import { formatTransactionRequest as A } from "./index213.js";
6
- import { assertRequest as G } from "./index226.js";
7
- async function _(t, e) {
8
- const { account: o = t.account, blockNumber: r, blockTag: m = "latest", blobs: i, data: u, gas: f, gasPrice: b, maxFeePerBlobGas: p, maxFeePerGas: d, maxPriorityFeePerGas: h, to: l, value: x, ...g } = e, a = o ? P(o) : void 0;
9
- try {
10
- G(e);
11
- const k = (typeof r == "bigint" ? y(r) : void 0) || m, c = t.chain?.formatters?.transactionRequest?.format, q = (c || A)({
12
- // Pick out extra data that might exist on the chain's transaction request type.
13
- ...L(g, { format: c }),
14
- from: a?.address,
15
- blobs: i,
16
- data: u,
17
- gas: f,
18
- gasPrice: b,
19
- maxFeePerBlobGas: p,
20
- maxFeePerGas: d,
21
- maxPriorityFeePerGas: h,
22
- to: l,
23
- value: x
24
- }), n = await t.request({
25
- method: "eth_createAccessList",
26
- params: [q, k]
1
+ import { addressResolverAbi as u, universalResolverResolveAbi as R } from "./index156.js";
2
+ import { decodeFunctionResult as g } from "./index204.js";
3
+ import { encodeFunctionData as b } from "./index213.js";
4
+ import { getChainContractAddress as w } from "./index234.js";
5
+ import { trim as y } from "./index194.js";
6
+ import { toHex as C } from "./index197.js";
7
+ import { isNullUniversalResolverError as x } from "./index294.js";
8
+ import { localBatchGatewayUrl as N } from "./index232.js";
9
+ import { namehash as m } from "./index239.js";
10
+ import { packetToBytes as T } from "./index295.js";
11
+ import { getAction as U } from "./index289.js";
12
+ import { readContract as k } from "./index132.js";
13
+ async function K(s, e) {
14
+ const { blockNumber: i, blockTag: f, coinType: a, name: t, gatewayUrls: v, strict: p } = e, { chain: o } = s, h = (() => {
15
+ if (e.universalResolverAddress)
16
+ return e.universalResolverAddress;
17
+ if (!o)
18
+ throw new Error("client chain not configured. universalResolverAddress is required.");
19
+ return w({
20
+ blockNumber: i,
21
+ chain: o,
22
+ contract: "ensUniversalResolver"
27
23
  });
28
- return {
29
- accessList: n.accessList,
30
- gasUsed: BigInt(n.gasUsed)
31
- };
32
- } catch (s) {
33
- throw F(s, {
34
- ...e,
35
- account: a,
36
- chain: t.chain
24
+ })(), c = o?.ensTlds;
25
+ if (c && !c.some((r) => t.endsWith(r)))
26
+ return null;
27
+ const l = a != null ? [m(t), BigInt(a)] : [m(t)];
28
+ try {
29
+ const r = b({
30
+ abi: u,
31
+ functionName: "addr",
32
+ args: l
33
+ }), A = {
34
+ address: h,
35
+ abi: R,
36
+ functionName: "resolveWithGateways",
37
+ args: [
38
+ C(T(t)),
39
+ r,
40
+ v ?? [N]
41
+ ],
42
+ blockNumber: i,
43
+ blockTag: f
44
+ }, d = await U(s, k, "readContract")(A);
45
+ if (d[0] === "0x")
46
+ return null;
47
+ const n = g({
48
+ abi: u,
49
+ args: l,
50
+ functionName: "addr",
51
+ data: d[0]
37
52
  });
53
+ return n === "0x" || y(n) === "0x00" ? null : n;
54
+ } catch (r) {
55
+ if (p)
56
+ throw r;
57
+ if (x(r))
58
+ return null;
59
+ throw r;
38
60
  }
39
61
  }
40
62
  export {
41
- _ as createAccessList
63
+ K as getEnsAddress
42
64
  };
@@ -1,12 +1,27 @@
1
- import { createFilterRequestScope as r } from "./index281.js";
2
- async function i(e) {
3
- const o = r(e, {
4
- method: "eth_newBlockFilter"
5
- }), t = await e.request({
6
- method: "eth_newBlockFilter"
1
+ import { parseAvatarRecord as m } from "./index296.js";
2
+ import { getAction as u } from "./index289.js";
3
+ import { getEnsText as f } from "./index98.js";
4
+ async function y(t, { blockNumber: a, blockTag: e, assetGatewayUrls: n, name: o, gatewayUrls: c, strict: i, universalResolverAddress: s }) {
5
+ const r = await u(t, f, "getEnsText")({
6
+ blockNumber: a,
7
+ blockTag: e,
8
+ key: "avatar",
9
+ name: o,
10
+ universalResolverAddress: s,
11
+ gatewayUrls: c,
12
+ strict: i
7
13
  });
8
- return { id: t, request: o(t), type: "block" };
14
+ if (!r)
15
+ return null;
16
+ try {
17
+ return await m(t, {
18
+ record: r,
19
+ gatewayUrls: n
20
+ });
21
+ } catch {
22
+ return null;
23
+ }
9
24
  }
10
25
  export {
11
- i as createBlockFilter
26
+ y as getEnsAvatar
12
27
  };
@@ -1,34 +1,39 @@
1
- import { encodeEventTopics as l } from "./index205.js";
2
- import { numberToHex as s } from "./index178.js";
3
- import { createFilterRequestScope as u } from "./index281.js";
4
- async function h(r, a) {
5
- const { address: m, abi: n, args: i, eventName: e, fromBlock: t, strict: p, toBlock: o } = a, f = u(r, {
6
- method: "eth_newFilter"
7
- }), d = e ? l({
8
- abi: n,
9
- args: i,
10
- eventName: e
11
- }) : void 0, c = await r.request({
12
- method: "eth_newFilter",
13
- params: [
14
- {
15
- address: m,
16
- fromBlock: typeof t == "bigint" ? s(t) : t,
17
- toBlock: typeof o == "bigint" ? s(o) : o,
18
- topics: d
19
- }
20
- ]
21
- });
22
- return {
23
- abi: n,
24
- args: i,
25
- eventName: e,
26
- id: c,
27
- request: f(c),
28
- strict: !!p,
29
- type: "event"
30
- };
1
+ import { universalResolverReverseAbi as m } from "./index156.js";
2
+ import { getChainContractAddress as f } from "./index234.js";
3
+ import { isNullUniversalResolverError as h } from "./index294.js";
4
+ import { localBatchGatewayUrl as w } from "./index232.js";
5
+ import { getAction as A } from "./index289.js";
6
+ import { readContract as R } from "./index132.js";
7
+ async function U(t, e) {
8
+ const { address: n, blockNumber: o, blockTag: a, coinType: i = 60n, gatewayUrls: c, strict: l } = e, { chain: s } = t, d = (() => {
9
+ if (e.universalResolverAddress)
10
+ return e.universalResolverAddress;
11
+ if (!s)
12
+ throw new Error("client chain not configured. universalResolverAddress is required.");
13
+ return f({
14
+ blockNumber: o,
15
+ chain: s,
16
+ contract: "ensUniversalResolver"
17
+ });
18
+ })();
19
+ try {
20
+ const r = {
21
+ address: d,
22
+ abi: m,
23
+ args: [n, i, c ?? [w]],
24
+ functionName: "reverseWithGateways",
25
+ blockNumber: o,
26
+ blockTag: a
27
+ }, u = A(t, R, "readContract"), [v] = await u(r);
28
+ return v || null;
29
+ } catch (r) {
30
+ if (l)
31
+ throw r;
32
+ if (h(r))
33
+ return null;
34
+ throw r;
35
+ }
31
36
  }
32
37
  export {
33
- h as createContractEventFilter
38
+ U as getEnsName
34
39
  };
@@ -1,39 +1,44 @@
1
- import { encodeEventTopics as b } from "./index205.js";
2
- import { numberToHex as m } from "./index178.js";
3
- import { createFilterRequestScope as h } from "./index281.js";
4
- async function l(r, { address: p, args: a, event: e, events: c, fromBlock: n, strict: f, toBlock: i } = {}) {
5
- const o = c ?? (e ? [e] : void 0), u = h(r, {
6
- method: "eth_newFilter"
7
- });
8
- let t = [];
9
- o && (t = [o.flatMap((d) => b({
10
- abi: [d],
11
- eventName: d.name,
12
- args: a
13
- }))], e && (t = t[0]));
14
- const s = await r.request({
15
- method: "eth_newFilter",
16
- params: [
1
+ import { getChainContractAddress as l } from "./index234.js";
2
+ import { toHex as u } from "./index197.js";
3
+ import { packetToBytes as v } from "./index295.js";
4
+ import { getAction as f } from "./index289.js";
5
+ import { readContract as m } from "./index132.js";
6
+ async function A(o, r) {
7
+ const { blockNumber: n, blockTag: i, name: t } = r, { chain: e } = o, a = (() => {
8
+ if (r.universalResolverAddress)
9
+ return r.universalResolverAddress;
10
+ if (!e)
11
+ throw new Error("client chain not configured. universalResolverAddress is required.");
12
+ return l({
13
+ blockNumber: n,
14
+ chain: e,
15
+ contract: "ensUniversalResolver"
16
+ });
17
+ })(), s = e?.ensTlds;
18
+ if (s && !s.some((c) => t.endsWith(c)))
19
+ throw new Error(`${t} is not a valid ENS TLD (${s?.join(", ")}) for chain "${e.name}" (id: ${e.id}).`);
20
+ const [d] = await f(o, m, "readContract")({
21
+ address: a,
22
+ abi: [
17
23
  {
18
- address: p,
19
- fromBlock: typeof n == "bigint" ? m(n) : n,
20
- toBlock: typeof i == "bigint" ? m(i) : i,
21
- ...t.length ? { topics: t } : {}
24
+ inputs: [{ type: "bytes" }],
25
+ name: "findResolver",
26
+ outputs: [
27
+ { type: "address" },
28
+ { type: "bytes32" },
29
+ { type: "uint256" }
30
+ ],
31
+ stateMutability: "view",
32
+ type: "function"
22
33
  }
23
- ]
34
+ ],
35
+ functionName: "findResolver",
36
+ args: [u(v(t))],
37
+ blockNumber: n,
38
+ blockTag: i
24
39
  });
25
- return {
26
- abi: o,
27
- args: a,
28
- eventName: e ? e.name : void 0,
29
- fromBlock: n,
30
- id: s,
31
- request: u(s),
32
- strict: !!f,
33
- toBlock: i,
34
- type: "event"
35
- };
40
+ return d;
36
41
  }
37
42
  export {
38
- l as createEventFilter
43
+ A as getEnsResolver
39
44
  };
@@ -1,12 +1,61 @@
1
- import { createFilterRequestScope as r } from "./index281.js";
2
- async function a(e) {
3
- const n = r(e, {
4
- method: "eth_newPendingTransactionFilter"
5
- }), t = await e.request({
6
- method: "eth_newPendingTransactionFilter"
7
- });
8
- return { id: t, request: n(t), type: "transaction" };
1
+ import { textResolverAbi as l, universalResolverResolveAbi as h } from "./index156.js";
2
+ import { decodeFunctionResult as p } from "./index204.js";
3
+ import { encodeFunctionData as A } from "./index213.js";
4
+ import { getChainContractAddress as R } from "./index234.js";
5
+ import { toHex as b } from "./index197.js";
6
+ import { isNullUniversalResolverError as g } from "./index294.js";
7
+ import { localBatchGatewayUrl as w } from "./index232.js";
8
+ import { namehash as x } from "./index239.js";
9
+ import { packetToBytes as y } from "./index295.js";
10
+ import { getAction as C } from "./index289.js";
11
+ import { readContract as N } from "./index132.js";
12
+ async function j(n, t) {
13
+ const { blockNumber: s, blockTag: m, key: d, name: e, gatewayUrls: u, strict: f } = t, { chain: o } = n, v = (() => {
14
+ if (t.universalResolverAddress)
15
+ return t.universalResolverAddress;
16
+ if (!o)
17
+ throw new Error("client chain not configured. universalResolverAddress is required.");
18
+ return R({
19
+ blockNumber: s,
20
+ chain: o,
21
+ contract: "ensUniversalResolver"
22
+ });
23
+ })(), a = o?.ensTlds;
24
+ if (a && !a.some((r) => e.endsWith(r)))
25
+ return null;
26
+ try {
27
+ const r = {
28
+ address: v,
29
+ abi: h,
30
+ args: [
31
+ b(y(e)),
32
+ A({
33
+ abi: l,
34
+ functionName: "text",
35
+ args: [x(e), d]
36
+ }),
37
+ u ?? [w]
38
+ ],
39
+ functionName: "resolveWithGateways",
40
+ blockNumber: s,
41
+ blockTag: m
42
+ }, i = await C(n, N, "readContract")(r);
43
+ if (i[0] === "0x")
44
+ return null;
45
+ const c = p({
46
+ abi: l,
47
+ functionName: "text",
48
+ data: i[0]
49
+ });
50
+ return c === "" ? null : c;
51
+ } catch (r) {
52
+ if (f)
53
+ throw r;
54
+ if (g(r))
55
+ return null;
56
+ throw r;
57
+ }
9
58
  }
10
59
  export {
11
- a as createPendingTransactionFilter
60
+ j as getEnsText
12
61
  };
@@ -1,32 +1,171 @@
1
- import { parseAccount as u } from "./index80.js";
2
- import { encodeFunctionData as f } from "./index206.js";
3
- import { getContractError as p } from "./index249.js";
4
- import { getAction as g } from "./index280.js";
5
- import { estimateGas as G } from "./index101.js";
6
- async function A(s, i) {
7
- const { abi: a, address: o, args: r, functionName: c, dataSuffix: e, ...t } = i, m = f({
8
- abi: a,
9
- args: r,
10
- functionName: c
11
- });
1
+ import { toRpc as W } from "./index297.js";
2
+ import { parseAccount as I } from "./index91.js";
3
+ import { multicall3Abi as O } from "./index156.js";
4
+ import { aggregate3Signature as J } from "./index298.js";
5
+ import { deploylessCallViaBytecodeBytecode as K, deploylessCallViaFactoryBytecode as Q, multicall3Bytecode as U } from "./index158.js";
6
+ import { BaseError as N } from "./index165.js";
7
+ import { ClientChainNotConfiguredError as P, ChainDoesNotSupportContract as X } from "./index169.js";
8
+ import { CounterfactualDeploymentFailedError as Y, RawContractError as Z } from "./index170.js";
9
+ import { decodeFunctionResult as tt } from "./index204.js";
10
+ import { encodeDeployData as T } from "./index209.js";
11
+ import { encodeFunctionData as at } from "./index213.js";
12
+ import { getChainContractAddress as et } from "./index234.js";
13
+ import { numberToHex as V } from "./index197.js";
14
+ import { getCallError as rt } from "./index299.js";
15
+ import { extract as ot } from "./index300.js";
16
+ import { formatTransactionRequest as ct } from "./index245.js";
17
+ import { createBatchScheduler as nt } from "./index154.js";
18
+ import { serializeStateOverride as st } from "./index301.js";
19
+ import { assertRequest as it } from "./index262.js";
20
+ import { parseAbi as z } from "./index278.js";
21
+ async function Ot(t, a) {
22
+ const { account: e = t.account, authorizationList: c, batch: n = !!t.batch?.multicall, blockNumber: s, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: p, code: b, data: r, factory: d, factoryData: i, gas: B, gasPrice: h, maxFeePerBlobGas: y, maxFeePerGas: f, maxPriorityFeePerGas: g, nonce: k, to: m, value: L, stateOverride: j, ...G } = a, R = e ? I(e) : void 0;
23
+ if (b && (d || i))
24
+ throw new N("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
25
+ if (b && m)
26
+ throw new N("Cannot provide both `code` & `to` as parameters.");
27
+ const S = b && r, A = d && i && m && r, _ = S || A, M = S ? H({
28
+ code: b,
29
+ data: r
30
+ }) : A ? dt({
31
+ data: r,
32
+ factory: d,
33
+ factoryData: i,
34
+ to: m
35
+ }) : r;
12
36
  try {
13
- return await g(s, G, "estimateGas")({
14
- data: `${m}${e ? e.replace("0x", "") : ""}`,
15
- to: o,
16
- ...t
37
+ it(a);
38
+ const w = (typeof s == "bigint" ? V(s) : void 0) || C, l = p ? W(p) : void 0, u = st(j), q = t.chain?.formatters?.transactionRequest?.format, v = (q || ct)({
39
+ // Pick out extra data that might exist on the chain's transaction request type.
40
+ ...ot(G, { format: q }),
41
+ accessList: x,
42
+ account: R,
43
+ authorizationList: c,
44
+ blobs: D,
45
+ data: M,
46
+ gas: B,
47
+ gasPrice: h,
48
+ maxFeePerBlobGas: y,
49
+ maxFeePerGas: f,
50
+ maxPriorityFeePerGas: g,
51
+ nonce: k,
52
+ to: _ ? void 0 : m,
53
+ value: L
54
+ }, "call");
55
+ if (n && lt({ request: v }) && !u && !l)
56
+ try {
57
+ return await ut(t, {
58
+ ...v,
59
+ blockNumber: s,
60
+ blockTag: C
61
+ });
62
+ } catch (o) {
63
+ if (!(o instanceof P) && !(o instanceof X))
64
+ throw o;
65
+ }
66
+ const $ = (() => {
67
+ const o = [
68
+ v,
69
+ w
70
+ ];
71
+ return u && l ? [...o, u, l] : u ? [...o, u] : l ? [...o, {}, l] : o;
72
+ })(), E = await t.request({
73
+ method: "eth_call",
74
+ params: $
17
75
  });
18
- } catch (n) {
19
- const d = t.account ? u(t.account) : void 0;
20
- throw p(n, {
21
- abi: a,
22
- address: o,
23
- args: r,
24
- docsPath: "/docs/contract/estimateContractGas",
25
- functionName: c,
26
- sender: d?.address
76
+ return E === "0x" ? { data: void 0 } : { data: E };
77
+ } catch (F) {
78
+ const w = ft(F), { offchainLookup: l, offchainLookupSignature: u } = await import("./index230.js");
79
+ if (t.ccipRead !== !1 && w?.slice(0, 10) === u && m)
80
+ return { data: await l(t, { data: w, to: m }) };
81
+ throw _ && w?.slice(0, 10) === "0x101bb98d" ? new Y({ factory: d }) : rt(F, {
82
+ ...a,
83
+ account: R,
84
+ chain: t.chain
27
85
  });
28
86
  }
29
87
  }
88
+ function lt({ request: t }) {
89
+ const { data: a, to: e, ...c } = t;
90
+ return !(!a || a.startsWith(J) || !e || Object.values(c).filter((n) => typeof n < "u").length > 0);
91
+ }
92
+ async function ut(t, a) {
93
+ const { batchSize: e = 1024, deployless: c = !1, wait: n = 0 } = typeof t.batch?.multicall == "object" ? t.batch.multicall : {}, { blockNumber: s, blockTag: C = t.experimental_blockTag ?? "latest", data: x, to: D } = a, p = (() => {
94
+ if (c)
95
+ return null;
96
+ if (a.multicallAddress)
97
+ return a.multicallAddress;
98
+ if (t.chain)
99
+ return et({
100
+ blockNumber: s,
101
+ chain: t.chain,
102
+ contract: "multicall3"
103
+ });
104
+ throw new P();
105
+ })(), r = (typeof s == "bigint" ? V(s) : void 0) || C, { schedule: d } = nt({
106
+ id: `${t.uid}.${r}`,
107
+ wait: n,
108
+ shouldSplitBatch(h) {
109
+ return h.reduce((f, { data: g }) => f + (g.length - 2), 0) > e * 2;
110
+ },
111
+ fn: async (h) => {
112
+ const y = h.map((k) => ({
113
+ allowFailure: !0,
114
+ callData: k.data,
115
+ target: k.to
116
+ })), f = at({
117
+ abi: O,
118
+ args: [y],
119
+ functionName: "aggregate3"
120
+ }), g = await t.request({
121
+ method: "eth_call",
122
+ params: [
123
+ {
124
+ ...p === null ? {
125
+ data: H({
126
+ code: U,
127
+ data: f
128
+ })
129
+ } : { to: p, data: f }
130
+ },
131
+ r
132
+ ]
133
+ });
134
+ return tt({
135
+ abi: O,
136
+ args: [y],
137
+ functionName: "aggregate3",
138
+ data: g || "0x"
139
+ });
140
+ }
141
+ }), [{ returnData: i, success: B }] = await d({ data: x, to: D });
142
+ if (!B)
143
+ throw new Z({ data: i });
144
+ return i === "0x" ? { data: void 0 } : { data: i };
145
+ }
146
+ function H(t) {
147
+ const { code: a, data: e } = t;
148
+ return T({
149
+ abi: z(["constructor(bytes, bytes)"]),
150
+ bytecode: K,
151
+ args: [a, e]
152
+ });
153
+ }
154
+ function dt(t) {
155
+ const { data: a, factory: e, factoryData: c, to: n } = t;
156
+ return T({
157
+ abi: z(["constructor(address, bytes, address, bytes)"]),
158
+ bytecode: Q,
159
+ args: [n, a, e, c]
160
+ });
161
+ }
162
+ function ft(t) {
163
+ if (!(t instanceof N))
164
+ return;
165
+ const a = t.walk();
166
+ return typeof a?.data == "object" ? a.data?.data : a.data;
167
+ }
30
168
  export {
31
- A as estimateContractGas
169
+ Ot as call,
170
+ ft as getRevertErrorData
32
171
  };
@@ -2,8 +2,6 @@ import { AllowedEvmTransactionType } from '@coinbase/cdp-core';
2
2
  import { APIError } from '@coinbase/cdp-core';
3
3
  import { APIErrorType } from '@coinbase/cdp-core';
4
4
  import { AuthenticateWithJWTResult } from '@coinbase/cdp-core';
5
- import { base } from 'viem/chains';
6
- import { baseSepolia } from 'viem/chains';
7
5
  import { Config as Config_2 } from '@coinbase/cdp-core';
8
6
  import { Context } from 'react';
9
7
  import { CreateEvmEip7702DelegationOptions } from '@coinbase/cdp-core';
@@ -120,7 +118,7 @@ export declare interface CDPHooksProviderProps {
120
118
  }
121
119
 
122
120
  export declare type Config = Config_2 & {
123
- transports?: Record<typeof base.id | typeof baseSepolia.id, Transport>;
121
+ transports?: Partial<Record<number, Transport>>;
124
122
  };
125
123
 
126
124
  export { CreateEvmEip7702DelegationOptions }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-hooks",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": ">=18.2.0",
18
- "@coinbase/cdp-core": "^0.0.95"
18
+ "@coinbase/cdp-core": "^0.0.97"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@testing-library/jest-dom": "^6.6.3",
@@ -30,7 +30,7 @@
30
30
  "@size-limit/webpack": "^11.2.0",
31
31
  "@size-limit/webpack-why": "^11.2.0",
32
32
  "size-limit": "^11.2.0",
33
- "@coinbase/cdp-core": "^0.0.95"
33
+ "@coinbase/cdp-core": "^0.0.97"
34
34
  },
35
35
  "size-limit": [
36
36
  {
@@ -38,7 +38,7 @@
38
38
  "path": "./dist/esm/index.js",
39
39
  "running": false,
40
40
  "import": "*",
41
- "limit": "65 KB"
41
+ "limit": "72 KB"
42
42
  },
43
43
  {
44
44
  "name": "config-only",