@coinbase/cdp-hooks 0.0.19 → 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 (268) hide show
  1. package/README.md +173 -7
  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 -7
  120. package/dist/esm/index206.js +7 -6
  121. package/dist/esm/index207.js +6 -36
  122. package/dist/esm/index208.js +35 -14
  123. package/dist/esm/index209.js +15 -8
  124. package/dist/esm/index21.js +37 -34
  125. package/dist/esm/index210.js +7 -11
  126. package/dist/esm/index211.js +3 -3
  127. package/dist/esm/index212.js +3 -3
  128. package/dist/esm/index213.js +1 -1
  129. package/dist/esm/index214.js +2 -2
  130. package/dist/esm/index216.js +2 -2
  131. package/dist/esm/index218.js +5 -5
  132. package/dist/esm/index219.js +2 -2
  133. package/dist/esm/index22.js +34 -55
  134. package/dist/esm/index220.js +2 -2
  135. package/dist/esm/index221.js +1 -1
  136. package/dist/esm/index223.js +1 -1
  137. package/dist/esm/index224.js +2 -2
  138. package/dist/esm/index225.js +3 -3
  139. package/dist/esm/index226.js +3 -3
  140. package/dist/esm/index227.js +16 -16
  141. package/dist/esm/index229.js +2 -2
  142. package/dist/esm/index23.js +55 -160
  143. package/dist/esm/index230.js +1 -1
  144. package/dist/esm/index231.js +11 -102
  145. package/dist/esm/index232.js +103 -6
  146. package/dist/esm/index233.js +5 -223
  147. package/dist/esm/index234.js +224 -6
  148. package/dist/esm/index235.js +7 -7
  149. package/dist/esm/index236.js +7 -27
  150. package/dist/esm/index237.js +25 -18
  151. package/dist/esm/index238.js +18 -145
  152. package/dist/esm/index239.js +146 -12
  153. package/dist/esm/index24.js +156 -32
  154. package/dist/esm/index240.js +12 -35
  155. package/dist/esm/index241.js +35 -41
  156. package/dist/esm/index242.js +41 -68
  157. package/dist/esm/index243.js +68 -3
  158. package/dist/esm/index244.js +3 -155
  159. package/dist/esm/index245.js +134 -7
  160. package/dist/esm/index246.js +144 -125
  161. package/dist/esm/index247.js +9 -16
  162. package/dist/esm/index248.js +16 -113
  163. package/dist/esm/index249.js +95 -116
  164. package/dist/esm/index25.js +39 -9
  165. package/dist/esm/index250.js +126 -70
  166. package/dist/esm/index251.js +79 -2
  167. package/dist/esm/index252.js +2 -699
  168. package/dist/esm/index253.js +685 -126
  169. package/dist/esm/index254.js +138 -41
  170. package/dist/esm/index255.js +40 -199
  171. package/dist/esm/index256.js +198 -62
  172. package/dist/esm/index257.js +65 -4
  173. package/dist/esm/index258.js +4 -40
  174. package/dist/esm/index259.js +40 -7
  175. package/dist/esm/index26.js +8 -30
  176. package/dist/esm/index260.js +7 -62
  177. package/dist/esm/index261.js +57 -72
  178. package/dist/esm/index262.js +78 -4
  179. package/dist/esm/index263.js +4 -195
  180. package/dist/esm/index264.js +183 -52
  181. package/dist/esm/index265.js +59 -40
  182. package/dist/esm/index266.js +44 -4
  183. package/dist/esm/index267.js +5 -5
  184. package/dist/esm/index268.js +5 -2
  185. package/dist/esm/index269.js +2 -22
  186. package/dist/esm/index27.js +21 -26
  187. package/dist/esm/index270.js +24 -0
  188. package/dist/esm/index28.js +35 -8
  189. package/dist/esm/index29.js +8 -28
  190. package/dist/esm/index3.js +127 -65
  191. package/dist/esm/index30.js +27 -44
  192. package/dist/esm/index31.js +44 -86
  193. package/dist/esm/index32.js +83 -35
  194. package/dist/esm/index33.js +40 -8
  195. package/dist/esm/index34.js +7 -5
  196. package/dist/esm/index35.js +6 -16
  197. package/dist/esm/index36.js +16 -8
  198. package/dist/esm/index37.js +8 -13
  199. package/dist/esm/index38.js +13 -7
  200. package/dist/esm/index39.js +7 -9
  201. package/dist/esm/index4.js +33 -17
  202. package/dist/esm/index40.js +9 -16
  203. package/dist/esm/index41.js +16 -46
  204. package/dist/esm/index42.js +46 -13
  205. package/dist/esm/index43.js +13 -16
  206. package/dist/esm/index44.js +14 -11
  207. package/dist/esm/index45.js +13 -6
  208. package/dist/esm/index46.js +5 -34
  209. package/dist/esm/index47.js +34 -8
  210. package/dist/esm/index48.js +8 -7
  211. package/dist/esm/index49.js +8 -25
  212. package/dist/esm/index5.js +18 -12
  213. package/dist/esm/index50.js +25 -10
  214. package/dist/esm/index51.js +10 -14
  215. package/dist/esm/index52.js +14 -11
  216. package/dist/esm/index53.js +11 -116
  217. package/dist/esm/index54.js +114 -31
  218. package/dist/esm/index55.js +30 -76
  219. package/dist/esm/index56.js +78 -176
  220. package/dist/esm/index57.js +174 -41
  221. package/dist/esm/index58.js +44 -6
  222. package/dist/esm/index59.js +5 -12
  223. package/dist/esm/index6.js +12 -54
  224. package/dist/esm/index60.js +12 -12
  225. package/dist/esm/index61.js +13 -99
  226. package/dist/esm/index62.js +96 -69
  227. package/dist/esm/index63.js +61 -76
  228. package/dist/esm/index64.js +74 -135
  229. package/dist/esm/index65.js +108 -96
  230. package/dist/esm/index66.js +113 -45
  231. package/dist/esm/index67.js +68 -23
  232. package/dist/esm/index68.js +23 -105
  233. package/dist/esm/index69.js +105 -6
  234. package/dist/esm/index7.js +54 -58
  235. package/dist/esm/index70.js +6 -131
  236. package/dist/esm/index71.js +130 -274
  237. package/dist/esm/index72.js +276 -3
  238. package/dist/esm/index73.js +3 -4
  239. package/dist/esm/index74.js +4 -9
  240. package/dist/esm/index75.js +9 -2
  241. package/dist/esm/index76.js +2 -2
  242. package/dist/esm/index77.js +2 -3
  243. package/dist/esm/index78.js +3 -327
  244. package/dist/esm/index79.js +324 -11
  245. package/dist/esm/index8.js +58 -56
  246. package/dist/esm/index80.js +13 -4
  247. package/dist/esm/index81.js +4 -55
  248. package/dist/esm/index82.js +56 -2
  249. package/dist/esm/index83.js +2 -8
  250. package/dist/esm/index84.js +6 -213
  251. package/dist/esm/index85.js +215 -32
  252. package/dist/esm/index86.js +32 -22
  253. package/dist/esm/index87.js +21 -5
  254. package/dist/esm/index88.js +5 -73
  255. package/dist/esm/index89.js +73 -5
  256. package/dist/esm/index9.js +56 -33
  257. package/dist/esm/index90.js +4 -4
  258. package/dist/esm/index91.js +5 -35
  259. package/dist/esm/index92.js +29 -69
  260. package/dist/esm/index93.js +76 -3
  261. package/dist/esm/index94.js +3 -24
  262. package/dist/esm/index95.js +16 -444
  263. package/dist/esm/index96.js +444 -23
  264. package/dist/esm/index97.js +24 -20
  265. package/dist/esm/index98.js +18 -25
  266. package/dist/esm/index99.js +31 -32
  267. package/dist/types/index.d.ts +29 -0
  268. package/package.json +3 -3
