@gardenfi/utils 3.0.0-beta.2 → 3.0.0-beta.3

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 (304) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +35 -36
  3. package/dist/index102.cjs +1 -1
  4. package/dist/index102.js +4 -4
  5. package/dist/index104.cjs +1 -1
  6. package/dist/index104.js +3 -3
  7. package/dist/index111.cjs +1 -1
  8. package/dist/index111.js +2 -2
  9. package/dist/index112.cjs +1 -1
  10. package/dist/index112.js +1 -1
  11. package/dist/index113.cjs +1 -1
  12. package/dist/index113.js +1 -1
  13. package/dist/index114.cjs +1 -1
  14. package/dist/index114.js +1 -1
  15. package/dist/index115.cjs +1 -1
  16. package/dist/index115.js +1 -1
  17. package/dist/index132.cjs +1 -1
  18. package/dist/index132.js +5 -5
  19. package/dist/index138.cjs +1 -1
  20. package/dist/index138.js +33 -13
  21. package/dist/index139.cjs +1 -1
  22. package/dist/index139.js +9 -34
  23. package/dist/index140.cjs +1 -1
  24. package/dist/index140.js +60 -55
  25. package/dist/index141.cjs +1 -1
  26. package/dist/index141.js +17 -23
  27. package/dist/index142.cjs +1 -1
  28. package/dist/index142.js +106 -6
  29. package/dist/index143.cjs +1 -1
  30. package/dist/index143.js +78 -18
  31. package/dist/index144.cjs +1 -1
  32. package/dist/index144.js +9 -15
  33. package/dist/index145.cjs +1 -1
  34. package/dist/index145.js +71 -5
  35. package/dist/index146.cjs +2 -1
  36. package/dist/index146.js +3 -14
  37. package/dist/index147.cjs +1 -1
  38. package/dist/index147.js +9 -11
  39. package/dist/index148.cjs +1 -1
  40. package/dist/index148.js +13 -12
  41. package/dist/index149.cjs +1 -1
  42. package/dist/index149.js +4 -11
  43. package/dist/index150.cjs +1 -1
  44. package/dist/index150.js +12 -8
  45. package/dist/index151.cjs +1 -1
  46. package/dist/index151.js +2 -4
  47. package/dist/index152.cjs +1 -1
  48. package/dist/index152.js +32 -17
  49. package/dist/index153.cjs +1 -1
  50. package/dist/index153.js +21 -5
  51. package/dist/index154.cjs +1 -1
  52. package/dist/index154.js +5 -171
  53. package/dist/index155.cjs +1 -1
  54. package/dist/index155.js +5 -103
  55. package/dist/index156.cjs +1 -1
  56. package/dist/index156.js +5 -33
  57. package/dist/index157.cjs +9 -1
  58. package/dist/index157.js +34 -8
  59. package/dist/index158.cjs +1 -1
  60. package/dist/index158.js +3 -61
  61. package/dist/index159.cjs +1 -1
  62. package/dist/index159.js +18 -19
  63. package/dist/index160.cjs +1 -1
  64. package/dist/index160.js +19 -105
  65. package/dist/index161.cjs +1 -1
  66. package/dist/index161.js +27 -70
  67. package/dist/index162.cjs +1 -1
  68. package/dist/index162.js +6 -7
  69. package/dist/index163.cjs +4 -1
  70. package/dist/index163.js +194 -71
  71. package/dist/index164.cjs +1 -2
  72. package/dist/index164.js +28 -3
  73. package/dist/index165.cjs +1 -1
  74. package/dist/index165.js +162 -9
  75. package/dist/index166.cjs +1 -1
  76. package/dist/index166.js +127 -13
  77. package/dist/index167.cjs +1 -1
  78. package/dist/index167.js +27 -4
  79. package/dist/index168.cjs +1 -1
  80. package/dist/index168.js +56 -2
  81. package/dist/index169.cjs +1 -1
  82. package/dist/index169.js +191 -31
  83. package/dist/index170.cjs +1 -1
  84. package/dist/index170.js +4 -22
  85. package/dist/index171.cjs +1 -1
  86. package/dist/index171.js +20 -5
  87. package/dist/index172.cjs +1 -1
  88. package/dist/index172.js +3 -6
  89. package/dist/index173.cjs +1 -1
  90. package/dist/index173.js +16 -5
  91. package/dist/index174.cjs +1 -9
  92. package/dist/index174.js +11 -35
  93. package/dist/index175.cjs +1 -1
  94. package/dist/index175.js +35 -3
  95. package/dist/index176.cjs +1 -1
  96. package/dist/index176.js +3 -19
  97. package/dist/index177.cjs +1 -1
  98. package/dist/index177.js +25 -18
  99. package/dist/index178.cjs +1 -1
  100. package/dist/index178.js +8 -35
  101. package/dist/index179.cjs +1 -1
  102. package/dist/index179.js +23 -6
  103. package/dist/index180.cjs +1 -4
  104. package/dist/index180.js +28 -194
  105. package/dist/index181.cjs +1 -1
  106. package/dist/index181.js +3 -27
  107. package/dist/index182.cjs +1 -1
  108. package/dist/index182.js +6 -161
  109. package/dist/index183.cjs +1 -1
  110. package/dist/index183.js +6 -127
  111. package/dist/index184.cjs +1 -1
  112. package/dist/index184.js +32 -27
  113. package/dist/index185.cjs +1 -1
  114. package/dist/index185.js +5 -192
  115. package/dist/index186.cjs +1 -1
  116. package/dist/index186.js +38 -4
  117. package/dist/index187.cjs +1 -1
  118. package/dist/index187.js +43 -14
  119. package/dist/index188.cjs +1 -1
  120. package/dist/index188.js +33 -3
  121. package/dist/index189.cjs +1 -1
  122. package/dist/index189.js +16 -15
  123. package/dist/index190.cjs +1 -1
  124. package/dist/index190.js +40 -32
  125. package/dist/index191.cjs +1 -1
  126. package/dist/index191.js +105 -3
  127. package/dist/index192.cjs +1 -1
  128. package/dist/index192.js +3 -28
  129. package/dist/index193.cjs +1 -1
  130. package/dist/index193.js +5 -25
  131. package/dist/index194.cjs +1 -1
  132. package/dist/index194.js +3 -28
  133. package/dist/index195.cjs +1 -1
  134. package/dist/index195.js +17 -6
  135. package/dist/index196.cjs +1 -1
  136. package/dist/index196.js +5 -6
  137. package/dist/index197.cjs +1 -1
  138. package/dist/index197.js +8 -32
  139. package/dist/index198.cjs +1 -1
  140. package/dist/index198.js +104 -5
  141. package/dist/index199.cjs +1 -1
  142. package/dist/index199.js +5 -37
  143. package/dist/index200.cjs +1 -1
  144. package/dist/index200.js +6 -49
  145. package/dist/index201.cjs +1 -1
  146. package/dist/index201.js +25 -30
  147. package/dist/index202.cjs +1 -1
  148. package/dist/index202.js +34 -17
  149. package/dist/index203.cjs +1 -1
  150. package/dist/index203.js +13 -42
  151. package/dist/index204.cjs +1 -1
  152. package/dist/index204.js +74 -100
  153. package/dist/index205.cjs +1 -1
  154. package/dist/index205.js +2 -3
  155. package/dist/index206.cjs +1 -1
  156. package/dist/index206.js +17 -4
  157. package/dist/index207.cjs +1 -1
  158. package/dist/index207.js +171 -3
  159. package/dist/index208.cjs +1 -1
  160. package/dist/index208.js +17 -17
  161. package/dist/index209.cjs +1 -1
  162. package/dist/index209.js +10 -8
  163. package/dist/index210.cjs +1 -1
  164. package/dist/index210.js +25 -5
  165. package/dist/index211.cjs +1 -1
  166. package/dist/index211.js +18 -27
  167. package/dist/index212.cjs +1 -1
  168. package/dist/index212.js +15 -78
  169. package/dist/index213.cjs +1 -1
  170. package/dist/index213.js +6 -2
  171. package/dist/index214.cjs +1 -1
  172. package/dist/index214.js +13 -18
  173. package/dist/index215.cjs +1 -1
  174. package/dist/index215.js +10 -17
  175. package/dist/index216.cjs +1 -1
  176. package/dist/index216.js +16 -10
  177. package/dist/index217.cjs +1 -1
  178. package/dist/index217.js +1 -1
  179. package/dist/index22.cjs +1 -1
  180. package/dist/index22.js +8 -8
  181. package/dist/index220.cjs +2 -1
  182. package/dist/index220.js +40 -102
  183. package/dist/index221.cjs +1 -1
  184. package/dist/index221.js +2 -17
  185. package/dist/index222.cjs +1 -1
  186. package/dist/index222.js +5 -214
  187. package/dist/index223.cjs +1 -1
  188. package/dist/index223.js +8 -106
  189. package/dist/index224.cjs +1 -1
  190. package/dist/index224.js +17 -204
  191. package/dist/index225.cjs +1 -1
  192. package/dist/index225.js +8 -42
  193. package/dist/index226.cjs +1 -1
  194. package/dist/index226.js +62 -74
  195. package/dist/index227.cjs +1 -1
  196. package/dist/index227.js +66 -2
  197. package/dist/index228.cjs +1 -2
  198. package/dist/index228.js +187 -40
  199. package/dist/index229.cjs +1 -1
  200. package/dist/index229.js +29 -2
  201. package/dist/index230.cjs +1 -1
  202. package/dist/index230.js +76 -5
  203. package/dist/index231.cjs +1 -1
  204. package/dist/index231.js +39 -9
  205. package/dist/index232.cjs +1 -1
  206. package/dist/index232.js +14 -17
  207. package/dist/index233.cjs +1 -1
  208. package/dist/index233.js +13 -8
  209. package/dist/index234.cjs +1 -1
  210. package/dist/index234.js +11 -66
  211. package/dist/index235.cjs +1 -1
  212. package/dist/index235.js +11 -64
  213. package/dist/index236.cjs +1 -1
  214. package/dist/index236.js +18 -187
  215. package/dist/index237.cjs +1 -1
  216. package/dist/index237.js +106 -26
  217. package/dist/index238.cjs +1 -1
  218. package/dist/index238.js +98 -71
  219. package/dist/index239.cjs +1 -1
  220. package/dist/index239.js +6 -40
  221. package/dist/index240.cjs +1 -1
  222. package/dist/index240.js +7 -17
  223. package/dist/index241.cjs +1 -1
  224. package/dist/index241.js +25 -12
  225. package/dist/index242.cjs +1 -1
  226. package/dist/index242.js +16 -11
  227. package/dist/index243.cjs +1 -1
  228. package/dist/index243.js +212 -10
  229. package/dist/index244.cjs +1 -1
  230. package/dist/index244.js +206 -6
  231. package/dist/index245.cjs +1 -1
  232. package/dist/index245.js +43 -7
  233. package/dist/index246.cjs +1 -1
  234. package/dist/index246.js +74 -22
  235. package/dist/index247.cjs +1 -1
  236. package/dist/index247.js +2 -20
  237. package/dist/index25.cjs +1 -1
  238. package/dist/index25.js +2 -2
  239. package/dist/index252.cjs +1 -1
  240. package/dist/index252.js +68 -657
  241. package/dist/index253.cjs +1 -1
  242. package/dist/index253.js +634 -154
  243. package/dist/index254.cjs +1 -1
  244. package/dist/index254.js +176 -67
  245. package/dist/index26.cjs +1 -1
  246. package/dist/index26.js +4 -4
  247. package/dist/index28.cjs +1 -1
  248. package/dist/index28.js +1 -1
  249. package/dist/index3.cjs +1 -1
  250. package/dist/index3.js +24 -41
  251. package/dist/index30.cjs +1 -1
  252. package/dist/index30.js +6 -6
  253. package/dist/index35.cjs +1 -1
  254. package/dist/index35.js +1 -1
  255. package/dist/index37.cjs +1 -1
  256. package/dist/index37.js +8 -8
  257. package/dist/index38.cjs +1 -1
  258. package/dist/index38.js +1 -1
  259. package/dist/index39.cjs +1 -1
  260. package/dist/index39.js +1 -1
  261. package/dist/index40.cjs +1 -1
  262. package/dist/index40.js +2 -2
  263. package/dist/index42.cjs +1 -1
  264. package/dist/index42.js +2 -2
  265. package/dist/index43.cjs +1 -1
  266. package/dist/index43.js +1 -1
  267. package/dist/index47.cjs +1 -1
  268. package/dist/index47.js +4 -4
  269. package/dist/index48.cjs +1 -1
  270. package/dist/index48.js +3 -3
  271. package/dist/index49.cjs +1 -1
  272. package/dist/index49.js +3 -3
  273. package/dist/index51.cjs +1 -1
  274. package/dist/index51.js +6 -6
  275. package/dist/index54.cjs +1 -1
  276. package/dist/index54.js +1 -1
  277. package/dist/index58.cjs +1 -1
  278. package/dist/index58.js +1 -1
  279. package/dist/index62.cjs +1 -1
  280. package/dist/index62.js +2 -2
  281. package/dist/index63.cjs +1 -1
  282. package/dist/index63.js +2 -2
  283. package/dist/index65.cjs +1 -1
  284. package/dist/index65.js +2 -2
  285. package/dist/index67.cjs +1 -1
  286. package/dist/index67.js +1 -1
  287. package/dist/index75.cjs +1 -1
  288. package/dist/index75.js +4 -4
  289. package/dist/index78.cjs +1 -1
  290. package/dist/index78.js +3 -3
  291. package/dist/index81.cjs +1 -1
  292. package/dist/index81.js +2 -2
  293. package/dist/index90.cjs +1 -1
  294. package/dist/index90.js +1 -1
  295. package/dist/index93.cjs +1 -1
  296. package/dist/index93.js +1 -1
  297. package/dist/index95.cjs +1 -1
  298. package/dist/index95.js +2 -2
  299. package/dist/index96.cjs +1 -1
  300. package/dist/index96.js +1 -1
  301. package/dist/index97.cjs +1 -1
  302. package/dist/index97.js +5 -5
  303. package/dist/src/lib/utils.d.ts +0 -15
  304. package/package.json +1 -1
