@coinbase/cdp-hooks 0.0.37 → 0.0.39

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 (248) hide show
  1. package/dist/esm/index10.js +33 -10
  2. package/dist/esm/index100.js +32 -24
  3. package/dist/esm/index101.js +182 -22
  4. package/dist/esm/index102.js +6 -32
  5. package/dist/esm/index103.js +2 -194
  6. package/dist/esm/index104.js +10 -6
  7. package/dist/esm/index105.js +19 -2
  8. package/dist/esm/index106.js +25 -10
  9. package/dist/esm/index107.js +8 -18
  10. package/dist/esm/index108.js +52 -24
  11. package/dist/esm/index109.js +45 -8
  12. package/dist/esm/index11.js +3 -8
  13. package/dist/esm/index110.js +8 -55
  14. package/dist/esm/index111.js +7 -45
  15. package/dist/esm/index112.js +16 -8
  16. package/dist/esm/index113.js +18 -7
  17. package/dist/esm/index114.js +24 -16
  18. package/dist/esm/index115.js +16 -18
  19. package/dist/esm/index116.js +52 -22
  20. package/dist/esm/index117.js +11 -16
  21. package/dist/esm/index118.js +159 -53
  22. package/dist/esm/index119.js +21 -11
  23. package/dist/esm/index12.js +8 -31
  24. package/dist/esm/index120.js +124 -157
  25. package/dist/esm/index121.js +37 -20
  26. package/dist/esm/index122.js +6 -127
  27. package/dist/esm/index123.js +24 -35
  28. package/dist/esm/index124.js +191 -6
  29. package/dist/esm/index125.js +4 -28
  30. package/dist/esm/index126.js +57 -184
  31. package/dist/esm/index127.js +3 -4
  32. package/dist/esm/index128.js +16 -60
  33. package/dist/esm/index129.js +17 -3
  34. package/dist/esm/index13.js +68 -3
  35. package/dist/esm/index130.js +22 -19
  36. package/dist/esm/index131.js +11 -16
  37. package/dist/esm/index132.js +33 -22
  38. package/dist/esm/index133.js +3 -12
  39. package/dist/esm/index134.js +17 -33
  40. package/dist/esm/index135.js +28 -3
  41. package/dist/esm/index136.js +35 -18
  42. package/dist/esm/index137.js +7 -27
  43. package/dist/esm/index138.js +24 -34
  44. package/dist/esm/index139.js +28 -7
  45. package/dist/esm/index14.js +8 -8
  46. package/dist/esm/index140.js +63 -24
  47. package/dist/esm/index141.js +9 -28
  48. package/dist/esm/index142.js +31 -62
  49. package/dist/esm/index143.js +27 -9
  50. package/dist/esm/index144.js +23 -32
  51. package/dist/esm/index145.js +3 -27
  52. package/dist/esm/index146.js +14 -24
  53. package/dist/esm/index147.js +103 -3
  54. package/dist/esm/index148.js +64 -14
  55. package/dist/esm/index149.js +5 -103
  56. package/dist/esm/index15.js +27 -67
  57. package/dist/esm/index150.js +6 -64
  58. package/dist/esm/index151.js +27 -5
  59. package/dist/esm/index152.js +39 -6
  60. package/dist/esm/index153.js +13 -27
  61. package/dist/esm/index154.js +41 -38
  62. package/dist/esm/index155.js +5 -13
  63. package/dist/esm/index156.js +11 -42
  64. package/dist/esm/index157.js +19 -5
  65. package/dist/esm/index158.js +78 -11
  66. package/dist/esm/index159.js +2 -20
  67. package/dist/esm/index16.js +70 -9
  68. package/dist/esm/index160.js +33 -74
  69. package/dist/esm/index161.js +111 -2
  70. package/dist/esm/index162.js +38 -27
  71. package/dist/esm/index163.js +30 -108
  72. package/dist/esm/index164.js +8 -48
  73. package/dist/esm/index165.js +6 -32
  74. package/dist/esm/index166.js +6 -8
  75. package/dist/esm/index167.js +11 -6
  76. package/dist/esm/index168.js +10 -6
  77. package/dist/esm/index169.js +13 -11
  78. package/dist/esm/index17.js +17 -26
  79. package/dist/esm/index170.js +31 -9
  80. package/dist/esm/index171.js +5 -14
  81. package/dist/esm/index172.js +8 -32
  82. package/dist/esm/index173.js +20 -5
  83. package/dist/esm/index174.js +31 -19
  84. package/dist/esm/index175.js +20 -31
  85. package/dist/esm/index176.js +3 -20
  86. package/dist/esm/index177.js +17 -3
  87. package/dist/esm/index178.js +10 -17
  88. package/dist/esm/index179.js +21 -10
  89. package/dist/esm/index18.js +108 -68
  90. package/dist/esm/index180.js +22 -21
  91. package/dist/esm/index181.js +5 -22
  92. package/dist/esm/index182.js +5 -5
  93. package/dist/esm/index183.js +8 -5
  94. package/dist/esm/index184.js +104 -8
  95. package/dist/esm/index185.js +3 -105
  96. package/dist/esm/index186.js +19 -3
  97. package/dist/esm/index187.js +170 -17
  98. package/dist/esm/index188.js +16 -170
  99. package/dist/esm/index189.js +10 -18
  100. package/dist/esm/index19.js +60 -19
  101. package/dist/esm/index190.js +40 -12
  102. package/dist/esm/index191.js +2 -36
  103. package/dist/esm/index192.js +4 -41
  104. package/dist/esm/index193.js +9 -39
  105. package/dist/esm/index194.js +20 -2
  106. package/dist/esm/index195.js +7 -4
  107. package/dist/esm/index196.js +10 -9
  108. package/dist/esm/index197.js +66 -19
  109. package/dist/esm/index198.js +65 -7
  110. package/dist/esm/index199.js +184 -10
  111. package/dist/esm/index20.js +24 -110
  112. package/dist/esm/index200.js +22 -66
  113. package/dist/esm/index201.js +38 -61
  114. package/dist/esm/index202.js +69 -178
  115. package/dist/esm/index203.js +39 -21
  116. package/dist/esm/index204.js +9 -35
  117. package/dist/esm/index205.js +7 -70
  118. package/dist/esm/index206.js +7 -40
  119. package/dist/esm/index207.js +6 -16
  120. package/dist/esm/index208.js +36 -13
  121. package/dist/esm/index209.js +15 -7
  122. package/dist/esm/index21.js +31 -51
  123. package/dist/esm/index210.js +8 -6
  124. package/dist/esm/index211.js +11 -35
  125. package/dist/esm/index212.js +9 -15
  126. package/dist/esm/index213.js +16 -8
  127. package/dist/esm/index214.js +22 -12
  128. package/dist/esm/index215.js +30 -9
  129. package/dist/esm/index216.js +2 -17
  130. package/dist/esm/index217.js +12 -21
  131. package/dist/esm/index218.js +12 -30
  132. package/dist/esm/index219.js +48 -2
  133. package/dist/esm/index22.js +36 -23
  134. package/dist/esm/index220.js +8 -12
  135. package/dist/esm/index221.js +13 -12
  136. package/dist/esm/index222.js +13 -46
  137. package/dist/esm/index223.js +8 -9
  138. package/dist/esm/index224.js +15 -13
  139. package/dist/esm/index225.js +24 -14
  140. package/dist/esm/index226.js +11 -8
  141. package/dist/esm/index227.js +23 -14
  142. package/dist/esm/index228.js +51 -24
  143. package/dist/esm/index229.js +17 -11
  144. package/dist/esm/index23.js +46 -28
  145. package/dist/esm/index230.js +14 -24
  146. package/dist/esm/index231.js +11 -51
  147. package/dist/esm/index232.js +103 -17
  148. package/dist/esm/index233.js +6 -14
  149. package/dist/esm/index234.js +224 -11
  150. package/dist/esm/index235.js +6 -103
  151. package/dist/esm/index236.js +7 -7
  152. package/dist/esm/index237.js +25 -223
  153. package/dist/esm/index238.js +19 -6
  154. package/dist/esm/index239.js +147 -7
  155. package/dist/esm/index24.js +160 -34
  156. package/dist/esm/index240.js +12 -26
  157. package/dist/esm/index241.js +36 -20
  158. package/dist/esm/index242.js +41 -146
  159. package/dist/esm/index245.js +2 -2
  160. package/dist/esm/index248.js +5 -5
  161. package/dist/esm/index249.js +2 -2
  162. package/dist/esm/index25.js +36 -55
  163. package/dist/esm/index251.js +1 -1
  164. package/dist/esm/index253.js +2 -2
  165. package/dist/esm/index254.js +2 -2
  166. package/dist/esm/index255.js +1 -1
  167. package/dist/esm/index256.js +1 -1
  168. package/dist/esm/index26.js +8 -162
  169. package/dist/esm/index260.js +1 -1
  170. package/dist/esm/index27.js +31 -39
  171. package/dist/esm/index28.js +35 -8
  172. package/dist/esm/index29.js +8 -30
  173. package/dist/esm/index30.js +28 -35
  174. package/dist/esm/index31.js +46 -9
  175. package/dist/esm/index32.js +83 -24
  176. package/dist/esm/index33.js +37 -43
  177. package/dist/esm/index34.js +8 -88
  178. package/dist/esm/index35.js +6 -40
  179. package/dist/esm/index36.js +16 -8
  180. package/dist/esm/index37.js +8 -6
  181. package/dist/esm/index38.js +13 -16
  182. package/dist/esm/index39.js +7 -8
  183. package/dist/esm/index40.js +9 -13
  184. package/dist/esm/index41.js +16 -7
  185. package/dist/esm/index42.js +46 -9
  186. package/dist/esm/index43.js +13 -16
  187. package/dist/esm/index44.js +16 -46
  188. package/dist/esm/index45.js +13 -13
  189. package/dist/esm/index46.js +5 -15
  190. package/dist/esm/index47.js +35 -13
  191. package/dist/esm/index48.js +8 -5
  192. package/dist/esm/index49.js +7 -34
  193. package/dist/esm/index50.js +25 -9
  194. package/dist/esm/index51.js +10 -8
  195. package/dist/esm/index52.js +14 -25
  196. package/dist/esm/index53.js +11 -10
  197. package/dist/esm/index54.js +116 -14
  198. package/dist/esm/index55.js +33 -11
  199. package/dist/esm/index56.js +76 -113
  200. package/dist/esm/index57.js +174 -30
  201. package/dist/esm/index58.js +42 -77
  202. package/dist/esm/index59.js +6 -177
  203. package/dist/esm/index6.js +2 -2
  204. package/dist/esm/index60.js +13 -44
  205. package/dist/esm/index61.js +12 -5
  206. package/dist/esm/index62.js +99 -13
  207. package/dist/esm/index63.js +72 -13
  208. package/dist/esm/index64.js +83 -95
  209. package/dist/esm/index65.js +138 -62
  210. package/dist/esm/index66.js +120 -71
  211. package/dist/esm/index67.js +46 -126
  212. package/dist/esm/index68.js +23 -136
  213. package/dist/esm/index69.js +102 -65
  214. package/dist/esm/index7.js +2 -2
  215. package/dist/esm/index70.js +6 -23
  216. package/dist/esm/index71.js +128 -102
  217. package/dist/esm/index72.js +276 -7
  218. package/dist/esm/index73.js +3 -132
  219. package/dist/esm/index74.js +4 -276
  220. package/dist/esm/index75.js +9 -3
  221. package/dist/esm/index76.js +2 -4
  222. package/dist/esm/index77.js +2 -9
  223. package/dist/esm/index78.js +3 -2
  224. package/dist/esm/index79.js +327 -2
  225. package/dist/esm/index8.js +5 -5
  226. package/dist/esm/index80.js +14 -3
  227. package/dist/esm/index81.js +4 -326
  228. package/dist/esm/index82.js +54 -12
  229. package/dist/esm/index83.js +2 -5
  230. package/dist/esm/index84.js +6 -54
  231. package/dist/esm/index85.js +215 -2
  232. package/dist/esm/index86.js +32 -8
  233. package/dist/esm/index87.js +20 -213
  234. package/dist/esm/index88.js +6 -32
  235. package/dist/esm/index89.js +73 -21
  236. package/dist/esm/index9.js +2 -2
  237. package/dist/esm/index90.js +5 -5
  238. package/dist/esm/index91.js +5 -73
  239. package/dist/esm/index92.js +35 -5
  240. package/dist/esm/index93.js +75 -5
  241. package/dist/esm/index94.js +3 -36
  242. package/dist/esm/index95.js +15 -67
  243. package/dist/esm/index96.js +452 -3
  244. package/dist/esm/index97.js +22 -15
  245. package/dist/esm/index98.js +15 -440
  246. package/dist/esm/index99.js +24 -21
  247. package/dist/types/index.d.ts +4 -0
  248. package/package.json +3 -3
