@arp-protocol/cli 0.0.1 → 0.0.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 (31) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/LICENSE +26 -0
  3. package/README.md +22 -8
  4. package/dist/chunks/backfill-5zmh0t43.js +1050 -0
  5. package/dist/chunks/{ccip-qmytgn8e.js → ccip-zxtpc4fx.js} +4 -4
  6. package/dist/chunks/check-k4qnc9ee.js +2011 -0
  7. package/dist/chunks/cli-00qp1sj2.js +116 -0
  8. package/dist/chunks/{cli-c8568g4c.js → cli-0gsbnq5w.js} +72 -72
  9. package/dist/chunks/{cli-zpft011j.js → cli-64fx73kx.js} +3 -3
  10. package/dist/chunks/cli-7c393v47.js +173 -0
  11. package/dist/chunks/{cli-0z6f3603.js → cli-8m56jsfx.js} +239 -183
  12. package/dist/chunks/{cli-v446mw5v.js → cli-fbwpcfvp.js} +34 -34
  13. package/dist/chunks/cli-kda5hz4w.js +23 -0
  14. package/dist/chunks/{cli-0hqxver6.js → cli-mhzh9z8k.js} +33 -33
  15. package/dist/chunks/{cli-tyey74p3.js → cli-n4qagybd.js} +6 -2
  16. package/dist/chunks/{cli-74hv4etk.js → cli-wer26exb.js} +4939 -4105
  17. package/dist/chunks/cli-zehr6kdx.js +719 -0
  18. package/dist/chunks/{commands-dnk10vze.js → commands-t5a0w785.js} +88 -17
  19. package/dist/chunks/{env-s4585w6j.js → env-n5ac8d1z.js} +1 -0
  20. package/dist/chunks/{index-3a3ssef1.js → index-jrs2shcc.js} +3 -3
  21. package/dist/chunks/line-kvm1ew55.js +215 -0
  22. package/dist/chunks/{node-init-4v2m2vj0.js → node-init-amedveja.js} +7 -6
  23. package/dist/chunks/{node-0ydee9hy.js → node-x35ncwhq.js} +7 -6
  24. package/dist/chunks/server-ek7fet5m.js +6924 -0
  25. package/dist/chunks/{share-g8v5qe6r.js → share-ax2k8805.js} +10 -5
  26. package/dist/cli.js +71 -19
  27. package/dist/hook.js +4178 -270
  28. package/package.json +10 -3
  29. package/dist/chunks/backfill-j4hxt1w1.js +0 -262
  30. package/dist/chunks/line-zy1tc2np.js +0 -45
  31. package/dist/chunks/server-jmyjttvv.js +0 -3170