package/dist/index208.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(n,{errorInstance:r=new Error("timed out"),timeout:i,signal:a}){return new Promise((l,e)=>{(async()=>{let o;try{const t=new AbortController;i>0&&(o=setTimeout(()=>{a&&t.abort()},i)),l(await n({signal:(t==null?void 0:t.signal)||null}))}catch(t){(t==null?void 0:t.name)==="AbortError"&&e(r),e(t)}finally{clearTimeout(o)}})()})}exports.withTimeout=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index42.cjs"),c=require("./index207.cjs");function u(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{chainId:i,nonce:o,...s}=r,a=r.address;e.push([i?n.toHex(i):"0x",a,o?n.toHex(o):"0x",...c.toYParitySignatureArray({},s)])}return e}exports.serializeAuthorizationList=u;
package/dist/index208.js CHANGED
@@ -1,20 +1,20 @@
1
- function u(r, { errorInstance: e = new Error("timed out"), timeout: i, signal: a }) {
2
- return new Promise((l, n) => {
3
- (async () => {
4
- let o;
5
- try {
6
- const t = new AbortController();
7
- i > 0 && (o = setTimeout(() => {
8
- a && t.abort();
9
- }, i)), l(await r({ signal: (t == null ? void 0 : t.signal) || null }));
10
- } catch (t) {
11
- (t == null ? void 0 : t.name) === "AbortError" && n(e), n(t);
12
- } finally {
13
- clearTimeout(o);
14
- }
15
- })();
16
- });
1
+ import { toHex as i } from "./index42.js";
2
+ import { toYParitySignatureArray as c } from "./index207.js";
3
+ function f(r) {
4
+ if (!r || r.length === 0)
5
+ return [];
6
+ const t = [];
7
+ for (const o of r) {
8
+ const { chainId: n, nonce: e, ...s } = o, a = o.address;
9
+ t.push([
10
+ n ? i(n) : "0x",
11
+ a,
12
+ e ? i(e) : "0x",
13
+ ...c({}, s)
14
+ ]);
15
+ }
16
+ return t;
17
17
  }
18
18
  export {
19
- u as withTimeout
19
+ f as serializeAuthorizationList
20
20
  };
package/dist/index209.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index164.cjs"),o=require("./index120.cjs"),s=require("./index167.cjs"),r=require("./index42.cjs");function c(e){const t=typeof e=="string"?r.stringToHex(e):typeof e.raw=="string"?e.raw:r.bytesToHex(e.raw),i=r.stringToHex(`${n.presignMessagePrefix}${s.size(t)}`);return o.concat([i,t])}exports.toPrefixedMessage=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,i){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(i,"0");let[l,e]=[t.slice(0,t.length-i),t.slice(t.length-i)];return e=e.replace(/(0+)$/,""),`${n?"-":""}${l||"0"}${e?`.${e}`:""}`}exports.formatUnits=o;
package/dist/index209.js CHANGED
@@ -1,11 +1,13 @@
1
- import { presignMessagePrefix as e } from "./index164.js";
2
- import { concat as n } from "./index120.js";
3
- import { size as f } from "./index167.js";
4
- import { stringToHex as o, bytesToHex as p } from "./index42.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
+ 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}` : ""}`;
8
10
  }