@@ -1,22 +1,34 @@
1
- import { ChainDoesNotSupportContract as e } from "./index99.js";
2
- function a({ blockNumber: o, chain: r, contract: c }) {
3
- const t = r?.contracts?.[c];
4
- if (!t)
5
- throw new e({
6
- chain: r,
7
- contract: { name: c }
8
- });
9
- if (o && t.blockCreated && t.blockCreated > o)
10
- throw new e({
11
- blockNumber: o,
12
- chain: r,
13
- contract: {
14
- name: c,
15
- blockCreated: t.blockCreated
16
- }
17
- });
18
- return t.address;
1
+ const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
+ function p(o) {
3
+ const a = (s, t) => ({
4
+ clear: () => t.delete(s),
5
+ get: () => t.get(s),
6
+ set: (r) => t.set(s, r)
7
+ }), n = a(o, i), e = a(o, c);
8
+ return {
9
+ clear: () => {
10
+ n.clear(), e.clear();
11
+ },
12
+ promise: n,
13
+ response: e
14
+ };
15
+ }
16
+ async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
+ const e = p(a), s = e.response.get();
18
+ if (s && n > 0 && (/* @__PURE__ */ new Date()).getTime() - s.created.getTime() < n)
19
+ return s.data;
20
+ let t = e.promise.get();
21
+ t || (t = o(), e.promise.set(t));
22
+ try {
23
+ const r = await t;
24
+ return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
+ } finally {
26
+ e.promise.clear();
27
+ }
19
28
  }
