@coinbase/cdp-hooks 0.0.20 → 0.0.21

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 (270) hide show
  1. package/README.md +160 -2
  2. package/dist/esm/index.js +12 -10
  3. package/dist/esm/index10.js +32 -3
  4. package/dist/esm/index100.js +32 -191
  5. package/dist/esm/index101.js +191 -6
  6. package/dist/esm/index102.js +9 -2
  7. package/dist/esm/index103.js +2 -13
  8. package/dist/esm/index104.js +11 -17
  9. package/dist/esm/index105.js +13 -22
  10. package/dist/esm/index106.js +27 -8
  11. package/dist/esm/index107.js +8 -55
  12. package/dist/esm/index108.js +50 -40
  13. package/dist/esm/index109.js +45 -8
  14. package/dist/esm/index11.js +3 -9
  15. package/dist/esm/index110.js +8 -7
  16. package/dist/esm/index111.js +7 -16
  17. package/dist/esm/index112.js +16 -18
  18. package/dist/esm/index113.js +18 -24
  19. package/dist/esm/index114.js +24 -16
  20. package/dist/esm/index115.js +16 -54
  21. package/dist/esm/index116.js +53 -10
  22. package/dist/esm/index117.js +11 -160
  23. package/dist/esm/index118.js +160 -21
  24. package/dist/esm/index119.js +21 -127
  25. package/dist/esm/index12.js +8 -67
  26. package/dist/esm/index120.js +127 -38
  27. package/dist/esm/index121.js +38 -6
  28. package/dist/esm/index122.js +6 -27
  29. package/dist/esm/index123.js +27 -191
  30. package/dist/esm/index124.js +192 -4
  31. package/dist/esm/index125.js +4 -65
  32. package/dist/esm/index126.js +65 -3
  33. package/dist/esm/index127.js +3 -21
  34. package/dist/esm/index128.js +19 -15
  35. package/dist/esm/index129.js +16 -23
  36. package/dist/esm/index13.js +66 -7
  37. package/dist/esm/index130.js +23 -11
  38. package/dist/esm/index131.js +11 -34
  39. package/dist/esm/index132.js +35 -3
  40. package/dist/esm/index133.js +3 -19
  41. package/dist/esm/index134.js +18 -27
  42. package/dist/esm/index135.js +25 -33
  43. package/dist/esm/index136.js +35 -7
  44. package/dist/esm/index137.js +7 -25
  45. package/dist/esm/index138.js +20 -23
  46. package/dist/esm/index139.js +27 -63
  47. package/dist/esm/index14.js +8 -27
  48. package/dist/esm/index140.js +64 -9
  49. package/dist/esm/index141.js +9 -33
  50. package/dist/esm/index142.js +33 -27
  51. package/dist/esm/index143.js +26 -23
  52. package/dist/esm/index144.js +24 -3
  53. package/dist/esm/index145.js +3 -14
  54. package/dist/esm/index146.js +14 -103
  55. package/dist/esm/index147.js +99 -60
  56. package/dist/esm/index148.js +64 -5
  57. package/dist/esm/index149.js +5 -6
  58. package/dist/esm/index15.js +25 -67
  59. package/dist/esm/index150.js +6 -27
  60. package/dist/esm/index151.js +27 -39
  61. package/dist/esm/index152.js +39 -13
  62. package/dist/esm/index153.js +13 -42
  63. package/dist/esm/index154.js +42 -5
  64. package/dist/esm/index155.js +5 -11
  65. package/dist/esm/index156.js +11 -19
  66. package/dist/esm/index157.js +18 -77
  67. package/dist/esm/index158.js +79 -2
  68. package/dist/esm/index159.js +2 -38
  69. package/dist/esm/index16.js +68 -17
  70. package/dist/esm/index160.js +32 -105
  71. package/dist/esm/index161.js +105 -43
  72. package/dist/esm/index162.js +47 -31
  73. package/dist/esm/index163.js +32 -8
  74. package/dist/esm/index164.js +8 -6
  75. package/dist/esm/index165.js +6 -6
  76. package/dist/esm/index166.js +6 -11
  77. package/dist/esm/index167.js +11 -10
  78. package/dist/esm/index168.js +10 -13
  79. package/dist/esm/index169.js +12 -31
  80. package/dist/esm/index17.js +17 -108
  81. package/dist/esm/index170.js +33 -5
  82. package/dist/esm/index171.js +5 -9
  83. package/dist/esm/index172.js +8 -19
  84. package/dist/esm/index173.js +19 -31
  85. package/dist/esm/index174.js +31 -20
  86. package/dist/esm/index175.js +20 -3
  87. package/dist/esm/index176.js +3 -17
  88. package/dist/esm/index177.js +17 -10
  89. package/dist/esm/index178.js +10 -21
  90. package/dist/esm/index179.js +21 -22
  91. package/dist/esm/index18.js +110 -60
  92. package/dist/esm/index180.js +22 -5
  93. package/dist/esm/index181.js +5 -5
  94. package/dist/esm/index182.js +5 -8
  95. package/dist/esm/index183.js +8 -104
  96. package/dist/esm/index184.js +105 -3
  97. package/dist/esm/index185.js +3 -19
  98. package/dist/esm/index186.js +17 -170
  99. package/dist/esm/index187.js +170 -16
  100. package/dist/esm/index188.js +18 -10
  101. package/dist/esm/index189.js +10 -41
  102. package/dist/esm/index19.js +56 -20
  103. package/dist/esm/index190.js +41 -2
  104. package/dist/esm/index191.js +2 -5
  105. package/dist/esm/index192.js +4 -10
  106. package/dist/esm/index193.js +9 -18
  107. package/dist/esm/index194.js +19 -7
  108. package/dist/esm/index195.js +7 -11
  109. package/dist/esm/index196.js +11 -66
  110. package/dist/esm/index197.js +65 -64
  111. package/dist/esm/index198.js +60 -180
  112. package/dist/esm/index199.js +183 -20
  113. package/dist/esm/index20.js +22 -38
  114. package/dist/esm/index200.js +21 -41
  115. package/dist/esm/index201.js +20 -54
  116. package/dist/esm/index202.js +54 -18
  117. package/dist/esm/index203.js +34 -10
  118. package/dist/esm/index204.js +10 -7
  119. package/dist/esm/index205.js +13 -36
  120. package/dist/esm/index206.js +7 -15
  121. package/dist/esm/index207.js +6 -8
  122. package/dist/esm/index208.js +35 -11
  123. package/dist/esm/index209.js +15 -9
  124. package/dist/esm/index21.js +37 -34
  125. package/dist/esm/index210.js +8 -16
  126. package/dist/esm/index211.js +9 -7
  127. package/dist/esm/index212.js +15 -21
  128. package/dist/esm/index213.js +22 -30
  129. package/dist/esm/index214.js +31 -2
  130. package/dist/esm/index215.js +2 -14
  131. package/dist/esm/index216.js +13 -12
  132. package/dist/esm/index217.js +10 -45
  133. package/dist/esm/index218.js +46 -5
  134. package/dist/esm/index219.js +2 -2
  135. package/dist/esm/index22.js +34 -55
  136. package/dist/esm/index220.js +2 -2
  137. package/dist/esm/index221.js +1 -1
  138. package/dist/esm/index223.js +1 -1
  139. package/dist/esm/index224.js +2 -2
  140. package/dist/esm/index225.js +3 -3
  141. package/dist/esm/index226.js +3 -3
  142. package/dist/esm/index227.js +16 -16
  143. package/dist/esm/index229.js +2 -2
  144. package/dist/esm/index23.js +55 -160
  145. package/dist/esm/index230.js +1 -1
  146. package/dist/esm/index231.js +11 -102
  147. package/dist/esm/index232.js +103 -6
  148. package/dist/esm/index233.js +5 -223
  149. package/dist/esm/index234.js +224 -6
  150. package/dist/esm/index235.js +7 -7
  151. package/dist/esm/index236.js +7 -27
  152. package/dist/esm/index237.js +25 -18
  153. package/dist/esm/index238.js +18 -145
  154. package/dist/esm/index239.js +146 -12
  155. package/dist/esm/index24.js +156 -32
  156. package/dist/esm/index240.js +12 -35
  157. package/dist/esm/index241.js +35 -41
  158. package/dist/esm/index242.js +41 -68
  159. package/dist/esm/index243.js +68 -3
  160. package/dist/esm/index244.js +3 -136
  161. package/dist/esm/index245.js +125 -144
  162. package/dist/esm/index246.js +155 -9
  163. package/dist/esm/index247.js +9 -16
  164. package/dist/esm/index248.js +16 -113
  165. package/dist/esm/index249.js +95 -116
  166. package/dist/esm/index25.js +39 -9
  167. package/dist/esm/index250.js +126 -70
  168. package/dist/esm/index251.js +79 -2
  169. package/dist/esm/index252.js +2 -699
  170. package/dist/esm/index253.js +685 -126
  171. package/dist/esm/index254.js +138 -41
  172. package/dist/esm/index255.js +40 -199
  173. package/dist/esm/index256.js +198 -62
  174. package/dist/esm/index257.js +65 -4
  175. package/dist/esm/index258.js +4 -40
  176. package/dist/esm/index259.js +40 -7
  177. package/dist/esm/index26.js +8 -30
  178. package/dist/esm/index260.js +7 -62
  179. package/dist/esm/index261.js +57 -72
  180. package/dist/esm/index262.js +78 -4
  181. package/dist/esm/index263.js +4 -195
  182. package/dist/esm/index264.js +183 -52
  183. package/dist/esm/index265.js +59 -40
  184. package/dist/esm/index266.js +44 -4
  185. package/dist/esm/index267.js +5 -5
  186. package/dist/esm/index268.js +5 -2
  187. package/dist/esm/index269.js +2 -22
  188. package/dist/esm/index27.js +21 -26
  189. package/dist/esm/index270.js +24 -0
  190. package/dist/esm/index28.js +35 -8
  191. package/dist/esm/index29.js +8 -28
  192. package/dist/esm/index3.js +127 -65
  193. package/dist/esm/index30.js +27 -44
  194. package/dist/esm/index31.js +44 -86
  195. package/dist/esm/index32.js +83 -35
  196. package/dist/esm/index33.js +40 -8
  197. package/dist/esm/index34.js +7 -5
  198. package/dist/esm/index35.js +6 -16
  199. package/dist/esm/index36.js +16 -8
  200. package/dist/esm/index37.js +8 -13
  201. package/dist/esm/index38.js +13 -7
  202. package/dist/esm/index39.js +7 -9
  203. package/dist/esm/index4.js +33 -17
  204. package/dist/esm/index40.js +9 -16
  205. package/dist/esm/index41.js +16 -46
  206. package/dist/esm/index42.js +46 -13
  207. package/dist/esm/index43.js +13 -16
  208. package/dist/esm/index44.js +14 -11
  209. package/dist/esm/index45.js +13 -6
  210. package/dist/esm/index46.js +5 -34
  211. package/dist/esm/index47.js +34 -8
  212. package/dist/esm/index48.js +8 -7
  213. package/dist/esm/index49.js +8 -25
  214. package/dist/esm/index5.js +18 -12
  215. package/dist/esm/index50.js +25 -10
  216. package/dist/esm/index51.js +10 -14
  217. package/dist/esm/index52.js +14 -11
  218. package/dist/esm/index53.js +11 -116
  219. package/dist/esm/index54.js +114 -31
  220. package/dist/esm/index55.js +30 -76
  221. package/dist/esm/index56.js +78 -176
  222. package/dist/esm/index57.js +174 -41
  223. package/dist/esm/index58.js +44 -6
  224. package/dist/esm/index59.js +5 -12
  225. package/dist/esm/index6.js +12 -54
  226. package/dist/esm/index60.js +12 -12
  227. package/dist/esm/index61.js +13 -99
  228. package/dist/esm/index62.js +96 -69
  229. package/dist/esm/index63.js +61 -76
  230. package/dist/esm/index64.js +74 -135
  231. package/dist/esm/index65.js +108 -96
  232. package/dist/esm/index66.js +113 -45
  233. package/dist/esm/index67.js +68 -23
  234. package/dist/esm/index68.js +23 -105
  235. package/dist/esm/index69.js +105 -6
  236. package/dist/esm/index7.js +54 -58
  237. package/dist/esm/index70.js +6 -131
  238. package/dist/esm/index71.js +130 -274
  239. package/dist/esm/index72.js +276 -3
  240. package/dist/esm/index73.js +3 -4
  241. package/dist/esm/index74.js +4 -9
  242. package/dist/esm/index75.js +9 -2
  243. package/dist/esm/index76.js +2 -2
  244. package/dist/esm/index77.js +2 -3
  245. package/dist/esm/index78.js +3 -327
  246. package/dist/esm/index79.js +324 -11
  247. package/dist/esm/index8.js +58 -56
  248. package/dist/esm/index80.js +13 -4
  249. package/dist/esm/index81.js +4 -55
  250. package/dist/esm/index82.js +56 -2
  251. package/dist/esm/index83.js +2 -8
  252. package/dist/esm/index84.js +6 -213
  253. package/dist/esm/index85.js +215 -32
  254. package/dist/esm/index86.js +32 -22
  255. package/dist/esm/index87.js +21 -5
  256. package/dist/esm/index88.js +5 -73
  257. package/dist/esm/index89.js +73 -5
  258. package/dist/esm/index9.js +56 -33
  259. package/dist/esm/index90.js +4 -4
  260. package/dist/esm/index91.js +5 -35
  261. package/dist/esm/index92.js +29 -69
  262. package/dist/esm/index93.js +76 -3
  263. package/dist/esm/index94.js +3 -24
  264. package/dist/esm/index95.js +16 -444
  265. package/dist/esm/index96.js +444 -23
  266. package/dist/esm/index97.js +24 -20
  267. package/dist/esm/index98.js +18 -25
  268. package/dist/esm/index99.js +31 -32
  269. package/dist/types/index.d.ts +29 -0
  270. package/package.json +3 -3