9
11
  export {
10
- u as toPrefixedMessage
12
+ a as formatUnits
11
13
  };
package/dist/index210.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index142.cjs"),o=require("./index211.cjs");async function s({hash:e,signature:r}){return c.publicKeyToAddress(await o.recoverPublicKey({hash:e,signature:r}))}exports.recoverAddress=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index150.cjs"),t=require("./index174.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/index210.js CHANGED
@@ -1,8 +1,28 @@
1
- import { publicKeyToAddress as o } from "./index142.js";
2
- import { recoverPublicKey as c } from "./index211.js";
3
- async function s({ hash: r, signature: e }) {
4
- return o(await c({ hash: r, signature: e }));
1
+ import { InvalidAddressError as s } from "./index150.js";
2
+ import { isAddress as a } from "./index174.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 });
14
+ return {
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"
24
+ };
5
25
  }
6
26
  export {
7
- s as recoverAddress
27
+ r as toAccount
8
28
  };
package/dist/index211.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index151.cjs"),d=require("./index167.cjs"),o=require("./index65.cjs"),c=require("./index42.cjs");async function g({hash:e,signature:r}){const u=n.isHex(e)?e:c.toHex(e),{secp256k1:i}=await Promise.resolve().then(()=>require("./index139.cjs"));return`0x${(()=>{if(typeof r=="object"&&"r"in r&&"s"in r){const{r:v,s:y,v:b,yParity:f}=r,a=Number(f??b),H=s(a);return new i.Signature(o.hexToBigInt(v),o.hexToBigInt(y)).addRecoveryBit(H)}const t=n.isHex(r)?r:c.toHex(r);if(d.size(t)!==65)throw new Error("invalid signature length");const l=o.hexToNumber(`0x${t.slice(130)}`),x=s(l);return i.Signature.fromCompact(t.substring(2,130)).addRecoveryBit(x)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function s(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}exports.recoverPublicKey=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index202.cjs"),l=require("./index181.cjs"),y=require("./index168.cjs"),i=require("./index42.cjs"),x=require("./index203.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;
package/dist/index211.js CHANGED
@@ -1,30 +1,21 @@
1
- import { isHex as i } from "./index151.js";
2
- import { size as b } from "./index167.js";
3
- import { hexToBigInt as n, hexToNumber as d } from "./index65.js";
4
- import { toHex as c } from "./index42.js";
5
- async function R({ hash: r, signature: e }) {
6
- const u = i(r) ? r : c(r), { secp256k1: t } = await import("./index139.js");
7
- return `0x${(() => {
8
- if (typeof e == "object" && "r" in e && "s" in e) {
9
- const { r: p, s: v, v: y, yParity: l } = e, x = Number(l ?? y), a = s(x);
10
- return new t.Signature(n(p), n(v)).addRecoveryBit(a);
11
- }
12
- const o = i(e) ? e : c(e);
13
- if (b(o) !== 65)
14
- throw new Error("invalid signature length");
15
- const f = d(`0x${o.slice(130)}`), m = s(f);
16
- return t.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(m);
17
- })().recoverPublicKey(u.substring(2)).toHex(!1)}`;
18
- }
19
- function s(r) {
20
- if (r === 0 || r === 1)
21
- return r;
22
- if (r === 27)
23
- return 0;
24
- if (r === 28)
25
- return 1;
26
- throw new Error("Invalid yParityOrV value");
1
+ import { secp256k1 as a } from "./index202.js";
2
+ import { isHex as f } from "./index181.js";
3
+ import { hexToBytes as p } from "./index168.js";
4
+ import { numberToHex as s } from "./index42.js";
5
+ import { serializeSignature as u } from "./index203.js";
6
+ let e = !1;
7
+ async function z({ hash: o, privateKey: n, to: r = "object" }) {
8
+ const { r: m, s: c, recovery: t } = a.sign(o.slice(2), n.slice(2), {
9
+ lowS: !0,
10
+ extraEntropy: f(e, { strict: !1 }) ? p(e) : e
11
+ }), i = {
12
+ r: s(m, { size: 32 }),
13
+ s: s(c, { size: 32 }),
14
+ v: t ? 28n : 27n,
15
+ yParity: t
16
+ };
17
+ return r === "bytes" || r === "hex" ? u({ ...i, to: r }) : i;
27
18
  }
28
19
  export {
29
- R as recoverPublicKey
20
+ z as sign
30
21
  };
package/dist/index212.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index213.cjs"),w=require("./index19.cjs"),t=require("./index148.cjs"),P=require("./index35.cjs"),h=require("./index199.cjs"),d=require("./index36.cjs"),n=require("./index180.cjs"),c=require("./index149.cjs"),I=require("./index167.cjs"),u=require("./index104.cjs"),l=require("./index65.cjs");function m(o){const{authorizationList:e}=o;if(e)for(const s of e){const{chainId:r}=s,i=s.address;if(!c.isAddress(i))throw new t.InvalidAddressError({address:i});if(r<0)throw new d.InvalidChainIdError({chainId:r})}f(o)}function T(o){const{blobVersionedHashes:e}=o;if(e){if(e.length===0)throw new h.EmptyBlobError;for(const s of e){const r=I.size(s),i=l.hexToNumber(u.slice(s,0,1));if(r!==32)throw new h.InvalidVersionedHashSizeError({hash:s,size:r});if(i!==E.versionedHashVersionKzg)throw new h.InvalidVersionedHashVersionError({hash:s,version:i})}}f(o)}function f(o){const{chainId:e,maxPriorityFeePerGas:s,maxFeePerGas:r,to:i}=o;if(e<=0)throw new d.InvalidChainIdError({chainId:e});if(i&&!c.isAddress(i))throw new t.InvalidAddressError({address:i});if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r});if(s&&r&&s>r)throw new n.TipAboveFeeCapError({maxFeePerGas:r,maxPriorityFeePerGas:s})}function x(o){const{chainId:e,maxPriorityFeePerGas:s,gasPrice:r,maxFeePerGas:i,to:a}=o;if(e<=0)throw new d.InvalidChainIdError({chainId:e});if(a&&!c.isAddress(a))throw new t.InvalidAddressError({address:a});if(s||i)throw new P.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r})}function v(o){const{chainId:e,maxPriorityFeePerGas:s,gasPrice:r,maxFeePerGas:i,to:a}=o;if(a&&!c.isAddress(a))throw new t.InvalidAddressError({address:a});if(typeof e<"u"&&e<=0)throw new d.InvalidChainIdError({chainId:e});if(s||i)throw new P.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r})}exports.assertTransactionEIP1559=f;exports.assertTransactionEIP2930=x;exports.assertTransactionEIP4844=T;exports.assertTransactionEIP7702=m;exports.assertTransactionLegacy=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index216.cjs"),a=require("./index211.cjs");async function u(t){const{chainId:n,nonce:i,privateKey:r,to:o="object"}=t,s=t.contractAddress??t.address,e=await a.sign({hash:c.hashAuthorization({address:s,chainId:n,nonce:i}),privateKey:r,to:o});return o==="object"?{address:s,chainId:n,nonce:i,...e}:e}exports.signAuthorization=u;
package/dist/index212.js CHANGED
@@ -1,81 +1,18 @@
1
- import { versionedHashVersionKzg as c } from "./index213.js";
2
- import { maxUint256 as m } from "./index19.js";
3
- import { InvalidAddressError as s } from "./index148.js";
4
- import { BaseError as h } from "./index35.js";
5
- import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index199.js";
6
- import { InvalidChainIdError as n } from "./index36.js";
7
- import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index180.js";
8
- import { isAddress as f } from "./index149.js";
9
- import { size as F } from "./index167.js";
10
- import { slice as I } from "./index104.js";
11
- import { hexToNumber as G } from "./index65.js";
12
- function C(t) {
13
- const { authorizationList: e } = t;
14
- if (e)
15
- for (const o of e) {
16
- const { chainId: r } = o, i = o.address;
17
- if (!f(i))
18
- throw new s({ address: i });
19
- if (r < 0)
20
- throw new n({ chainId: r });
21
- }
22
- d(t);
23
- }
24
- function L(t) {
25
- const { blobVersionedHashes: e } = t;
26
- if (e) {
27
- if (e.length === 0)
28
- throw new P();
29
- for (const o of e) {
30
- const r = F(o), i = G(I(o, 0, 1));
31
- if (r !== 32)
32
- throw new p({ hash: o, size: r });
33
- if (i !== c)
34
- throw new x({
35
- hash: o,
36
- version: i
37
- });
38
- }
39
- }
40
- d(t);
41
- }
42
- function d(t) {
43
- const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
44
- if (e <= 0)
45
- throw new n({ chainId: e });
46
- if (i && !f(i))
47
- throw new s({ address: i });
48
- if (r && r > m)
49
- throw new w({ maxFeePerGas: r });
50
- if (o && r && o > r)
51
- throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
52
- }
53
- function B(t) {
54
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
55
- if (e <= 0)
56
- throw new n({ chainId: e });
57
- if (a && !f(a))
58
- throw new s({ address: a });
59
- if (o || i)
60
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
61
- if (r && r > m)
62
- throw new w({ maxFeePerGas: r });
63
- }
64
- function K(t) {
65
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
66
- if (a && !f(a))
67
- throw new s({ address: a });
68
- if (typeof e < "u" && e <= 0)
69
- throw new n({ chainId: e });
70
- if (o || i)
71
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
72
- if (r && r > m)
73
- throw new w({ maxFeePerGas: r });
1
+ import { hashAuthorization as a } from "./index216.js";
2
+ import { sign as e } from "./index211.js";
3
+ async function u(t) {
4
+ const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
5
+ hash: a({ address: r, chainId: o, nonce: n }),
6
+ privateKey: c,
7
+ to: i
8
+ });
9
+ return i === "object" ? {
10
+ address: r,
11
+ chainId: o,
12
+ nonce: n,
13
+ ...s
14
+ } : s;
74
15
  }