20
29
  export {
21
- a as getChainContractAddress
30
+ p as getCache,
31
+ i as promiseCache,
32
+ c as responseCache,
33
+ l as withCache
22
34
  };
@@ -1,34 +1,23 @@
1
- const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
- function p(o) {
3
- const a = (s, t) => ({
4
- clear: () => t.delete(s),
5
- get: () => t.get(s),
6
- set: (r) => t.set(s, r)
7
- }), n = a(o, i), e = a(o, c);
8
- return {
9
- clear: () => {
10
- n.clear(), e.clear();
11
- },
12
- promise: n,
13
- response: e
14
- };
15
- }
16
- async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
- const e = p(a), s = e.response.get();
18
- if (s && n > 0 && (/* @__PURE__ */ new Date()).getTime() - s.created.getTime() < n)
19
- return s.data;
20
- let t = e.promise.get();
21
- t || (t = o(), e.promise.set(t));
22
- try {
23
- const r = await t;
24
- return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
- } finally {
26
- e.promise.clear();
27
- }
1
+ import { wait as w } from "./index176.js";
2
+ function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
+ return new Promise((s, y) => {
4
+ const a = async ({ count: r = 0 } = {}) => {
5
+ const f = async ({ error: t }) => {
6
+ const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
+ i && await w(i), a({ count: r + 1 });
8
+ };
9
+ try {
10
+ const t = await n();
11
+ s(t);
12
+ } catch (t) {
13
+ if (r < o && await c({ count: r, error: t }))
14
+ return f({ error: t });
15
+ y(t);
16
+ }
17
+ };
18
+ a();
19
+ });
28
20
  }
