@gardenfi/utils 3.1.1-beta.3 → 3.1.1-beta.4

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 (305) hide show
  1. package/dist/index102.cjs +1 -1
  2. package/dist/index102.js +4 -4
  3. package/dist/index104.cjs +1 -1
  4. package/dist/index104.js +3 -3
  5. package/dist/index111.cjs +1 -1
  6. package/dist/index111.js +2 -2
  7. package/dist/index112.cjs +1 -1
  8. package/dist/index112.js +1 -1
  9. package/dist/index113.cjs +1 -1
  10. package/dist/index113.js +1 -1
  11. package/dist/index114.cjs +1 -1
  12. package/dist/index114.js +1 -1
  13. package/dist/index115.cjs +1 -1
  14. package/dist/index115.js +1 -1
  15. package/dist/index132.cjs +1 -1
  16. package/dist/index132.js +5 -5
  17. package/dist/index138.cjs +1 -1
  18. package/dist/index138.js +13 -33
  19. package/dist/index139.cjs +1 -1
  20. package/dist/index139.js +34 -9
  21. package/dist/index140.cjs +1 -1
  22. package/dist/index140.js +55 -60
  23. package/dist/index141.cjs +1 -1
  24. package/dist/index141.js +23 -17
  25. package/dist/index142.cjs +1 -1
  26. package/dist/index142.js +6 -106
  27. package/dist/index143.cjs +1 -1
  28. package/dist/index143.js +18 -78
  29. package/dist/index144.cjs +1 -1
  30. package/dist/index144.js +15 -9
  31. package/dist/index145.cjs +1 -1
  32. package/dist/index145.js +5 -90
  33. package/dist/index146.cjs +1 -2
  34. package/dist/index146.js +14 -3
  35. package/dist/index147.cjs +1 -1
  36. package/dist/index147.js +11 -9
  37. package/dist/index148.cjs +1 -1
  38. package/dist/index148.js +12 -13
  39. package/dist/index149.cjs +1 -1
  40. package/dist/index149.js +11 -4
  41. package/dist/index150.cjs +1 -1
  42. package/dist/index150.js +8 -12
  43. package/dist/index151.cjs +1 -1
  44. package/dist/index151.js +4 -2
  45. package/dist/index152.cjs +1 -1
  46. package/dist/index152.js +17 -32
  47. package/dist/index153.cjs +1 -1
  48. package/dist/index153.js +5 -21
  49. package/dist/index154.cjs +1 -1
  50. package/dist/index154.js +171 -5
  51. package/dist/index155.cjs +1 -1
  52. package/dist/index155.js +103 -5
  53. package/dist/index156.cjs +1 -1
  54. package/dist/index156.js +33 -5
  55. package/dist/index157.cjs +1 -9
  56. package/dist/index157.js +8 -34
  57. package/dist/index158.cjs +1 -1
  58. package/dist/index158.js +61 -3
  59. package/dist/index159.cjs +1 -1
  60. package/dist/index159.js +19 -18
  61. package/dist/index160.cjs +1 -1
  62. package/dist/index160.js +105 -19
  63. package/dist/index161.cjs +1 -1
  64. package/dist/index161.js +70 -27
  65. package/dist/index162.cjs +1 -1
  66. package/dist/index162.js +7 -6
  67. package/dist/index163.cjs +1 -4
  68. package/dist/index163.js +88 -192
  69. package/dist/index164.cjs +2 -1
  70. package/dist/index164.js +3 -28
  71. package/dist/index165.cjs +1 -1
  72. package/dist/index165.js +9 -162
  73. package/dist/index166.cjs +1 -1
  74. package/dist/index166.js +13 -127
  75. package/dist/index167.cjs +1 -1
  76. package/dist/index167.js +4 -27
  77. package/dist/index168.cjs +1 -1
  78. package/dist/index168.js +2 -56
  79. package/dist/index169.cjs +1 -1
  80. package/dist/index169.js +31 -191
  81. package/dist/index170.cjs +1 -1
  82. package/dist/index170.js +22 -4
  83. package/dist/index171.cjs +1 -1
  84. package/dist/index171.js +5 -20
  85. package/dist/index172.cjs +1 -1
  86. package/dist/index172.js +6 -3
  87. package/dist/index173.cjs +1 -1
  88. package/dist/index173.js +5 -16
  89. package/dist/index174.cjs +9 -1
  90. package/dist/index174.js +35 -11
  91. package/dist/index175.cjs +1 -1
  92. package/dist/index175.js +3 -35
  93. package/dist/index176.cjs +1 -1
  94. package/dist/index176.js +19 -3
  95. package/dist/index177.cjs +1 -1
  96. package/dist/index177.js +18 -25
  97. package/dist/index178.cjs +1 -1
  98. package/dist/index178.js +35 -8
  99. package/dist/index179.cjs +1 -1
  100. package/dist/index179.js +6 -23
  101. package/dist/index180.cjs +4 -1
  102. package/dist/index180.js +194 -28
  103. package/dist/index181.cjs +1 -1
  104. package/dist/index181.js +27 -3
  105. package/dist/index182.cjs +1 -1
  106. package/dist/index182.js +161 -6
  107. package/dist/index183.cjs +1 -1
  108. package/dist/index183.js +127 -6
  109. package/dist/index184.cjs +1 -1
  110. package/dist/index184.js +27 -32
  111. package/dist/index185.cjs +1 -1
  112. package/dist/index185.js +192 -5
  113. package/dist/index186.cjs +1 -1
  114. package/dist/index186.js +4 -38
  115. package/dist/index187.cjs +1 -1
  116. package/dist/index187.js +14 -43
  117. package/dist/index188.cjs +1 -1
  118. package/dist/index188.js +3 -33
  119. package/dist/index189.cjs +1 -1
  120. package/dist/index189.js +15 -16
  121. package/dist/index190.cjs +1 -1
  122. package/dist/index190.js +32 -40
  123. package/dist/index191.cjs +1 -1
  124. package/dist/index191.js +3 -105
  125. package/dist/index192.cjs +1 -1
  126. package/dist/index192.js +28 -3
  127. package/dist/index193.cjs +1 -1
  128. package/dist/index193.js +25 -5
  129. package/dist/index194.cjs +1 -1
  130. package/dist/index194.js +28 -3
  131. package/dist/index195.cjs +1 -1
  132. package/dist/index195.js +6 -17
  133. package/dist/index196.cjs +1 -1
  134. package/dist/index196.js +6 -5
  135. package/dist/index197.cjs +1 -1
  136. package/dist/index197.js +32 -8
  137. package/dist/index198.cjs +1 -1
  138. package/dist/index198.js +5 -104
  139. package/dist/index199.cjs +1 -1
  140. package/dist/index199.js +37 -5
  141. package/dist/index200.cjs +1 -1
  142. package/dist/index200.js +49 -6
  143. package/dist/index201.cjs +1 -1
  144. package/dist/index201.js +30 -25
  145. package/dist/index202.cjs +1 -1
  146. package/dist/index202.js +17 -34
  147. package/dist/index203.cjs +1 -1
  148. package/dist/index203.js +42 -13
  149. package/dist/index204.cjs +1 -1
  150. package/dist/index204.js +100 -74
  151. package/dist/index205.cjs +1 -1
  152. package/dist/index205.js +3 -2
  153. package/dist/index206.cjs +1 -1
  154. package/dist/index206.js +4 -17
  155. package/dist/index207.cjs +1 -1
  156. package/dist/index207.js +3 -171
  157. package/dist/index208.cjs +1 -1
  158. package/dist/index208.js +17 -17
  159. package/dist/index209.cjs +1 -1
  160. package/dist/index209.js +8 -10
  161. package/dist/index210.cjs +1 -1
  162. package/dist/index210.js +5 -25
  163. package/dist/index211.cjs +1 -1
  164. package/dist/index211.js +27 -18
  165. package/dist/index212.cjs +1 -1
  166. package/dist/index212.js +78 -15
  167. package/dist/index213.cjs +1 -1
  168. package/dist/index213.js +2 -6
  169. package/dist/index214.cjs +1 -1
  170. package/dist/index214.js +18 -13
  171. package/dist/index215.cjs +1 -1
  172. package/dist/index215.js +17 -10
  173. package/dist/index216.cjs +1 -1
  174. package/dist/index216.js +10 -16
  175. package/dist/index217.cjs +1 -1
  176. package/dist/index217.js +1 -1
  177. package/dist/index22.cjs +1 -1
  178. package/dist/index22.js +8 -8
  179. package/dist/index220.cjs +1 -2
  180. package/dist/index220.js +102 -40
  181. package/dist/index221.cjs +1 -1
  182. package/dist/index221.js +17 -2
  183. package/dist/index222.cjs +1 -1
  184. package/dist/index222.js +214 -5
  185. package/dist/index223.cjs +2 -1
  186. package/dist/index223.js +40 -9
  187. package/dist/index224.cjs +1 -1
  188. package/dist/index224.js +2 -20
  189. package/dist/index225.cjs +1 -1
  190. package/dist/index225.js +5 -8
  191. package/dist/index226.cjs +1 -1
  192. package/dist/index226.js +9 -65
  193. package/dist/index227.cjs +1 -1
  194. package/dist/index227.js +17 -63
  195. package/dist/index228.cjs +1 -1
  196. package/dist/index228.js +8 -188
  197. package/dist/index229.cjs +1 -1
  198. package/dist/index229.js +66 -28
  199. package/dist/index23.cjs +1 -1
  200. package/dist/index23.js +2 -2
  201. package/dist/index230.cjs +1 -1
  202. package/dist/index230.js +61 -72
  203. package/dist/index231.cjs +1 -1
  204. package/dist/index231.js +183 -35
  205. package/dist/index232.cjs +1 -1
  206. package/dist/index232.js +21 -9
  207. package/dist/index233.cjs +1 -1
  208. package/dist/index233.js +70 -7
  209. package/dist/index234.cjs +1 -1
  210. package/dist/index234.js +40 -11
  211. package/dist/index235.cjs +1 -1
  212. package/dist/index235.js +16 -12
  213. package/dist/index236.cjs +1 -1
  214. package/dist/index236.js +12 -18
  215. package/dist/index237.cjs +1 -1
  216. package/dist/index237.js +1 -1
  217. package/dist/index238.cjs +1 -1
  218. package/dist/index238.js +206 -6
  219. package/dist/index239.cjs +1 -1
  220. package/dist/index239.js +43 -7
  221. package/dist/index24.cjs +1 -1
  222. package/dist/index24.js +4 -4
  223. package/dist/index240.cjs +1 -1
  224. package/dist/index240.js +72 -97
  225. package/dist/index241.cjs +1 -1
  226. package/dist/index241.js +2 -27
  227. package/dist/index242.cjs +1 -1
  228. package/dist/index242.js +11 -16
  229. package/dist/index243.cjs +1 -1
  230. package/dist/index243.js +10 -212
  231. package/dist/index244.cjs +1 -1
  232. package/dist/index244.js +18 -10
  233. package/dist/index245.cjs +1 -1
  234. package/dist/index245.js +6 -19
  235. package/dist/index246.cjs +1 -1
  236. package/dist/index246.js +6 -206
  237. package/dist/index247.cjs +1 -1
  238. package/dist/index247.js +25 -41
  239. package/dist/index248.cjs +1 -1
  240. package/dist/index248.js +10 -77
  241. package/dist/index249.cjs +1 -1
  242. package/dist/index249.js +20 -2
  243. package/dist/index25.cjs +1 -1
  244. package/dist/index25.js +2 -2
  245. package/dist/index252.cjs +1 -1
  246. package/dist/index252.js +657 -68
  247. package/dist/index253.cjs +1 -1
  248. package/dist/index253.js +154 -634
  249. package/dist/index254.cjs +1 -1
  250. package/dist/index254.js +67 -176
  251. package/dist/index26.cjs +1 -1
  252. package/dist/index26.js +1 -1
  253. package/dist/index30.cjs +1 -1
  254. package/dist/index30.js +6 -6
  255. package/dist/index35.cjs +1 -1
  256. package/dist/index35.js +1 -1
  257. package/dist/index37.cjs +1 -1
  258. package/dist/index37.js +8 -8
  259. package/dist/index38.cjs +1 -1
  260. package/dist/index38.js +1 -1
  261. package/dist/index39.cjs +1 -1
  262. package/dist/index39.js +1 -1
  263. package/dist/index40.cjs +1 -1
  264. package/dist/index40.js +2 -2
  265. package/dist/index42.cjs +1 -1
  266. package/dist/index42.js +2 -2
  267. package/dist/index43.cjs +1 -1
  268. package/dist/index43.js +1 -1
  269. package/dist/index47.cjs +1 -1
  270. package/dist/index47.js +4 -4
  271. package/dist/index48.cjs +1 -1
  272. package/dist/index48.js +3 -3
  273. package/dist/index49.cjs +1 -1
  274. package/dist/index49.js +3 -3
  275. package/dist/index51.cjs +1 -1
  276. package/dist/index51.js +6 -6
  277. package/dist/index54.cjs +1 -1
  278. package/dist/index54.js +1 -1
  279. package/dist/index58.cjs +1 -1
  280. package/dist/index58.js +1 -1
  281. package/dist/index62.cjs +1 -1
  282. package/dist/index62.js +2 -2
  283. package/dist/index63.cjs +1 -1
  284. package/dist/index63.js +2 -2
  285. package/dist/index65.cjs +1 -1
  286. package/dist/index65.js +2 -2
  287. package/dist/index67.cjs +1 -1
  288. package/dist/index67.js +1 -1
  289. package/dist/index75.cjs +1 -1
  290. package/dist/index75.js +4 -4
  291. package/dist/index78.cjs +1 -1
  292. package/dist/index78.js +3 -3
  293. package/dist/index81.cjs +1 -1
  294. package/dist/index81.js +2 -2
  295. package/dist/index90.cjs +1 -1
  296. package/dist/index90.js +1 -1
  297. package/dist/index93.cjs +1 -1
  298. package/dist/index93.js +1 -1
  299. package/dist/index95.cjs +1 -1
  300. package/dist/index95.js +2 -2
  301. package/dist/index96.cjs +1 -1
  302. package/dist/index96.js +1 -1
  303. package/dist/index97.cjs +1 -1
  304. package/dist/index97.js +5 -5
  305. package/package.json +1 -1
