tenjin-cli 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (193) hide show
  1. package/NOTICE.md +33 -0
  2. package/README.md +596 -79
  3. package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
  4. package/dist/_esm-N4KAVXQR.js +881 -0
  5. package/dist/buy-THMVOPUH.js +44 -0
  6. package/dist/ccip-RPPPKTJR.js +19 -0
  7. package/dist/{ccip-UCLT5VOW.js → ccip-ZGGWQN4X.js} +6 -5
  8. package/dist/chunk-2I4QTOLB.js +11 -0
  9. package/dist/chunk-2I4QTOLB.js.map +1 -0
  10. package/dist/chunk-2SDUV6MQ.js +352 -0
  11. package/dist/chunk-2SDUV6MQ.js.map +1 -0
  12. package/dist/chunk-3GSZUADW.js +199 -0
  13. package/dist/chunk-3GSZUADW.js.map +1 -0
  14. package/dist/{chunk-BRJHUQSY.js → chunk-47PP7TAG.js} +908 -812
  15. package/dist/chunk-47PP7TAG.js.map +1 -0
  16. package/dist/chunk-4NTZETIL.js +158 -0
  17. package/dist/chunk-4NTZETIL.js.map +1 -0
  18. package/dist/chunk-4TCU3YRD.js +130 -0
  19. package/dist/chunk-4TCU3YRD.js.map +1 -0
  20. package/dist/chunk-6BGYHARE.js +14620 -0
  21. package/dist/chunk-6BGYHARE.js.map +1 -0
  22. package/dist/chunk-6UY2UQMY.js +213 -0
  23. package/dist/chunk-6UY2UQMY.js.map +1 -0
  24. package/dist/{chunk-IPOWB3G3.js → chunk-7FK2UN2T.js} +3515 -507
  25. package/dist/chunk-7FK2UN2T.js.map +1 -0
  26. package/dist/chunk-ALUNME53.js +306 -0
  27. package/dist/chunk-ALUNME53.js.map +1 -0
  28. package/dist/{chunk-EXBMF5X7.js → chunk-CNUXRXI2.js} +526 -79
  29. package/dist/chunk-CNUXRXI2.js.map +1 -0
  30. package/dist/chunk-E6YOODH7.js +913 -0
  31. package/dist/chunk-E6YOODH7.js.map +1 -0
  32. package/dist/chunk-EDVI7RRD.js +317 -0
  33. package/dist/chunk-EDVI7RRD.js.map +1 -0
  34. package/dist/chunk-FKSAUOJU.js +137 -0
  35. package/dist/chunk-FKSAUOJU.js.map +1 -0
  36. package/dist/chunk-GKV6VZSZ.js +125 -0
  37. package/dist/chunk-GKV6VZSZ.js.map +1 -0
  38. package/dist/chunk-GUUAYR3K.js +175 -0
  39. package/dist/chunk-GUUAYR3K.js.map +1 -0
  40. package/dist/chunk-IAFYUFIC.js +1408 -0
  41. package/dist/chunk-IAFYUFIC.js.map +1 -0
  42. package/dist/chunk-IB63U6BM.js +185 -0
  43. package/dist/chunk-IB63U6BM.js.map +1 -0
  44. package/dist/chunk-IXTENA2H.js +235 -0
  45. package/dist/chunk-IXTENA2H.js.map +1 -0
  46. package/dist/chunk-JTYIX6OD.js +161 -0
  47. package/dist/chunk-JTYIX6OD.js.map +1 -0
  48. package/dist/chunk-KYQVEKP5.js +209 -0
  49. package/dist/chunk-KYQVEKP5.js.map +1 -0
  50. package/dist/chunk-KZAAWQNP.js +6199 -0
  51. package/dist/chunk-KZAAWQNP.js.map +1 -0
  52. package/dist/{chunk-T4LKNY7T.js → chunk-M2O56UK7.js} +225 -70
  53. package/dist/chunk-M2O56UK7.js.map +1 -0
  54. package/dist/chunk-MJZZTKCC.js +323 -0
  55. package/dist/chunk-MJZZTKCC.js.map +1 -0
  56. package/dist/chunk-NUF2PKJO.js +207 -0
  57. package/dist/chunk-NUF2PKJO.js.map +1 -0
  58. package/dist/chunk-O25VWJCG.js +1357 -0
  59. package/dist/chunk-O25VWJCG.js.map +1 -0
  60. package/dist/chunk-OCN27NJV.js +612 -0
  61. package/dist/chunk-OCN27NJV.js.map +1 -0
  62. package/dist/chunk-OZHJ3FLR.js +105 -0
  63. package/dist/chunk-OZHJ3FLR.js.map +1 -0
  64. package/dist/chunk-P74I3WH4.js +204 -0
  65. package/dist/chunk-P74I3WH4.js.map +1 -0
  66. package/dist/chunk-POJRB2AE.js +83 -0
  67. package/dist/chunk-POJRB2AE.js.map +1 -0
  68. package/dist/{chunk-YG2DO46P.js → chunk-PZRAAAY2.js} +107 -22
  69. package/dist/chunk-PZRAAAY2.js.map +1 -0
  70. package/dist/chunk-PZSUWDF2.js +35 -0
  71. package/dist/chunk-PZSUWDF2.js.map +1 -0
  72. package/dist/chunk-QW2Q2KAH.js +27 -0
  73. package/dist/chunk-QW2Q2KAH.js.map +1 -0
  74. package/dist/{chunk-CUWUHTIL.js → chunk-RBJPAZFI.js} +16 -202
  75. package/dist/chunk-RBJPAZFI.js.map +1 -0
  76. package/dist/chunk-RSBN67PA.js +152 -0
  77. package/dist/chunk-RSBN67PA.js.map +1 -0
  78. package/dist/chunk-S5RYMCV6.js +70 -0
  79. package/dist/chunk-S5RYMCV6.js.map +1 -0
  80. package/dist/chunk-SFGXAZ3M.js +316 -0
  81. package/dist/chunk-SFGXAZ3M.js.map +1 -0
  82. package/dist/chunk-SGK2B724.js +67 -0
  83. package/dist/chunk-SGK2B724.js.map +1 -0
  84. package/dist/chunk-TDDN5GXR.js +145 -0
  85. package/dist/chunk-TDDN5GXR.js.map +1 -0
  86. package/dist/{chunk-LPRVHM7P.js → chunk-U5S527PP.js} +1655 -114
  87. package/dist/chunk-U5S527PP.js.map +1 -0
  88. package/dist/chunk-UFPJBS4C.js +242 -0
  89. package/dist/chunk-UFPJBS4C.js.map +1 -0
  90. package/dist/chunk-UHTVXQ2O.js +140 -0
  91. package/dist/chunk-UHTVXQ2O.js.map +1 -0
  92. package/dist/chunk-UY6CGULW.js +83 -0
  93. package/dist/chunk-UY6CGULW.js.map +1 -0
  94. package/dist/chunk-VWY3U732.js +674 -0
  95. package/dist/chunk-VWY3U732.js.map +1 -0
  96. package/dist/{chunk-Q53IYV2G.js → chunk-W6R3HAAG.js} +20 -17
  97. package/dist/{chunk-Q53IYV2G.js.map → chunk-W6R3HAAG.js.map} +1 -1
  98. package/dist/chunk-XJN5WUKL.js +204 -0
  99. package/dist/chunk-XJN5WUKL.js.map +1 -0
  100. package/dist/chunk-XWHXX2BI.js +149 -0
  101. package/dist/chunk-XWHXX2BI.js.map +1 -0
  102. package/dist/{chunk-DXPYFVKG.js → chunk-Y7ERTA7D.js} +35 -15
  103. package/dist/chunk-Y7ERTA7D.js.map +1 -0
  104. package/dist/chunk-YLYINX2H.js +7806 -0
  105. package/dist/chunk-YLYINX2H.js.map +1 -0
  106. package/dist/chunk-ZE7KOO7A.js +233 -0
  107. package/dist/chunk-ZE7KOO7A.js.map +1 -0
  108. package/dist/chunk-ZQIQ55KK.js +51 -0
  109. package/dist/chunk-ZQIQ55KK.js.map +1 -0
  110. package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
  111. package/dist/{cli-WA65NP4Y.js → cli-Y2HBOSGK.js} +437 -175
  112. package/dist/cli-Y2HBOSGK.js.map +1 -0
  113. package/dist/config-WDGMZKHU.js +26 -0
  114. package/dist/config-WDGMZKHU.js.map +1 -0
  115. package/dist/dist-U4M6QCKE.js +2842 -0
  116. package/dist/dist-U4M6QCKE.js.map +1 -0
  117. package/dist/doctor-CSIWKWM2.js +27 -0
  118. package/dist/doctor-CSIWKWM2.js.map +1 -0
  119. package/dist/edit-E7N6F3OY.js +38 -0
  120. package/dist/edit-E7N6F3OY.js.map +1 -0
  121. package/dist/ethersCompat-Df4a6QIZ-WHYKB6HA.js +18 -0
  122. package/dist/ethersCompat-Df4a6QIZ-WHYKB6HA.js.map +1 -0
  123. package/dist/fund-OKK627GL.js +38 -0
  124. package/dist/fund-OKK627GL.js.map +1 -0
  125. package/dist/index.js +1 -1
  126. package/dist/inspect-573WHEV4.js +35 -0
  127. package/dist/inspect-573WHEV4.js.map +1 -0
  128. package/dist/install-SQAYMNQC.js +1134 -0
  129. package/dist/install-SQAYMNQC.js.map +1 -0
  130. package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
  131. package/dist/outcome-W3KYGF23.js +22 -0
  132. package/dist/outcome-W3KYGF23.js.map +1 -0
  133. package/dist/publish-N5U4XYVA.js +40 -0
  134. package/dist/publish-N5U4XYVA.js.map +1 -0
  135. package/dist/read-PJ7Z6UGF.js +158 -0
  136. package/dist/read-PJ7Z6UGF.js.map +1 -0
  137. package/dist/run-FSO3MMXN.js +16883 -0
  138. package/dist/run-FSO3MMXN.js.map +1 -0
  139. package/dist/search-ZWOP4EGK.js +23 -0
  140. package/dist/search-ZWOP4EGK.js.map +1 -0
  141. package/dist/{secp256k1-BEZS642W.js → secp256k1-XRPVBC6V.js} +5 -4
  142. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  143. package/dist/send-F34ZDXDZ.js +223 -0
  144. package/dist/send-F34ZDXDZ.js.map +1 -0
  145. package/dist/session-4N4ZT3AH.js +88 -0
  146. package/dist/session-4N4ZT3AH.js.map +1 -0
  147. package/dist/skill-heal-XBEK272G.js +85 -0
  148. package/dist/skill-heal-XBEK272G.js.map +1 -0
  149. package/dist/uninstall-BTKPHPDL.js +68 -0
  150. package/dist/uninstall-BTKPHPDL.js.map +1 -0
  151. package/dist/usdc-4VCDHFWX.js +38 -0
  152. package/dist/usdc-4VCDHFWX.js.map +1 -0
  153. package/dist/viemAdapter-By13KInL-TUQJBMHM.js +14 -0
  154. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  155. package/dist/wallet-UL4P2JRO.js +42 -0
  156. package/dist/wallet-UL4P2JRO.js.map +1 -0
  157. package/dist/wallet-WJ6UP5OU.js +32 -0
  158. package/dist/wallet-WJ6UP5OU.js.map +1 -0
  159. package/docs/agent-permissions.md +294 -0
  160. package/package.json +25 -18
  161. package/skills/tenjin/SKILL.md +364 -0
  162. package/skills/tenjin-publish/SKILL.md +232 -0
  163. package/skills/tenjin-search/SKILL.md +341 -0
  164. package/dist/chunk-BRJHUQSY.js.map +0 -1
  165. package/dist/chunk-CUWUHTIL.js.map +0 -1
  166. package/dist/chunk-DXPYFVKG.js.map +0 -1
  167. package/dist/chunk-EXBMF5X7.js.map +0 -1
  168. package/dist/chunk-EZROUI5U.js +0 -135
  169. package/dist/chunk-EZROUI5U.js.map +0 -1
  170. package/dist/chunk-IPOWB3G3.js.map +0 -1
  171. package/dist/chunk-LPRVHM7P.js.map +0 -1
  172. package/dist/chunk-T4LKNY7T.js.map +0 -1
  173. package/dist/chunk-YBMMV4Y4.js +0 -51
  174. package/dist/chunk-YBMMV4Y4.js.map +0 -1
  175. package/dist/chunk-YG2DO46P.js.map +0 -1
  176. package/dist/chunk-ZPZFPVDN.js +0 -67
  177. package/dist/chunk-ZPZFPVDN.js.map +0 -1
  178. package/dist/cli-WA65NP4Y.js.map +0 -1
  179. package/dist/config-CEFTL5ZL.js +0 -164
  180. package/dist/config-CEFTL5ZL.js.map +0 -1
  181. package/dist/doctor-3QBYN46N.js +0 -338
  182. package/dist/doctor-3QBYN46N.js.map +0 -1
  183. package/dist/usdc-44R6XZF2.js +0 -18
  184. package/dist/wallet-ELBTBMXO.js +0 -20
  185. package/dist/wallet-XD576HF3.js +0 -173
  186. package/dist/wallet-XD576HF3.js.map +0 -1
  187. /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
  188. /package/dist/{ccip-UCLT5VOW.js.map → _esm-N4KAVXQR.js.map} +0 -0
  189. /package/dist/{chunk-3IMLRUZE.js.map → buy-THMVOPUH.js.map} +0 -0
  190. /package/dist/{secp256k1-BEZS642W.js.map → ccip-RPPPKTJR.js.map} +0 -0
  191. /package/dist/{usdc-44R6XZF2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  192. /package/dist/{wallet-ELBTBMXO.js.map → chunk-ZXTAQYNA.js.map} +0 -0
  193. /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
@@ -1,8 +1,10 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
- secp256k1,
4
3
  sha256
5
- } from "./chunk-Q53IYV2G.js";
4
+ } from "./chunk-UHTVXQ2O.js";
5
+ import {
6
+ secp256k1
7
+ } from "./chunk-W6R3HAAG.js";
6
8
  import {
7
9
  BaseError,
8
10
  BytesSizeMismatchError,
@@ -12,6 +14,7 @@ import {
12
14
  InvalidLegacyVError,
13
15
  InvalidSerializableTransactionError,
14
16
  InvalidStorageKeySizeError,
17
+ LruMap,
15
18
  TipAboveFeeCapError,
16
19
  bytesRegex,
17
20
  bytesToHex,
@@ -20,7 +23,8 @@ import {
20
23
  concatHex,
21
24
  createCursor,
22
25
  encodeAbiParameters,
23
- from2 as from,
26
+ formatBlockParameter,
27
+ from,
24
28
  fromBytes,
25
29
  hexToBigInt,
26
30
  hexToBytes,
@@ -29,7 +33,6 @@ import {
29
33
  isAddress,
30
34
  isHex,
31
35
  keccak256,
32
- keccak_256,
33
36
  maxUint256,
34
37
  numberToHex,
35
38
  size,
@@ -39,22 +42,10 @@ import {
39
42
  toBytes,
40
43
  toHex,
41
44
  trim
42
- } from "./chunk-BRJHUQSY.js";
43
-
44
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeSignature.js
45
- function serializeSignature({ r, s, to = "hex", v, yParity }) {
46
- const yParity_ = (() => {
47
- if (yParity === 0 || yParity === 1)
48
- return yParity;
49
- if (v && (v === 27n || v === 28n || v >= 35n))
50
- return v % 2n === 0n ? 1 : 0;
51
- throw new Error("Invalid `v` or `yParity` value");
52
- })();
53
- const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? "1b" : "1c"}`;
54
- if (to === "hex")
55
- return signature;
56
- return hexToBytes(signature);
57
- }
45
+ } from "./chunk-47PP7TAG.js";
46
+ import {
47
+ keccak_256
48
+ } from "./chunk-XJN5WUKL.js";
58
49
 
59
50
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toRlp.js
60
51
  function toRlp(bytes, to = "hex") {
@@ -65,6 +56,12 @@ function toRlp(bytes, to = "hex") {
65
56
  return bytesToHex(cursor.bytes);
66
57
  return cursor.bytes;
67
58
  }
59
+ function bytesToRlp(bytes, to = "bytes") {
60
+ return toRlp(bytes, to);
61
+ }
62
+ function hexToRlp(hex, to = "hex") {
63
+ return toRlp(hex, to);
64
+ }
68
65
  function getEncodable(bytes) {
69
66
  if (Array.isArray(bytes))
70
67
  return getEncodableList(bytes.map((x) => getEncodable(x)));
@@ -145,27 +142,6 @@ function getSizeOfLength(length) {
145
142
  throw new BaseError("Length is too large.");
146
143
  }
147
144
 
148
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/strings.js
149
- var presignMessagePrefix = "Ethereum Signed Message:\n";
150
-
151
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
152
- function toPrefixedMessage(message_) {
153
- const message = (() => {
154
- if (typeof message_ === "string")
155
- return stringToHex(message_);
156
- if (typeof message_.raw === "string")
157
- return message_.raw;
158
- return bytesToHex(message_.raw);
159
- })();
160
- const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`);
161
- return concat([prefix, message]);
162
- }
163
-
164
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/hashMessage.js
165
- function hashMessage(message, to_) {
166
- return keccak256(toPrefixedMessage(message), to_);
167
- }
168
-
169
145
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
170
146
  function blobsToCommitments(parameters) {
171
147
  const { kzg } = parameters;
@@ -192,13 +168,10 @@ function blobsToProofs(parameters) {
192
168
  return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x));
193
169
  }
194
170
 
195
- // node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
196
- var sha2562 = sha256;
197
-
198
171
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/sha256.js
199
- function sha2563(value, to_) {
172
+ function sha2562(value, to_) {
200
173
  const to = to_ || "hex";
201
- const bytes = sha2562(isHex(value, { strict: false }) ? toBytes(value) : value);
174
+ const bytes = sha256(isHex(value, { strict: false }) ? toBytes(value) : value);
202
175
  if (to === "bytes")
203
176
  return bytes;
204
177
  return toHex(bytes);
@@ -208,7 +181,7 @@ function sha2563(value, to_) {
208
181
  function commitmentToVersionedHash(parameters) {
209
182
  const { commitment, version = 1 } = parameters;
210
183
  const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
211
- const versionedHash = sha2563(commitment, "bytes");
184
+ const versionedHash = sha2562(commitment, "bytes");
212
185
  versionedHash.set([version], 0);
213
186
  return to === "bytes" ? versionedHash : bytesToHex(versionedHash);
214
187
  }
@@ -325,6 +298,25 @@ function toBlobSidecars(parameters) {
325
298
  return sidecars;
326
299
  }
327
300
 
301
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/getTransactionType.js
302
+ function getTransactionType(transaction) {
303
+ if (transaction.type)
304
+ return transaction.type;
305
+ if (typeof transaction.authorizationList !== "undefined")
306
+ return "eip7702";
307
+ if (typeof transaction.blobs !== "undefined" || typeof transaction.blobVersionedHashes !== "undefined" || typeof transaction.maxFeePerBlobGas !== "undefined" || typeof transaction.sidecars !== "undefined")
308
+ return "eip4844";
309
+ if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") {
310
+ return "eip1559";
311
+ }
312
+ if (typeof transaction.gasPrice !== "undefined") {
313
+ if (typeof transaction.accessList !== "undefined")
314
+ return "eip2930";
315
+ return "legacy";
316
+ }
317
+ throw new InvalidSerializableTransactionError({ transaction });
318
+ }
319
+
328
320
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/assertTransaction.js
329
321
  function assertTransactionEIP7702(transaction) {
330
322
  const { authorizationList } = transaction;
@@ -393,25 +385,6 @@ function assertTransactionLegacy(transaction) {
393
385
  throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
394
386
  }
395
387
 
396
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/getTransactionType.js
397
- function getTransactionType(transaction) {
398
- if (transaction.type)
399
- return transaction.type;
400
- if (typeof transaction.authorizationList !== "undefined")
401
- return "eip7702";
402
- if (typeof transaction.blobs !== "undefined" || typeof transaction.blobVersionedHashes !== "undefined" || typeof transaction.maxFeePerBlobGas !== "undefined" || typeof transaction.sidecars !== "undefined")
403
- return "eip4844";
404
- if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") {
405
- return "eip1559";
406
- }
407
- if (typeof transaction.gasPrice !== "undefined") {
408
- if (typeof transaction.accessList !== "undefined")
409
- return "eip2930";
410
- return "legacy";
411
- }
412
- throw new InvalidSerializableTransactionError({ transaction });
413
- }
414
-
415
388
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
416
389
  function serializeAccessList(accessList) {
417
390
  if (!accessList || accessList.length === 0)
@@ -650,6 +623,115 @@ function toYParitySignatureArray(transaction, signature_) {
650
623
  return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
651
624
  }
652
625
 
626
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/getTransactionCount.js
627
+ async function getTransactionCount(client, { address, blockHash, blockNumber, blockTag = "latest", requireCanonical }) {
628
+ const block = formatBlockParameter({
629
+ blockHash,
630
+ blockNumber,
631
+ blockTag,
632
+ requireCanonical
633
+ });
634
+ const count = await client.request({
635
+ method: "eth_getTransactionCount",
636
+ params: [address, block]
637
+ }, {
638
+ dedupe: typeof blockNumber === "bigint" || blockHash !== void 0
639
+ });
640
+ return hexToNumber(count);
641
+ }
642
+
643
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/nonceManager.js
644
+ function createNonceManager(parameters) {
645
+ const { source } = parameters;
646
+ const deltaMap = /* @__PURE__ */ new Map();
647
+ const nonceMap = new LruMap(8192);
648
+ const promiseMap = /* @__PURE__ */ new Map();
649
+ const getKey = ({ address, chainId }) => `${address}.${chainId}`;
650
+ const resetCache = (key) => {
651
+ deltaMap.delete(key);
652
+ promiseMap.delete(key);
653
+ };
654
+ return {
655
+ async consume({ address, chainId, client }) {
656
+ const key = getKey({ address, chainId });
657
+ const promise = this.get({ address, chainId, client });
658
+ this.increment({ address, chainId });
659
+ const nonce = await promise;
660
+ await source.set({ address, chainId }, nonce);
661
+ nonceMap.set(key, nonce);
662
+ return nonce;
663
+ },
664
+ async increment({ address, chainId }) {
665
+ const key = getKey({ address, chainId });
666
+ const delta = deltaMap.get(key) ?? 0;
667
+ deltaMap.set(key, delta + 1);
668
+ },
669
+ async get({ address, chainId, client }) {
670
+ const key = getKey({ address, chainId });
671
+ let promise = promiseMap.get(key);
672
+ if (!promise) {
673
+ promise = (async () => {
674
+ try {
675
+ const nonce = await source.get({ address, chainId, client });
676
+ const previousNonce = nonceMap.get(key) ?? 0;
677
+ if (previousNonce > 0 && nonce <= previousNonce)
678
+ return previousNonce + 1;
679
+ nonceMap.delete(key);
680
+ return nonce;
681
+ } finally {
682
+ resetCache(key);
683
+ }
684
+ })();
685
+ promiseMap.set(key, promise);
686
+ }
687
+ const delta = deltaMap.get(key) ?? 0;
688
+ return delta + await promise;
689
+ },
690
+ reset({ address, chainId }) {
691
+ const key = getKey({ address, chainId });
692
+ nonceMap.delete(key);
693
+ resetCache(key);
694
+ }
695
+ };
696
+ }
697
+ function jsonRpc() {
698
+ return {
699
+ async get(parameters) {
700
+ const { address, client } = parameters;
701
+ return getTransactionCount(client, {
702
+ address,
703
+ blockTag: "pending"
704
+ });
705
+ },
706
+ set() {
707
+ }
708
+ };
709
+ }
710
+ var nonceManager = /* @__PURE__ */ createNonceManager({
711
+ source: jsonRpc()
712
+ });
713
+
714
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/strings.js
715
+ var presignMessagePrefix = "Ethereum Signed Message:\n";
716
+
717
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
718
+ function toPrefixedMessage(message_) {
719
+ const message = (() => {
720
+ if (typeof message_ === "string")
721
+ return stringToHex(message_);
722
+ if (typeof message_.raw === "string")
723
+ return message_.raw;
724
+ return bytesToHex(message_.raw);
725
+ })();
726
+ const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`);
727
+ return concat([prefix, message]);
728
+ }
729
+
730
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/hashMessage.js
731
+ function hashMessage(message, to_) {
732
+ return keccak256(toPrefixedMessage(message), to_);
733
+ }
734
+
653
735
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/typedData.js
654
736
  var InvalidDomainError = class extends BaseError {
655
737
  constructor({ domain }) {
@@ -786,6 +868,31 @@ function encodeField({ types, name, type, value }) {
786
868
  }
787
869
 
788
870
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/typedData.js
871
+ function serializeTypedData(parameters) {
872
+ const { domain: domain_, message: message_, primaryType, types } = parameters;
873
+ const normalizeData = (struct, data_) => {
874
+ const data = { ...data_ };
875
+ for (const param of struct) {
876
+ const { name, type } = param;
877
+ if (type === "address")
878
+ data[name] = data[name].toLowerCase();
879
+ }
880
+ return data;
881
+ };
882
+ const domain = (() => {
883
+ if (!types.EIP712Domain)
884
+ return {};
885
+ if (!domain_)
886
+ return {};
887
+ return normalizeData(types.EIP712Domain, domain_);
888
+ })();
889
+ const message = (() => {
890
+ if (primaryType === "EIP712Domain")
891
+ return void 0;
892
+ return normalizeData(types[primaryType], message_);
893
+ })();
894
+ return stringify({ domain, message, primaryType, types });
895
+ }
789
896
  function validateTypedData(parameters) {
790
897
  const { domain, message, primaryType, types } = parameters;
791
898
  const validateData = (struct, data) => {
@@ -845,11 +952,34 @@ function getTypesForEIP712Domain({ domain }) {
845
952
  domain?.salt && { name: "salt", type: "bytes32" }
846
953
  ].filter(Boolean);
847
954
  }
955
+ function domainSeparator({ domain }) {
956
+ return hashDomain({
957
+ domain,
958
+ types: {
959
+ EIP712Domain: getTypesForEIP712Domain({ domain })
960
+ }
961
+ });
962
+ }
848
963
  function validateReference(type) {
849
964
  if (type === "address" || type === "bool" || type === "string" || type.startsWith("bytes") || type.startsWith("uint") || type.startsWith("int"))
850
965
  throw new InvalidStructTypeError({ type });
851
966
  }
852
967
 
968
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeSignature.js
969
+ function serializeSignature({ r, s, to = "hex", v, yParity }) {
970
+ const yParity_ = (() => {
971
+ if (yParity === 0 || yParity === 1)
972
+ return yParity;
973
+ if (v && (v === 27n || v === 28n || v >= 35n))
974
+ return v % 2n === 0n ? 1 : 0;
975
+ throw new Error("Invalid `v` or `yParity` value");
976
+ })();
977
+ const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? "1b" : "1c"}`;
978
+ if (to === "hex")
979
+ return signature;
980
+ return hexToBytes(signature);
981
+ }
982
+
853
983
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
854
984
  function publicKeyToAddress(publicKey) {
855
985
  const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);
@@ -883,18 +1013,43 @@ function hashAuthorization(parameters) {
883
1013
  }
884
1014
 
885
1015
  export {
886
- serializeSignature,
887
1016
  publicKeyToAddress,
888
1017
  toRlp,
1018
+ bytesToRlp,
1019
+ hexToRlp,
889
1020
  hashAuthorization,
890
- hashMessage,
1021
+ getTransactionCount,
891
1022
  blobsToCommitments,
892
1023
  blobsToProofs,
1024
+ sha2562 as sha256,
1025
+ commitmentToVersionedHash,
893
1026
  commitmentsToVersionedHashes,
1027
+ toBlobs,
894
1028
  toBlobSidecars,
895
1029
  getTransactionType,
1030
+ assertTransactionEIP7702,
1031
+ assertTransactionEIP4844,
1032
+ assertTransactionEIP1559,
1033
+ assertTransactionEIP2930,
1034
+ assertTransactionLegacy,
1035
+ serializeAccessList,
896
1036
  serializeTransaction,
1037
+ createNonceManager,
1038
+ nonceManager,
1039
+ presignMessagePrefix,
1040
+ toPrefixedMessage,
1041
+ hashMessage,
1042
+ InvalidDomainError,
1043
+ InvalidPrimaryTypeError,
1044
+ InvalidStructTypeError,
1045
+ serializeTypedData,
1046
+ validateTypedData,
1047
+ getTypesForEIP712Domain,
1048
+ domainSeparator,
897
1049
  hashTypedData,
898
- keccak2562 as keccak256
1050
+ hashDomain,
1051
+ hashStruct,
1052
+ keccak2562 as keccak256,
1053
+ serializeSignature
899
1054
  };
900
- //# sourceMappingURL=chunk-T4LKNY7T.js.map
1055
+ //# sourceMappingURL=chunk-M2O56UK7.js.map