29
21
  export {
30
- p as getCache,
31
- i as promiseCache,
32
- c as responseCache,
33
- l as withCache
22
+ p as withRetry
34
23
  };
@@ -1,23 +1,6 @@
1
- import { wait as w } from "./index177.js";
2
- function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
- return new Promise((s, y) => {
4
- const a = async ({ count: r = 0 } = {}) => {
5
- const f = async ({ error: t }) => {
6
- const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
- i && await w(i), a({ count: r + 1 });
8
- };
9
- try {
10
- const t = await n();
11
- s(t);
12
- } catch (t) {
13
- if (r < o && await c({ count: r, error: t }))
14
- return f({ error: t });
15
- y(t);
16
- }
17
- };
18
- a();
19
- });
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
20
3
  }
21
4
  export {
22
- p as withRetry
5
+ n as wait
23
6
  };
@@ -1,6 +1,20 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ function u(n, { errorInstance: i = new Error("timed out"), timeout: t, signal: l }) {
2
+ return new Promise((a, o) => {
3
+ (async () => {
4
+ let e;
5
+ try {
6
+ const r = new AbortController();
7
+ t > 0 && (e = setTimeout(() => {
8
+ l && r.abort();
9
+ }, t)), a(await n({ signal: r?.signal || null }));
10
+ } catch (r) {
11
+ r?.name === "AbortError" && o(i), o(r);
12
+ } finally {
13
+ clearTimeout(e);
14
+ }
15
+ })();
16
+ });
3
17
  }
4
18
  export {
5
- n as wait
19
+ u as withTimeout
6
20
  };