@@ -1,61 +1,40 @@
1
- import { textResolverAbi as l, universalResolverResolveAbi as h } from "./index71.js";
2
- import { decodeFunctionResult as p } from "./index129.js";
3
- import { encodeFunctionData as A } from "./index136.js";
4
- import { getChainContractAddress as R } from "./index172.js";
5
- import { toHex as b } from "./index108.js";
6
- import { isNullUniversalResolverError as g } from "./index209.js";
7
- import { localBatchGatewayUrl as w } from "./index162.js";
8
- import { namehash as x } from "./index111.js";
9
- import { packetToBytes as C } from "./index210.js";
10
- import { getAction as y } from "./index211.js";
11
- import { readContract as N } from "./index54.js";
12
- async function j(n, e) {
13
- const { blockNumber: s, blockTag: m, key: d, name: t, gatewayUrls: u, strict: f } = e, { chain: o } = n, v = (() => {
14
- if (e.universalResolverAddress)
15
- return e.universalResolverAddress;
16
- if (!o)
1
+ import { getChainContractAddress as l } from "./index173.js";
2
+ import { toHex as u } from "./index109.js";
3
+ import { packetToBytes as v } from "./index212.js";
4
+ import { getAction as f } from "./index206.js";
5
+ import { readContract as m } from "./index55.js";
6
+ async function A(o, r) {
7
+ const { blockNumber: n, blockTag: i, name: s } = r, { chain: e } = o, a = (() => {
8
+ if (r.universalResolverAddress)
9
+ return r.universalResolverAddress;
10
+ if (!e)
17
11
  throw new Error("client chain not configured. universalResolverAddress is required.");
18
- return R({
19
- blockNumber: s,
20
- chain: o,
12
+ return l({
13
+ blockNumber: n,
14
+ chain: e,
21
15
  contract: "ensUniversalResolver"
22
16
  });
23
- })(), a = o?.ensTlds;
24
- if (a && !a.some((r) => t.endsWith(r)))
25
- return null;
26
- try {
27
- const r = {
28
- address: v,
29
- abi: h,
30
- functionName: "resolve",
31
- args: [
32
- b(C(t)),
33
- A({
34
- abi: l,
35
- functionName: "text",
36
- args: [x(t), d]
37
- }),
38
- u ?? [w]
39
- ],
40
- blockNumber: s,
41
- blockTag: m
42
- }, i = await y(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, "resolve"))
55
- return null;
56
- throw r;
57
- }
17
+ })(), t = e?.ensTlds;
18
+ if (t && !t.some((c) => s.endsWith(c)))
19
+ throw new Error(`${s} is not a valid ENS TLD (${t?.join(", ")}) for chain "${e.name}" (id: ${e.id}).`);
20
+ const [d] = await f(o, m, "readContract")({
21
+ address: a,
22
+ abi: [
23
+ {
24
+ inputs: [{ type: "bytes" }],
25
+ name: "findResolver",
26
+ outputs: [{ type: "address" }, { type: "bytes32" }],
27
+ stateMutability: "view",
28
+ type: "function"
29
+ }
30
+ ],
31
+ functionName: "findResolver",
32
+ args: [u(v(s))],
33
+ blockNumber: n,
34
+ blockTag: i
35
+ });
36
+ return d;
58
37
  }
59
38
  export {
60
- j as getEnsText
39
+ A as getEnsResolver
61
40
  };
@@ -1,5 +1,5 @@
1
- import { EstimateGasExecutionError as i } from "./index99.js";
2
- import { UnknownNodeError as m } from "./index100.js";
1
+ import { EstimateGasExecutionError as i } from "./index100.js";
2
+ import { UnknownNodeError as m } from "./index101.js";
3
3
  import { getNodeError as s } from "./index224.js";
4
4
  function a(r, { docsPath: e, ...o }) {
5
5
  const n = (() => {
@@ -1,4 +1,4 @@
1
- import { BaseError as t } from "./index81.js";
1
+ import { BaseError as t } from "./index82.js";
2
2
  class r extends t {
3
3
  constructor({ address: o }) {
4
4
  super(`No EIP-712 domain found on contract "${o}".`, {
@@ -1,4 +1,4 @@
1
- import { hexToNumber as a } from "./index141.js";
1
+ import { hexToNumber as a } from "./index142.js";
2
2
  function t(e) {
3
3
  return e.map((n) => ({
4
4
  ...n,
@@ -1,5 +1,5 @@
1
- import { BaseError as a } from "./index81.js";
2
- import { ExecutionRevertedError as s, FeeCapTooHighError as r, FeeCapTooLowError as i, NonceTooHighError as c, NonceTooLowError as u, NonceMaxValueError as d, InsufficientFundsError as f, IntrinsicGasTooHighError as w, IntrinsicGasTooLowError as E, TransactionTypeNotSupportedError as m, TipAboveFeeCapError as g, UnknownNodeError as F } from "./index100.js";
1
+ import { BaseError as a } from "./index82.js";
2
+ import { ExecutionRevertedError as s, FeeCapTooHighError as r, FeeCapTooLowError as i, NonceTooHighError as c, NonceTooLowError as u, NonceMaxValueError as d, InsufficientFundsError as f, IntrinsicGasTooHighError as w, IntrinsicGasTooLowError as E, TransactionTypeNotSupportedError as m, TipAboveFeeCapError as g, UnknownNodeError as F } from "./index101.js";
3
3
  function G(e, n) {
4
4
  const o = (e.details || "").toLowerCase(), t = e instanceof a ? e.walk((x) => x?.code === s.code) : e;
5
5
  return t instanceof a ? new s({
@@ -1,6 +1,6 @@
1
- import { from as t } from "./index248.js";
2
- import { encode as m } from "./index249.js";
3
- import { concat as c } from "./index245.js";
1
+ import { from as t } from "./index249.js";
2
+ import { encode as m } from "./index250.js";
3
+ import { concat as c } from "./index246.js";
4
4
  function s(o, e) {
5
5
  const { bytecode: r, args: n } = e;
6
6
  return c(r, o.inputs?.length && n?.length ? m(o.inputs, n) : "0x");
@@ -1,6 +1,6 @@
1
- import { from as c, fromAbi as m, NotFoundError as i, getSelector as s } from "./index248.js";
2
- import { encode as u } from "./index249.js";
3
- import { concat as d } from "./index245.js";
1
+ import { from as c, fromAbi as m, NotFoundError as i, getSelector as s } from "./index249.js";
2
+ import { encode as u } from "./index250.js";
3
+ import { concat as d } from "./index246.js";
4
4
  function S(o, ...t) {
5
5
  const { overloads: r } = o, e = r ? p([o, ...r], o.name, {
6
6
  args: t[0]
@@ -1,19 +1,19 @@
1
- import { universalSignatureValidatorAbi as d } from "./index71.js";
2
- import { universalSignatureValidatorByteCode as l } from "./index73.js";
3
- import { CallExecutionError as g } from "./index84.js";
4
- import { encodeDeployData as y } from "./index133.js";
5
- import { getAddress as S } from "./index118.js";
6
- import { isAddressEqual as h } from "./index140.js";
7
- import { isHex as v } from "./index144.js";
8
- import { bytesToHex as x } from "./index108.js";
9
- import { getAction as b } from "./index211.js";
10
- import { isErc6492Signature as A } from "./index154.js";
11
- import { recoverAddress as w } from "./index148.js";
12
- import { serializeErc6492Signature as E } from "./index155.js";
13
- import { serializeSignature as V } from "./index152.js";
14
- import { call as D } from "./index23.js";
15
- import { encodeFunctionData as H } from "./index136.js";
16
- import { hexToBool as z } from "./index141.js";
1
+ import { universalSignatureValidatorAbi as d } from "./index72.js";
2
+ import { universalSignatureValidatorByteCode as l } from "./index74.js";
3
+ import { CallExecutionError as g } from "./index85.js";
4
+ import { encodeDeployData as y } from "./index134.js";
5
+ import { getAddress as S } from "./index119.js";
6
+ import { isAddressEqual as h } from "./index141.js";
7
+ import { isHex as v } from "./index145.js";
8
+ import { bytesToHex as x } from "./index109.js";
9
+ import { getAction as b } from "./index206.js";
10
+ import { isErc6492Signature as A } from "./index155.js";
11
+ import { recoverAddress as w } from "./index149.js";
12
+ import { serializeErc6492Signature as E } from "./index156.js";
13
+ import { serializeSignature as V } from "./index153.js";
14
+ import { call as D } from "./index24.js";
15
+ import { encodeFunctionData as H } from "./index137.js";
16
+ import { hexToBool as z } from "./index142.js";
17
17
  async function Q(o, p) {
18
18
  const { address: i, factory: n, factoryData: s, hash: a, signature: r, universalSignatureVerifierAddress: f = o.chain?.contracts?.universalSignatureVerifier?.address, ...m } = p, t = v(r) ? r : typeof r == "object" && "r" in r && "s" in r ? V(r) : x(r), c = await (async () => !n && !s || A(t) ? t : E({
19
19
  address: n,
@@ -1,5 +1,5 @@
1
- import { isAddress as f } from "./index130.js";
2
- import { isAddressEqual as o } from "./index140.js";
1
+ import { isAddress as f } from "./index131.js";
2
+ import { isAddressEqual as o } from "./index141.js";
3
3
  function l(n) {
4
4
  const { address: r, domain: s, message: e, nonce: t, scheme: a, time: i = /* @__PURE__ */ new Date() } = n;
5
5
  if (s && e.domain !== s || t && e.nonce !== t || a && e.scheme !== a || e.expirationTime && i >= e.expirationTime || e.notBefore && i < e.notBefore)
@@ -1,166 +1,61 @@
1
- import { toRpc as $ } from "./index213.js";
2
- import { parseAccount as W } from "./index10.js";
3
- import { multicall3Abi as O } from "./index71.js";
4
- import { aggregate3Signature as I } from "./index214.js";
5
- import { deploylessCallViaBytecodeBytecode as J, deploylessCallViaFactoryBytecode as K } from "./index73.js";
6
- import { BaseError as N } from "./index81.js";
7
- import { ClientChainNotConfiguredError as P, ChainDoesNotSupportContract as Q } from "./index96.js";
8
- import { CounterfactualDeploymentFailedError as U, RawContractError as X } from "./index84.js";
9
- import { decodeFunctionResult as Y } from "./index129.js";
10
- import { encodeDeployData as T } from "./index133.js";
11
- import { encodeFunctionData as Z } from "./index136.js";
12
- import { getChainContractAddress as tt } from "./index172.js";
13
- import { numberToHex as V } from "./index108.js";
14
- import { getCallError as at } from "./index215.js";
15
- import { extract as et } from "./index216.js";
16
- import { formatTransactionRequest as rt } from "./index143.js";
17
- import { createBatchScheduler as ot } from "./index14.js";
18
- import { serializeStateOverride as ct } from "./index217.js";
19
- import { assertRequest as nt } from "./index156.js";
20
- import { parseAbi as z } from "./index195.js";
21
- async function Et(t, a) {
22
- const { account: e = t.account, authorizationList: n, batch: r = !!t.batch?.multicall, blockNumber: m, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: d, code: p, data: o, factory: u, factoryData: s, gas: B, gasPrice: b, maxFeePerBlobGas: h, maxFeePerGas: y, maxPriorityFeePerGas: g, nonce: k, to: f, value: H, stateOverride: L, ...j } = a, R = e ? W(e) : void 0;
23
- if (p && (u || s))
24
- throw new N("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
25
- if (p && f)
26
- throw new N("Cannot provide both `code` & `to` as parameters.");
27
- const S = p && o, _ = u && s && f && o, A = S || _, G = S ? lt({
28
- code: p,
29
- data: o
30
- }) : _ ? dt({
31
- data: o,
32
- factory: u,
33
- factoryData: s,
34
- to: f
35
- }) : o;
36
- try {
37
- nt(a);
38
- const w = (typeof m == "bigint" ? V(m) : void 0) || C, i = d ? $(d) : void 0, l = ct(L), q = t.chain?.formatters?.transactionRequest?.format, v = (q || rt)({
39
- // Pick out extra data that might exist on the chain's transaction request type.
40
- ...et(j, { format: q }),
41
- from: R?.address,
42
- accessList: x,
43
- authorizationList: n,
44
- blobs: D,
45
- data: G,
46
- gas: B,
47
- gasPrice: b,
48
- maxFeePerBlobGas: h,
49
- maxFeePerGas: y,
50
- maxPriorityFeePerGas: g,
51
- nonce: k,
52
- to: A ? void 0 : f,
53
- value: H
54
- });
55
- if (r && st({ request: v }) && !l && !i)
56
- try {
57
- return await it(t, {
58
- ...v,
59
- blockNumber: m,
60
- blockTag: C
61
- });
62
- } catch (c) {
63
- if (!(c instanceof P) && !(c instanceof Q))
64
- throw c;
65
- }
66
- const M = (() => {
67
- const c = [
68
- v,
69
- w
70
- ];
71
- return l && i ? [...c, l, i] : l ? [...c, l] : i ? [...c, {}, i] : c;
72
- })(), E = await t.request({
73
- method: "eth_call",
74
- params: M
75
- });
76
- return E === "0x" ? { data: void 0 } : { data: E };
77
- } catch (F) {
78
- const w = ut(F), { offchainLookup: i, offchainLookupSignature: l } = await import("./index160.js");
79
- if (t.ccipRead !== !1 && w?.slice(0, 10) === l && f)
80
- return { data: await i(t, { data: w, to: f }) };
81
- throw A && w?.slice(0, 10) === "0x101bb98d" ? new U({ factory: u }) : at(F, {
82
- ...a,
83
- account: R,
84
- chain: t.chain
1
+ import { textResolverAbi as l, universalResolverResolveAbi as h } from "./index72.js";
2
+ import { decodeFunctionResult as p } from "./index130.js";
3
+ import { encodeFunctionData as A } from "./index137.js";
4
+ import { getChainContractAddress as R } from "./index173.js";
5
+ import { toHex as b } from "./index109.js";
6
+ import { isNullUniversalResolverError as g } from "./index211.js";
7
+ import { localBatchGatewayUrl as w } from "./index163.js";
8
+ import { namehash as x } from "./index112.js";
9
+ import { packetToBytes as C } from "./index212.js";
10
+ import { getAction as y } from "./index206.js";
11
+ import { readContract as N } from "./index55.js";
12
+ async function j(n, e) {
13
+ const { blockNumber: s, blockTag: m, key: d, name: t, gatewayUrls: u, strict: f } = e, { chain: o } = n, v = (() => {
14
+ if (e.universalResolverAddress)
15
+ return e.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"
85
22
  });
86
- }
87
- }
88
- function st({ request: t }) {
89
- const { data: a, to: e, ...n } = t;
90
- return !(!a || a.startsWith(I) || !e || Object.values(n).filter((r) => typeof r < "u").length > 0);
91
- }
92
- async function it(t, a) {
93
- const { batchSize: e = 1024, wait: n = 0 } = typeof t.batch?.multicall == "object" ? t.batch.multicall : {}, { blockNumber: r, blockTag: m = t.experimental_blockTag ?? "latest", data: C, multicallAddress: x, to: D } = a;
94
- let d = x;
95
- if (!d) {
96
- if (!t.chain)
97
- throw new P();
98
- d = tt({
99
- blockNumber: r,
100
- chain: t.chain,
101
- contract: "multicall3"
23
+ })(), a = o?.ensTlds;
24
+ if (a && !a.some((r) => t.endsWith(r)))
25
+ return null;
26
+ try {
27
+ const r = {
28
+ address: v,
29
+ abi: h,
30
+ functionName: "resolve",
31
+ args: [
32
+ b(C(t)),
33
+ A({
34
+ abi: l,
35
+ functionName: "text",
36
+ args: [x(t), d]
37
+ }),
38
+ u ?? [w]
39
+ ],
40
+ blockNumber: s,
41
+ blockTag: m
42
+ }, i = await y(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]
102
49
  });
50
+ return c === "" ? null : c;
51
+ } catch (r) {
52
+ if (f)
53
+ throw r;
54
+ if (g(r, "resolve"))
55
+ return null;
56
+ throw r;
103
57
  }
104
- const o = (typeof r == "bigint" ? V(r) : void 0) || m, { schedule: u } = ot({
105
- id: `${t.uid}.${o}`,
106
- wait: n,
107
- shouldSplitBatch(b) {
108
- return b.reduce((y, { data: g }) => y + (g.length - 2), 0) > e * 2;
109
- },
110
- fn: async (b) => {
111
- const h = b.map((k) => ({
112
- allowFailure: !0,
113
- callData: k.data,
114
- target: k.to
115
- })), y = Z({
116
- abi: O,
117
- args: [h],
118
- functionName: "aggregate3"
119
- }), g = await t.request({
120
- method: "eth_call",
121
- params: [
122
- {
123
- data: y,
124
- to: d
125
- },
126
- o
127
- ]
128
- });
129
- return Y({
130
- abi: O,
131
- args: [h],
132
- functionName: "aggregate3",
133
- data: g || "0x"
134
- });
135
- }
136
- }), [{ returnData: s, success: B }] = await u({ data: C, to: D });
137
- if (!B)
138
- throw new X({ data: s });
139
- return s === "0x" ? { data: void 0 } : { data: s };
140
- }
141
- function lt(t) {
142
- const { code: a, data: e } = t;
143
- return T({
144
- abi: z(["constructor(bytes, bytes)"]),
145
- bytecode: J,
146
- args: [a, e]
147
- });
148
- }
149
- function dt(t) {
150
- const { data: a, factory: e, factoryData: n, to: r } = t;
151
- return T({
152
- abi: z(["constructor(address, bytes, address, bytes)"]),
153
- bytecode: K,
154
- args: [r, a, e, n]
155
- });
156
- }
157
- function ut(t) {
158
- if (!(t instanceof N))
159
- return;
160
- const a = t.walk();
161
- return typeof a?.data == "object" ? a.data?.data : a.data;
162
58
  }
163
59
  export {
164
- Et as call,
165
- ut as getRevertErrorData
60
+ j as getEnsText
166
61
  };
@@ -1,4 +1,4 @@
1
- import { LruMap as u } from "./index178.js";
1
+ import { LruMap as u } from "./index179.js";
2
2
  const t = /* @__PURE__ */ new u(8192);
3
3
  function s(r, { enabled: o = !0, id: e }) {
4
4
  if (!o || !e)
@@ -1,106 +1,15 @@
1
- import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index250.js";
2
- import { createHasher as u, clean as C, rotr as i } from "./index238.js";
3
- const B = /* @__PURE__ */ Uint32Array.from([
4
- 1116352408,
5
- 1899447441,
6
- 3049323471,
7
- 3921009573,
8
- 961987163,
9
- 1508970993,
10
- 2453635748,
11
- 2870763221,
12
- 3624381080,
13
- 310598401,
14
- 607225278,
15
- 1426881987,
16
- 1925078388,
17
- 2162078206,
18
- 2614888103,
19
- 3248222580,
20
- 3835390401,
21
- 4022224774,
22
- 264347078,
23
- 604807628,
24
- 770255983,
25
- 1249150122,
26
- 1555081692,
27
- 1996064986,
28
- 2554220882,
29
- 2821834349,
30
- 2952996808,
31
- 3210313671,
32
- 3336571891,
33
- 3584528711,
34
- 113926993,
35
- 338241895,
36
- 666307205,
37
- 773529912,
38
- 1294757372,
39
- 1396182291,
40
- 1695183700,
41
- 1986661051,
42
- 2177026350,
43
- 2456956037,
44
- 2730485921,
45
- 2820302411,
46
- 3259730800,
47
- 3345764771,
48
- 3516065817,
49
- 3600352804,
50
- 4094571909,
51
- 275423344,
52
- 430227734,
53
- 506948616,
54
- 659060556,
55
- 883997877,
56
- 958139571,
57
- 1322822218,
58
- 1537002063,
59
- 1747873779,
60
- 1955562222,
61
- 2024104815,
62
- 2227730452,
63
- 2361852424,
64
- 2428436474,
65
- 2756734187,
66
- 3204031479,
67
- 3329325298
68
- ]), h = /* @__PURE__ */ new Uint32Array(64);
69
- class E extends D {
70
- constructor(o = 32) {
71
- super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
72
- }
73
- get() {
74
- const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
- return [o, r, t, s, a, f, c, e];
76
- }
77
- // prettier-ignore
78
- set(o, r, t, s, a, f, c, e) {
79
- this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
- }
81
- process(o, r) {
82
- for (let x = 0; x < 16; x++, r += 4)
83
- h[x] = o.getUint32(r, !1);
84
- for (let x = 16; x < 64; x++) {
85
- const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
- h[x] = l + h[x - 7] + m + h[x - 16] | 0;
1
+ function r() {
2
+ return {
3
+ current: 0,
4
+ take() {
5
+ return this.current++;
6
+ },
7
+ reset() {
8
+ this.current = 0;
87
9
  }
88
- let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
- for (let x = 0; x < 64; x++) {
90
- const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
- A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
- }
93
- t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
- }
95
- roundClean() {
96
- C(h);
97
- }
98
- destroy() {
99
- this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
100
- }
10
+ };
101
11
  }
102
- const y = /* @__PURE__ */ u(() => new E());
12
+ const t = /* @__PURE__ */ r();
103
13
  export {
104
- E as SHA256,
105
- y as sha256
14
+ t as idCache
106
15
  };
@@ -1,9 +1,106 @@
1
- import { weierstrass as s } from "./index252.js";
2
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
- function c(e, t) {
4
- const r = (o) => s({ ...e, hash: o });
5
- return { ...r(t), create: r };
1
+ import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index251.js";
2
+ import { createHasher as u, clean as C, rotr as i } from "./index239.js";
3
+ const B = /* @__PURE__ */ Uint32Array.from([
4
+ 1116352408,
5
+ 1899447441,
6
+ 3049323471,
7
+ 3921009573,
8
+ 961987163,
9
+ 1508970993,
10
+ 2453635748,
11
+ 2870763221,
12
+ 3624381080,
13
+ 310598401,
14
+ 607225278,
15
+ 1426881987,
16
+ 1925078388,
17
+ 2162078206,
18
+ 2614888103,
19
+ 3248222580,
20
+ 3835390401,
21
+ 4022224774,
22
+ 264347078,
23
+ 604807628,
24
+ 770255983,
25
+ 1249150122,
26
+ 1555081692,
27
+ 1996064986,
28
+ 2554220882,
29
+ 2821834349,
30
+ 2952996808,
31
+ 3210313671,
32
+ 3336571891,
33
+ 3584528711,
34
+ 113926993,
35
+ 338241895,
36
+ 666307205,
37
+ 773529912,
38
+ 1294757372,
39
+ 1396182291,
40
+ 1695183700,
41
+ 1986661051,
42
+ 2177026350,
43
+ 2456956037,
44
+ 2730485921,
45
+ 2820302411,
46
+ 3259730800,
47
+ 3345764771,
48
+ 3516065817,
49
+ 3600352804,
50
+ 4094571909,
51
+ 275423344,
52
+ 430227734,
53
+ 506948616,
54
+ 659060556,
55
+ 883997877,
56
+ 958139571,
57
+ 1322822218,
58
+ 1537002063,
59
+ 1747873779,
60
+ 1955562222,
61
+ 2024104815,
62
+ 2227730452,
63
+ 2361852424,
64
+ 2428436474,
65
+ 2756734187,
66
+ 3204031479,
67
+ 3329325298
68
+ ]), h = /* @__PURE__ */ new Uint32Array(64);
69
+ class E extends D {
70
+ constructor(o = 32) {
71
+ super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
72
+ }
73
+ get() {
74
+ const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
+ return [o, r, t, s, a, f, c, e];
76
+ }
77
+ // prettier-ignore
78
+ set(o, r, t, s, a, f, c, e) {
79
+ this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
+ }
81
+ process(o, r) {
82
+ for (let x = 0; x < 16; x++, r += 4)
83
+ h[x] = o.getUint32(r, !1);
84
+ for (let x = 16; x < 64; x++) {
85
+ const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
+ h[x] = l + h[x - 7] + m + h[x - 16] | 0;
87
+ }
88
+ let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
+ for (let x = 0; x < 64; x++) {
90
+ const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
+ A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
+ }
93
+ t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
+ }
95
+ roundClean() {
96
+ C(h);
97
+ }
98
+ destroy() {
99
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
100
+ }
6
101
  }
102
+ const y = /* @__PURE__ */ u(() => new E());
7
103
  export {
8
- c as createCurve
104
+ E as SHA256,
105
+ y as sha256
9
106
  };