package/dist/index102.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index150.cjs"),f=require("./index168.cjs"),a=require("./index178.cjs"),l=require("./index116.cjs"),A=require("./index174.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c),"bytes"),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index148.cjs"),f=require("./index140.cjs"),a=require("./index150.cjs"),l=require("./index116.cjs"),A=require("./index149.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c),"bytes"),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
package/dist/index102.js CHANGED
@@ -1,8 +1,8 @@
1
- import { InvalidAddressError as c } from "./index150.js";
2
- import { stringToBytes as m } from "./index168.js";
3
- import { keccak256 as p } from "./index178.js";
1
+ import { InvalidAddressError as c } from "./index148.js";
2
+ import { stringToBytes as m } from "./index140.js";
3
+ import { keccak256 as p } from "./index150.js";
4
4
  import { LruMap as u } from "./index116.js";
5
- import { isAddress as $ } from "./index174.js";
5
+ import { isAddress as $ } from "./index149.js";
6
6
  const s = /* @__PURE__ */ new u(8192);
7
7
  function h(t, o) {
8
8
  if (s.has(`${t}.${o}`))
package/dist/index104.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index159.cjs"),O=require("./index181.cjs"),n=require("./index149.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index176.cjs"),O=require("./index151.cjs"),n=require("./index167.cjs");function p(i,e,s,{strict:f}={}){return O.isHex(i,{strict:!1})?l(i,e,s,{strict:f}):u(i,e,s,{strict:f})}function r(i,e){if(typeof e=="number"&&e>0&&e>n.size(i)-1)throw new t.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:n.size(i)})}function c(i,e,s){if(typeof e=="number"&&typeof s=="number"&&n.size(i)!==s-e)throw new t.SliceOffsetOutOfBoundsError({offset:s,position:"end",size:n.size(i)})}function u(i,e,s,{strict:f}={}){r(i,e);const o=i.slice(e,s);return f&&c(o,e,s),o}function l(i,e,s,{strict:f}={}){r(i,e);const o=`0x${i.replace("0x","").slice((e??0)*2,(s??i.length)*2)}`;return f&&c(o,e,s),o}exports.slice=p;exports.sliceBytes=u;exports.sliceHex=l;
package/dist/index104.js CHANGED
@@ -1,6 +1,6 @@
1
- import { SliceOffsetOutOfBoundsError as t } from "./index159.js";
2
- import { isHex as p } from "./index181.js";
3
- import { size as r } from "./index149.js";
1
+ import { SliceOffsetOutOfBoundsError as t } from "./index176.js";
2
+ import { isHex as p } from "./index151.js";
3
+ import { size as r } from "./index167.js";
4
4
  function w(e, f, i, { strict: o } = {}) {
5
5
  return p(e, { strict: !1 }) ? u(e, f, i, {
6
6
  strict: o
package/dist/index111.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index150.cjs"),d=require("./index174.cjs");function t(s,r){if(!d.isAddress(s,{strict:!1}))throw new e.InvalidAddressError({address:s});if(!d.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});return s.toLowerCase()===r.toLowerCase()}exports.isAddressEqual=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index148.cjs"),d=require("./index149.cjs");function t(s,r){if(!d.isAddress(s,{strict:!1}))throw new e.InvalidAddressError({address:s});if(!d.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});return s.toLowerCase()===r.toLowerCase()}exports.isAddressEqual=t;
package/dist/index111.js CHANGED
@@ -1,5 +1,5 @@
1
- import { InvalidAddressError as e } from "./index150.js";
2
- import { isAddress as o } from "./index174.js";
1
+ import { InvalidAddressError as e } from "./index148.js";
2
+ import { isAddress as o } from "./index149.js";
3
3
  function i(r, s) {
4
4
  if (!o(r, { strict: !1 }))
5
5
  throw new e({ address: r });
package/dist/index112.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index168.cjs"),l=require("./index42.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index140.cjs"),l=require("./index42.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
package/dist/index112.js CHANGED
@@ -1,4 +1,4 @@
1
- import { hexToBytes as i } from "./index168.js";
1
+ import { hexToBytes as i } from "./index140.js";
2
2
  import { bytesToHex as f } from "./index42.js";
3
3
  function y(o) {
4
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 = [];
package/dist/index113.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index168.cjs"),y=require("./index42.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index140.cjs"),y=require("./index42.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;
package/dist/index113.js CHANGED
@@ -1,4 +1,4 @@
1
- import { hexToBytes as b } from "./index168.js";
1
+ import { hexToBytes as b } from "./index140.js";
2
2
  import { bytesToHex as y } from "./index42.js";
3
3
  function h(t) {
4
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 = [];
package/dist/index114.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index182.cjs");function c(o){const{commitments:e,version:s}=o,n=o.to??(typeof e[0]=="string"?"hex":"bytes"),t=[];for(const m of e)t.push(i.commitmentToVersionedHash({commitment:m,to:n,version:s}));return t}exports.commitmentsToVersionedHashes=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index195.cjs");function c(o){const{commitments:e,version:s}=o,n=o.to??(typeof e[0]=="string"?"hex":"bytes"),t=[];for(const m of e)t.push(i.commitmentToVersionedHash({commitment:m,to:n,version:s}));return t}exports.commitmentsToVersionedHashes=c;
package/dist/index114.js CHANGED
@@ -1,4 +1,4 @@
1
- import { commitmentToVersionedHash as i } from "./index182.js";
1
+ import { commitmentToVersionedHash as i } from "./index195.js";
2
2
  function r(o) {
3
3
  const { commitments: t, version: n } = o, e = o.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), s = [];
4
4
  for (const m of t)
package/dist/index115.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index112.cjs"),m=require("./index113.cjs"),u=require("./index184.cjs");function f(t){const{data:i,kzg:n,to:b}=t,s=t.blobs??u.toBlobs({data:i,to:b}),e=t.commitments??r.blobsToCommitments({blobs:s,kzg:n,to:b}),l=t.proofs??m.blobsToProofs({blobs:s,commitments:e,kzg:n,to:b}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:e[o],proof:l[o]});return c}exports.toBlobSidecars=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index112.cjs"),m=require("./index113.cjs"),u=require("./index197.cjs");function f(t){const{data:i,kzg:n,to:b}=t,s=t.blobs??u.toBlobs({data:i,to:b}),e=t.commitments??r.blobsToCommitments({blobs:s,kzg:n,to:b}),l=t.proofs??m.blobsToProofs({blobs:s,commitments:e,kzg:n,to:b}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:e[o],proof:l[o]});return c}exports.toBlobSidecars=f;
package/dist/index115.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { blobsToCommitments as f } from "./index112.js";
2
2
  import { blobsToProofs as l } from "./index113.js";
3
- import { toBlobs as p } from "./index184.js";
3
+ import { toBlobs as p } from "./index197.js";
4
4
  function k(t) {
5
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
6
  for (let o = 0; o < s.length; o++)
package/dist/index132.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index95.cjs"),E=require("./index150.cjs"),b=require("./index164.cjs"),z=require("./index174.cjs"),d=require("./index149.cjs"),T=require("./index42.cjs"),h=require("./index176.cjs"),w=require("./index91.cjs");function P(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(g,l)=>{const s={...l};for(const r of g){const{name:o,type:f}=r;f==="address"&&(s[o]=s[o].toLowerCase())}return s},u=t.EIP712Domain?i?a(t.EIP712Domain,i):{}:{},p=(()=>{if(n!=="EIP712Domain")return a(t[n],y)})();return w.stringify({domain:u,message:p,primaryType:n,types:t})}function q(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(u,p)=>{for(const g of u){const{name:l,type:s}=g,r=p[l],o=s.match(h.integerRegex);if(o&&(typeof r=="number"||typeof r=="bigint")){const[D,c,v]=o;T.numberToHex(r,{signed:c==="int",size:Number.parseInt(v,10)/8})}if(s==="address"&&typeof r=="string"&&!z.isAddress(r))throw new E.InvalidAddressError({address:r});const f=s.match(h.bytesRegex);if(f){const[D,c]=f;if(c&&d.size(r)!==Number.parseInt(c,10))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(c,10),givenSize:d.size(r)})}const I=t[s];I&&(S(s),a(I,r))}};if(t.EIP712Domain&&i){if(typeof i!="object")throw new b.InvalidDomainError({domain:i});a(t.EIP712Domain,i)}if(n!=="EIP712Domain")if(t[n])a(t[n],y);else throw new b.InvalidPrimaryTypeError({primaryType:n,types:t})}function x({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function S(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new b.InvalidStructTypeError({type:e})}exports.getTypesForEIP712Domain=x;exports.serializeTypedData=P;exports.validateTypedData=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index95.cjs"),E=require("./index148.cjs"),b=require("./index181.cjs"),z=require("./index149.cjs"),d=require("./index167.cjs"),T=require("./index42.cjs"),h=require("./index191.cjs"),w=require("./index91.cjs");function P(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(g,l)=>{const s={...l};for(const r of g){const{name:o,type:f}=r;f==="address"&&(s[o]=s[o].toLowerCase())}return s},u=t.EIP712Domain?i?a(t.EIP712Domain,i):{}:{},p=(()=>{if(n!=="EIP712Domain")return a(t[n],y)})();return w.stringify({domain:u,message:p,primaryType:n,types:t})}function q(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(u,p)=>{for(const g of u){const{name:l,type:s}=g,r=p[l],o=s.match(h.integerRegex);if(o&&(typeof r=="number"||typeof r=="bigint")){const[D,c,v]=o;T.numberToHex(r,{signed:c==="int",size:Number.parseInt(v,10)/8})}if(s==="address"&&typeof r=="string"&&!z.isAddress(r))throw new E.InvalidAddressError({address:r});const f=s.match(h.bytesRegex);if(f){const[D,c]=f;if(c&&d.size(r)!==Number.parseInt(c,10))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(c,10),givenSize:d.size(r)})}const I=t[s];I&&(S(s),a(I,r))}};if(t.EIP712Domain&&i){if(typeof i!="object")throw new b.InvalidDomainError({domain:i});a(t.EIP712Domain,i)}if(n!=="EIP712Domain")if(t[n])a(t[n],y);else throw new b.InvalidPrimaryTypeError({primaryType:n,types:t})}function x({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function S(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new b.InvalidStructTypeError({type:e})}exports.getTypesForEIP712Domain=x;exports.serializeTypedData=P;exports.validateTypedData=q;
package/dist/index132.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { BytesSizeMismatchError as v } from "./index95.js";
2
- import { InvalidAddressError as D } from "./index150.js";
3
- import { InvalidDomainError as E, InvalidPrimaryTypeError as w, InvalidStructTypeError as z } from "./index164.js";
4
- import { isAddress as P } from "./index174.js";
5
- import { size as h } from "./index149.js";
2
+ import { InvalidAddressError as D } from "./index148.js";
3
+ import { InvalidDomainError as E, InvalidPrimaryTypeError as w, InvalidStructTypeError as z } from "./index181.js";
4
+ import { isAddress as P } from "./index149.js";
5
+ import { size as h } from "./index167.js";
6
6
  import { numberToHex as T } from "./index42.js";
7
- import { integerRegex as d, bytesRegex as _ } from "./index176.js";
7
+ import { integerRegex as d, bytesRegex as _ } from "./index191.js";
8
8
  import { stringify as x } from "./index91.js";
9
9
  function F(e) {
10
10
  const { domain: i, message: p, primaryType: n, types: t } = e, o = (u, g) => {
package/dist/index138.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index32.cjs"),j=require("./index139.cjs");function q(n){const{batch:a,chain:e,ccipRead:d,key:b="base",name:f="Base Client",type:g="base"}=n,o=n.experimental_blockTag??(typeof(e==null?void 0:e.experimental_preconfirmationTime)=="number"?"pending":void 0),m=(e==null?void 0:e.blockTime)??12e3,p=Math.min(Math.max(Math.floor(m/2),500),4e3),t=n.pollingInterval??p,x=n.cacheTime??t,i=n.account?h.parseAccount(n.account):void 0,{config:T,request:k,value:y}=n.transport({account:i,chain:e,pollingInterval:t}),v={...T,...y},c={account:i,batch:a,cacheTime:x,ccipRead:d,chain:e,key:b,name:f,pollingInterval:t,request:k,transport:v,type:g,uid:j.uid(),...o?{experimental_blockTag:o}:{}};function l(u){return _=>{const r=_(u);for(const M in c)delete r[M];const s={...u,...r};return Object.assign(s,{extend:l(s)})}}return Object.assign(c,{extend:l(c)})}exports.createClient=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index139.cjs"),n=require("./index65.cjs"),a=require("./index140.cjs");function g({r:i,s:o,to:u="hex",v:e,yParity:r}){const s=(()=>{if(r===0||r===1)return r;if(e&&(e===27n||e===28n||e>=35n))return e%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),t=`0x${new c.secp256k1.Signature(n.hexToBigInt(i),n.hexToBigInt(o)).toCompactHex()}${s===0?"1b":"1c"}`;return u==="hex"?t:a.hexToBytes(t)}exports.serializeSignature=g;
package/dist/index138.js CHANGED
@@ -1,36 +1,16 @@
1
- import { parseAccount as I } from "./index32.js";
2
- import { uid as M } from "./index139.js";
3
- function O(e) {
4
- const { batch: a, chain: n, ccipRead: d, key: f = "base", name: m = "Base Client", type: b = "base" } = e, c = e.experimental_blockTag ?? (typeof (n == null ? void 0 : n.experimental_preconfirmationTime) == "number" ? "pending" : void 0), p = (n == null ? void 0 : n.blockTime) ?? 12e3, g = Math.min(Math.max(Math.floor(p / 2), 500), 4e3), t = e.pollingInterval ?? g, x = e.cacheTime ?? t, i = e.account ? I(e.account) : void 0, { config: T, request: k, value: _ } = e.transport({
5
- account: i,
6
- chain: n,
7
- pollingInterval: t
8
- }), v = { ...T, ..._ }, o = {
9
- account: i,
10
- batch: a,
11
- cacheTime: x,
12
- ccipRead: d,
13
- chain: n,
14
- key: f,
15
- name: m,
16
- pollingInterval: t,
17
- request: k,
18
- transport: v,
19
- type: b,
20
- uid: M(),
21
- ...c ? { experimental_blockTag: c } : {}
22
- };
23
- function l(r) {
24
- return (y) => {
25
- const s = y(r);
26
- for (const h in o)
27
- delete s[h];
28
- const u = { ...r, ...s };
29
- return Object.assign(u, { extend: l(u) });
30
- };
31
- }
32
- return Object.assign(o, { extend: l(o) });
1
+ import { secp256k1 as f } from "./index139.js";
2
+ import { hexToBigInt as t } from "./index65.js";
3
+ import { hexToBytes as m } from "./index140.js";
4
+ function s({ r: o, s: i, to: u = "hex", v: r, yParity: e }) {
5
+ const a = (() => {
6
+ if (e === 0 || e === 1)
7
+ return e;
8
+ if (r && (r === 27n || r === 28n || r >= 35n))
9
+ return r % 2n === 0n ? 1 : 0;
10
+ throw new Error("Invalid `v` or `yParity` value");
11
+ })(), n = `0x${new f.Signature(t(o), t(i)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
12
+ return u === "hex" ? n : m(n);
33
13
  }
34
14
  export {
35
- O as createClient
15
+ s as serializeSignature
36
16
  };
package/dist/index139.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=256;let t=i,e;function u(r=11){if(!e||t+r>i*2){e="",t=0;for(let n=0;n<i;n++)e+=(256+Math.random()*256|0).toString(16).substring(1)}return e.substring(t,t+++r)}exports.uid=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index220.cjs"),C=require("./index221.cjs"),n=require("./index222.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
package/dist/index139.js CHANGED
@@ -1,12 +1,37 @@
1
- let i = 256, t;
2
- function s(e = 11) {
3
- if (!t || i + e > 256 * 2) {
4
- t = "", i = 0;
5
- for (let r = 0; r < 256; r++)
6
- t += (256 + Math.random() * 256 | 0).toString(16).substring(1);
7
- }
8
- return t.substring(i, i++ + e);
1
+ import { sha256 as C } from "./index220.js";
2
+ import { createCurve as G } from "./index221.js";
3
+ import { Field as N, mod as k, pow2 as t } from "./index222.js";
4
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
+ const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), M = BigInt(0), O = BigInt(1), _ = BigInt(2), h = (n, f) => (n + f / _) / f;
6
+ function W(n) {
7
+ const f = q, e = BigInt(3), r = BigInt(6), B = BigInt(11), a = BigInt(22), s = BigInt(23), i = BigInt(44), g = BigInt(88), o = n * n * n % f, c = o * o * n % f, d = t(c, e, f) * c % f, b = t(d, e, f) * c % f, m = t(b, _, f) * o % f, I = t(m, B, f) * m % f, p = t(I, a, f) * I % f, x = t(p, i, f) * p % f, E = t(x, g, f) * x % f, F = t(E, i, f) * p % f, P = t(F, e, f) * c % f, S = t(P, s, f) * I % f, v = t(S, r, f) * o % f, u = t(v, _, f);
8
+ if (!l.eql(l.sqr(u), n))
9
+ throw new Error("Cannot find square root");
10
+ return u;
9
11
  }
12
+ const l = N(q, void 0, void 0, { sqrt: W }), D = G({
13
+ a: M,
14
+ b: BigInt(7),
15
+ Fp: l,
16
+ n: w,
17
+ Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
18
+ Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
19
+ h: BigInt(1),
20
+ lowS: !0,
21
+ // Allow only low-S signatures by default in sign() and verify()
22
+ endo: {
23
+ // Endomorphism, see above
24
+ beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
25
+ splitScalar: (n) => {
26
+ const f = w, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -O * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), B = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), a = e, s = BigInt("0x100000000000000000000000000000000"), i = h(a * n, f), g = h(-r * n, f);
27
+ let o = k(n - i * e - g * B, f), c = k(-i * r - g * a, f);
28
+ const d = o > s, b = c > s;
29
+ if (d && (o = f - o), b && (c = f - c), o > s || c > s)
30
+ throw new Error("splitScalar: Endomorphism failed, k=" + n);
31
+ return { k1neg: d, k1: o, k2neg: b, k2: c };
32
+ }
33
+ }
34
+ }, C);
10
35
  export {
11
- s as uid
36
+ D as secp256k1
12
37
  };
package/dist/index140.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index66.cjs"),a=require("./index69.cjs"),t=require("./index98.cjs"),n=require("./index99.cjs"),i=require("./index101.cjs"),o=require("./index103.cjs"),u=require("./index107.cjs"),c=require("./index108.cjs"),d=require("./index109.cjs"),q=require("./index64.cjs"),C=require("./index118.cjs"),g=require("./index119.cjs"),w=require("./index106.cjs"),T=require("./index121.cjs"),h=require("./index123.cjs"),S=require("./index124.cjs"),l=require("./index100.cjs"),p=require("./index126.cjs"),y=require("./index127.cjs"),A=require("./index128.cjs"),R=require("./index129.cjs"),m=require("./index130.cjs"),P=require("./index131.cjs"),z=require("./index133.cjs"),b=require("./index122.cjs"),f=require("./index135.cjs"),M=require("./index136.cjs"),D=require("./index137.cjs");function F(e){return{addChain:s=>t.addChain(e,s),deployContract:s=>n.deployContract(e,s),fillTransaction:s=>r.fillTransaction(e,s),getAddresses:()=>i.getAddresses(e),getCallsStatus:s=>o.getCallsStatus(e,s),getCapabilities:s=>u.getCapabilities(e,s),getChainId:()=>a.getChainId(e),getPermissions:()=>c.getPermissions(e),prepareAuthorization:s=>d.prepareAuthorization(e,s),prepareTransactionRequest:s=>q.prepareTransactionRequest(e,s),requestAddresses:()=>C.requestAddresses(e),requestPermissions:s=>g.requestPermissions(e,s),sendCalls:s=>w.sendCalls(e,s),sendCallsSync:s=>T.sendCallsSync(e,s),sendRawTransaction:s=>h.sendRawTransaction(e,s),sendRawTransactionSync:s=>S.sendRawTransactionSync(e,s),sendTransaction:s=>l.sendTransaction(e,s),sendTransactionSync:s=>p.sendTransactionSync(e,s),showCallsStatus:s=>y.showCallsStatus(e,s),signAuthorization:s=>A.signAuthorization(e,s),signMessage:s=>R.signMessage(e,s),signTransaction:s=>m.signTransaction(e,s),signTypedData:s=>P.signTypedData(e,s),switchChain:s=>z.switchChain(e,s),waitForCallsStatus:s=>b.waitForCallsStatus(e,s),watchAsset:s=>f.watchAsset(e,s),writeContract:s=>M.writeContract(e,s),writeContractSync:s=>D.writeContractSync(e,s)}}exports.walletActions=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index35.cjs"),l=require("./index151.cjs"),u=require("./index190.cjs"),f=require("./index65.cjs"),m=require("./index42.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
package/dist/index140.js CHANGED
@@ -1,63 +1,58 @@
1
- import { fillTransaction as s } from "./index66.js";
2
- import { getChainId as a } from "./index69.js";
3
- import { addChain as t } from "./index98.js";
4
- import { deployContract as i } from "./index99.js";
5
- import { getAddresses as m } from "./index101.js";
6
- import { getCallsStatus as n } from "./index103.js";
7
- import { getCapabilities as e } from "./index107.js";
8
- import { getPermissions as p } from "./index108.js";
9
- import { prepareAuthorization as f } from "./index109.js";
10
- import { prepareTransactionRequest as d } from "./index64.js";
11
- import { requestAddresses as C } from "./index118.js";
12
- import { requestPermissions as g } from "./index119.js";
13
- import { sendCalls as u } from "./index106.js";
14
- import { sendCallsSync as w } from "./index121.js";
15
- import { sendRawTransaction as h } from "./index123.js";
16
- import { sendRawTransactionSync as T } from "./index124.js";
17
- import { sendTransaction as S } from "./index100.js";
18
- import { sendTransactionSync as y } from "./index126.js";
19
- import { showCallsStatus as A } from "./index127.js";
20
- import { signAuthorization as c } from "./index128.js";
21
- import { signMessage as q } from "./index129.js";
22
- import { signTransaction as R } from "./index130.js";
23
- import { signTypedData as z } from "./index131.js";
24
- import { switchChain as P } from "./index133.js";
25
- import { waitForCallsStatus as l } from "./index122.js";
26
- import { watchAsset as b } from "./index135.js";
27
- import { writeContract as D } from "./index136.js";
28
- import { writeContractSync as F } from "./index137.js";
29
- function tr(o) {
30
- return {
31
- addChain: (r) => t(o, r),
32
- deployContract: (r) => i(o, r),
33
- fillTransaction: (r) => s(o, r),
34
- getAddresses: () => m(o),
35
- getCallsStatus: (r) => n(o, r),
36
- getCapabilities: (r) => e(o, r),
37
- getChainId: () => a(o),
38
- getPermissions: () => p(o),
39
- prepareAuthorization: (r) => f(o, r),
40
- prepareTransactionRequest: (r) => d(o, r),
41
- requestAddresses: () => C(o),
42
- requestPermissions: (r) => g(o, r),
43
- sendCalls: (r) => u(o, r),
44
- sendCallsSync: (r) => w(o, r),
45
- sendRawTransaction: (r) => h(o, r),
46
- sendRawTransactionSync: (r) => T(o, r),
47
- sendTransaction: (r) => S(o, r),
48
- sendTransactionSync: (r) => y(o, r),
49
- showCallsStatus: (r) => A(o, r),
50
- signAuthorization: (r) => c(o, r),
51
- signMessage: (r) => q(o, r),
52
- signTransaction: (r) => R(o, r),
53
- signTypedData: (r) => z(o, r),
54
- switchChain: (r) => P(o, r),
55
- waitForCallsStatus: (r) => l(o, r),
56
- watchAsset: (r) => b(o, r),
57
- writeContract: (r) => D(o, r),
58
- writeContractSync: (r) => F(o, r)
59
- };
1
+ import { BaseError as g } from "./index35.js";
2
+ import { isHex as x } from "./index151.js";
3
+ import { pad as s } from "./index190.js";
4
+ import { assertSize as u } from "./index65.js";
5
+ import { numberToHex as h } from "./index42.js";
6
+ const A = /* @__PURE__ */ new TextEncoder();
7
+ function F(e, n = {}) {
8
+ return typeof e == "number" || typeof e == "bigint" ? T(e, n) : typeof e == "boolean" ? B(e, n) : x(e) ? y(e, n) : l(e, n);
9
+ }
10
+ function B(e, n = {}) {
11
+ const r = new Uint8Array(1);
12
+ return r[0] = Number(e), typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { size: n.size })) : r;
13
+ }
14
+ const t = {
15
+ zero: 48,
16
+ nine: 57,
17
+ A: 65,
18
+ F: 70,
19
+ a: 97,
20
+ f: 102
21
+ };
22
+ function m(e) {
23
+ if (e >= t.zero && e <= t.nine)
24
+ return e - t.zero;
25
+ if (e >= t.A && e <= t.F)
26
+ return e - (t.A - 10);
27
+ if (e >= t.a && e <= t.f)
28
+ return e - (t.a - 10);
29
+ }
30
+ function y(e, n = {}) {
31
+ let r = e;
32
+ n.size && (u(r, { size: n.size }), r = s(r, { dir: "right", size: n.size }));
33
+ let i = r.slice(2);
34
+ i.length % 2 && (i = `0${i}`);
35
+ const z = i.length / 2, d = new Uint8Array(z);
36
+ for (let f = 0, o = 0; f < z; f++) {
37
+ const b = m(i.charCodeAt(o++)), c = m(i.charCodeAt(o++));
38
+ if (b === void 0 || c === void 0)
39
+ throw new g(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
40
+ d[f] = b * 16 + c;
41
+ }
42
+ return d;
43
+ }
44
+ function T(e, n) {
45
+ const r = h(e, n);
46
+ return y(r);
47
+ }
48
+ function l(e, n = {}) {
49
+ const r = A.encode(e);
50
+ return typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { dir: "right", size: n.size })) : r;
60
51
  }
61
52
  export {
62
- tr as walletActions
53
+ B as boolToBytes,
54
+ y as hexToBytes,
55
+ T as numberToBytes,
56
+ l as stringToBytes,
57
+ F as toBytes
63
58
  };
package/dist/index141.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index142.cjs"),b=require("./index139.cjs");function l({key:r,methods:e,name:n,request:u,retryCount:i=3,retryDelay:t=150,timeout:c,type:o},s){const d=b.uid();return{config:{key:r,methods:e,name:n,request:u,retryCount:i,retryDelay:t,timeout:c,type:o},request:a.buildRequest(u,{methods:e,retryCount:i,retryDelay:t,uid:d}),value:s}}exports.createTransport=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index148.cjs"),t=require("./index149.cjs");function i(s){if(typeof s=="string"){if(!t.isAddress(s,{strict:!1}))throw new n.InvalidAddressError({address:s});return{address:s,type:"json-rpc"}}if(!t.isAddress(s.address,{strict:!1}))throw new n.InvalidAddressError({address:s.address});return{address:s.address,nonceManager:s.nonceManager,sign:s.sign,signAuthorization:s.signAuthorization,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData,source:"custom",type:"local"}}exports.toAccount=i;
package/dist/index141.js CHANGED
@@ -1,22 +1,28 @@
1
- import { buildRequest as m } from "./index142.js";
2
- import { uid as e } from "./index139.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();
1
+ import { InvalidAddressError as s } from "./index148.js";
2
+ import { isAddress as a } from "./index149.js";
3
+ function r(n) {
4
+ if (typeof n == "string") {
5
+ if (!a(n, { strict: !1 }))
6
+ throw new s({ address: n });
7
+ return {
8
+ address: n,
9
+ type: "json-rpc"
10
+ };
11
+ }
12
+ if (!a(n.address, { strict: !1 }))
13
+ throw new s({ address: n.address });
5
14
  return {
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
15
+ address: n.address,
16
+ nonceManager: n.nonceManager,
17
+ sign: n.sign,
18
+ signAuthorization: n.signAuthorization,
19
+ signMessage: n.signMessage,
20
+ signTransaction: n.signTransaction,
21
+ signTypedData: n.signTypedData,
22
+ source: "custom",
23
+ type: "local"
18
24
  };
19
25
  }
20
26
  export {
21
- b as createTransport
27
+ r as toAccount
22
28
  };
package/dist/index142.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index35.cjs"),p=require("./index143.cjs"),e=require("./index96.cjs"),I=require("./index42.cjs"),q=require("./index234.cjs"),m=require("./index90.cjs"),v=require("./index91.cjs");function N(t,E={}){return async(c,h={})=>{var i;const{dedupe:s=!1,methods:o,retryDelay:R=150,retryCount:l=3,uid:f}={...E,...h},{method:d}=c;if((i=o==null?void 0:o.exclude)!=null&&i.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});const y=s?I.stringToHex(`${f}.${v.stringify(c)}`):void 0;return q.withDedupe(()=>m.withRetry(async()=>{try{return await t(c)}catch(n){const r=n;switch(r.code){case e.ParseRpcError.code:throw new e.ParseRpcError(r);case e.InvalidRequestRpcError.code:throw new e.InvalidRequestRpcError(r);case e.MethodNotFoundRpcError.code:throw new e.MethodNotFoundRpcError(r,{method:c.method});case e.InvalidParamsRpcError.code:throw new e.InvalidParamsRpcError(r);case e.InternalRpcError.code:throw new e.InternalRpcError(r);case e.InvalidInputRpcError.code:throw new e.InvalidInputRpcError(r);case e.ResourceNotFoundRpcError.code:throw new e.ResourceNotFoundRpcError(r);case e.ResourceUnavailableRpcError.code:throw new e.ResourceUnavailableRpcError(r);case e.TransactionRejectedRpcError.code:throw new e.TransactionRejectedRpcError(r);case e.MethodNotSupportedRpcError.code:throw new e.MethodNotSupportedRpcError(r,{method:c.method});case e.LimitExceededRpcError.code:throw new e.LimitExceededRpcError(r);case e.JsonRpcVersionUnsupportedError.code:throw new e.JsonRpcVersionUnsupportedError(r);case e.UserRejectedRequestError.code:throw new e.UserRejectedRequestError(r);case e.UnauthorizedProviderError.code:throw new e.UnauthorizedProviderError(r);case e.UnsupportedProviderMethodError.code:throw new e.UnsupportedProviderMethodError(r);case e.ProviderDisconnectedError.code:throw new e.ProviderDisconnectedError(r);case e.ChainDisconnectedError.code:throw new e.ChainDisconnectedError(r);case e.SwitchChainError.code:throw new e.SwitchChainError(r);case e.UnsupportedNonOptionalCapabilityError.code:throw new e.UnsupportedNonOptionalCapabilityError(r);case e.UnsupportedChainIdError.code:throw new e.UnsupportedChainIdError(r);case e.DuplicateIdError.code:throw new e.DuplicateIdError(r);case e.UnknownBundleIdError.code:throw new e.UnknownBundleIdError(r);case e.BundleTooLargeError.code:throw new e.BundleTooLargeError(r);case e.AtomicReadyWalletRejectedUpgradeError.code:throw new e.AtomicReadyWalletRejectedUpgradeError(r);case e.AtomicityNotSupportedError.code:throw new e.AtomicityNotSupportedError(r);case 5e3:throw new e.UserRejectedRequestError(r);default:throw n instanceof U.BaseError?n:new e.UnknownRpcError(r)}}},{delay:({count:n,error:r})=>{var a;if(r&&r instanceof p.HttpRequestError){const u=(a=r==null?void 0:r.headers)==null?void 0:a.get("Retry-After");if(u!=null&&u.match(/\d/))return Number.parseInt(u,10)*1e3}return~~(1<<n)*R},retryCount:l,shouldRetry:({error:n})=>w(n)}),{enabled:s,id:y})}}function w(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===e.LimitExceededRpcError.code||t.code===e.InternalRpcError.code:t instanceof p.HttpRequestError&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}exports.buildRequest=N;exports.shouldRetry=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index102.cjs"),c=require("./index150.cjs");function t(e){const s=c.keccak256(`0x${e.substring(4)}`).substring(26);return r.checksumAddress(`0x${s}`)}exports.publicKeyToAddress=t;
package/dist/index142.js CHANGED
@@ -1,109 +1,9 @@
1
- import { BaseError as z } from "./index35.js";
2
- import { HttpRequestError as k } from "./index143.js";
3
- import { MethodNotSupportedRpcError as s, UnknownRpcError as J, UserRejectedRequestError as u, AtomicityNotSupportedError as f, AtomicReadyWalletRejectedUpgradeError as E, BundleTooLargeError as l, UnknownBundleIdError as R, DuplicateIdError as m, UnsupportedChainIdError as y, UnsupportedNonOptionalCapabilityError as I, SwitchChainError as U, ChainDisconnectedError as v, ProviderDisconnectedError as b, UnsupportedProviderMethodError as N, UnauthorizedProviderError as q, JsonRpcVersionUnsupportedError as C, LimitExceededRpcError as a, TransactionRejectedRpcError as D, ResourceUnavailableRpcError as P, ResourceNotFoundRpcError as x, InvalidInputRpcError as j, InternalRpcError as i, InvalidParamsRpcError as B, MethodNotFoundRpcError as M, InvalidRequestRpcError as S, ParseRpcError as T } from "./index96.js";
4
- import { stringToHex as O } from "./index42.js";
5
- import { withDedupe as V } from "./index234.js";
6
- import { withRetry as W } from "./index90.js";
7
- import { stringify as _ } from "./index91.js";
8
- function te(r, A = {}) {
9
- return async (n, F = {}) => {
10
- var h;
11
- const { dedupe: w = !1, methods: t, retryDelay: H = 150, retryCount: L = 3, uid: $ } = {
12
- ...A,
13
- ...F
14
- }, { method: c } = n;
15
- if ((h = t == null ? void 0 : t.exclude) != null && h.includes(c))
16
- throw new s(new Error("method not supported"), {
17
- method: c
18
- });
19
- if (t != null && t.include && !t.include.includes(c))
20
- throw new s(new Error("method not supported"), {
21
- method: c
22
- });
23
- const g = w ? O(`${$}.${_(n)}`) : void 0;
24
- return V(() => W(async () => {
25
- try {
26
- return await r(n);
27
- } catch (o) {
28
- const e = o;
29
- switch (e.code) {
30
- case T.code:
31
- throw new T(e);
32
- case S.code:
33
- throw new S(e);
34
- case M.code:
35
- throw new M(e, { method: n.method });
36
- case B.code:
37
- throw new B(e);
38
- case i.code:
39
- throw new i(e);
40
- case j.code:
41
- throw new j(e);
42
- case x.code:
43
- throw new x(e);
44
- case P.code:
45
- throw new P(e);
46
- case D.code:
47
- throw new D(e);
48
- case s.code:
49
- throw new s(e, {
50
- method: n.method
51
- });
52
- case a.code:
53
- throw new a(e);
54
- case C.code:
55
- throw new C(e);
56
- case u.code:
57
- throw new u(e);
58
- case q.code:
59
- throw new q(e);
60
- case N.code:
61
- throw new N(e);
62
- case b.code:
63
- throw new b(e);
64
- case v.code:
65
- throw new v(e);
66
- case U.code:
67
- throw new U(e);
68
- case I.code:
69
- throw new I(e);
70
- case y.code:
71
- throw new y(e);
72
- case m.code:
73
- throw new m(e);
74
- case R.code:
75
- throw new R(e);
76
- case l.code:
77
- throw new l(e);
78
- case E.code:
79
- throw new E(e);
80
- case f.code:
81
- throw new f(e);
82
- case 5e3:
83
- throw new u(e);
84
- default:
85
- throw o instanceof z ? o : new J(e);
86
- }
87
- }
88
- }, {
89
- delay: ({ count: o, error: e }) => {
90
- var p;
91
- if (e && e instanceof k) {
92
- const d = (p = e == null ? void 0 : e.headers) == null ? void 0 : p.get("Retry-After");
93
- if (d != null && d.match(/\d/))
94
- return Number.parseInt(d, 10) * 1e3;
95
- }
96
- return ~~(1 << o) * H;
97
- },
98
- retryCount: L,
99
- shouldRetry: ({ error: o }) => G(o)
100
- }), { enabled: w, id: g });
101
- };
102
- }
103
- function G(r) {
104
- return "code" in r && typeof r.code == "number" ? r.code === -1 || r.code === a.code || r.code === i.code : r instanceof k && r.status ? r.status === 403 || r.status === 408 || r.status === 413 || r.status === 429 || r.status === 500 || r.status === 502 || r.status === 503 || r.status === 504 : !0;
1
+ import { checksumAddress as e } from "./index102.js";
2
+ import { keccak256 as o } from "./index150.js";
3
+ function d(r) {
4
+ const s = o(`0x${r.substring(4)}`).substring(26);
5
+ return e(`0x${s}`);
105
6
  }
106
7
  export {
107
- te as buildRequest,
108
- G as shouldRetry
8
+ d as publicKeyToAddress
109
9
  };
package/dist/index143.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index91.cjs"),i=require("./index35.cjs"),a=require("./index158.cjs");class b extends i.BaseError{constructor({body:t,cause:e,details:r,headers:n,status:u,url:l}){super("HTTP request failed.",{cause:e,details:r,metaMessages:[u&&`Status: ${u}`,`URL: ${a.getUrl(l)}`,t&&`Request body: ${s.stringify(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=n,this.status=u,this.url=l}}class d extends i.BaseError{constructor({body:t,error:e,url:r}){super("RPC Request failed.",{cause:e,details:e.message,metaMessages:[`URL: ${a.getUrl(r)}`,`Request body: ${s.stringify(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e.code,this.data=e.data,this.url=r}}class c extends i.BaseError{constructor({body:t,url:e}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${a.getUrl(e)}`,`Request body: ${s.stringify(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e}}exports.HttpRequestError=b;exports.RpcRequestError=d;exports.TimeoutError=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index139.cjs"),l=require("./index151.cjs"),y=require("./index140.cjs"),i=require("./index42.cjs"),x=require("./index138.cjs");let r=!1;async function g({hash:n,privateKey:o,to:e="object"}){const{r:c,s:u,recovery:t}=a.secp256k1.sign(n.slice(2),o.slice(2),{lowS:!0,extraEntropy:l.isHex(r,{strict:!1})?y.hexToBytes(r):r}),s={r:i.numberToHex(c,{size:32}),s:i.numberToHex(u,{size:32}),v:t?28n:27n,yParity:t};return e==="bytes"||e==="hex"?x.serializeSignature({...s,to:e}):s}exports.sign=g;