@@ -1,20 +1,13 @@
1
- function u(n, { errorInstance: i = new Error("timed out"), timeout: t, signal: l }) {
2
- return new Promise((a, o) => {
3
- (async () => {
4
- let e;
5
- try {
6
- const r = new AbortController();
7
- t > 0 && (e = setTimeout(() => {
8
- l && r.abort();
9
- }, t)), a(await n({ signal: r?.signal || null }));
10
- } catch (r) {
11
- r?.name === "AbortError" && o(i), o(r);
12
- } finally {
13
- clearTimeout(e);
14
- }
15
- })();
16
- });
1
+ function a(r, n) {
2
+ let t = r.toString();
3
+ const i = t.startsWith("-");
4
+ i && (t = t.slice(1)), t = t.padStart(n, "0");
5
+ let [l, e] = [
6
+ t.slice(0, t.length - n),
7
+ t.slice(t.length - n)
8
+ ];
9
+ return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
17
10
  }
18
11
  export {
19
- u as withTimeout
12
+ a as formatUnits
20
13
  };
@@ -1,13 +1,24 @@
1
- function a(r, n) {
2
- let t = r.toString();
3
- const i = t.startsWith("-");
4
- i && (t = t.slice(1)), t = t.padStart(n, "0");
5
- let [l, e] = [
6
- t.slice(0, t.length - n),
7
- t.slice(t.length - n)
8
- ];
9
- return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
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;
20
+ }
10
21
  }
11
22
  export {
12
- a as formatUnits
23
+ r as LruMap
13
24
  };