75
16
  export {
76
- d as assertTransactionEIP1559,
77
- B as assertTransactionEIP2930,
78
- L as assertTransactionEIP4844,
79
- C as assertTransactionEIP7702,
80
- K as assertTransactionLegacy
17
+ u as signAuthorization
81
18
  };
package/dist/index213.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=1;exports.versionedHashVersionKzg=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index196.cjs"),n=require("./index211.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
package/dist/index213.js CHANGED
@@ -1,4 +1,8 @@
1
- const e = 1;
1
+ import { hashMessage as e } from "./index196.js";
2
+ import { sign as o } from "./index211.js";
3
+ async function i({ message: s, privateKey: a }) {
4
+ return await o({ hash: e(s), privateKey: a, to: "hex" });
5
+ }
2
6
  export {
3
- e as versionedHashVersionKzg
7
+ i as signMessage
4
8
  };
package/dist/index214.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index148.cjs"),d=require("./index81.cjs"),l=require("./index149.cjs");function a(e){if(!e||e.length===0)return[];const n=[];for(let t=0;t<e.length;t++){const{address:i,storageKeys:r}=e[t];for(let s=0;s<r.length;s++)if(r[s].length-2!==64)throw new d.InvalidStorageKeySizeError({storageKey:r[s]});if(!l.isAddress(i,{strict:!1}))throw new o.InvalidAddressError({address:i});n.push([i,r])}return n}exports.serializeAccessList=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index178.cjs"),c=require("./index207.cjs"),o=require("./index211.cjs");async function u(i){const{privateKey:n,transaction:a,serializer:e=c.serializeTransaction}=i,r=a.type==="eip4844"?{...a,sidecars:!1}:a,t=await o.sign({hash:s.keccak256(await e(r)),privateKey:n});return await e(a,t)}exports.signTransaction=u;
package/dist/index214.js CHANGED
@@ -1,21 +1,16 @@
1
- import { InvalidAddressError as s } from "./index148.js";
2
- import { InvalidStorageKeySizeError as l } from "./index81.js";
3
- import { isAddress as f } from "./index149.js";
4
- function a(r) {
5
- if (!r || r.length === 0)
6
- return [];
7
- const n = [];
8
- for (let o = 0; o < r.length; o++) {
9
- const { address: i, storageKeys: e } = r[o];
10
- for (let t = 0; t < e.length; t++)
11
- if (e[t].length - 2 !== 64)
12
- throw new l({ storageKey: e[t] });
13
- if (!f(i, { strict: !1 }))
14
- throw new s({ address: i });
15
- n.push([i, e]);
16
- }
17
- return n;
1
+ import { keccak256 as e } from "./index178.js";
2
+ import { serializeTransaction as o } from "./index207.js";
3
+ import { sign as c } from "./index211.js";
4
+ async function u(r) {
5
+ const { privateKey: t, transaction: a, serializer: i = o } = r, n = a.type === "eip4844" ? {
6
+ ...a,
7
+ sidecars: !1
8
+ } : a, s = await c({
9
+ hash: e(await i(n)),
10
+ privateKey: t
11
+ });
12
+ return await i(a, s);
18
13
  }
19
14
  export {
20
- a as serializeAccessList
15
+ u as signTransaction
21
16
  };
package/dist/index215.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index42.cjs"),c=require("./index154.cjs");function u(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{chainId:i,nonce:o,...s}=r,a=r.address;e.push([i?n.toHex(i):"0x",a,o?n.toHex(o):"0x",...c.toYParitySignatureArray({},s)])}return e}exports.serializeAuthorizationList=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index198.cjs"),s=require("./index211.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
package/dist/index215.js CHANGED
@@ -1,20 +1,13 @@
1
- import { toHex as i } from "./index42.js";
2
- import { toYParitySignatureArray as c } from "./index154.js";
3
- function f(r) {
4
- if (!r || r.length === 0)
5
- return [];
6
- const t = [];
7
- for (const o of r) {
8
- const { chainId: n, nonce: e, ...s } = o, a = o.address;
9
- t.push([
10
- n ? i(n) : "0x",
11
- a,
12
- e ? i(e) : "0x",
13
- ...c({}, s)
14
- ]);
15
- }
16
- return t;
1
+ import { hashTypedData as o } from "./index198.js";
2
+ import { sign as r } from "./index211.js";
3
+ async function p(t) {
4
+ const { privateKey: a, ...e } = t;
5
+ return await r({
6
+ hash: o(e),
7
+ privateKey: a,
8
+ to: "hex"
9
+ });
17
10
  }
18
11
  export {
19
- f as serializeAuthorizationList
12
+ p as signTypedData
20
13
  };
package/dist/index216.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,i){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(i,"0");let[l,e]=[t.slice(0,t.length-i),t.slice(t.length-i)];return e=e.replace(/(0+)$/,""),`${n?"-":""}${l||"0"}${e?`.${e}`:""}`}exports.formatUnits=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index120.cjs"),u=require("./index168.cjs"),c=require("./index42.cjs"),a=require("./index190.cjs"),h=require("./index178.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;
package/dist/index216.js CHANGED
@@ -1,13 +1,19 @@
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
+ import { concatHex as i } from "./index120.js";
2
+ import { hexToBytes as m } from "./index168.js";
3
+ import { numberToHex as c } from "./index42.js";
4
+ import { toRlp as d } from "./index190.js";
5
+ import { keccak256 as f } from "./index178.js";
6
+ function b(o) {
7
+ const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
8
+ "0x05",
9
+ d([
10
+ t ? c(t) : "0x",
11
+ e,
12
+ r ? c(r) : "0x"
13
+ ])
14
+ ]));
15
+ return s === "bytes" ? m(n) : n;
10
16
  }