@@ -32,7 +32,7 @@ import {
32
32
  toBytes,
33
33
  toHex,
34
34
  trim
35
- } from "./cli-0hqxver6.js";
35
+ } from "./cli-mhzh9z8k.js";
36
36
  import {
37
37
  secp256k1,
38
38
  sha256
@@ -43,12 +43,12 @@ var DECIMAL = /^(0|[1-9][0-9]*)$/;
43
43
  var ERC8004_REGISTRY = /^eip155:([1-9][0-9]*):(0x[0-9a-fA-F]{40})$/;
44
44
  var CAIP19_ERC721 = /^eip155:([1-9][0-9]*)\/erc721:(0x[0-9a-fA-F]{40})\/(0|[1-9][0-9]*)$/;
45
45
 
46
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/generatePrivateKey.js
46
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/generatePrivateKey.js
47
47
  function generatePrivateKey() {
48
48
  return toHex(secp256k1.utils.randomPrivateKey());
49
49
  }
50
50
 
51
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
51
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
52
52
  function publicKeyToAddress(publicKey) {
53
53
  const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);
54
54
  return checksumAddress(`0x${address}`);
@@ -57,7 +57,7 @@ function publicKeyToAddress(publicKey) {
57
57
  // ../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
58
58
  var sha2562 = sha256;
59
59
 
60
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/hash/sha256.js
60
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/hash/sha256.js
61
61
  function sha2563(value, to_) {
62
62
  const to = to_ || "hex";
63
63
  const bytes = sha2562(isHex(value, { strict: false }) ? toBytes(value) : value);
@@ -66,7 +66,7 @@ function sha2563(value, to_) {
66
66
  return toHex(bytes);
67
67
  }
68
68
 
69
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/toAccount.js
69
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/toAccount.js
70
70
  function toAccount(source) {
71
71
  if (typeof source === "string") {
72
72
  if (!isAddress(source, { strict: false }))
@@ -91,7 +91,7 @@ function toAccount(source) {
91
91
  };
92
92
  }
93
93
 
94
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/signature/serializeSignature.js
94
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/signature/serializeSignature.js
95
95
  function serializeSignature({ r, s, to = "hex", v, yParity }) {
96
96
  const yParity_ = (() => {
97
97
  if (yParity === 0 || yParity === 1)
@@ -106,7 +106,7 @@ function serializeSignature({ r, s, to = "hex", v, yParity }) {
106
106
  return hexToBytes(signature);
107
107
  }
108
108
 
109
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/sign.js
109
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/sign.js
110
110
  var extraEntropy = false;
111
111
  async function sign({ hash, privateKey, to = "object" }) {
112
112
  const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2), {
@@ -126,7 +126,7 @@ async function sign({ hash, privateKey, to = "object" }) {
126
126
  })();
127
127
  }
128
128
 
129
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/encoding/toRlp.js
129
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/encoding/toRlp.js
130
130
  function toRlp(bytes, to = "hex") {
131
131
  const encodable = getEncodable(bytes);
132
132
  const cursor = createCursor(new Uint8Array(encodable.length));
@@ -215,7 +215,7 @@ function getSizeOfLength(length) {
215
215
  throw new BaseError("Length is too large.");
216
216
  }
217
217
 
218
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
218
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
219
219
  function hashAuthorization(parameters) {
220
220
  const { chainId, nonce, to } = parameters;
221
221
  const address = parameters.contractAddress ?? parameters.address;
@@ -232,7 +232,7 @@ function hashAuthorization(parameters) {
232
232
  return hash;
233
233
  }
234
234
 
235
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/signAuthorization.js
235
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/signAuthorization.js
236
236
  async function signAuthorization(parameters) {
237
237
  const { chainId, nonce, privateKey, to = "object" } = parameters;
238
238
  const address = parameters.contractAddress ?? parameters.address;
@@ -251,11 +251,11 @@ async function signAuthorization(parameters) {
251
251
  return signature;
252
252
  }
253
253
 
254
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/constants/strings.js
254
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/constants/strings.js
255
255
  var presignMessagePrefix = `\x19Ethereum Signed Message:
256
256
  `;
257
257
 
258
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
258
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
259
259
  function toPrefixedMessage(message_) {
260
260
  const message = (() => {
261
261
  if (typeof message_ === "string")
@@ -268,17 +268,17 @@ function toPrefixedMessage(message_) {
268
268
  return concat([prefix, message]);
269
269
  }
270
270
 
271
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/signature/hashMessage.js
271
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/signature/hashMessage.js
272
272
  function hashMessage(message, to_) {
273
273
  return keccak256(toPrefixedMessage(message), to_);
274
274
  }
275
275
 
276
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/signMessage.js
276
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/signMessage.js
277
277
  async function signMessage({ message, privateKey }) {
278
278
  return await sign({ hash: hashMessage(message), privateKey, to: "hex" });
279
279
  }
280
280
 
281
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
281
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
282
282
  function serializeAuthorizationList(authorizationList) {
283
283
  if (!authorizationList || authorizationList.length === 0)
284
284
  return [];
@@ -296,7 +296,7 @@ function serializeAuthorizationList(authorizationList) {
296
296
  return serializedAuthorizationList;
297
297
  }
298
298
 
299
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
299
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
300
300
  function blobsToCommitments(parameters) {
301
301
  const { kzg } = parameters;
302
302
  const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
@@ -307,7 +307,7 @@ function blobsToCommitments(parameters) {
307
307
  return to === "bytes" ? commitments : commitments.map((x) => bytesToHex(x));
308
308
  }
309
309
 
310
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/blobsToProofs.js
310
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/blobsToProofs.js
311
311
  function blobsToProofs(parameters) {
312
312
  const { kzg } = parameters;
313
313
  const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
@@ -322,7 +322,7 @@ function blobsToProofs(parameters) {
322
322
  return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x));
323
323
  }
324
324
 
325
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
325
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
326
326
  function commitmentToVersionedHash(parameters) {
327
327
  const { commitment, version = 1 } = parameters;
328
328
  const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
@@ -331,7 +331,7 @@ function commitmentToVersionedHash(parameters) {
331
331
  return to === "bytes" ? versionedHash : bytesToHex(versionedHash);
332
332
  }
333
333
 
334
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
334
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
335
335
  function commitmentsToVersionedHashes(parameters) {
336
336
  const { commitments, version } = parameters;
337
337
  const to = parameters.to ?? (typeof commitments[0] === "string" ? "hex" : "bytes");
@@ -346,17 +346,17 @@ function commitmentsToVersionedHashes(parameters) {
346
346
  return hashes;
347
347
  }
348
348
 
349
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/constants/blob.js
349
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/constants/blob.js
350
350
  var blobsPerTransaction = 6;
351
351
  var bytesPerFieldElement = 32;
352
352
  var fieldElementsPerBlob = 4096;
353
353
  var bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
354
354
  var maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - 1 - 1 * fieldElementsPerBlob * blobsPerTransaction;
355
355
 
356
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/constants/kzg.js
356
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/constants/kzg.js
357
357
  var versionedHashVersionKzg = 1;
358
358
 
359
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/blob.js
359
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/blob.js
360
360
  class BlobSizeTooLargeError extends BaseError {
361
361
  constructor({ maxSize, size: size2 }) {
362
362
  super("Blob size is too large.", {
@@ -393,7 +393,7 @@ class InvalidVersionedHashVersionError extends BaseError {
393
393
  }
394
394
  }
395
395
 
396
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/toBlobs.js
396
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/toBlobs.js
397
397
  function toBlobs(parameters) {
398
398
  const to = parameters.to ?? (typeof parameters.data === "string" ? "hex" : "bytes");
399
399
  const data = typeof parameters.data === "string" ? hexToBytes(parameters.data) : parameters.data;
@@ -428,7 +428,7 @@ function toBlobs(parameters) {
428
428
  return to === "bytes" ? blobs.map((x) => x.bytes) : blobs.map((x) => bytesToHex(x.bytes));
429
429
  }
430
430
 
431
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/blob/toBlobSidecars.js
431
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/blob/toBlobSidecars.js
432
432
  function toBlobSidecars(parameters) {
433
433
  const { data, kzg, to } = parameters;
434
434
  const blobs = parameters.blobs ?? toBlobs({ data, to });
@@ -444,7 +444,7 @@ function toBlobSidecars(parameters) {
444
444
  return sidecars;
445
445
  }
446
446
 
447
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/transaction/assertTransaction.js
447
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/transaction/assertTransaction.js
448
448
  function assertTransactionEIP7702(transaction) {
449
449
  const { authorizationList } = transaction;
450
450
  if (authorizationList) {
@@ -512,7 +512,7 @@ function assertTransactionLegacy(transaction) {
512
512
  throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
513
513
  }
514
514
 
515
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/transaction/getTransactionType.js
515
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/transaction/getTransactionType.js
516
516
  function getTransactionType(transaction) {
517
517
  if (transaction.type)
518
518
  return transaction.type;
@@ -531,7 +531,7 @@ function getTransactionType(transaction) {
531
531
  throw new InvalidSerializableTransactionError({ transaction });
532
532
  }
533
533
 
534
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
534
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
535
535
  function serializeAccessList(accessList) {
536
536
  if (!accessList || accessList.length === 0)
537
537
  return [];
@@ -551,7 +551,7 @@ function serializeAccessList(accessList) {
551
551
  return serializedAccessList;
552
552
  }
553
553
 
554
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/transaction/serializeTransaction.js
554
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/transaction/serializeTransaction.js
555
555
  function serializeTransaction(transaction, signature) {
556
556
  const type = getTransactionType(transaction);
557
557
  if (type === "eip1559")
@@ -745,7 +745,7 @@ function toYParitySignatureArray(transaction, signature_) {
745
745
  return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
746
746
  }
747
747
 
748
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/signTransaction.js
748
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/signTransaction.js
749
749
  async function signTransaction(parameters) {
750
750
  const { privateKey, transaction, serializer = serializeTransaction } = parameters;
751
751
  const signableTransaction = (() => {
@@ -763,7 +763,7 @@ async function signTransaction(parameters) {
763
763
  return await serializer(transaction, signature);
764
764
  }
765
765
 
766
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/typedData.js
766
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/typedData.js
767
767
  class InvalidDomainError extends BaseError {
768
768
  constructor({ domain }) {
769
769
  super(`Invalid domain "${stringify(domain)}".`, {
@@ -790,7 +790,7 @@ class InvalidStructTypeError extends BaseError {
790
790
  }
791
791
  }
792
792
 
793
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/typedData.js
793
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/typedData.js
794
794
  function serializeTypedData(parameters) {
795
795
  const { domain: domain_, message: message_, primaryType, types } = parameters;
796
796
  const normalizeData = (struct, data_) => {
@@ -880,7 +880,7 @@ function validateReference(type) {
880
880
  throw new InvalidStructTypeError({ type });
881
881
  }
882
882
 
883
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/signature/hashTypedData.js
883
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/signature/hashTypedData.js
884
884
  function hashTypedData(parameters) {
885
885
  const { domain = {}, message, primaryType } = parameters;
886
886
  const types = {
@@ -990,7 +990,7 @@ function encodeField({ types, name, type, value }) {
990
990
  return [{ type }, value];
991
991
  }
992
992
 
993
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/utils/signTypedData.js
993
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/utils/signTypedData.js
994
994
  async function signTypedData(parameters) {
995
995
  const { privateKey, ...typedData } = parameters;
996
996
  return await sign({
@@ -1000,7 +1000,7 @@ async function signTypedData(parameters) {
1000
1000
  });
1001
1001
  }
1002
1002
 
1003
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/accounts/privateKeyToAccount.js
1003
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/accounts/privateKeyToAccount.js
1004
1004
  function privateKeyToAccount(privateKey, options = {}) {
1005
1005
  const { nonceManager } = options;
1006
1006
  const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false));
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ../../packages/protocol/src/declare/line-need.ts
4
+ var NEEDS_LABEL = "needs";
5
+ var WITH_LABEL = "with";
6
+ var PROGRAM_NAME = /^[a-z0-9][a-z0-9._+-]{0,39}$/;
7
+ var KEY_NAME = /^[A-Z][A-Z0-9_]{2,63}$/;
8
+ function needKindOf(name) {
9
+ if (PROGRAM_NAME.test(name))
10
+ return "program";
11
+ if (KEY_NAME.test(name))
12
+ return "key";
13
+ return null;
14
+ }
15
+ function needKindOfReason(reason) {
16
+ if (reason === "missing-program")
17
+ return "program";
18
+ if (reason === "missing-key")
19
+ return "key";
20
+ return null;
21
+ }
22
+
23
+ export { NEEDS_LABEL, WITH_LABEL, PROGRAM_NAME, KEY_NAME, needKindOf, needKindOfReason };
@@ -17,7 +17,7 @@ import {
17
17
  u32
18
18
  } from "./cli-3kbbwfbp.js";
19
19
 
20
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/isHex.js
20
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/isHex.js
21
21
  function isHex(value, { strict = true } = {}) {
22
22
  if (!value)
23
23
  return false;
@@ -26,7 +26,7 @@ function isHex(value, { strict = true } = {}) {
26
26
  return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
27
27
  }
28
28
 
29
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/concat.js
29
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/concat.js
30
30
  function concat(values) {
31
31
  if (typeof values[0] === "string")
32
32
  return concatHex(values);
@@ -49,7 +49,7 @@ function concatHex(values) {
49
49
  return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
50
50
  }
51
51
 
52
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/constants/unit.js
52
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/constants/unit.js
53
53
  var etherUnits = {
54
54
  gwei: 9,
55
55
  wei: 18
@@ -59,7 +59,7 @@ var gweiUnits = {
59
59
  wei: 9
60
60
  };
61
61
 
62
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/unit/formatUnits.js
62
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/unit/formatUnits.js
63
63
  function formatUnits(value, decimals) {
64
64
  let display = value.toString();
65
65
  const negative = display.startsWith("-");
@@ -74,12 +74,12 @@ function formatUnits(value, decimals) {
74
74
  return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
75
75
  }
76
76
 
77
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/unit/formatEther.js
77
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/unit/formatEther.js
78
78
  function formatEther(wei, unit = "wei") {
79
79
  return formatUnits(wei, etherUnits[unit]);
80
80
  }
81
81
 
82
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/abi/formatAbiItem.js
82
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/abi/formatAbiItem.js
83
83
  function formatAbiItem(abiItem, { includeName = false } = {}) {
84
84
  if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
85
85
  throw new InvalidDefinitionTypeError(abiItem.type);
@@ -97,17 +97,17 @@ function formatAbiParam(param, { includeName }) {
97
97
  return param.type + (includeName && param.name ? ` ${param.name}` : "");
98
98
  }
99
99
 
100
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/size.js
100
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/size.js
101
101
  function size(value) {
102
102
  if (isHex(value, { strict: false }))
103
103
  return Math.ceil((value.length - 2) / 2);
104
104
  return value.length;
105
105
  }
106
106
 
107
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/version.js
107
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/version.js
108
108
  var version = "2.52.0";
109
109
 
110
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/base.js
110
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/base.js
111
111
  var errorConfig = {
112
112
  getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : undefined,
113
113
  version: `viem@${version}`
@@ -192,7 +192,7 @@ function walk(err, fn) {
192
192
  return fn ? null : err;
193
193
  }
194
194
 
195
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/abi.js
195
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/abi.js
196
196
  class AbiConstructorNotFoundError extends BaseError {
197
197
  constructor({ docsPath }) {
198
198
  super([
@@ -536,7 +536,7 @@ class InvalidDefinitionTypeError extends BaseError {
536
536
  }
537
537
  }
538
538
 
539
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/address.js
539
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/address.js
540
540
  class InvalidAddressError extends BaseError {
541
541
  constructor({ address }) {
542
542
  super(`Address "${address}" is invalid.`, {
@@ -549,7 +549,7 @@ class InvalidAddressError extends BaseError {
549
549
  }
550
550
  }
551
551
 
552
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/encoding.js
552
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/encoding.js
553
553
  class IntegerOutOfRangeError extends BaseError {
554
554
  constructor({ max, min, signed, size: size2, value }) {
555
555
  super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
@@ -575,7 +575,7 @@ class SizeOverflowError extends BaseError {
575
575
  }
576
576
  }
577
577
 
578
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/lru.js
578
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/lru.js
579
579
  class LruMap extends Map {
580
580
  constructor(size2) {
581
581
  super();
@@ -608,7 +608,7 @@ class LruMap extends Map {
608
608
  }
609
609
  }
610
610
 
611
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/data.js
611
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/data.js
612
612
  class SliceOffsetOutOfBoundsError extends BaseError {
613
613
  constructor({ offset, position, size: size2 }) {
614
614
  super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
@@ -627,7 +627,7 @@ class InvalidBytesLengthError extends BaseError {
627
627
  }
628
628
  }
629
629
 
630
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/pad.js
630
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/pad.js
631
631
  function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
632
632
  if (typeof hexOrBytes === "string")
633
633
  return padHex(hexOrBytes, { dir, size: size2 });
@@ -662,7 +662,7 @@ function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
662
662
  return paddedBytes;
663
663
  }
664
664
 
665
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/trim.js
665
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/trim.js
666
666
  function trim(hexOrBytes, { dir = "left" } = {}) {
667
667
  let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
668
668
  let sliceLength = 0;
@@ -681,7 +681,7 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
681
681
  return data;
682
682
  }
683
683
 
684
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/encoding/fromHex.js
684
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/encoding/fromHex.js
685
685
  function assertSize(hexOrBytes, { size: size2 }) {
686
686
  if (size(hexOrBytes) > size2)
687
687
  throw new SizeOverflowError({
@@ -728,7 +728,7 @@ function hexToNumber(hex, opts = {}) {
728
728
  return number;
729
729
  }
730
730
 
731
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/encoding/toHex.js
731
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/encoding/toHex.js
732
732
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
733
733
  function toHex(value, opts = {}) {
734
734
  if (typeof value === "number" || typeof value === "bigint")
@@ -794,7 +794,7 @@ function stringToHex(value_, opts = {}) {
794
794
  return bytesToHex(value, opts);
795
795
  }
796
796
 
797
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/encoding/toBytes.js
797
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/encoding/toBytes.js
798
798
  var encoder2 = /* @__PURE__ */ new TextEncoder;
799
799
  function toBytes2(value, opts = {}) {
800
800
  if (typeof value === "number" || typeof value === "bigint")
@@ -1046,7 +1046,7 @@ class Keccak extends Hash {
1046
1046
  var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
1047
1047
  var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
1048
1048
 
1049
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/hash/keccak256.js
1049
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/hash/keccak256.js
1050
1050
  function keccak256(value, to_) {
1051
1051
  const to = to_ || "hex";
1052
1052
  const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes2(value) : value);
@@ -1055,7 +1055,7 @@ function keccak256(value, to_) {
1055
1055
  return toHex(bytes);
1056
1056
  }
1057
1057
 
1058
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/address/getAddress.js
1058
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/address/getAddress.js
1059
1059
  var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
1060
1060
  function checksumAddress(address_, chainId) {
1061
1061
  if (checksumAddressCache.has(`${address_}.${chainId}`))
@@ -1081,7 +1081,7 @@ function getAddress(address, chainId) {
1081
1081
  return checksumAddress(address, chainId);
1082
1082
  }
1083
1083
 
1084
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/address/isAddress.js
1084
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/address/isAddress.js
1085
1085
  var addressRegex = /^0x[a-fA-F0-9]{40}$/;
1086
1086
  var isAddressCache = /* @__PURE__ */ new LruMap(8192);
1087
1087
  function isAddress(address, options) {
@@ -1102,7 +1102,7 @@ function isAddress(address, options) {
1102
1102
  return result;
1103
1103
  }
1104
1104
 
1105
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/data/slice.js
1105
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/data/slice.js
1106
1106
  function slice(value, start, end, { strict } = {}) {
1107
1107
  if (isHex(value, { strict: false }))
1108
1108
  return sliceHex(value, start, end, {
@@ -1144,11 +1144,11 @@ function sliceHex(value_, start, end, { strict } = {}) {
1144
1144
  return value;
1145
1145
  }
1146
1146
 
1147
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/regex.js
1147
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/regex.js
1148
1148
  var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
1149
1149
  var integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
1150
1150
 
1151
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
1151
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
1152
1152
  function encodeAbiParameters(params, values) {
1153
1153
  if (params.length !== values.length)
1154
1154
  throw new AbiEncodingLengthMismatchError({
@@ -1359,18 +1359,18 @@ function getArrayComponents(type) {
1359
1359
  return matches ? [matches[2] ? Number(matches[2]) : null, matches[1]] : undefined;
1360
1360
  }
1361
1361
 
1362
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/stringify.js
1362
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/stringify.js
1363
1363
  var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
1364
1364
  const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
1365
1365
  return typeof replacer === "function" ? replacer(key, value2) : value2;
1366
1366
  }, space);
1367
1367
 
1368
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/unit/formatGwei.js
1368
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/unit/formatGwei.js
1369
1369
  function formatGwei(wei, unit = "wei") {
1370
1370
  return formatUnits(wei, gweiUnits[unit]);
1371
1371
  }
1372
1372
 
1373
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/transaction.js
1373
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/transaction.js
1374
1374
  function prettyPrint(args) {
1375
1375
  const entries = Object.entries(args).map(([key, value]) => {
1376
1376
  if (value === undefined || value === false)
@@ -1503,7 +1503,7 @@ class WaitForTransactionReceiptTimeoutError extends BaseError {
1503
1503
  }
1504
1504
  }
1505
1505
 
1506
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/chain.js
1506
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/chain.js
1507
1507
  class ChainDoesNotSupportContract extends BaseError {
1508
1508
  constructor({ blockNumber, chain, contract }) {
1509
1509
  super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
@@ -1558,7 +1558,7 @@ class InvalidChainIdError extends BaseError {
1558
1558
  }
1559
1559
  }
1560
1560
 
1561
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/cursor.js
1561
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/cursor.js
1562
1562
  class NegativeOffsetError extends BaseError {
1563
1563
  constructor({ offset }) {
1564
1564
  super(`Offset \`${offset}\` cannot be negative.`, {
@@ -1579,7 +1579,7 @@ class RecursiveReadLimitExceededError extends BaseError {
1579
1579
  }
1580
1580
  }
1581
1581
 
1582
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/utils/cursor.js
1582
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/cursor.js
1583
1583
  var staticCursor = {
1584
1584
  bytes: new Uint8Array,
1585
1585
  dataView: new DataView(new ArrayBuffer(0)),
@@ -1748,7 +1748,7 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
1748
1748
  return cursor;
1749
1749
  }
1750
1750
 
1751
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/constants/number.js
1751
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/constants/number.js
1752
1752
  var maxInt8 = 2n ** (8n - 1n) - 1n;
1753
1753
  var maxInt16 = 2n ** (16n - 1n) - 1n;
1754
1754
  var maxInt24 = 2n ** (24n - 1n) - 1n;
@@ -1846,7 +1846,7 @@ var maxUint240 = 2n ** 240n - 1n;
1846
1846
  var maxUint248 = 2n ** 248n - 1n;
1847
1847
  var maxUint256 = 2n ** 256n - 1n;
1848
1848
 
1849
- // ../../node_modules/.bun/viem@2.52.0+1cd18485b0404aca/node_modules/viem/_esm/errors/node.js
1849
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/node.js
1850
1850
  class ExecutionRevertedError extends BaseError {
1851
1851
  constructor({ cause, message } = {}) {
1852
1852
  const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generatePrivateKey
4
- } from "./cli-v446mw5v.js";
4
+ } from "./cli-fbwpcfvp.js";
5
5
 
6
6
  // ../../packages/protocol/dist/node/serve.js
7
7
  import { createServer } from "node:http";
@@ -230,6 +230,7 @@ function alive(pid) {
230
230
  return error.code === "EPERM";
231
231
  }
232
232
  }
233
+ var HELD_HERE = new Set;
233
234
  function lockFile(path) {
234
235
  const lock = `${path}.lock`;
235
236
  mkdirSync(dirname(lock), { recursive: true });
@@ -241,7 +242,8 @@ function lockFile(path) {
241
242
  if (error.code !== "EEXIST")
242
243
  throw error;
243
244
  const holder = Number(readFileSync(lock, "utf8").trim());
244
- if (Number.isInteger(holder) && holder > 0 && alive(holder)) {
245
+ const ownLeftover = holder === process.pid && !HELD_HERE.has(lock);
246
+ if (Number.isInteger(holder) && holder > 0 && !ownLeftover && alive(holder)) {
245
247
  throw new Error(`${path} is held by process ${holder} (${lock}); one process per ledger`);
246
248
  }
247
249
  unlinkSync(lock);
@@ -250,11 +252,13 @@ function lockFile(path) {
250
252
  writeSync(fd, `${process.pid}
251
253
  `);
252
254
  closeSync(fd);
255
+ HELD_HERE.add(lock);
253
256
  let held = true;
254
257
  const release = () => {
255
258
  if (!held)
256
259
  return;
257
260
  held = false;
261
+ HELD_HERE.delete(lock);
258
262
  try {
259
263
  if (readFileSync(lock, "utf8").trim() === String(process.pid))
260
264
  unlinkSync(lock);