@@ -1,73 +1,113 @@
1
- import { TimeoutError as m, HttpRequestError as i } from "./index15.js";
2
- import { withTimeout as j } from "./index178.js";
3
- import { stringify as c } from "./index105.js";
4
- import { idCache as y } from "./index214.js";
5
- function E(s, o = {}) {
1
+ import { getEnsAddress as a } from "./index19.js";
2
+ import { getEnsAvatar as m } from "./index20.js";
3
+ import { getEnsName as s } from "./index21.js";
4
+ import { getEnsResolver as i } from "./index22.js";
5
+ import { getEnsText as g } from "./index23.js";
6
+ import { call as p } from "./index24.js";
7
+ import { createAccessList as f } from "./index25.js";
8
+ import { createBlockFilter as n } from "./index26.js";
9
+ import { createContractEventFilter as c } from "./index27.js";
10
+ import { createEventFilter as C } from "./index28.js";
11
+ import { createPendingTransactionFilter as u } from "./index29.js";
12
+ import { estimateContractGas as F } from "./index30.js";
13
+ import { estimateFeesPerGas as T } from "./index31.js";
14
+ import { estimateGas as E } from "./index32.js";
15
+ import { estimateMaxPriorityFeePerGas as B } from "./index33.js";
16
+ import { getBalance as v } from "./index34.js";
17
+ import { getBlobBaseFee as d } from "./index35.js";
18
+ import { getBlock as w } from "./index36.js";
19
+ import { getBlockNumber as h } from "./index37.js";
20
+ import { getBlockTransactionCount as k } from "./index38.js";
21
+ import { getChainId as P } from "./index39.js";
22
+ import { getCode as o } from "./index40.js";
23
+ import { getContractEvents as y } from "./index41.js";
24
+ import { getEip712Domain as G } from "./index42.js";
25
+ import { getFeeHistory as R } from "./index43.js";
26
+ import { getFilterChanges as A } from "./index44.js";
27
+ import { getFilterLogs as b } from "./index45.js";
28
+ import { getGasPrice as l } from "./index46.js";
29
+ import { getLogs as L } from "./index47.js";
30
+ import { getProof as M } from "./index48.js";
31
+ import { getStorageAt as N } from "./index49.js";
32
+ import { getTransaction as x } from "./index50.js";
33
+ import { getTransactionConfirmations as D } from "./index51.js";
34
+ import { getTransactionCount as S } from "./index52.js";
35
+ import { getTransactionReceipt as q } from "./index53.js";
36
+ import { multicall as H } from "./index54.js";
37
+ import { readContract as I } from "./index55.js";
38
+ import { simulateBlocks as e } from "./index56.js";
39
+ import { simulateCalls as j } from "./index57.js";
40
+ import { simulateContract as z } from "./index58.js";
41
+ import { uninstallFilter as J } from "./index59.js";
42
+ import { verifyMessage as K } from "./index60.js";
43
+ import { verifyTypedData as O } from "./index61.js";
44
+ import { waitForTransactionReceipt as Q } from "./index62.js";
45
+ import { watchBlockNumber as U } from "./index63.js";
46
+ import { watchBlocks as V } from "./index64.js";
47
+ import { watchContractEvent as W } from "./index65.js";
48
+ import { watchEvent as X } from "./index66.js";
49
+ import { watchPendingTransactions as Y } from "./index67.js";
50
+ import { verifySiweMessage as Z } from "./index68.js";
51
+ import { prepareTransactionRequest as _ } from "./index69.js";
52
+ import { sendRawTransaction as $ } from "./index70.js";
53
+ function _r(t) {
6
54
  return {
7
- async request(p) {
8
- const { body: r, onRequest: g = o.onRequest, onResponse: h = o.onResponse, timeout: f = o.timeout ?? 1e4 } = p, u = {
9
- ...o.fetchOptions ?? {},
10
- ...p.fetchOptions ?? {}
11
- }, { headers: l, method: R, signal: q } = u;
12
- try {
13
- const t = await j(async ({ signal: n }) => {
14
- const a = {
15
- ...u,
16
- body: Array.isArray(r) ? c(r.map((d) => ({
17
- jsonrpc: "2.0",
18
- id: d.id ?? y.take(),
19
- ...d
20
- }))) : c({
21
- jsonrpc: "2.0",
22
- id: r.id ?? y.take(),
23
- ...r
24
- }),
25
- headers: {
26
- "Content-Type": "application/json",
27
- ...l
28
- },
29
- method: R || "POST",
30
- signal: q || (f > 0 ? n : null)
31
- }, T = new Request(s, a), w = await g?.(T, a) ?? { ...a, url: s };
32
- return await fetch(w.url ?? s, w);
33
- }, {
34
- errorInstance: new m({ body: r, url: s }),
35
- timeout: f,
36
- signal: !0
37
- });
38
- h && await h(t);
39
- let e;
40
- if (t.headers.get("Content-Type")?.startsWith("application/json"))
41
- e = await t.json();
42
- else {
43
- e = await t.text();
44
- try {
45
- e = JSON.parse(e || "{}");
46
- } catch (n) {
47
- if (t.ok)
48
- throw n;
49
- e = { error: e };
50
- }
51
- }
52
- if (!t.ok)
53
- throw new i({
54
- body: r,
55
- details: c(e.error) || t.statusText,
56
- headers: t.headers,
57
- status: t.status,
58
- url: s
59
- });
60
- return e;
61
- } catch (t) {
62
- throw t instanceof i || t instanceof m ? t : new i({
63
- body: r,
64
- cause: t,
65
- url: s
66
- });
67
- }
68
- }
55
+ call: (r) => p(t, r),
56
+ createAccessList: (r) => f(t, r),
57
+ createBlockFilter: () => n(t),
58
+ createContractEventFilter: (r) => c(t, r),
59
+ createEventFilter: (r) => C(t, r),
60
+ createPendingTransactionFilter: () => u(t),
61
+ estimateContractGas: (r) => F(t, r),
62
+ estimateGas: (r) => E(t, r),
63
+ getBalance: (r) => v(t, r),
64
+ getBlobBaseFee: () => d(t),
65
+ getBlock: (r) => w(t, r),
66
+ getBlockNumber: (r) => h(t, r),
67
+ getBlockTransactionCount: (r) => k(t, r),
68
+ getBytecode: (r) => o(t, r),
69
+ getChainId: () => P(t),
70
+ getCode: (r) => o(t, r),
71
+ getContractEvents: (r) => y(t, r),
72
+ getEip712Domain: (r) => G(t, r),
73
+ getEnsAddress: (r) => a(t, r),
74
+ getEnsAvatar: (r) => m(t, r),
75
+ getEnsName: (r) => s(t, r),
76
+ getEnsResolver: (r) => i(t, r),
77
+ getEnsText: (r) => g(t, r),
78
+ getFeeHistory: (r) => R(t, r),
79
+ estimateFeesPerGas: (r) => T(t, r),
80
+ getFilterChanges: (r) => A(t, r),
81
+ getFilterLogs: (r) => b(t, r),
82
+ getGasPrice: () => l(t),
83
+ getLogs: (r) => L(t, r),
84
+ getProof: (r) => M(t, r),
85
+ estimateMaxPriorityFeePerGas: (r) => B(t, r),
86
+ getStorageAt: (r) => N(t, r),
87
+ getTransaction: (r) => x(t, r),
88
+ getTransactionConfirmations: (r) => D(t, r),
89
+ getTransactionCount: (r) => S(t, r),
90
+ getTransactionReceipt: (r) => q(t, r),
91
+ multicall: (r) => H(t, r),
92
+ prepareTransactionRequest: (r) => _(t, r),
93
+ readContract: (r) => I(t, r),
94
+ sendRawTransaction: (r) => $(t, r),
95
+ simulate: (r) => e(t, r),
96
+ simulateBlocks: (r) => e(t, r),
97
+ simulateCalls: (r) => j(t, r),
98
+ simulateContract: (r) => z(t, r),
99
+ verifyMessage: (r) => K(t, r),
100
+ verifySiweMessage: (r) => Z(t, r),
101
+ verifyTypedData: (r) => O(t, r),
102
+ uninstallFilter: (r) => J(t, r),
103
+ waitForTransactionReceipt: (r) => Q(t, r),
104
+ watchBlocks: (r) => V(t, r),
105
+ watchBlockNumber: (r) => U(t, r),
106
+ watchContractEvent: (r) => W(t, r),
107
+ watchEvent: (r) => X(t, r),
108
+ watchPendingTransactions: (r) => Y(t, r)
69
109
  };
70
110
  }
71
111
  export {
72
- E as getHttpRpcClient
112
+ _r as publicActions
73
113
  };
@@ -1,24 +1,25 @@
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;
20
- }
1
+ import { AbiDecodingZeroDataError as p } from "./index79.js";
2
+ import { BaseError as C } from "./index82.js";
3
+ import { RawContractError as w, ContractFunctionZeroDataError as g, ContractFunctionRevertedError as l, ContractFunctionExecutionError as D } from "./index85.js";
4
+ import { RpcRequestError as F } from "./index13.js";
5
+ import { InternalRpcError as O } from "./index96.js";
6
+ const _ = 3;
7
+ function Z(r, { abi: n, address: i, args: E, docsPath: d, functionName: o, sender: f }) {
8
+ const e = r instanceof w ? r : r instanceof C ? r.walk((R) => "data" in R) || r.walk() : {}, { code: m, data: t, details: a, message: c, shortMessage: s } = e, u = r instanceof p ? new g({ functionName: o }) : [_, O.code].includes(m) && (t || a || c || s) ? new l({
9
+ abi: n,
10
+ data: typeof t == "object" ? t.data : t,
11
+ functionName: o,
12
+ message: e instanceof F ? a : s ?? c
13
+ }) : r;
14
+ return new D(u, {
15
+ abi: n,
16
+ args: E,
17
+ contractAddress: i,
18
+ docsPath: d,
19
+ functionName: o,
20
+ sender: f
21
+ });
21
22
  }
