tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.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 (132) hide show
  1. package/README.md +156 -188
  2. package/dist/{_esm-FEASBWRP.js → _esm-N4KAVXQR.js} +9 -9
  3. package/dist/buy-OOOLUDND.js +41 -0
  4. package/dist/candidate-TWCWTFGA.js +22 -0
  5. package/dist/{ccip-XR5NE5QK.js → ccip-RPPPKTJR.js} +5 -5
  6. package/dist/{ccip-NQXCEK2U.js → ccip-ZGGWQN4X.js} +4 -4
  7. package/dist/{chunk-XJIW7USF.js → chunk-333FOTUJ.js} +5 -5
  8. package/dist/{chunk-YALGASEU.js → chunk-47PP7TAG.js} +1610 -1610
  9. package/dist/chunk-47PP7TAG.js.map +1 -0
  10. package/dist/{buy-EE6SEXP6.js → chunk-4GR7DGD6.js} +23 -41
  11. package/dist/{buy-EE6SEXP6.js.map → chunk-4GR7DGD6.js.map} +1 -1
  12. package/dist/{chunk-DXTQ3CSI.js → chunk-5JH7ZB6Z.js} +7 -7
  13. package/dist/{chunk-DXTQ3CSI.js.map → chunk-5JH7ZB6Z.js.map} +1 -1
  14. package/dist/{chunk-OYMYCW7J.js → chunk-6WWVYYSB.js} +32 -2
  15. package/dist/{chunk-OYMYCW7J.js.map → chunk-6WWVYYSB.js.map} +1 -1
  16. package/dist/{chunk-UGX7YPX2.js → chunk-7FK2UN2T.js} +65 -65
  17. package/dist/{chunk-UGX7YPX2.js.map → chunk-7FK2UN2T.js.map} +1 -1
  18. package/dist/{chunk-ESPNTPQ2.js → chunk-BXUS5UCT.js} +9 -4
  19. package/dist/{chunk-ESPNTPQ2.js.map → chunk-BXUS5UCT.js.map} +1 -1
  20. package/dist/{chunk-4ONXEEQL.js → chunk-C4TIWOAM.js} +2 -2
  21. package/dist/{chunk-4ONXEEQL.js.map → chunk-C4TIWOAM.js.map} +1 -1
  22. package/dist/{chunk-AWPAWHNX.js → chunk-CJU555P5.js} +24 -24
  23. package/dist/{chunk-AWPAWHNX.js.map → chunk-CJU555P5.js.map} +1 -1
  24. package/dist/{chunk-YN5SHIXQ.js → chunk-DPET3TW5.js} +2 -2
  25. package/dist/{chunk-TLCMMYLY.js → chunk-DPUMEMGM.js} +5 -5
  26. package/dist/chunk-DPUMEMGM.js.map +1 -0
  27. package/dist/{chunk-XHC6FCGZ.js → chunk-EUQN3L5X.js} +9 -9
  28. package/dist/{chunk-XHC6FCGZ.js.map → chunk-EUQN3L5X.js.map} +1 -1
  29. package/dist/{chunk-GO75V3NZ.js → chunk-FHB3VKZW.js} +6 -6
  30. package/dist/{chunk-GO75V3NZ.js.map → chunk-FHB3VKZW.js.map} +1 -1
  31. package/dist/{chunk-S3IGX57D.js → chunk-FU6MCSLG.js} +9 -9
  32. package/dist/{lookup-ZPN2Q67N.js → chunk-H5ETJRQD.js} +40 -31
  33. package/dist/chunk-H5ETJRQD.js.map +1 -0
  34. package/dist/chunk-KXIX7YDV.js +59 -0
  35. package/dist/chunk-KXIX7YDV.js.map +1 -0
  36. package/dist/{chunk-5CLSD5YN.js → chunk-KYQVEKP5.js} +7 -7
  37. package/dist/{chunk-RRN3YTK7.js → chunk-KZAAWQNP.js} +3 -3
  38. package/dist/{chunk-NCE5NSN6.js → chunk-M2O56UK7.js} +158 -158
  39. package/dist/chunk-M2O56UK7.js.map +1 -0
  40. package/dist/{chunk-7KUW4MJD.js → chunk-MM4TGTST.js} +6 -6
  41. package/dist/{chunk-7KUW4MJD.js.map → chunk-MM4TGTST.js.map} +1 -1
  42. package/dist/{chunk-662MSGZB.js → chunk-NXCJN2FJ.js} +55 -28
  43. package/dist/chunk-NXCJN2FJ.js.map +1 -0
  44. package/dist/{candidate-ERMSYYQZ.js → chunk-OJD54DIU.js} +15 -19
  45. package/dist/{candidate-ERMSYYQZ.js.map → chunk-OJD54DIU.js.map} +1 -1
  46. package/dist/{chunk-ZABPQJ3M.js → chunk-POJRB2AE.js} +2 -2
  47. package/dist/{chunk-FJPLRISB.js → chunk-QH6677FJ.js} +5 -4
  48. package/dist/chunk-QH6677FJ.js.map +1 -0
  49. package/dist/{wallet-CWEMYVIH.js → chunk-R7BMDJZM.js} +15 -27
  50. package/dist/{wallet-CWEMYVIH.js.map → chunk-R7BMDJZM.js.map} +1 -1
  51. package/dist/{chunk-Z6MFJV5Z.js → chunk-S3KZ3PPK.js} +15 -11
  52. package/dist/{chunk-Z6MFJV5Z.js.map → chunk-S3KZ3PPK.js.map} +1 -1
  53. package/dist/{chunk-CYOF7ROH.js → chunk-S5RYMCV6.js} +3 -3
  54. package/dist/{chunk-ZMHYXMO6.js → chunk-U5S527PP.js} +3 -3
  55. package/dist/{chunk-RY4XKNV3.js → chunk-UHTVXQ2O.js} +3 -3
  56. package/dist/{publish-BKBQQAW4.js → chunk-ULLWHHIT.js} +19 -34
  57. package/dist/{publish-BKBQQAW4.js.map → chunk-ULLWHHIT.js.map} +1 -1
  58. package/dist/{chunk-Z52RA3NC.js → chunk-VV4P5RVK.js} +47 -20
  59. package/dist/chunk-VV4P5RVK.js.map +1 -0
  60. package/dist/{chunk-QVX5MWJZ.js → chunk-W6R3HAAG.js} +2 -2
  61. package/dist/{chunk-3OV7E5G5.js → chunk-WWX32ML4.js} +1 -1
  62. package/dist/{chunk-3OV7E5G5.js.map → chunk-WWX32ML4.js.map} +1 -1
  63. package/dist/{chunk-HIVZG55D.js → chunk-XJN5WUKL.js} +2 -2
  64. package/dist/{chunk-JPHG2JW3.js → chunk-XNNOR7F7.js} +25 -25
  65. package/dist/chunk-XNNOR7F7.js.map +1 -0
  66. package/dist/{inspect-LMKOXE4Y.js → chunk-YFREUEUI.js} +8 -26
  67. package/dist/{inspect-LMKOXE4Y.js.map → chunk-YFREUEUI.js.map} +1 -1
  68. package/dist/{chunk-HSDCI7OV.js → chunk-YLYINX2H.js} +3 -3
  69. package/dist/{cli-SBXI5AMS.js → cli-AFSLAKR6.js} +47 -36
  70. package/dist/{cli-SBXI5AMS.js.map → cli-AFSLAKR6.js.map} +1 -1
  71. package/dist/{config-VELDKLHY.js → config-DBEEM3UA.js} +5 -5
  72. package/dist/{doctor-T3KWNNP2.js → doctor-XDA3YU6H.js} +7 -7
  73. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-WHYKB6HA.js} +5 -5
  74. package/dist/index.js +1 -1
  75. package/dist/inspect-YBGDAG47.js +33 -0
  76. package/dist/{install-LEX3ENQ6.js → install-7J6KKEEP.js} +240 -85
  77. package/dist/install-7J6KKEEP.js.map +1 -0
  78. package/dist/outcome-ZFGHX2XW.js +20 -0
  79. package/dist/publish-IH7RJXGB.js +36 -0
  80. package/dist/publish-IH7RJXGB.js.map +1 -0
  81. package/dist/run-DCZFEW2C.js +16806 -0
  82. package/dist/run-DCZFEW2C.js.map +1 -0
  83. package/dist/search-R6NIQFXI.js +24 -0
  84. package/dist/search-R6NIQFXI.js.map +1 -0
  85. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-XRPVBC6V.js} +3 -3
  86. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  87. package/dist/usdc-AU6ZIKA6.js +22 -0
  88. package/dist/usdc-AU6ZIKA6.js.map +1 -0
  89. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-TUQJBMHM.js} +5 -5
  90. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  91. package/dist/{wallet-PA54CRBL.js → wallet-HKG3GSTX.js} +10 -10
  92. package/dist/wallet-HKG3GSTX.js.map +1 -0
  93. package/dist/wallet-UWHSHWC6.js +31 -0
  94. package/dist/wallet-UWHSHWC6.js.map +1 -0
  95. package/package.json +4 -3
  96. package/skills/tenjin/SKILL.md +56 -13
  97. package/skills/tenjin-publish/SKILL.md +21 -6
  98. package/skills/tenjin-search/SKILL.md +35 -20
  99. package/dist/chunk-662MSGZB.js.map +0 -1
  100. package/dist/chunk-FJPLRISB.js.map +0 -1
  101. package/dist/chunk-JPHG2JW3.js.map +0 -1
  102. package/dist/chunk-NCE5NSN6.js.map +0 -1
  103. package/dist/chunk-TLCMMYLY.js.map +0 -1
  104. package/dist/chunk-YALGASEU.js.map +0 -1
  105. package/dist/chunk-Z52RA3NC.js.map +0 -1
  106. package/dist/install-LEX3ENQ6.js.map +0 -1
  107. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  108. package/dist/outcome-N7TAK6WR.js +0 -66
  109. package/dist/outcome-N7TAK6WR.js.map +0 -1
  110. package/dist/usdc-JIAJW4SV.js +0 -22
  111. /package/dist/{_esm-FEASBWRP.js.map → _esm-N4KAVXQR.js.map} +0 -0
  112. /package/dist/{ccip-NQXCEK2U.js.map → buy-OOOLUDND.js.map} +0 -0
  113. /package/dist/{ccip-XR5NE5QK.js.map → candidate-TWCWTFGA.js.map} +0 -0
  114. /package/dist/{config-VELDKLHY.js.map → ccip-RPPPKTJR.js.map} +0 -0
  115. /package/dist/{doctor-T3KWNNP2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  116. /package/dist/{chunk-XJIW7USF.js.map → chunk-333FOTUJ.js.map} +0 -0
  117. /package/dist/{chunk-YN5SHIXQ.js.map → chunk-DPET3TW5.js.map} +0 -0
  118. /package/dist/{chunk-S3IGX57D.js.map → chunk-FU6MCSLG.js.map} +0 -0
  119. /package/dist/{chunk-5CLSD5YN.js.map → chunk-KYQVEKP5.js.map} +0 -0
  120. /package/dist/{chunk-RRN3YTK7.js.map → chunk-KZAAWQNP.js.map} +0 -0
  121. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POJRB2AE.js.map} +0 -0
  122. /package/dist/{chunk-CYOF7ROH.js.map → chunk-S5RYMCV6.js.map} +0 -0
  123. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-U5S527PP.js.map} +0 -0
  124. /package/dist/{chunk-RY4XKNV3.js.map → chunk-UHTVXQ2O.js.map} +0 -0
  125. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-W6R3HAAG.js.map} +0 -0
  126. /package/dist/{chunk-HIVZG55D.js.map → chunk-XJN5WUKL.js.map} +0 -0
  127. /package/dist/{chunk-HSDCI7OV.js.map → chunk-YLYINX2H.js.map} +0 -0
  128. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → config-DBEEM3UA.js.map} +0 -0
  129. /package/dist/{secp256k1-N3ZHU7LB.js.map → doctor-XDA3YU6H.js.map} +0 -0
  130. /package/dist/{usdc-JIAJW4SV.js.map → ethersCompat-Df4a6QIZ-WHYKB6HA.js.map} +0 -0
  131. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → inspect-YBGDAG47.js.map} +0 -0
  132. /package/dist/{wallet-PA54CRBL.js.map → outcome-ZFGHX2XW.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  sha256
4
- } from "./chunk-RY4XKNV3.js";
4
+ } from "./chunk-UHTVXQ2O.js";
5
5
  import {
6
6
  secp256k1
7
- } from "./chunk-QVX5MWJZ.js";
7
+ } from "./chunk-W6R3HAAG.js";
8
8
  import {
9
9
  BaseError,
10
10
  BytesSizeMismatchError,
@@ -24,7 +24,7 @@ import {
24
24
  createCursor,
25
25
  encodeAbiParameters,
26
26
  formatBlockParameter,
27
- from2 as from,
27
+ from,
28
28
  fromBytes,
29
29
  hexToBigInt,
30
30
  hexToBytes,
@@ -42,113 +42,10 @@ import {
42
42
  toBytes,
43
43
  toHex,
44
44
  trim
45
- } from "./chunk-YALGASEU.js";
45
+ } from "./chunk-47PP7TAG.js";
46
46
  import {
47
47
  keccak_256
48
- } from "./chunk-HIVZG55D.js";
49
-
50
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/getTransactionCount.js
51
- async function getTransactionCount(client, { address, blockHash, blockNumber, blockTag = "latest", requireCanonical }) {
52
- const block = formatBlockParameter({
53
- blockHash,
54
- blockNumber,
55
- blockTag,
56
- requireCanonical
57
- });
58
- const count = await client.request({
59
- method: "eth_getTransactionCount",
60
- params: [address, block]
61
- }, {
62
- dedupe: typeof blockNumber === "bigint" || blockHash !== void 0
63
- });
64
- return hexToNumber(count);
65
- }
66
-
67
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/nonceManager.js
68
- function createNonceManager(parameters) {
69
- const { source } = parameters;
70
- const deltaMap = /* @__PURE__ */ new Map();
71
- const nonceMap = new LruMap(8192);
72
- const promiseMap = /* @__PURE__ */ new Map();
73
- const getKey = ({ address, chainId }) => `${address}.${chainId}`;
74
- const resetCache = (key) => {
75
- deltaMap.delete(key);
76
- promiseMap.delete(key);
77
- };
78
- return {
79
- async consume({ address, chainId, client }) {
80
- const key = getKey({ address, chainId });
81
- const promise = this.get({ address, chainId, client });
82
- this.increment({ address, chainId });
83
- const nonce = await promise;
84
- await source.set({ address, chainId }, nonce);
85
- nonceMap.set(key, nonce);
86
- return nonce;
87
- },
88
- async increment({ address, chainId }) {
89
- const key = getKey({ address, chainId });
90
- const delta = deltaMap.get(key) ?? 0;
91
- deltaMap.set(key, delta + 1);
92
- },
93
- async get({ address, chainId, client }) {
94
- const key = getKey({ address, chainId });
95
- let promise = promiseMap.get(key);
96
- if (!promise) {
97
- promise = (async () => {
98
- try {
99
- const nonce = await source.get({ address, chainId, client });
100
- const previousNonce = nonceMap.get(key) ?? 0;
101
- if (previousNonce > 0 && nonce <= previousNonce)
102
- return previousNonce + 1;
103
- nonceMap.delete(key);
104
- return nonce;
105
- } finally {
106
- resetCache(key);
107
- }
108
- })();
109
- promiseMap.set(key, promise);
110
- }
111
- const delta = deltaMap.get(key) ?? 0;
112
- return delta + await promise;
113
- },
114
- reset({ address, chainId }) {
115
- const key = getKey({ address, chainId });
116
- nonceMap.delete(key);
117
- resetCache(key);
118
- }
119
- };
120
- }
121
- function jsonRpc() {
122
- return {
123
- async get(parameters) {
124
- const { address, client } = parameters;
125
- return getTransactionCount(client, {
126
- address,
127
- blockTag: "pending"
128
- });
129
- },
130
- set() {
131
- }
132
- };
133
- }
134
- var nonceManager = /* @__PURE__ */ createNonceManager({
135
- source: jsonRpc()
136
- });
137
-
138
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/serializeSignature.js
139
- function serializeSignature({ r, s, to = "hex", v, yParity }) {
140
- const yParity_ = (() => {
141
- if (yParity === 0 || yParity === 1)
142
- return yParity;
143
- if (v && (v === 27n || v === 28n || v >= 35n))
144
- return v % 2n === 0n ? 1 : 0;
145
- throw new Error("Invalid `v` or `yParity` value");
146
- })();
147
- const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? "1b" : "1c"}`;
148
- if (to === "hex")
149
- return signature;
150
- return hexToBytes(signature);
151
- }
48
+ } from "./chunk-XJN5WUKL.js";
152
49
 
153
50
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toRlp.js
154
51
  function toRlp(bytes, to = "hex") {
@@ -245,27 +142,6 @@ function getSizeOfLength(length) {
245
142
  throw new BaseError("Length is too large.");
246
143
  }
247
144
 
248
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/strings.js
249
- var presignMessagePrefix = "Ethereum Signed Message:\n";
250
-
251
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
252
- function toPrefixedMessage(message_) {
253
- const message = (() => {
254
- if (typeof message_ === "string")
255
- return stringToHex(message_);
256
- if (typeof message_.raw === "string")
257
- return message_.raw;
258
- return bytesToHex(message_.raw);
259
- })();
260
- const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`);
261
- return concat([prefix, message]);
262
- }
263
-
264
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/hashMessage.js
265
- function hashMessage(message, to_) {
266
- return keccak256(toPrefixedMessage(message), to_);
267
- }
268
-
269
145
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
270
146
  function blobsToCommitments(parameters) {
271
147
  const { kzg } = parameters;
@@ -422,6 +298,25 @@ function toBlobSidecars(parameters) {
422
298
  return sidecars;
423
299
  }
424
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
+
425
320
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/assertTransaction.js
426
321
  function assertTransactionEIP7702(transaction) {
427
322
  const { authorizationList } = transaction;
@@ -490,25 +385,6 @@ function assertTransactionLegacy(transaction) {
490
385
  throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
491
386
  }
492
387
 
493
- // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/getTransactionType.js
494
- function getTransactionType(transaction) {
495
- if (transaction.type)
496
- return transaction.type;
497
- if (typeof transaction.authorizationList !== "undefined")
498
- return "eip7702";
499
- if (typeof transaction.blobs !== "undefined" || typeof transaction.blobVersionedHashes !== "undefined" || typeof transaction.maxFeePerBlobGas !== "undefined" || typeof transaction.sidecars !== "undefined")
500
- return "eip4844";
501
- if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") {
502
- return "eip1559";
503
- }
504
- if (typeof transaction.gasPrice !== "undefined") {
505
- if (typeof transaction.accessList !== "undefined")
506
- return "eip2930";
507
- return "legacy";
508
- }
509
- throw new InvalidSerializableTransactionError({ transaction });
510
- }
511
-
512
388
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
513
389
  function serializeAccessList(accessList) {
514
390
  if (!accessList || accessList.length === 0)
@@ -747,6 +623,115 @@ function toYParitySignatureArray(transaction, signature_) {
747
623
  return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
748
624
  }
749
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
+
750
735
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/typedData.js
751
736
  var InvalidDomainError = class extends BaseError {
752
737
  constructor({ domain }) {
@@ -980,6 +965,21 @@ function validateReference(type) {
980
965
  throw new InvalidStructTypeError({ type });
981
966
  }
982
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
+
983
983
  // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
984
984
  function publicKeyToAddress(publicKey) {
985
985
  const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);
@@ -1013,18 +1013,12 @@ function hashAuthorization(parameters) {
1013
1013
  }
1014
1014
 
1015
1015
  export {
1016
- getTransactionCount,
1017
- createNonceManager,
1018
- nonceManager,
1019
- serializeSignature,
1020
1016
  publicKeyToAddress,
1021
1017
  toRlp,
1022
1018
  bytesToRlp,
1023
1019
  hexToRlp,
1024
1020
  hashAuthorization,
1025
- presignMessagePrefix,
1026
- toPrefixedMessage,
1027
- hashMessage,
1021
+ getTransactionCount,
1028
1022
  blobsToCommitments,
1029
1023
  blobsToProofs,
1030
1024
  sha2562 as sha256,
@@ -1032,14 +1026,19 @@ export {
1032
1026
  commitmentsToVersionedHashes,
1033
1027
  toBlobs,
1034
1028
  toBlobSidecars,
1029
+ getTransactionType,
1035
1030
  assertTransactionEIP7702,
1036
1031
  assertTransactionEIP4844,
1037
1032
  assertTransactionEIP1559,
1038
1033
  assertTransactionEIP2930,
1039
1034
  assertTransactionLegacy,
1040
- getTransactionType,
1041
1035
  serializeAccessList,
1042
1036
  serializeTransaction,
1037
+ createNonceManager,
1038
+ nonceManager,
1039
+ presignMessagePrefix,
1040
+ toPrefixedMessage,
1041
+ hashMessage,
1043
1042
  InvalidDomainError,
1044
1043
  InvalidPrimaryTypeError,
1045
1044
  InvalidStructTypeError,
@@ -1050,6 +1049,7 @@ export {
1050
1049
  hashTypedData,
1051
1050
  hashDomain,
1052
1051
  hashStruct,
1053
- keccak2562 as keccak256
1052
+ keccak2562 as keccak256,
1053
+ serializeSignature
1054
1054
  };
1055
- //# sourceMappingURL=chunk-NCE5NSN6.js.map
1055
+ //# sourceMappingURL=chunk-M2O56UK7.js.map