11
17
  export {
12
- a as formatUnits
18
+ b as hashAuthorization
13
19
  };
package/dist/index217.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index180.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index163.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
package/dist/index217.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseError as c } from "./index35.js";
2
- import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index180.js";
2
+ import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index163.js";
3
3
  function P(o, e) {
4
4
  const n = (o.details || "").toLowerCase(), s = o instanceof c ? o.walk((i) => (i == null ? void 0 : i.code) === t.code) : o;
5
5
  return s instanceof c ? new t({
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index139.cjs"),u=require("./index42.cjs"),a=require("./index141.cjs"),g=require("./index142.cjs"),y=require("./index143.cjs"),d=require("./index144.cjs"),T=require("./index145.cjs"),l=require("./index146.cjs"),q=require("./index147.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index202.cjs"),u=require("./index42.cjs"),a=require("./index210.cjs"),g=require("./index200.cjs"),y=require("./index211.cjs"),d=require("./index212.cjs"),T=require("./index213.cjs"),l=require("./index214.cjs"),q=require("./index215.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
package/dist/index22.js CHANGED
@@ -1,12 +1,12 @@
1
- import { secp256k1 as e } from "./index139.js";
1
+ import { secp256k1 as e } from "./index202.js";
2
2
  import { toHex as a } from "./index42.js";
3
- import { toAccount as m } from "./index141.js";
4
- import { publicKeyToAddress as u } from "./index142.js";
5
- import { sign as g } from "./index143.js";
6
- import { signAuthorization as p } from "./index144.js";
7
- import { signMessage as f } from "./index145.js";
8
- import { signTransaction as y } from "./index146.js";
9
- import { signTypedData as d } from "./index147.js";
3
+ import { toAccount as m } from "./index210.js";
4
+ import { publicKeyToAddress as u } from "./index200.js";
5
+ import { sign as g } from "./index211.js";
6
+ import { signAuthorization as p } from "./index212.js";
7
+ import { signMessage as f } from "./index213.js";
8
+ import { signTransaction as y } from "./index214.js";
9
+ import { signTypedData as d } from "./index215.js";
10
10
  function H(n, t = {}) {
11
11
  const { nonceManager: s } = t, r = a(e.getPublicKey(n.slice(2), !1)), c = u(r);
12
12
  return {
package/dist/index220.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index226.cjs"),x=require("./index223.cjs"),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),f=new Uint32Array(64);class u extends e.HashMD{constructor(o=32){super(64,o,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:o,B:h,C:s,D:a,E:r,F:b,G:c,H:i}=this;return[o,h,s,a,r,b,c,i]}set(o,h,s,a,r,b,c,i){this.A=o|0,this.B=h|0,this.C=s|0,this.D=a|0,this.E=r|0,this.F=b|0,this.G=c|0,this.H=i|0}process(o,h){for(let t=0;t<16;t++,h+=4)f[t]=o.getUint32(h,!1);for(let t=16;t<64;t++){const H=f[t-15],d=f[t-2],S=x.rotr(H,7)^x.rotr(H,18)^H>>>3,l=x.rotr(d,17)^x.rotr(d,19)^d>>>10;f[t]=l+f[t-7]+S+f[t-16]|0}let{A:s,B:a,C:r,D:b,E:c,F:i,G:n,H:A}=this;for(let t=0;t<64;t++){const H=x.rotr(c,6)^x.rotr(c,11)^x.rotr(c,25),d=A+H+e.Chi(c,i,n)+_[t]+f[t]|0,l=(x.rotr(s,2)^x.rotr(s,13)^x.rotr(s,22))+e.Maj(s,a,r)|0;A=n,n=i,i=c,c=b+d|0,b=r,r=a,a=s,s=d+l|0}s=s+this.A|0,a=a+this.B|0,r=r+this.C|0,b=b+this.D|0,c=c+this.E|0,i=i+this.F|0,n=n+this.G|0,A=A+this.H|0,this.set(s,a,r,b,c,i,n,A)}roundClean(){x.clean(f)}destroy(){this.set(0,0,0,0,0,0,0,0),x.clean(this.buffer)}}const I=x.createHasher(()=>new u);exports.SHA256=u;exports.sha256=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index221.cjs");class t extends Error{constructor(a,e={}){var i;const s=e.cause instanceof t?e.cause.details:(i=e.cause)!=null&&i.message?e.cause.message:e.details,r=e.cause instanceof t&&e.cause.docsPath||e.docsPath,u=[a||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${o.version}`].join(`
2
+ `);super(u),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),e.cause&&(this.cause=e.cause),this.details=s,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=a}}exports.BaseError=t;