22
23
  export {
23
- r as LruMap
24
+ Z as getContractError
24
25
  };
@@ -1,25 +1,8 @@
1
- import { AbiDecodingZeroDataError as p } from "./index81.js";
2
- import { BaseError as C } from "./index84.js";
3
- import { RawContractError as w, ContractFunctionZeroDataError as g, ContractFunctionRevertedError as l, ContractFunctionExecutionError as D } from "./index87.js";
4
- import { RpcRequestError as F } from "./index15.js";
5
- import { InternalRpcError as O } from "./index98.js";
6
- const _ = 3;
7
- function Z(r, { abi: n, address: i, args: E, docsPath: d, functionName: o, sender: f }) {
8
- const e = r instanceof w ? r : r instanceof C ? r.walk((R) => "data" in R) || r.walk() : {}, { code: m, data: t, details: a, message: c, shortMessage: s } = e, u = r instanceof p ? new g({ functionName: o }) : [_, O.code].includes(m) && (t || a || c || s) ? new l({
9
- abi: n,
10
- data: typeof t == "object" ? t.data : t,
11
- functionName: o,
12
- message: e instanceof F ? a : s ?? c
13
- }) : r;
14
- return new D(u, {
15
- abi: n,
16
- args: E,
17
- contractAddress: i,
18
- docsPath: d,
19
- functionName: o,
20
- sender: f
21
- });
1
+ import { hashSignature as t } from "./index235.js";
2
+ import { toSignature as o } from "./index236.js";
3
+ function a(r) {
4
+ return t(o(r));
22
5
  }
23
6
  export {
24
- Z as getContractError
7
+ a as toSignatureHash
25
8
  };
@@ -1,8 +1,8 @@
1
- import { hashSignature as t } from "./index238.js";
2
- import { toSignature as o } from "./index239.js";
3
- function a(r) {
4
- return t(o(r));
1
+ import { keccak256 as o } from "./index110.js";
2
+ import { toPrefixedMessage as t } from "./index183.js";
3
+ function f(e, r) {
4
+ return o(t(e), r);
5
5
  }
6
6
  export {
7
- a as toSignatureHash
7
+ f as hashMessage
8
8
  };
@@ -1,8 +1,11 @@
1
- import { keccak256 as o } from "./index112.js";
2
- import { toPrefixedMessage as t } from "./index184.js";
3
- function f(e, r) {
4
- return o(t(e), r);
1
+ import { presignMessagePrefix as e } from "./index78.js";
2
+ import { concat as n } from "./index113.js";
3
+ import { size as f } from "./index81.js";
4
+ import { stringToHex as o, bytesToHex as p } from "./index109.js";
5
+ function u(r) {
6
+ const t = typeof r == "string" ? o(r) : typeof r.raw == "string" ? r.raw : p(r.raw), i = o(`${e}${f(t)}`);
7
+ return n([i, t]);
5
8
  }
6
9
  export {
7
- f as hashMessage
10
+ u as toPrefixedMessage
8
11
  };
@@ -1,11 +1,107 @@
1
- import { presignMessagePrefix as e } from "./index80.js";
2
- import { concat as n } from "./index115.js";
3
- import { size as f } from "./index83.js";
4
- import { stringToHex as o, bytesToHex as p } from "./index111.js";
5
- function u(r) {
6
- const t = typeof r == "string" ? o(r) : typeof r.raw == "string" ? r.raw : p(r.raw), i = o(`${e}${f(t)}`);
7
- return n([i, t]);
1
+ import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index238.js";
2
+ import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index239.js";
3
+ const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
+ for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
+ [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
+ let o = R;
7
+ for (let r = 0; r < 7; r++)
8
+ t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
+ B.push(o);
8
10
  }
11
+ const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
+ function G(n, t = 24) {
13
+ const s = new Uint32Array(10);
14
+ for (let i = 24 - t; i < 24; i++) {
15
+ for (let e = 0; e < 10; e++)
16
+ s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
+ for (let e = 0; e < 10; e += 2) {
18
+ const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
+ for (let a = 0; a < 50; a += 10)
20
+ n[e + a] ^= b, n[e + a + 1] ^= H;
21
+ }
22
+ let o = n[2], r = n[3];
23
+ for (let e = 0; e < 24; e++) {
24
+ const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
+ o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
+ }
27
+ for (let e = 0; e < 50; e += 10) {
28
+ for (let h = 0; h < 10; h++)
29
+ s[h] = n[e + h];
30
+ for (let h = 0; h < 10; h++)
31
+ n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
+ }
33
+ n[0] ^= C[i], n[1] ^= D[i];
34
+ }
35
+ y(s);
36
+ }
37
+ class p extends E {
38
+ // NOTE: we accept arguments in bytes instead of bits here.
39
+ constructor(t, s, i, o = !1, r = 24) {
40
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
+ throw new Error("only keccak-f1600 function is supported");
42
+ this.state = new Uint8Array(200), this.state32 = U(this.state);
43
+ }
44
+ clone() {
45
+ return this._cloneInto();
46
+ }
47
+ keccak() {
48
+ I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
+ }
50
+ update(t) {
51
+ x(this), t = P(t), k(t);
52
+ const { blockLen: s, state: i } = this, o = t.length;
53
+ for (let r = 0; r < o; ) {
54
+ const e = Math.min(s - this.pos, o - r);
55
+ for (let h = 0; h < e; h++)
56
+ i[this.pos++] ^= t[r++];
57
+ this.pos === s && this.keccak();
58
+ }
59
+ return this;
60
+ }
61
+ finish() {
62
+ if (this.finished)
63
+ return;
64
+ this.finished = !0;
65
+ const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
+ t[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
+ }
68
+ writeInto(t) {
69
+ x(this, !1), k(t), this.finish();
70
+ const s = this.state, { blockLen: i } = this;
71
+ for (let o = 0, r = t.length; o < r; ) {
72
+ this.posOut >= i && this.keccak();
73
+ const e = Math.min(i - this.posOut, r - o);
74
+ t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
+ }
76
+ return t;
77
+ }
78
+ xofInto(t) {
79
+ if (!this.enableXOF)
80
+ throw new Error("XOF is not possible for this instance");
81
+ return this.writeInto(t);
82
+ }
83
+ xof(t) {
84
+ return d(t), this.xofInto(new Uint8Array(t));
85
+ }
86
+ digestInto(t) {
87
+ if (M(t, this), this.finished)
88
+ throw new Error("digest() was already called");
89
+ return this.writeInto(t), this.destroy(), t;
90
+ }
91
+ digest() {
92
+ return this.digestInto(new Uint8Array(this.outputLen));
93
+ }
94
+ destroy() {
95
+ this.destroyed = !0, y(this.state);
96
+ }
97
+ _cloneInto(t) {
98
+ const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
+ return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
100
+ }
101
+ }
102
+ const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
9
103
  export {
10
- u as toPrefixedMessage
104
+ p as Keccak,
105
+ G as keccakP,
106
+ Q as keccak_256
11
107
  };