@@ -1,16 +1,13 @@
1
- import { blobsToCommitments as f } from "./index163.js";
2
- import { blobsToProofs as l } from "./index167.js";
3
- import { toBlobs as p } from "./index169.js";
4
- function k(t) {
5
- const { data: i, kzg: n, to: m } = t, s = t.blobs ?? p({ data: i, to: m }), b = t.commitments ?? f({ blobs: s, kzg: n, to: m }), r = t.proofs ?? l({ blobs: s, commitments: b, kzg: n, to: m }), c = [];
6
- for (let o = 0; o < s.length; o++)
7
- c.push({
8
- blob: s[o],
9
- commitment: b[o],
10
- proof: r[o]
11
- });
12
- return c;
1
+ import { hexToBytes as b } from "./index108.js";
2
+ import { bytesToHex as y } from "./index109.js";
3
+ function h(t) {
4
+ const { kzg: m } = t, c = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), s = typeof t.blobs[0] == "string" ? t.blobs.map((o) => b(o)) : t.blobs, i = typeof t.commitments[0] == "string" ? t.commitments.map((o) => b(o)) : t.commitments, n = [];
5
+ for (let o = 0; o < s.length; o++) {
6
+ const f = s[o], l = i[o];
7
+ n.push(Uint8Array.from(m.computeBlobKzgProof(f, l)));
8
+ }
9
+ return c === "bytes" ? n : n.map((o) => y(o));
13
10
  }
