@coinbase/cdp-hooks 0.0.96 → 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 (282) hide show
  1. package/dist/esm/index100.js +35 -25
  2. package/dist/esm/index101.js +9 -46
  3. package/dist/esm/index102.js +31 -69
  4. package/dist/esm/index103.js +36 -40
  5. package/dist/esm/index104.js +9 -75
  6. package/dist/esm/index105.js +25 -27
  7. package/dist/esm/index106.js +46 -6
  8. package/dist/esm/index107.js +69 -16
  9. package/dist/esm/index108.js +40 -8
  10. package/dist/esm/index109.js +75 -13
  11. package/dist/esm/index110.js +31 -7
  12. package/dist/esm/index111.js +6 -9
  13. package/dist/esm/index112.js +16 -16
  14. package/dist/esm/index113.js +8 -12
  15. package/dist/esm/index114.js +13 -46
  16. package/dist/esm/index115.js +7 -13
  17. package/dist/esm/index116.js +9 -16
  18. package/dist/esm/index117.js +16 -13
  19. package/dist/esm/index118.js +11 -5
  20. package/dist/esm/index119.js +46 -35
  21. package/dist/esm/index120.js +13 -9
  22. package/dist/esm/index121.js +15 -7
  23. package/dist/esm/index122.js +13 -28
  24. package/dist/esm/index123.js +6 -10
  25. package/dist/esm/index124.js +32 -11
  26. package/dist/esm/index125.js +9 -11
  27. package/dist/esm/index126.js +8 -120
  28. package/dist/esm/index127.js +27 -32
  29. package/dist/esm/index128.js +10 -80
  30. package/dist/esm/index129.js +13 -176
  31. package/dist/esm/index130.js +11 -44
  32. package/dist/esm/index131.js +120 -6
  33. package/dist/esm/index132.js +30 -151
  34. package/dist/esm/index133.js +80 -14
  35. package/dist/esm/index134.js +177 -14
  36. package/dist/esm/index135.js +42 -97
  37. package/dist/esm/index136.js +6 -72
  38. package/dist/esm/index137.js +153 -86
  39. package/dist/esm/index138.js +14 -148
  40. package/dist/esm/index139.js +14 -136
  41. package/dist/esm/index140.js +94 -63
  42. package/dist/esm/index141.js +72 -23
  43. package/dist/esm/index142.js +83 -154
  44. package/dist/esm/index143.js +148 -6
  45. package/dist/esm/index144.js +136 -11
  46. package/dist/esm/index145.js +68 -19
  47. package/dist/esm/index146.js +23 -135
  48. package/dist/esm/index147.js +155 -75
  49. package/dist/esm/index148.js +6 -9
  50. package/dist/esm/index149.js +11 -28
  51. package/dist/esm/index150.js +17 -87
  52. package/dist/esm/index151.js +135 -350
  53. package/dist/esm/index152.js +79 -3
  54. package/dist/esm/index153.js +10 -5
  55. package/dist/esm/index154.js +29 -2
  56. package/dist/esm/index155.js +90 -3
  57. package/dist/esm/index156.js +351 -9
  58. package/dist/esm/index157.js +3 -327
  59. package/dist/esm/index158.js +5 -14
  60. package/dist/esm/index159.js +2 -5
  61. package/dist/esm/index160.js +3 -56
  62. package/dist/esm/index161.js +9 -13
  63. package/dist/esm/index162.js +327 -2
  64. package/dist/esm/index163.js +13 -7
  65. package/dist/esm/index164.js +4 -30
  66. package/dist/esm/index165.js +29 -188
  67. package/dist/esm/index166.js +13 -32
  68. package/dist/esm/index167.js +2 -22
  69. package/dist/esm/index168.js +7 -5
  70. package/dist/esm/index169.js +25 -68
  71. package/dist/esm/index170.js +214 -5
  72. package/dist/esm/index171.js +32 -6
  73. package/dist/esm/index172.js +20 -34
  74. package/dist/esm/index173.js +5 -119
  75. package/dist/esm/index174.js +74 -3
  76. package/dist/esm/index175.js +5 -18
  77. package/dist/esm/index176.js +5 -26
  78. package/dist/esm/index177.js +28 -26
  79. package/dist/esm/index178.js +105 -20
  80. package/dist/esm/index179.js +3 -24
  81. package/dist/esm/index180.js +17 -7
  82. package/dist/esm/index181.js +18 -185
  83. package/dist/esm/index182.js +34 -2
  84. package/dist/esm/index183.js +28 -461
  85. package/dist/esm/index184.js +16 -20
  86. package/dist/esm/index185.js +6 -158
  87. package/dist/esm/index186.js +193 -21
  88. package/dist/esm/index187.js +2 -128
  89. package/dist/esm/index188.js +467 -38
  90. package/dist/esm/index189.js +27 -6
  91. package/dist/esm/index190.js +160 -27
  92. package/dist/esm/index191.js +20 -54
  93. package/dist/esm/index192.js +126 -44
  94. package/dist/esm/index193.js +31 -184
  95. package/dist/esm/index194.js +7 -4
  96. package/dist/esm/index195.js +26 -72
  97. package/dist/esm/index196.js +52 -17
  98. package/dist/esm/index197.js +46 -3
  99. package/dist/esm/index198.js +188 -13
  100. package/dist/esm/index199.js +4 -24
  101. package/dist/esm/index200.js +73 -11
  102. package/dist/esm/index201.js +18 -16
  103. package/dist/esm/index202.js +3 -35
  104. package/dist/esm/index203.js +17 -3
  105. package/dist/esm/index204.js +23 -18
  106. package/dist/esm/index205.js +11 -27
  107. package/dist/esm/index206.js +17 -34
  108. package/dist/esm/index207.js +34 -8
  109. package/dist/esm/index208.js +3 -8
  110. package/dist/esm/index209.js +18 -25
  111. package/dist/esm/index210.js +26 -27
  112. package/dist/esm/index211.js +35 -3
  113. package/dist/esm/index212.js +8 -79
  114. package/dist/esm/index213.js +7 -9
  115. package/dist/esm/index214.js +23 -10
  116. package/dist/esm/index215.js +27 -20
  117. package/dist/esm/index216.js +3 -8
  118. package/dist/esm/index217.js +78 -9
  119. package/dist/esm/index218.js +9 -11
  120. package/dist/esm/index219.js +12 -6
  121. package/dist/esm/index220.js +21 -6
  122. package/dist/esm/index221.js +8 -13
  123. package/dist/esm/index222.js +9 -31
  124. package/dist/esm/index223.js +12 -5
  125. package/dist/esm/index224.js +6 -37
  126. package/dist/esm/index225.js +6 -110
  127. package/dist/esm/index226.js +12 -47
  128. package/dist/esm/index227.js +31 -31
  129. package/dist/esm/index228.js +5 -18
  130. package/dist/esm/index229.js +35 -17
  131. package/dist/esm/index230.js +108 -40
  132. package/dist/esm/index231.js +46 -40
  133. package/dist/esm/index232.js +32 -8
  134. package/dist/esm/index233.js +17 -7
  135. package/dist/esm/index234.js +19 -16
  136. package/dist/esm/index235.js +42 -22
  137. package/dist/esm/index236.js +40 -22
  138. package/dist/esm/index237.js +8 -16
  139. package/dist/esm/index238.js +7 -54
  140. package/dist/esm/index239.js +16 -27
  141. package/dist/esm/index240.js +22 -24
  142. package/dist/esm/index241.js +24 -104
  143. package/dist/esm/index242.js +17 -3
  144. package/dist/esm/index243.js +54 -5
  145. package/dist/esm/index244.js +26 -30
  146. package/dist/esm/index245.js +24 -20
  147. package/dist/esm/index246.js +104 -3
  148. package/dist/esm/index247.js +3 -18
  149. package/dist/esm/index248.js +5 -5
  150. package/dist/esm/index249.js +31 -8
  151. package/dist/esm/index250.js +19 -102
  152. package/dist/esm/index251.js +3 -64
  153. package/dist/esm/index252.js +17 -5
  154. package/dist/esm/index253.js +5 -6
  155. package/dist/esm/index254.js +8 -27
  156. package/dist/esm/index255.js +103 -33
  157. package/dist/esm/index256.js +64 -13
  158. package/dist/esm/index257.js +5 -16
  159. package/dist/esm/index258.js +6 -78
  160. package/dist/esm/index259.js +28 -2
  161. package/dist/esm/index260.js +33 -14
  162. package/dist/esm/index261.js +13 -18
  163. package/dist/esm/index262.js +16 -171
  164. package/dist/esm/index263.js +77 -16
  165. package/dist/esm/index264.js +2 -11
  166. package/dist/esm/index265.js +15 -10
  167. package/dist/esm/index266.js +18 -38
  168. package/dist/esm/index267.js +172 -2
  169. package/dist/esm/index268.js +17 -69
  170. package/dist/esm/index269.js +10 -34
  171. package/dist/esm/index270.js +10 -15
  172. package/dist/esm/index271.js +2 -41
  173. package/dist/esm/index272.js +41 -2
  174. package/dist/esm/index273.js +2 -5
  175. package/dist/esm/index274.js +4 -10
  176. package/dist/esm/index275.js +9 -18
  177. package/dist/esm/index276.js +19 -7
  178. package/dist/esm/index277.js +7 -11
  179. package/dist/esm/index278.js +11 -72
  180. package/dist/esm/index279.js +71 -64
  181. package/dist/esm/index280.js +60 -182
  182. package/dist/esm/index281.js +185 -20
  183. package/dist/esm/index282.js +21 -41
  184. package/dist/esm/index283.js +41 -24
  185. package/dist/esm/index284.js +24 -89
  186. package/dist/esm/index285.js +68 -18
  187. package/dist/esm/index286.js +34 -10
  188. package/dist/esm/index287.js +10 -7
  189. package/dist/esm/index288.js +13 -7
  190. package/dist/esm/index289.js +7 -6
  191. package/dist/esm/index290.js +6 -36
  192. package/dist/esm/index291.js +35 -14
  193. package/dist/esm/index292.js +15 -8
  194. package/dist/esm/index293.js +8 -8
  195. package/dist/esm/index294.js +8 -16
  196. package/dist/esm/index295.js +15 -21
  197. package/dist/esm/index296.js +22 -30
  198. package/dist/esm/index297.js +31 -2
  199. package/dist/esm/index298.js +2 -14
  200. package/dist/esm/index299.js +13 -12
  201. package/dist/esm/index3.js +1 -1
  202. package/dist/esm/index300.js +10 -45
  203. package/dist/esm/index301.js +47 -9
  204. package/dist/esm/index302.js +8 -12
  205. package/dist/esm/index303.js +10 -10
  206. package/dist/esm/index304.js +13 -14
  207. package/dist/esm/index305.js +14 -8
  208. package/dist/esm/index306.js +6 -13
  209. package/dist/esm/index307.js +15 -24
  210. package/dist/esm/index308.js +24 -24
  211. package/dist/esm/index309.js +20 -27
  212. package/dist/esm/index310.js +31 -9
  213. package/dist/esm/index311.js +9 -51
  214. package/dist/esm/index312.js +38 -24
  215. package/dist/esm/index313.js +37 -17
  216. package/dist/esm/index314.js +17 -14
  217. package/dist/esm/index315.js +14 -11
  218. package/dist/esm/index316.js +11 -12
  219. package/dist/esm/index317.js +12 -19
  220. package/dist/esm/index318.js +18 -106
  221. package/dist/esm/index319.js +105 -101
  222. package/dist/esm/index320.js +103 -6
  223. package/dist/esm/index321.js +7 -7
  224. package/dist/esm/index322.js +7 -27
  225. package/dist/esm/index323.js +26 -15
  226. package/dist/esm/index324.js +13 -211
  227. package/dist/esm/index325.js +213 -12
  228. package/dist/esm/index326.js +12 -35
  229. package/dist/esm/index327.js +35 -41
  230. package/dist/esm/index328.js +42 -2
  231. package/dist/esm/index329.js +3 -68
  232. package/dist/esm/index330.js +68 -3
  233. package/dist/esm/index331.js +3 -136
  234. package/dist/esm/index332.js +125 -163
  235. package/dist/esm/index333.js +174 -9
  236. package/dist/esm/index334.js +9 -16
  237. package/dist/esm/index335.js +16 -133
  238. package/dist/esm/index336.js +112 -172
  239. package/dist/esm/index337.js +194 -2
  240. package/dist/esm/index338.js +2 -79
  241. package/dist/esm/index339.js +77 -13
  242. package/dist/esm/index340.js +13 -89
  243. package/dist/esm/index341.js +70 -143
  244. package/dist/esm/index342.js +157 -36
  245. package/dist/esm/index343.js +41 -654
  246. package/dist/esm/index344.js +646 -196
  247. package/dist/esm/index345.js +201 -172
  248. package/dist/esm/index346.js +176 -3
  249. package/dist/esm/index347.js +1 -1
  250. package/dist/esm/index349.js +2 -2
  251. package/dist/esm/index350.js +1 -1
  252. package/dist/esm/index351.js +1 -1
  253. package/dist/esm/index352.js +2 -2
  254. package/dist/esm/index353.js +3 -3
  255. package/dist/esm/index354.js +1 -1
  256. package/dist/esm/index73.js +2 -2
  257. package/dist/esm/index74.js +1 -1
  258. package/dist/esm/index75.js +2 -2
  259. package/dist/esm/index76.js +1 -1
  260. package/dist/esm/index77.js +1 -1
  261. package/dist/esm/index78.js +1 -1
  262. package/dist/esm/index79.js +1 -1
  263. package/dist/esm/index80.js +2 -2
  264. package/dist/esm/index81.js +2 -2
  265. package/dist/esm/index82.js +5 -5
  266. package/dist/esm/index83.js +2 -2
  267. package/dist/esm/index85.js +37 -33
  268. package/dist/esm/index86.js +2 -4
  269. package/dist/esm/index87.js +69 -9
  270. package/dist/esm/index88.js +33 -117
  271. package/dist/esm/index89.js +13 -60
  272. package/dist/esm/index90.js +33 -23
  273. package/dist/esm/index91.js +3 -36
  274. package/dist/esm/index92.js +9 -41
  275. package/dist/esm/index93.js +118 -58
  276. package/dist/esm/index94.js +58 -165
  277. package/dist/esm/index95.js +21 -36
  278. package/dist/esm/index96.js +36 -9
  279. package/dist/esm/index97.js +38 -28
  280. package/dist/esm/index98.js +58 -36
  281. package/dist/esm/index99.js +167 -8
  282. package/package.json +3 -3