14
11
  export {
15
- k as toBlobSidecars
12
+ h as blobsToProofs
16
13
  };
@@ -1,35 +1,16 @@
1
- import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index170.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index159.js";
3
- import { createCursor as B } from "./index119.js";
4
- import { size as u } from "./index80.js";
5
- import { hexToBytes as x } from "./index107.js";
6
- import { bytesToHex as d } from "./index108.js";
7
- function S(e) {
8
- const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
- if (!o)
10
- throw new c();
11
- if (o > y)
12
- throw new h({
13
- maxSize: y,
14
- size: o
1
+ import { blobsToCommitments as f } from "./index164.js";
2
+ import { blobsToProofs as l } from "./index168.js";
3
+ import { toBlobs as p } from "./index170.js";
4
+ function k(t) {
5
+ const { data: i, kzg: n, to: m } = t, s = t.blobs ?? p({ data: i, to: m }), b = t.commitments ?? f({ blobs: s, kzg: n, to: m }), r = t.proofs ?? l({ blobs: s, commitments: b, kzg: n, to: m }), c = [];
6
+ for (let o = 0; o < s.length; o++)
7
+ c.push({
8
+ blob: s[o],
9
+ commitment: b[o],
10
+ proof: r[o]
15
11
  });
16
- const s = [];
17
- let n = !0, r = 0;
18
- for (; n; ) {
19
- const t = B(new Uint8Array(p));
20
- let l = 0;
21
- for (; l < a; ) {
22
- const b = i.slice(r, r + (f - 1));
23
- if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
- t.pushByte(128), n = !1;
25
- break;
26
- }
27
- l++, r += 31;
28
- }
29
- s.push(t);
30
- }
31
- return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
12
+ return c;
32
13
  }
33
14
  export {
34
- S as toBlobs
15
+ k as toBlobSidecars
35
16
  };
@@ -1,113 +1,22 @@
1
- import { getEnsAddress as a } from "./index18.js";
2
- import { getEnsAvatar as m } from "./index19.js";
3
- import { getEnsName as s } from "./index20.js";
4
- import { getEnsResolver as i } from "./index21.js";
5
- import { getEnsText as g } from "./index22.js";
6
- import { call as p } from "./index23.js";
7
- import { createAccessList as f } from "./index24.js";
8
- import { createBlockFilter as n } from "./index25.js";
9
- import { createContractEventFilter as c } from "./index26.js";
10
- import { createEventFilter as C } from "./index27.js";
11
- import { createPendingTransactionFilter as u } from "./index28.js";
12
- import { estimateContractGas as F } from "./index29.js";
13
- import { estimateFeesPerGas as T } from "./index30.js";
14
- import { estimateGas as E } from "./index31.js";
15
- import { estimateMaxPriorityFeePerGas as B } from "./index32.js";
16
- import { getBalance as v } from "./index33.js";
17
- import { getBlobBaseFee as d } from "./index34.js";
18
- import { getBlock as w } from "./index35.js";
19
- import { getBlockNumber as h } from "./index36.js";
20
- import { getBlockTransactionCount as k } from "./index37.js";
21
- import { getChainId as P } from "./index38.js";
22
- import { getCode as o } from "./index39.js";
23
- import { getContractEvents as y } from "./index40.js";
24
- import { getEip712Domain as G } from "./index41.js";
25
- import { getFeeHistory as R } from "./index42.js";
26
- import { getFilterChanges as A } from "./index43.js";
27
- import { getFilterLogs as b } from "./index44.js";
28
- import { getGasPrice as l } from "./index45.js";
29
- import { getLogs as L } from "./index46.js";
30
- import { getProof as M } from "./index47.js";
31
- import { getStorageAt as N } from "./index48.js";
32
- import { getTransaction as x } from "./index49.js";
33
- import { getTransactionConfirmations as D } from "./index50.js";
34
- import { getTransactionCount as S } from "./index51.js";
35
- import { getTransactionReceipt as q } from "./index52.js";
36
- import { multicall as H } from "./index53.js";
37
- import { readContract as I } from "./index54.js";
38
- import { simulateBlocks as e } from "./index55.js";
39
- import { simulateCalls as j } from "./index56.js";
40
- import { simulateContract as z } from "./index57.js";
41
- import { uninstallFilter as J } from "./index58.js";
42
- import { verifyMessage as K } from "./index59.js";
43
- import { verifyTypedData as O } from "./index60.js";
44
- import { waitForTransactionReceipt as Q } from "./index61.js";
45
- import { watchBlockNumber as U } from "./index62.js";
46
- import { watchBlocks as V } from "./index63.js";
47
- import { watchContractEvent as W } from "./index64.js";
48
- import { watchEvent as X } from "./index65.js";
49
- import { watchPendingTransactions as Y } from "./index66.js";
50
- import { verifySiweMessage as Z } from "./index67.js";
51
- import { prepareTransactionRequest as _ } from "./index68.js";
52
- import { sendRawTransaction as $ } from "./index69.js";
53
- function _r(t) {
1
+ import { buildRequest as m } from "./index71.js";
2
+ import { uid as e } from "./index12.js";
3
+ function b({ key: n, methods: i, name: t, request: o, retryCount: r = 3, retryDelay: u = 150, timeout: c, type: f }, p) {
4
+ const d = e();
54
5
  return {
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)
6
+ config: {
7
+ key: n,
8
+ methods: i,
9
+ name: t,
10
+ request: o,
11
+ retryCount: r,
12
+ retryDelay: u,
13
+ timeout: c,
14
+ type: f
15
+ },
16
+ request: m(o, { methods: i, retryCount: r, retryDelay: u, uid: d }),
17
+ value: p
109
18
  };
110
19
  }
111
20
  export {
112
- _r as publicActions
21
+ b as createTransport
113
22
  };
@@ -1,7 +1,35 @@
1
- const e = 32, s = 4096, t = 131072, l = 761855;
1
+ import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index171.js";
2
+ import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index160.js";
3
+ import { createCursor as B } from "./index120.js";
4
+ import { size as u } from "./index81.js";
5
+ import { hexToBytes as x } from "./index108.js";
6
+ import { bytesToHex as d } from "./index109.js";
7
+ function S(e) {
8
+ const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
+ if (!o)
10
+ throw new c();
11
+ if (o > y)
12
+ throw new h({
13
+ maxSize: y,
14
+ size: o
15
+ });
16
+ const s = [];
17
+ let n = !0, r = 0;
18
+ for (; n; ) {
19
+ const t = B(new Uint8Array(p));
20
+ let l = 0;
21
+ for (; l < a; ) {
22
+ const b = i.slice(r, r + (f - 1));
23
+ if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
+ t.pushByte(128), n = !1;
25
+ break;
26
+ }
27
+ l++, r += 31;
28
+ }
29
+ s.push(t);
30
+ }
31
+ return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
32
+ }
2
33
  export {
3
- t as bytesPerBlob,
4
- e as bytesPerFieldElement,
5
- s as fieldElementsPerBlob,
6
- l as maxBytesPerTransaction
34
+ S as toBlobs
7
35
  };
@@ -1,11 +1,7 @@
1
- function n(e) {
2
- return {
3
- formatters: void 0,
4
- fees: void 0,
5
- serializers: void 0,
6
- ...e
7
- };
8
- }
1
+ const e = 32, s = 4096, t = 131072, l = 761855;
9
2
  export {
10
- n as defineChain
3
+ t as bytesPerBlob,
4
+ e as bytesPerFieldElement,
5
+ s as fieldElementsPerBlob,
6
+ l as maxBytesPerTransaction
11
7
  };
@@ -1,22 +1,11 @@
1
- import { ChainDoesNotSupportContract as e } from "./index96.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
+ function n(e) {
2
+ return {
3
+ formatters: void 0,
4
+ fees: void 0,
5
+ serializers: void 0,
6
+ ...e
7
+ };
19
8
  }
20
9
  export {
21
- a as getChainContractAddress
10
+ n as defineChain
22
11
  };
@@ -1,34 +1,22 @@
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 { ChainDoesNotSupportContract as e } from "./index97.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;
28
19
  }
29
20
  export {
30
- p as getCache,
31
- i as promiseCache,
32
- c as responseCache,
33
- l as withCache
21
+ a as getChainContractAddress
34
22
  };
@@ -1,23 +1,34 @@
1
- import { wait as w } from "./index175.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
+ 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
+ }
20
28
  }
21
29
  export {
22
- p as withRetry
30
+ p as getCache,
31
+ i as promiseCache,
32
+ c as responseCache,
33
+ l as withCache
23
34
  };
@@ -1,6 +1,23 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
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
+ });
3
20
  }
4
21
  export {
5
- n as wait
22
+ p as withRetry
6
23
  };
@@ -1,20 +1,6 @@
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
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
17
3
  }
18
4
  export {
19
- u as withTimeout
5
+ n as wait
20
6
  };
@@ -1,13 +1,20 @@
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
+ 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
+ });
10
17
  }
11
18
  export {
12
- a as formatUnits
19
+ u as withTimeout
13
20
  };
@@ -1,24 +1,13 @@
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
+ 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}` : ""}`;
21
10
  }
22
11
  export {
23
- r as LruMap
12
+ a as formatUnits
24
13
  };
@@ -1,25 +1,24 @@
1
- import { AbiDecodingZeroDataError as p } from "./index78.js";
2
- import { BaseError as C } from "./index81.js";
3
- import { RawContractError as w, ContractFunctionZeroDataError as g, ContractFunctionRevertedError as l, ContractFunctionExecutionError as D } from "./index84.js";
4
- import { RpcRequestError as F } from "./index12.js";
5
- import { InternalRpcError as O } from "./index95.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
+ 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
+ }
22
21
  }
23
22
  export {
24
- Z as getContractError
23
+ r as LruMap
25
24
  };