@@ -1,5 +1,19 @@
1
- const e = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, t = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
1
+ import { AbiFunctionSignatureNotFoundError as a } from "./index162.js";
2
+ import { slice as r } from "./index193.js";
3
+ import { toFunctionSelector as u } from "./index199.js";
4
+ import { decodeAbiParameters as m } from "./index190.js";
5
+ import { formatAbiItem as d } from "./index163.js";
6
+ function g(e) {
7
+ const { abi: c, data: o } = e, n = r(o, 0, 4), t = c.find((i) => i.type === "function" && n === u(d(i)));
8
+ if (!t)
9
+ throw new a(n, {
10
+ docsPath: "/docs/contract/decodeFunctionData"
11
+ });
12
+ return {
13
+ functionName: t.name,
14
+ args: "inputs" in t && t.inputs && t.inputs.length > 0 ? m(t.inputs, r(o, 4)) : void 0
15
+ };
16
+ }
2
17
  export {
3
- e as bytesRegex,
4
- t as integerRegex
18
+ g as decodeFunctionData
5
19
  };
@@ -1,21 +1,26 @@
1
- import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./index157.js";
2
- import { concatHex as u } from "./index201.js";
3
- import { encodeAbiParameters as d } from "./index193.js";
4
- const r = "/docs/contract/encodeDeployData";
5
- function w(c) {
6
- const { abi: s, args: o, bytecode: n } = c;
7
- if (!o || o.length === 0)
8
- return n;
9
- const t = s.find((e) => "type" in e && e.type === "constructor");
10
- if (!t)
11
- throw new p({ docsPath: r });
12
- if (!("inputs" in t))
13
- throw new i({ docsPath: r });
14
- if (!t.inputs || t.inputs.length === 0)
15
- throw new i({ docsPath: r });
16
- const a = d(t.inputs, o);
17
- return u([n, a]);
1
+ import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./index162.js";
2
+ import { decodeAbiParameters as a } from "./index190.js";
3
+ import { getAbiItem as m } from "./index174.js";
4
+ const e = "/docs/contract/decodeFunctionResult";
5
+ function l(c) {
6
+ const { abi: r, args: d, functionName: o, data: f } = c;
7
+ let n = r[0];
8
+ if (o) {
9
+ const i = m({ abi: r, args: d, name: o });
10
+ if (!i)
11
+ throw new u(o, { docsPath: e });
12
+ n = i;
13
+ }
14
+ if (n.type !== "function")
15
+ throw new u(void 0, { docsPath: e });
16
+ if (!n.outputs)
17
+ throw new s(n.name, { docsPath: e });
18
+ const t = a(n.outputs, f);
19
+ if (t && t.length > 1)
20
+ return t;
21
+ if (t && t.length === 1)
22
+ return t[0];
18
23
  }
19
24
  export {
20
- w as encodeDeployData
25
+ l as decodeFunctionResult
21
26
  };
@@ -1,30 +1,14 @@
1
- import { AbiErrorNotFoundError as c, AbiErrorInputsNotFoundError as u } from "./index157.js";
2
- import { concatHex as d } from "./index201.js";
3
- import { toFunctionSelector as p } from "./index194.js";
4
- import { encodeAbiParameters as b } from "./index193.js";
5
- import { formatAbiItem as l } from "./index158.js";
6
- import { getAbiItem as w } from "./index169.js";
7
- const e = "/docs/contract/encodeErrorResult";
8
- function F(a) {
9
- const { abi: n, errorName: t, args: o } = a;
10
- let r = n[0];
11
- if (t) {
12
- const m = w({ abi: n, args: o, name: t });
13
- if (!m)
14
- throw new c(t, { docsPath: e });
15
- r = m;
16
- }
17
- if (r.type !== "error")
18
- throw new c(void 0, { docsPath: e });
19
- const f = l(r), s = p(f);
20
- let i = "0x";
21
- if (o && o.length > 0) {
22
- if (!r.inputs)
23
- throw new u(r.name, { docsPath: e });
24
- i = b(r.inputs, o);
25
- }
26
- return d([s, i]);
1
+ import { LruMap as u } from "./index220.js";
2
+ import { checksumAddress as c } from "./index191.js";
3
+ const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
+ function h(t, s) {
5
+ const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
+ if (r.has(e))
7
+ return r.get(e);
8
+ const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
+ return r.set(e, o), o;
27
10
  }
28
11
  export {
29
- F as encodeErrorResult
12
+ h as isAddress,
13
+ r as isAddressCache
30
14
  };
@@ -1,38 +1,21 @@
1
- import { AbiEventNotFoundError as p } from "./index157.js";
2
- import { FilterTypeNotSupportedError as A } from "./index180.js";
3
- import { toBytes as b } from "./index191.js";
4
- import { keccak256 as g } from "./index207.js";
5
- import { toEventSelector as v } from "./index197.js";
6
- import { encodeAbiParameters as h } from "./index193.js";
7
- import { formatAbiItem as w } from "./index158.js";
8
- import { getAbiItem as E } from "./index169.js";
9
- const d = "/docs/contract/encodeEventTopics";
10
- function j(t) {
11
- const { abi: r, eventName: f, args: i } = t;
12
- let c = r[0];
13
- if (f) {
14
- const s = E({ abi: r, name: f });
15
- if (!s)
16
- throw new p(f, { docsPath: d });
17
- c = s;
18
- }
19
- if (c.type !== "event")
20
- throw new p(void 0, { docsPath: d });
21
- const l = w(c), y = v(l);
22
- let m = [];
23
- if (i && "inputs" in c) {
24
- const s = c.inputs?.filter((n) => "indexed" in n && n.indexed), e = Array.isArray(i) ? i : Object.values(i).length > 0 ? s?.map((n) => i[n.name]) ?? [] : [];
25
- e.length > 0 && (m = s?.map((n, o) => Array.isArray(e[o]) ? e[o].map((x, a) => u({ param: n, value: e[o][a] })) : typeof e[o] < "u" && e[o] !== null ? u({ param: n, value: e[o] }) : null) ?? []);
26
- }
27
- return [y, ...m];
1
+ function i(t) {
2
+ return typeof t[0] == "string" ? f(t) : c(t);
28
3
  }
29
- function u({ param: t, value: r }) {
30
- if (t.type === "string" || t.type === "bytes")
31
- return g(b(r));
32
- if (t.type === "tuple" || t.type.match(/^(.*)\[(\d+)?\]$/))
33
- throw new A(t.type);
34
- return h([t], [r]);
4
+ function c(t) {
5
+ let n = 0;
6
+ for (const e of t)
7
+ n += e.length;
8
+ const r = new Uint8Array(n);
9
+ let o = 0;
10
+ for (const e of t)
11
+ r.set(e, o), o += e.length;
12
+ return r;
13
+ }
14
+ function f(t) {
15
+ return `0x${t.reduce((n, r) => n + r.replace("0x", ""), "")}`;
35
16
  }
36
17
  export {
37
- j as encodeEventTopics
18
+ i as concat,
19
+ c as concatBytes,
20
+ f as concatHex
38
21
  };
@@ -1,11 +1,37 @@
1
- import { keccak_256 as c } from "./index241.js";
2
- import { isHex as i } from "./index211.js";
3
- import { toBytes as m } from "./index191.js";
4
- import { toHex as s } from "./index192.js";
5
- function x(t, r) {
6
- const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
7
- return e === "bytes" ? o : s(o);
1
+ import { SizeExceedsPaddingSizeError as d } from "./index180.js";
2
+ function f(n, { dir: r, size: t = 32 } = {}) {
3
+ return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
4
+ }
5
+ function p(n, { dir: r, size: t = 32 } = {}) {
6
+ if (t === null)
7
+ return n;
8
+ const e = n.replace("0x", "");
9
+ if (e.length > t * 2)
10
+ throw new d({
11
+ size: Math.ceil(e.length / 2),
12
+ targetSize: t,
13
+ type: "hex"
14
+ });
15
+ return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
16
+ }
17
+ function i(n, { dir: r, size: t = 32 } = {}) {
18
+ if (t === null)
19
+ return n;
20
+ if (n.length > t)
21
+ throw new d({
22
+ size: n.length,
23
+ targetSize: t,
24
+ type: "bytes"
25
+ });
26
+ const e = new Uint8Array(t);
27
+ for (let a = 0; a < t; a++) {
28
+ const o = r === "right";
29
+ e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
30
+ }
31
+ return e;
8
32
  }
9
33
  export {
10
- x as keccak256
34
+ f as pad,
35
+ i as padBytes,
36
+ p as padHex
11
37
  };
@@ -1,10 +1,5 @@
1
- import { concatHex as r } from "./index201.js";
2
- import { encodeAbiParameters as a } from "./index193.js";
3
- import { prepareEncodeFunctionData as s } from "./index209.js";
4
- function p(n) {
5
- const { args: o } = n, { abi: i, functionName: c } = n.abi.length === 1 && n.functionName?.startsWith("0x") ? n : s(n), t = i[0], e = c, u = "inputs" in t && t.inputs ? a(t.inputs, o ?? []) : void 0;
6
- return r([e, u ?? "0x"]);
7
- }
1
+ const e = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, t = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
8
2
  export {
9
- p as encodeFunctionData
3
+ e as bytesRegex,
4
+ t as integerRegex
10
5
  };
@@ -1,28 +1,21 @@
1
- import { AbiFunctionNotFoundError as i } from "./index157.js";
2
- import { toFunctionSelector as a } from "./index194.js";
3
- import { formatAbiItem as f } from "./index158.js";
4
- import { getAbiItem as u } from "./index169.js";
5
- const r = "/docs/contract/encodeFunctionData";
6
- function F(c) {
7
- const { abi: n, args: m, functionName: o } = c;
8
- let t = n[0];
9
- if (o) {
10
- const e = u({
11
- abi: n,
12
- args: m,
13
- name: o
14
- });
15
- if (!e)
16
- throw new i(o, { docsPath: r });
17
- t = e;
18
- }
19
- if (t.type !== "function")
20
- throw new i(void 0, { docsPath: r });
21
- return {
22
- abi: [t],
23
- functionName: a(f(t))
24
- };
1
+ import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./index162.js";
2
+ import { concatHex as u } from "./index206.js";
3
+ import { encodeAbiParameters as d } from "./index198.js";
4
+ const r = "/docs/contract/encodeDeployData";
5
+ function w(c) {
6
+ const { abi: s, args: o, bytecode: n } = c;
7
+ if (!o || o.length === 0)
8
+ return n;
9
+ const t = s.find((e) => "type" in e && e.type === "constructor");
10
+ if (!t)
11
+ throw new p({ docsPath: r });
12
+ if (!("inputs" in t))
13
+ throw new i({ docsPath: r });
14
+ if (!t.inputs || t.inputs.length === 0)
15
+ throw new i({ docsPath: r });
16
+ const a = d(t.inputs, o);
17
+ return u([n, a]);
25
18
  }
26
19
  export {
27
- F as prepareEncodeFunctionData
20
+ w as encodeDeployData
28
21
  };
@@ -1,31 +1,30 @@
1
- import { AbiFunctionNotFoundError as i, AbiFunctionOutputsNotFoundError as a, InvalidArrayError as f } from "./index157.js";
2
- import { encodeAbiParameters as m } from "./index193.js";
3
- import { getAbiItem as d } from "./index169.js";
4
- const r = "/docs/contract/encodeFunctionResult";
5
- function h(c) {
6
- const { abi: e, functionName: o, result: n } = c;
7
- let t = e[0];
8
- if (o) {
9
- const u = d({ abi: e, name: o });
10
- if (!u)
11
- throw new i(o, { docsPath: r });
12
- t = u;
1
+ import { AbiErrorNotFoundError as c, AbiErrorInputsNotFoundError as u } from "./index162.js";
2
+ import { concatHex as d } from "./index206.js";
3
+ import { toFunctionSelector as p } from "./index199.js";
4
+ import { encodeAbiParameters as b } from "./index198.js";
5
+ import { formatAbiItem as l } from "./index163.js";
6
+ import { getAbiItem as w } from "./index174.js";
7
+ const e = "/docs/contract/encodeErrorResult";
8
+ function F(a) {
9
+ const { abi: n, errorName: t, args: o } = a;
10
+ let r = n[0];
11
+ if (t) {
12
+ const m = w({ abi: n, args: o, name: t });
13
+ if (!m)
14
+ throw new c(t, { docsPath: e });
15
+ r = m;
13
16
  }
14
- if (t.type !== "function")
15
- throw new i(void 0, { docsPath: r });
16
- if (!t.outputs)
17
- throw new a(t.name, { docsPath: r });
18
- const s = (() => {
19
- if (t.outputs.length === 0)
20
- return [];
21
- if (t.outputs.length === 1)
22
- return [n];
23
- if (Array.isArray(n))
24
- return n;
25
- throw new f(n);
26
- })();
27
- return m(t.outputs, s);
17
+ if (r.type !== "error")
18
+ throw new c(void 0, { docsPath: e });
19
+ const f = l(r), s = p(f);
20
+ let i = "0x";
21
+ if (o && o.length > 0) {
22
+ if (!r.inputs)
23
+ throw new u(r.name, { docsPath: e });
24
+ i = b(r.inputs, o);
25
+ }
26
+ return d([s, i]);
28
27
  }
29
28
  export {
30
- h as encodeFunctionResult
29
+ F as encodeErrorResult
31
30
  };
@@ -1,6 +1,38 @@
1
- function e(t, { strict: r = !0 } = {}) {
2
- return !t || typeof t != "string" ? !1 : r ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
1
+ import { AbiEventNotFoundError as p } from "./index162.js";
2
+ import { FilterTypeNotSupportedError as A } from "./index185.js";
3
+ import { toBytes as b } from "./index196.js";
4
+ import { keccak256 as g } from "./index212.js";
5
+ import { toEventSelector as v } from "./index202.js";
6
+ import { encodeAbiParameters as h } from "./index198.js";
7
+ import { formatAbiItem as w } from "./index163.js";
8
+ import { getAbiItem as E } from "./index174.js";
9
+ const d = "/docs/contract/encodeEventTopics";
10
+ function j(t) {
11
+ const { abi: r, eventName: f, args: i } = t;
12
+ let c = r[0];
13
+ if (f) {
14
+ const s = E({ abi: r, name: f });
15
+ if (!s)
16
+ throw new p(f, { docsPath: d });
17
+ c = s;
18
+ }
19
+ if (c.type !== "event")
20
+ throw new p(void 0, { docsPath: d });
21
+ const l = w(c), y = v(l);
22
+ let m = [];
23
+ if (i && "inputs" in c) {
24
+ const s = c.inputs?.filter((n) => "indexed" in n && n.indexed), e = Array.isArray(i) ? i : Object.values(i).length > 0 ? s?.map((n) => i[n.name]) ?? [] : [];
25
+ e.length > 0 && (m = s?.map((n, o) => Array.isArray(e[o]) ? e[o].map((x, a) => u({ param: n, value: e[o][a] })) : typeof e[o] < "u" && e[o] !== null ? u({ param: n, value: e[o] }) : null) ?? []);
26
+ }
27
+ return [y, ...m];
28
+ }
29
+ function u({ param: t, value: r }) {
30
+ if (t.type === "string" || t.type === "bytes")
31
+ return g(b(r));
32
+ if (t.type === "tuple" || t.type.match(/^(.*)\[(\d+)?\]$/))
33
+ throw new A(t.type);
34
+ return h([t], [r]);
3
35
  }
4
36
  export {
5
- e as isHex
37
+ j as encodeEventTopics
6
38
  };
@@ -1,82 +1,11 @@
1
- import { isAddressEqual as b } from "./index213.js";
2
- import { toBytes as d } from "./index191.js";
3
- import { formatLog as A } from "./index214.js";
4
- import { keccak256 as g } from "./index207.js";
5
- import { toEventSelector as v } from "./index197.js";
6
- import { decodeEventLog as p } from "./index195.js";
7
- function q(a) {
8
- const { abi: i, args: m, logs: s, strict: y = !0 } = a, t = (() => {
9
- if (a.eventName)
10
- return Array.isArray(a.eventName) ? a.eventName : [a.eventName];
11
- })(), e = i.filter((r) => r.type === "event").map((r) => ({
12
- abi: r,
13
- selector: v(r)
14
- }));
15
- return s.map((r) => {
16
- const o = typeof r.blockNumber == "string" ? A(r) : r, n = e.filter((c) => o.topics[0] === c.selector);
17
- if (n.length === 0)
18
- return null;
19
- let f, u;
20
- for (const c of n)
21
- try {
22
- f = p({
23
- ...o,
24
- abi: [c.abi],
25
- strict: !0
26
- }), u = c;
27
- break;
28
- } catch {
29
- }
30
- if (!f && !y) {
31
- u = n[0];
32
- try {
33
- f = p({
34
- data: o.data,
35
- topics: o.topics,
36
- abi: [u.abi],
37
- strict: !1
38
- });
39
- } catch {
40
- const c = u.abi.inputs?.some((l) => !("name" in l && l.name));
41
- return {
42
- ...o,
43
- args: c ? [] : {},
44
- eventName: u.abi.name
45
- };
46
- }
47
- }
48
- return !f || !u || t && !t.includes(f.eventName) || !N({
49
- args: f.args,
50
- inputs: u.abi.inputs,
51
- matchArgs: m
52
- }) ? null : { ...f, ...o };
53
- }).filter(Boolean);
54
- }
55
- function N(a) {
56
- const { args: i, inputs: m, matchArgs: s } = a;
57
- if (!s)
58
- return !0;
59
- if (!i)
60
- return !1;
61
- function y(t, e, r) {
62
- try {
63
- return t.type === "address" ? b(e, r) : t.type === "string" || t.type === "bytes" ? g(d(e)) === r : e === r;
64
- } catch {
65
- return !1;
66
- }
67
- }
68
- return Array.isArray(i) && Array.isArray(s) ? s.every((t, e) => {
69
- if (t == null)
70
- return !0;
71
- const r = m[e];
72
- return r ? (Array.isArray(t) ? t : [t]).some((n) => y(r, n, i[e])) : !1;
73
- }) : typeof i == "object" && !Array.isArray(i) && typeof s == "object" && !Array.isArray(s) ? Object.entries(s).every(([t, e]) => {
74
- if (e == null)
75
- return !0;
76
- const r = m.find((n) => n.name === t);
77
- return r ? (Array.isArray(e) ? e : [e]).some((n) => y(r, n, i[t])) : !1;
78
- }) : !1;
1
+ import { keccak_256 as c } from "./index246.js";
2
+ import { isHex as i } from "./index216.js";
3
+ import { toBytes as m } from "./index196.js";
4
+ import { toHex as s } from "./index197.js";
5
+ function x(t, r) {
6
+ const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
7
+ return e === "bytes" ? o : s(o);
79
8
  }
80
9
  export {
81
- q as parseEventLogs
10
+ x as keccak256
82
11
  };
@@ -1,12 +1,10 @@
1
- import { InvalidAddressError as e } from "./index161.js";
2
- import { isAddress as o } from "./index200.js";
3
- function i(r, s) {
4
- if (!o(r, { strict: !1 }))
5
- throw new e({ address: r });
6
- if (!o(s, { strict: !1 }))
7
- throw new e({ address: s });
8
- return r.toLowerCase() === s.toLowerCase();
1
+ import { concatHex as r } from "./index206.js";
2
+ import { encodeAbiParameters as a } from "./index198.js";
3
+ import { prepareEncodeFunctionData as s } from "./index214.js";
4
+ function p(n) {
5
+ const { args: o } = n, { abi: i, functionName: c } = n.abi.length === 1 && n.functionName?.startsWith("0x") ? n : s(n), t = i[0], e = c, u = "inputs" in t && t.inputs ? a(t.inputs, o ?? []) : void 0;
6
+ return r([e, u ?? "0x"]);
9
7
  }
10
8
  export {
11
- i as isAddressEqual
9
+ p as encodeFunctionData
12
10
  };
@@ -1,15 +1,28 @@
1
- function c(n, { args: t, eventName: a } = {}) {
1
+ import { AbiFunctionNotFoundError as i } from "./index162.js";
2
+ import { toFunctionSelector as a } from "./index199.js";
3
+ import { formatAbiItem as f } from "./index163.js";
4
+ import { getAbiItem as u } from "./index174.js";
5
+ const r = "/docs/contract/encodeFunctionData";
6
+ function F(c) {
7
+ const { abi: n, args: m, functionName: o } = c;
8
+ let t = n[0];
9
+ if (o) {
10
+ const e = u({
11
+ abi: n,
12
+ args: m,
13
+ name: o
14
+ });
15
+ if (!e)
16
+ throw new i(o, { docsPath: r });
17
+ t = e;
18
+ }
19
+ if (t.type !== "function")
20
+ throw new i(void 0, { docsPath: r });
2
21
  return {
3
- ...n,
4
- blockHash: n.blockHash ? n.blockHash : null,
5
- blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
- blockTimestamp: n.blockTimestamp ? BigInt(n.blockTimestamp) : n.blockTimestamp === null ? null : void 0,
7
- logIndex: n.logIndex ? Number(n.logIndex) : null,
8
- transactionHash: n.transactionHash ? n.transactionHash : null,
9
- transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
10
- ...a ? { args: t, eventName: a } : {}
22
+ abi: [t],
23
+ functionName: a(f(t))
11
24
  };
12
25
  }
13
26
  export {
14
- c as formatLog
27
+ F as prepareEncodeFunctionData
15
28
  };
@@ -1,24 +1,31 @@
1
- class r extends Map {
2
- constructor(e) {
3
- super(), Object.defineProperty(this, "maxSize", {
4
- enumerable: !0,
5
- configurable: !0,
6
- writable: !0,
7
- value: void 0
8
- }), this.maxSize = e;
9
- }
10
- get(e) {
11
- const t = super.get(e);
12
- return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
13
- }
14
- set(e, t) {
15
- if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
16
- const s = this.keys().next().value;
17
- s && this.delete(s);
18
- }
19
- return this;
1
+ import { AbiFunctionNotFoundError as i, AbiFunctionOutputsNotFoundError as a, InvalidArrayError as f } from "./index162.js";
2
+ import { encodeAbiParameters as m } from "./index198.js";
3
+ import { getAbiItem as d } from "./index174.js";
4
+ const r = "/docs/contract/encodeFunctionResult";
5
+ function h(c) {
6
+ const { abi: e, functionName: o, result: n } = c;
7
+ let t = e[0];
8
+ if (o) {
9
+ const u = d({ abi: e, name: o });
10
+ if (!u)
11
+ throw new i(o, { docsPath: r });
12
+ t = u;
20
13
  }
14
+ if (t.type !== "function")
15
+ throw new i(void 0, { docsPath: r });
16
+ if (!t.outputs)
17
+ throw new a(t.name, { docsPath: r });
18
+ const s = (() => {
19
+ if (t.outputs.length === 0)
20
+ return [];
21
+ if (t.outputs.length === 1)
22
+ return [n];
23
+ if (Array.isArray(n))
24
+ return n;
25
+ throw new f(n);
26
+ })();
27
+ return m(t.outputs, s);
21
28
  }
22
29
  export {
23
- r as LruMap
30
+ h as encodeFunctionResult
24
31
  };
@@ -1,11 +1,6 @@
1
- import { hexToBytes as i } from "./index191.js";
2
- import { bytesToHex as f } from "./index192.js";
3
- function y(o) {
4
- const { kzg: s } = o, n = o.to ?? (typeof o.blobs[0] == "string" ? "hex" : "bytes"), m = typeof o.blobs[0] == "string" ? o.blobs.map((t) => i(t)) : o.blobs, b = [];
5
- for (const t of m)
6
- b.push(Uint8Array.from(s.blobToKzgCommitment(t)));
7
- return n === "bytes" ? b : b.map((t) => f(t));
1
+ function e(t, { strict: r = !0 } = {}) {
2
+ return !t || typeof t != "string" ? !1 : r ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
8
3
  }
9
4
  export {
10
- y as blobsToCommitments
5
+ e as isHex
11
6
  };