@ghostlytools/cli 1.13.2 → 1.13.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 (110) hide show
  1. package/README.md +9 -8
  2. package/dist/assets/{api-DV52o7A8.js → api-B5qxNMgg.js} +2 -2
  3. package/dist/assets/{api-O57SNJcb.js → api-iiij_pP5.js} +213 -59
  4. package/dist/assets/api-iiij_pP5.js.map +1 -0
  5. package/dist/assets/{apiKit-CPTFJHA7.js → apiKit-BPuHOoXF.js} +17 -3
  6. package/dist/assets/apiKit-BPuHOoXF.js.map +1 -0
  7. package/dist/assets/{appFetch-Ca9DNQQ2.js → appFetch-D89FnCxr.js} +2 -2
  8. package/dist/assets/{appFetch-Ca9DNQQ2.js.map → appFetch-D89FnCxr.js.map} +1 -1
  9. package/dist/assets/{apps-uZTu5FlR.js → apps-BpZcd86Y.js} +1 -1
  10. package/dist/assets/{apps-gXpGFPiv.js → apps-D2YGSPJe.js} +45 -19
  11. package/dist/assets/apps-D2YGSPJe.js.map +1 -0
  12. package/dist/assets/{backup-CxH3auHB.js → backup-BrMe9VPY.js} +11 -6
  13. package/dist/assets/backup-BrMe9VPY.js.map +1 -0
  14. package/dist/assets/{backup-Di2U6QVH.js → backup-COkkM8Yy.js} +1 -1
  15. package/dist/assets/bark_ffi_wasm_bg-CjjCN3FD.js +5 -0
  16. package/dist/assets/{bitcoind-BpZn3bRN.js → bitcoind-CK1QEUHn.js} +2 -2
  17. package/dist/assets/{bitcoind-BpZn3bRN.js.map → bitcoind-CK1QEUHn.js.map} +1 -1
  18. package/dist/assets/bitcoindevkit_bg-D6IFIaJi.js +5 -0
  19. package/dist/assets/{blobFiles-DDs34n0r.js → blobFiles-DA3UEn37.js} +3 -3
  20. package/dist/assets/{blobFiles-DDs34n0r.js.map → blobFiles-DA3UEn37.js.map} +1 -1
  21. package/dist/assets/buttons-BWEdoxgK.js +1 -0
  22. package/dist/assets/{buttons-D4udKEvT.js → buttons-UsDPQJsQ.js} +4 -4
  23. package/dist/assets/{buttons-D4udKEvT.js.map → buttons-UsDPQJsQ.js.map} +1 -1
  24. package/dist/assets/{client-DGx7E8b3.js → client-Cj-VLeTs.js} +2 -2
  25. package/dist/assets/{client-DGx7E8b3.js.map → client-Cj-VLeTs.js.map} +1 -1
  26. package/dist/assets/{fedimintSdk-D-6H9Pe7.js → fedimintSdk-eLXBrj9i.js} +2 -2
  27. package/dist/assets/{fedimintSdk-D-6H9Pe7.js.map → fedimintSdk-eLXBrj9i.js.map} +1 -1
  28. package/dist/assets/fedimint_client_wasm_bg-CRQlnJdu.js +5 -0
  29. package/dist/assets/{fileBytes-CfvUXdSy.js → fileBytes-B2jXQI8e.js} +3 -3
  30. package/dist/assets/{fileBytes-CfvUXdSy.js.map → fileBytes-B2jXQI8e.js.map} +1 -1
  31. package/dist/assets/{fileBytes-tj6-VZcB.js → fileBytes-BQrW3m-d.js} +2 -2
  32. package/dist/assets/{fileBytes-tj6-VZcB.js.map → fileBytes-BQrW3m-d.js.map} +1 -1
  33. package/dist/assets/{fileBytes-CCKbwqG_.js → fileBytes-CtjxJ6AL.js} +1 -1
  34. package/dist/assets/{fileBytesIdb-BJirUAjI.js → fileBytesIdb-B7Wjw0S8.js} +3 -3
  35. package/dist/assets/{fileBytesIdb-BJirUAjI.js.map → fileBytesIdb-B7Wjw0S8.js.map} +1 -1
  36. package/dist/assets/fileBytesIdb-Fcj2mwj6.js +1 -0
  37. package/dist/assets/{fileBytesOpfs-DRUYLER4.js → fileBytesOpfs-BW0u-_f_.js} +3 -3
  38. package/dist/assets/{fileBytesOpfs-DRUYLER4.js.map → fileBytesOpfs-BW0u-_f_.js.map} +1 -1
  39. package/dist/assets/{fixedHosts-CODN2pTL.js → fixedHosts-CrO01M_y.js} +3 -3
  40. package/dist/assets/{fixedHosts-CODN2pTL.js.map → fixedHosts-CrO01M_y.js.map} +1 -1
  41. package/dist/assets/{groupMeta-CeZpqVVC.js → groupMeta-DHJxOu0K.js} +99 -10
  42. package/dist/assets/groupMeta-DHJxOu0K.js.map +1 -0
  43. package/dist/assets/{host-CRA7h5A2.js → host-C4J4y-Zq.js} +187 -29
  44. package/dist/assets/host-C4J4y-Zq.js.map +1 -0
  45. package/dist/assets/{idb-ewvbqyDI.js → idb-CmIR_bxg.js} +2 -1
  46. package/dist/assets/idb-CmIR_bxg.js.map +1 -0
  47. package/dist/assets/{identityProofs-B8zCp5_0.js → identityProofs-C0rIGT6y.js} +20 -3
  48. package/dist/assets/identityProofs-C0rIGT6y.js.map +1 -0
  49. package/dist/assets/{irohWeb-mnOi2Jp7.js → irohWeb-BXgunUhu.js} +113 -33
  50. package/dist/assets/irohWeb-BXgunUhu.js.map +1 -0
  51. package/dist/assets/{main-Chc871HV.js → main-BLs-zUTt.js} +68 -28
  52. package/dist/assets/main-BLs-zUTt.js.map +1 -0
  53. package/dist/assets/{mainline-CDUXtV-I.js → mainline-CYek1H10.js} +2 -2
  54. package/dist/assets/{mainline-CDUXtV-I.js.map → mainline-CYek1H10.js.map} +1 -1
  55. package/dist/assets/{networkReason-DYlPZS5M.js → networkReason-C6LYbjF2.js} +2 -2
  56. package/dist/assets/{networkReason-DYlPZS5M.js.map → networkReason-C6LYbjF2.js.map} +1 -1
  57. package/dist/assets/{ownDid-BOuSlDv-.js → ownDid-Dg-8e_hs.js} +6 -5
  58. package/dist/assets/ownDid-Dg-8e_hs.js.map +1 -0
  59. package/dist/assets/{ownStatus-CLA1VPkL.js → ownStatus-BOx4vLi6.js} +34 -11
  60. package/dist/assets/ownStatus-BOx4vLi6.js.map +1 -0
  61. package/dist/assets/{profiles-BH1bH9aE.js → profiles-BA0ePikY.js} +33 -8
  62. package/dist/assets/profiles-BA0ePikY.js.map +1 -0
  63. package/dist/assets/{registry-DAq16T-V.js → registry-DuSwXntJ.js} +1 -1
  64. package/dist/assets/{registry-DP_-RA-v.js → registry-OoIgxDrO.js} +25 -13
  65. package/dist/assets/registry-OoIgxDrO.js.map +1 -0
  66. package/dist/assets/{relay-gJTOYQJZ.js → relay-NT5bf1WA.js} +9 -6
  67. package/dist/assets/relay-NT5bf1WA.js.map +1 -0
  68. package/dist/assets/{resolve-B1eQ4dVQ.js → resolve-DUmE70Eo.js} +3 -3
  69. package/dist/assets/{resolve-B1eQ4dVQ.js.map → resolve-DUmE70Eo.js.map} +1 -1
  70. package/dist/assets/{restoredRows-D_WSHE7H.js → restoredRows-Cgaxx1xW.js} +2 -2
  71. package/dist/assets/{restoredRows-D_WSHE7H.js.map → restoredRows-Cgaxx1xW.js.map} +1 -1
  72. package/dist/assets/{server-Bd2ofxc1.js → server-WWlXICVB.js} +555 -110
  73. package/dist/assets/server-WWlXICVB.js.map +1 -0
  74. package/dist/assets/{sshForges-As7dbGXM.js → sshForges-Cfu-dSwc.js} +2 -2
  75. package/dist/assets/{sshForges-As7dbGXM.js.map → sshForges-Cfu-dSwc.js.map} +1 -1
  76. package/dist/assets/translate-DnuQMfj0.js.map +1 -1
  77. package/dist/assets/{usdt-DLmtf8F9.js → usdt-BkO4SY07.js} +2 -2
  78. package/dist/assets/{usdt-DLmtf8F9.js.map → usdt-BkO4SY07.js.map} +1 -1
  79. package/dist/assets/{waitNotice-BHuMofaH.js → waitNotice-DSECf6II.js} +2 -2
  80. package/dist/assets/{waitNotice-BHuMofaH.js.map → waitNotice-DSECf6II.js.map} +1 -1
  81. package/dist/ghostly.mjs +1 -1
  82. package/npm-shrinkwrap.json +2 -2
  83. package/package.json +1 -1
  84. package/dist/assets/api-O57SNJcb.js.map +0 -1
  85. package/dist/assets/apiKit-CPTFJHA7.js.map +0 -1
  86. package/dist/assets/apps-gXpGFPiv.js.map +0 -1
  87. package/dist/assets/backup-CxH3auHB.js.map +0 -1
  88. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js +0 -5
  89. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +0 -1
  90. package/dist/assets/bark_ffi_wasm_bg-VNmaJsc9.wasm +0 -0
  91. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js +0 -5
  92. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +0 -1
  93. package/dist/assets/bitcoindevkit_bg-DXil67yS.wasm +0 -0
  94. package/dist/assets/buttons-YTYEqvGC.js +0 -1
  95. package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js +0 -5
  96. package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js.map +0 -1
  97. package/dist/assets/fedimint_client_wasm_bg-DeFtkIv6.wasm +0 -0
  98. package/dist/assets/fileBytesIdb-B0zzJ6p7.js +0 -1
  99. package/dist/assets/groupMeta-CeZpqVVC.js.map +0 -1
  100. package/dist/assets/host-CRA7h5A2.js.map +0 -1
  101. package/dist/assets/idb-ewvbqyDI.js.map +0 -1
  102. package/dist/assets/identityProofs-B8zCp5_0.js.map +0 -1
  103. package/dist/assets/irohWeb-mnOi2Jp7.js.map +0 -1
  104. package/dist/assets/main-Chc871HV.js.map +0 -1
  105. package/dist/assets/ownDid-BOuSlDv-.js.map +0 -1
  106. package/dist/assets/ownStatus-CLA1VPkL.js.map +0 -1
  107. package/dist/assets/profiles-BH1bH9aE.js.map +0 -1
  108. package/dist/assets/registry-DP_-RA-v.js.map +0 -1
  109. package/dist/assets/relay-gJTOYQJZ.js.map +0 -1
  110. package/dist/assets/server-Bd2ofxc1.js.map +0 -1
@@ -1,18 +1,19 @@
1
1
  import { d as utf8Decode, f as utf8Encode, i as fromBase64Url, l as toBase64Url, n as concatBytes, o as isZ32Key, s as randomBytes } from "./bytes-C1DNGY18.js";
2
2
  import { a as stripHidden, i as sanitizeNick, n as hasVisible, s as unwrapPasted, t as dropLoneJoiners } from "./text-li76pThX.js";
3
+ import { i as linkTail } from "./linkPreview-5kHmKUTN.js";
3
4
  import { S as underLocalSuffix, c as irohRelayUrl, d as relayUrlTooLong, o as dialableIrohRelay, s as irohDescriptor, u as relayUrl } from "./pairedTransports-DAzupLYo.js";
4
5
  import { S as verify, _ as identityFromSeed, v as identityFromSeedB64, x as sign, y as publicKeyFromZ32 } from "./pkarr-BQo4PcCg.js";
5
- import { m as isDiscoveryBudgetError, p as budgetRetryMs } from "./relay-gJTOYQJZ.js";
6
- import { $r as sortRoster, An as baseMime, Cr as cardEditNumber, Da as pacer, Dr as readStatusCard, F as readGroupFileMeta, Fi as LIMITS, Hr as MEMBER_KEY, I as readGroupHave, Kn as readForwarded, L as readGroupWant, M as fetchesByItself, Mn as fileMessageText, N as groupFileFallback, O as GROUP_FILE_LIMITS, P as isGroupMessageId, R as readGroupWantNo, Rr as GROUP_ADMIN_OFF_ERROR, Un as validEditNumber, Ur as OWN_FRAME_LIMIT, Vn as RateWindow, Wn as validRemovalNumber, Wr as SAID_AGAIN, Xr as rosterAdmin, Yr as rememberAlone, Za as exifOrientation, Zr as rosterHas, _ as signGroupMeta, _t as FileUplink, a as groupMetaChange, ai as confirmationTag, ar as groupReplyAuthor, c as groupMetaTag, ci as encryptText, cr as replySnippet, d as keepPastGroupMeta, di as newEpochSecret, f as nextGroupMetaRevision, fi as openPair, g as parseGroupMetaTag, gi as sha256Hex, h as parseGroupMetaFrame, hi as sealSecret, ht as ChatFiles, i as groupMetaBody, ii as confirmationMatches, j as GROUP_WANT_NO_FRAME, k as GROUP_HAVE_FRAME, kr as statusCardBytes, l as groupMetaToHand, li as epochKeys, lr as wireReply, mi as sealPair, o as groupMetaNewer, oi as decryptText, p as openGroupMeta, pi as openSecret, r as groupDisplayName, s as groupMetaPicture, si as edgeParams, sr as readReply, t as encodeGroupMetaBody, u as groupName, ui as groupCallKey, v as verifyGroupMetaSignature, y as wrapGroupMeta, yt as transferEnded, zr as GROUP_ID } from "./groupMeta-CeZpqVVC.js";
7
- import { _ as receivedIdentityStatus, c as IdentityExchange, d as emptyIdentityLedger, f as identityRefusal, g as newIdentityBinding, h as isIdentityBinding, i as IDENTITY_MAX_VALIDITY, l as boundIdentityDisplay, m as identityStatement, o as IDENTITY_REVOCATION_LABEL, p as identityRevocationValue, s as IdentityCheckUnavailable, v as revokesIdentity } from "./identityProofs-B8zCp5_0.js";
6
+ import { m as isDiscoveryBudgetError, p as budgetRetryMs } from "./relay-NT5bf1WA.js";
7
+ import { $r as sortRoster, An as baseMime, Cr as cardEditNumber, Da as pacer, Dr as readStatusCard, F as readGroupFileMeta, Fi as LIMITS, Hr as MEMBER_KEY, I as readGroupHave, Kn as readForwarded, L as readGroupWant, M as fetchesByItself, Mn as fileMessageText, N as groupFileFallback, O as GROUP_FILE_LIMITS, P as isGroupMessageId, R as readGroupWantNo, Rr as GROUP_ADMIN_OFF_ERROR, Un as validEditNumber, Ur as OWN_FRAME_LIMIT, Vn as RateWindow, Wn as validRemovalNumber, Wr as SAID_AGAIN, Xr as rosterAdmin, Yr as rememberAlone, Za as exifOrientation, Zr as rosterHas, _ as signGroupMeta, _t as FileUplink, a as groupMetaChange, ai as confirmationTag, ar as groupReplyAuthor, c as groupMetaTag, ci as encryptText, cr as replySnippet, d as keepPastGroupMeta, di as newEpochSecret, f as nextGroupMetaRevision, fi as openPair, g as parseGroupMetaTag, gi as sha256Hex, h as parseGroupMetaFrame, hi as sealSecret, ht as ChatFiles, i as groupMetaBody, ii as confirmationMatches, j as GROUP_WANT_NO_FRAME, k as GROUP_HAVE_FRAME, kr as statusCardBytes, l as groupMetaToHand, li as epochKeys, lr as wireReply, mi as sealPair, o as groupMetaNewer, oi as decryptText, p as openGroupMeta, pi as openSecret, r as groupDisplayName, s as groupMetaPicture, si as edgeParams, sr as readReply, t as encodeGroupMetaBody, u as groupName, ui as groupCallKey, v as verifyGroupMetaSignature, y as wrapGroupMeta, yt as transferEnded, zr as GROUP_ID } from "./groupMeta-DHJxOu0K.js";
8
+ import { _ as receivedIdentityStatus, c as IdentityExchange, d as emptyIdentityLedger, f as identityRefusal, g as newIdentityBinding, h as isIdentityBinding, i as IDENTITY_MAX_VALIDITY, l as boundIdentityDisplay, m as identityStatement, o as IDENTITY_REVOCATION_LABEL, p as identityRevocationValue, s as IdentityCheckUnavailable, v as revokesIdentity } from "./identityProofs-C0rIGT6y.js";
8
9
  import { i as engineText, n as ecashUnitError, r as engineError } from "./engineErrors-wWlLy54D.js";
9
10
  import { g as walletNetworkOf, i as PaymentPreflightError, l as WALLET_NETWORKS } from "./paymentIntent-Cr3uZa_0.js";
10
11
  import { a as decodeBolt11, r as nwcWalletName, t as nwc } from "./nwcProvider-pL2XqSbW.js";
11
- import { c as boundedIdentityFetch, l as verifyIdentity } from "./ownDid-BOuSlDv-.js";
12
+ import { c as boundedIdentityFetch, l as verifyIdentity } from "./ownDid-Dg-8e_hs.js";
12
13
  import { a as describeProvider, c as offeredIn, d as sourceProblem, n as PROVIDER_PLATFORMS, o as isNothingSpentError, s as networkMode, t as NothingSpentError, u as redact } from "./types-CdWwgvyt.js";
13
- import { _ as openDb, b as transact, f as errorLine, g as newestWalletTx, l as committed, p as fileStore, s as STORES, u as databaseName, x as wrap, y as store } from "./idb-ewvbqyDI.js";
14
- import { a as sealSeed, c as openRow, d as sealRow, f as sealedStore, g as whenDataKeyDropped, h as sealSecret$1, i as newDeviceKey, l as openRows, m as openSecret$1, o as unsealSeed, p as hasDataKey, s as RowSeals, t as networkReason, u as proofKey } from "./networkReason-DYlPZS5M.js";
15
- import { f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf } from "./fileBytes-CfvUXdSy.js";
14
+ import { _ as openDb, b as transact, f as errorLine, g as newestWalletTx, l as committed, p as fileStore, s as STORES, u as databaseName, x as wrap, y as store } from "./idb-CmIR_bxg.js";
15
+ import { a as sealSeed, c as openRow, d as sealRow, f as sealedStore, g as whenDataKeyDropped, h as sealSecret$1, i as newDeviceKey, l as openRows, m as openSecret$1, o as unsealSeed, p as hasDataKey, s as RowSeals, t as networkReason, u as proofKey } from "./networkReason-C6LYbjF2.js";
16
+ import { f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf } from "./fileBytes-B2jXQI8e.js";
16
17
  import { c as isTestMint, d as mintUrlSpelling, f as paysItsOwnInvoices, o as fakesLightning, t as BITCOIN_INVOICE_ON_TESTNET, u as mintNetwork } from "./mints-CMDLbMeH.js";
17
18
  import { sha256 } from "@noble/hashes/sha2.js";
18
19
  import { hkdf } from "@noble/hashes/hkdf.js";
@@ -2617,9 +2618,18 @@ function acceptUrl(text) {
2617
2618
  if (url.username || url.password) throw new Error("That LNURL carries credentials, which is not allowed");
2618
2619
  return url;
2619
2620
  }
2621
+ /**
2622
+ * Text without what a link leaves out at its end (`linkTail`): a direction mark a right-to-left sentence puts after it,
2623
+ * another character that draws as nothing, an emoji. Taken off one by one: linear however many there are.
2624
+ */
2625
+ function withoutTail(text) {
2626
+ let end = text.length;
2627
+ for (let tail = linkTail(text, end); tail; tail = linkTail(text, end)) end -= tail;
2628
+ return text.slice(0, end);
2629
+ }
2620
2630
  /** Reads what was pasted as a Lightning address or an LNURL; null when it is neither. Throws when it is one, but a bad one. */
2621
2631
  function parseLightningDestination(input) {
2622
- const text = input.trim().replace(/^(lightning:|⚡\s*)/i, "").trim();
2632
+ const text = withoutTail(input.trim()).replace(/^(lightning:|⚡\s*)/i, "").trim();
2623
2633
  if (!text) return null;
2624
2634
  if (LNURL_BECH32.test(text)) {
2625
2635
  let decoded;
@@ -9525,7 +9535,7 @@ var registry;
9525
9535
  var loading;
9526
9536
  var listeners = /* @__PURE__ */ new Set();
9527
9537
  function loadIdentityProviders() {
9528
- return loading ??= import("./registry-DAq16T-V.js").then((m) => {
9538
+ return loading ??= import("./registry-DuSwXntJ.js").then((m) => {
9529
9539
  registry = m;
9530
9540
  for (const listener of listeners) listener();
9531
9541
  return m;
@@ -9549,6 +9559,11 @@ var REVOCATIONS = "identityRevocations";
9549
9559
  var REVOCATIONS_CHECKED_AT = "identityRevocationsCheckedAt";
9550
9560
  /** The lookup under way: when it began (ms) and the proofs it already looked up (`linkId|id`), so one cut short goes on from the rest. */
9551
9561
  var REVOCATIONS_ROUND = "identityRevocationsRound";
9562
+ /**
9563
+ * The contacts' withdrawn proofs whose revocation lookups after the withdraw (`WITHDRAWN_REVOCATION_TRIES_MS`) have not
9564
+ * ended (`linkId|id`): a stop drops their timers, so the next start plans them again.
9565
+ */
9566
+ var WITHDRAWN_LOOKUPS = "identityWithdrawnLookups";
9552
9567
  /** Relays and the DHT forget a record within hours: republish revocations this often while the app runs. */
9553
9568
  var REPUBLISH_MS = 36e5;
9554
9569
  /** The longest a timer waits; a redraw further off waits again from there. */
@@ -9615,7 +9630,7 @@ var now = () => Math.floor(Date.now() / 1e3);
9615
9630
  * A share of mine as every reader gets it (the app, the CLI, `getState`): its reason only in words this app writes
9616
9631
  * (identityRefusal), else none. A ledger kept from before that check holds the contact's own words there.
9617
9632
  */
9618
- var ownRefusal = (s) => {
9633
+ var ownRefusal = ({ held: _held, ...s }) => {
9619
9634
  if (s.error === void 0 || identityRefusal(s.error) !== void 0) return s;
9620
9635
  const { error: _contactWords, ...rest } = s;
9621
9636
  return rest;
@@ -9638,6 +9653,9 @@ var IdentityProofs = class {
9638
9653
  /** When `round` was last written (ms), and how many proofs it gained since: `noteRound`. */
9639
9654
  roundSavedAt = 0;
9640
9655
  roundUnsaved = 0;
9656
+ /** `WITHDRAWN_LOOKUPS`, and the run of lookups under way for each (a newer withdraw of the same proof replaces it). */
9657
+ withdrawnLookups = /* @__PURE__ */ new Set();
9658
+ withdrawalRuns = /* @__PURE__ */ new Map();
9641
9659
  /**
9642
9660
  * How the last Pkarr read of each contact's proof went (`revoked`), by proof id: answered, could not run (offline, no
9643
9661
  * relay answered), or held back by the relays' budget, which takes reads again in this many ms.
@@ -9688,12 +9706,15 @@ var IdentityProofs = class {
9688
9706
  async load() {
9689
9707
  const providers = loadIdentityProviders();
9690
9708
  const settings = await store(STORES.settings, "readonly");
9691
- [this.proofs, this.revocations, this.revocationsCheckedAt, this.round] = await Promise.all([
9709
+ let pending;
9710
+ [this.proofs, this.revocations, this.revocationsCheckedAt, this.round, pending] = await Promise.all([
9692
9711
  wrap(settings.get(KEY)).then((v) => v ?? []),
9693
9712
  wrap(settings.get(REVOCATIONS)).then((v) => v ?? []),
9694
9713
  wrap(settings.get(REVOCATIONS_CHECKED_AT)).then((v) => typeof v === "number" ? v : 0),
9695
- wrap(settings.get(REVOCATIONS_ROUND)).then((v) => typeof v?.startedAt === "number" && Array.isArray(v.done) ? v : void 0)
9714
+ wrap(settings.get(REVOCATIONS_ROUND)).then((v) => typeof v?.startedAt === "number" && Array.isArray(v.done) ? v : void 0),
9715
+ wrap(settings.get(WITHDRAWN_LOOKUPS)).then((v) => Array.isArray(v) ? v.filter((k) => typeof k === "string") : [])
9696
9716
  ]);
9717
+ this.withdrawnLookups = new Set(pending);
9697
9718
  await providers;
9698
9719
  }
9699
9720
  /** Background work: republish revocations, look up the contacts' proofs for revocations. */
@@ -9711,6 +9732,10 @@ var IdentityProofs = class {
9711
9732
  every(REPUBLISH_MS, 5e3, () => this.republish());
9712
9733
  const due = Math.min(REVOCATION_CHECK_MS, this.revocationsCheckedAt + REVOCATION_CHECK_MS - Date.now());
9713
9734
  this.lookUpIn(Math.max(6e4, due));
9735
+ for (const key of this.withdrawnLookups) {
9736
+ const at = key.lastIndexOf("|");
9737
+ this.afterWithdrawal(key.slice(0, at), key.slice(at + 1));
9738
+ }
9714
9739
  every(AUTO_RECHECK_TICK_MS, AUTO_RECHECK_FIRST_MS, () => this.recheckDue());
9715
9740
  every(3e5, 3e5, () => this.expireChallenges());
9716
9741
  this.unlisten ??= whenDataKeyDropped(() => this.forgetSeeds());
@@ -9806,7 +9831,7 @@ var IdentityProofs = class {
9806
9831
  let refused;
9807
9832
  let fetch = this.fetch;
9808
9833
  if (this.host.relayOnly?.()) {
9809
- const { fixedIdentityHosts } = await import("./fixedHosts-CODN2pTL.js");
9834
+ const { fixedIdentityHosts } = await import("./fixedHosts-CrO01M_y.js");
9810
9835
  const fixed = fixedIdentityHosts();
9811
9836
  fetch = async (url, options) => {
9812
9837
  const host = new URL(url).host;
@@ -10154,19 +10179,47 @@ var IdentityProofs = class {
10154
10179
  revocable(r) {
10155
10180
  return r.status !== "revoked" && Math.min(r.binding.expiresAt, r.verified.expiresAt ?? Infinity) > now();
10156
10181
  }
10157
- /** A proof the contact just withdrew: looked up for its revocation a few times (`WITHDRAWN_REVOCATION_TRIES_MS`). */
10158
- afterWithdrawal(linkId, id, tries = WITHDRAWN_REVOCATION_TRIES_MS) {
10159
- const [wait, ...rest] = tries;
10160
- if (wait === void 0) return;
10161
- const timer = setTimeout(() => {
10162
- this.timers = this.timers.filter((t) => t !== timer);
10163
- const r = this.host.ledger(linkId)?.received.find((x) => x.id === id);
10164
- if (!r || r.status !== "withdrawn" || !this.revocable(r)) return;
10165
- (async () => {
10166
- if ((this.host.online() ? await this.exchange(linkId)?.recheck(id, { revocationOnly: true }).catch(() => void 0) : void 0)?.status !== "revoked") this.afterWithdrawal(linkId, id, rest);
10167
- })();
10168
- }, wait);
10169
- this.timers.push(timer);
10182
+ /**
10183
+ * A proof the contact just withdrew: looked up for its revocation a few times (`WITHDRAWN_REVOCATION_TRIES_MS`). Kept
10184
+ * (`WITHDRAWN_LOOKUPS`) until they end, so a stop before then has them start over at the next start, not wait 12 h.
10185
+ */
10186
+ afterWithdrawal(linkId, id) {
10187
+ const key = `${linkId}|${id}`, run = {}, stops = this.stops;
10188
+ this.withdrawalRuns.set(key, run);
10189
+ if (!this.withdrawnLookups.has(key)) {
10190
+ this.withdrawnLookups.add(key);
10191
+ this.saveWithdrawnLookups();
10192
+ }
10193
+ const current = () => this.stops === stops && this.withdrawalRuns.get(key) === run;
10194
+ const end = () => {
10195
+ this.withdrawalRuns.delete(key);
10196
+ if (this.withdrawnLookups.delete(key)) this.saveWithdrawnLookups();
10197
+ };
10198
+ const next = ([wait, ...rest]) => {
10199
+ if (wait === void 0) return end();
10200
+ const timer = setTimeout(() => {
10201
+ this.timers = this.timers.filter((t) => t !== timer);
10202
+ if (!current()) return;
10203
+ const r = this.host.ledger(linkId)?.received.find((x) => x.id === id);
10204
+ if (!r || r.status !== "withdrawn" || !this.revocable(r)) return end();
10205
+ (async () => {
10206
+ const found = this.host.online() ? await this.exchange(linkId)?.recheck(id, { revocationOnly: true }).catch(() => void 0) : void 0;
10207
+ if (!current()) return;
10208
+ if (found?.status === "revoked") end();
10209
+ else next(rest);
10210
+ })();
10211
+ }, wait);
10212
+ this.timers.push(timer);
10213
+ };
10214
+ next(WITHDRAWN_REVOCATION_TRIES_MS);
10215
+ }
10216
+ /** Not waited on, as `saveRound`: the writes keep their order. */
10217
+ saveWithdrawnLookups() {
10218
+ if (this.ended) return;
10219
+ const keys = [...this.withdrawnLookups];
10220
+ transact([STORES.settings], (stores) => {
10221
+ stores[STORES.settings].put(keys, WITHDRAWN_LOOKUPS);
10222
+ }).catch(() => {});
10170
10223
  }
10171
10224
  /** Every engine state builds these: each chat's ledger is read once for all the proofs, not once per proof. */
10172
10225
  views() {
@@ -10600,7 +10653,8 @@ async function copyFile(sourceId, target) {
10600
10653
  if (!source?.metadata) throw new Error("The file is not on this device any more");
10601
10654
  const stored = storedSize(source);
10602
10655
  const checked = source.wire3 ? source.wire3.state === "done" : !source.group || source.transfer?.state === "done";
10603
- if (source.direction === "in" && !checked || await bytesHere(source) !== stored) throw new Error("The file has not arrived yet");
10656
+ if (source.direction === "in" && !checked) throw new Error("The file has not arrived yet");
10657
+ if (await bytesHere(source) !== stored) throw new Error(source.direction === "out" ? "The file is not on this device any more" : "The file has not arrived yet");
10604
10658
  const from = source.bytes ? await fileBytesOf(source.bytes) : null;
10605
10659
  const read = async (offset, length) => source.blob ? new Uint8Array(await source.blob.slice(offset, offset + length).arrayBuffer()) : from.read(source.id, offset, length);
10606
10660
  const stripped = await withoutMetadata(source, stored, target.file, read);
@@ -11320,6 +11374,10 @@ var GroupFileDesk = class {
11320
11374
  this.communityHave.delete(groupId);
11321
11375
  this.deps.changed();
11322
11376
  }
11377
+ /** The app stops: no edge's files are swept any more (`ChatFiles.stop`). */
11378
+ stopSweeps() {
11379
+ for (const edge of this.edgesById.values()) edge.files.stop();
11380
+ }
11323
11381
  /** An edge's files/3 session opened (both sides agreed it) or closed. */
11324
11382
  session(groupId, peer, linkId, open) {
11325
11383
  const edge = this.edge(groupId, peer, linkId);
@@ -14200,7 +14258,7 @@ var CashuWallet = class CashuWallet {
14200
14258
  result = await wallet.completeMelt(preview);
14201
14259
  } catch (error) {
14202
14260
  if (!mintRefused(error) && !(error instanceof MeltChangeError)) return "pending";
14203
- const outcome = await this.settleMelt(melt, true).catch(() => "pending");
14261
+ const outcome = await this.settleMelt(await this.meltAnswered(melt), true).catch(() => "pending");
14204
14262
  if (outcome === "unpaid") {
14205
14263
  unpaid();
14206
14264
  const lost = this.takeFailedFee(melt.quote);
@@ -14214,11 +14272,27 @@ var CashuWallet = class CashuWallet {
14214
14272
  await this.finishMelt(melt, result.change);
14215
14273
  return "paid";
14216
14274
  }
14217
- const outcome = await this.settleMelt(melt, true).catch(() => "pending");
14275
+ const outcome = await this.settleMelt(await this.meltAnswered(melt), true).catch(() => "pending");
14218
14276
  if (outcome === "unpaid") unpaid();
14219
14277
  return outcome;
14220
14278
  }
14221
14279
  /**
14280
+ * Writes down that the mint answered this melt's one request: the poll's later UNPAID is then final (`settleMelt`),
14281
+ * with no hold for a request still on its way. Not written, it is held as one whose answer was lost.
14282
+ */
14283
+ async meltAnswered(melt) {
14284
+ const answered = {
14285
+ ...melt,
14286
+ answeredAt: Date.now()
14287
+ };
14288
+ try {
14289
+ await committed((await store(STORES.melts, "readwrite")).put(await sealRow(STORES.melts, answered)));
14290
+ } catch {
14291
+ return melt;
14292
+ }
14293
+ return answered;
14294
+ }
14295
+ /**
14222
14296
  * Whether a Lightning payment of this invoice is written down as in flight. A melt is written before the mint sees
14223
14297
  * its proofs, and `pollMelts` settles and reports it: an invoice with none never reached the mint's melt, or is done.
14224
14298
  */
@@ -14302,7 +14376,7 @@ var CashuWallet = class CashuWallet {
14302
14376
  return "paid";
14303
14377
  }
14304
14378
  if (quote.state === "PENDING") return "pending";
14305
- if (!answered && !this.meltOverdue(melt)) return "pending";
14379
+ if (!answered && melt.answeredAt === void 0 && !this.meltOverdue(melt)) return "pending";
14306
14380
  const inputs = await this.reservedProofs(melt);
14307
14381
  const states = inputs.length > 0 ? await wallet.checkProofsStates(inputs) : [];
14308
14382
  if (states.some((s) => s.state === "PENDING")) return "pending";
@@ -14320,7 +14394,10 @@ var CashuWallet = class CashuWallet {
14320
14394
  reserved: false
14321
14395
  });
14322
14396
  stores[STORES.melts].delete(melt.quote);
14323
- if (lost > 0) stores[STORES.walletTx].put(walletTx(melt.mint, "fee", 0, lost, melt.note ? `Payment failed: ${melt.note}` : "A Lightning payment failed"));
14397
+ if (lost > 0) stores[STORES.walletTx].put({
14398
+ ...walletTx(melt.mint, "fee", 0, lost, melt.note ? `Payment failed: ${melt.note}` : "A Lightning payment failed"),
14399
+ quote: melt.quote
14400
+ });
14324
14401
  });
14325
14402
  if (lost > 0) this.failedFees.set(melt.quote, lost);
14326
14403
  if (spent.size > 0) {
@@ -14337,7 +14414,10 @@ var CashuWallet = class CashuWallet {
14337
14414
  }
14338
14415
  /** The invoice is paid: the reserved proofs are spent, the change is ours, and the payment goes in the history. */
14339
14416
  async finishMelt(melt, change) {
14340
- const tx = walletTx(melt.mint, "lightning-out", melt.amount, melt.outlay - sats(change) - melt.amount, melt.note);
14417
+ const tx = {
14418
+ ...walletTx(melt.mint, "lightning-out", melt.amount, melt.outlay - sats(change) - melt.amount, melt.note),
14419
+ quote: melt.quote
14420
+ };
14341
14421
  await this.sealedTransact([
14342
14422
  STORES.proofs,
14343
14423
  STORES.melts,
@@ -14878,4 +14958,4 @@ async function createIrohWebEndpoint(seedB64, options = {}) {
14878
14958
  }
14879
14959
  export { cardsKey as $, validEditText as $t, assertConfirmedReal as A, COMMUNITY_LIMITS as At, copyForForward as B, encodeGroupEntryLink as Bt, pairedWireReply as C, WrongNetworkError as Ct, paymentAlias as D, requireTurn as Dt, replyTo as E, refuseAway as Et, paymentNetworksOf as F, encodeCommunityLink as Ft, removeStored as G, readKnocks as Gt, forwardKind as H, knockIdentity as Ht, walletInstances as I, memberAdmissions as It, waitingGroupFile as J, GROUP_EDIT_FRAME as Jt, storedSize as K, CatchUpAnswers as Kt, MESSAGE_DETAILS_MAX_BYTES as L, routedCommunityFrame as Lt, createTiming as M, GROUP_READ_NOTE_COMMUNITY as Mt, crossNetwork as N, communityHasFrame as Nt, paymentWireId as O, setAwayWallets as Ot, paymentNetwork as P, decodeCommunityLink as Pt, LightningCards as Q, parseCommunityEdit as Qt, WALLET_TYPES as R, KNOCK_TTL_MS as Rt, groupReply as S, ModeGate as St, replyRef as T, awayFrom as Tt, FileAppender as U, knockRecords as Ut, forwardError as V, entryParams as Vt, readStored as W, mergeKnocks as Wt, IdentityProofs as X, carryMentions as Xt, IDENTITY_DRAFT_TTL_MS as Y, GROUP_EDIT_TEXT_BYTES as Yt, CASHU_CARD as Z, meshMessageRef as Zt, GroupFileDesk as _, breezDatabasesFor as _t, CashuWallet as a, withoutAudioMetadata as an, INVOICE_PACE as at, groupOfFile as b, relayOnlyProblem as bt, assertAmount as c, NO_PICTURE_METADATA as cn, CASHU_MINT_SOURCE as ct, groupPayLineId as d, CashuAdapter as dt, MENTION_LIMITS as en, BREEZ_SOURCE as et, groupPayNoteId as f, swapSettledAt as ft, parsePayLink as g, breezDatabaseInUse as gt, pairLinkId as h, openBreez as ht, onPublicIrohRelay as i, NO_AUDIO_METADATA as in, lightningPaying as it, createFailure as j, CommunitySession as jt, WALLET_NAMES as k, setSingleWriterGate as kt, normalizeMintUrl as l, stripPictureMetadata as ln, cashuMint as lt, groupLinkId as m, loadBreezSdk as mt, createIrohWebEndpoint as n, validMentions as nn, normalizePhrase as nt, SwapUnsettledError as o, NO_VIDEO_METADATA as on, ProviderSources as ot, groupPayTwin as p, forgetBreez as pt, streamStored as q, COMMUNITY_EDIT_FRAME as qt, irohRelayProblem as r, wireMentions as rn, journaledPayment as rt, TEST_COINS_NOTE as s, withoutVideoMetadata as sn, sourceKey as st, DEFAULT_IROH_RELAYS as t, mentionsMember as tn, breez as tt, groupMemberOfLink as u, withoutPictureMetadata as un, AskBackoff as ut, groupFileId as v, iceServerProblem as vt, receivedPairedReply as w, networkLabel as wt, storedGroupFiles as x, ModeChanged as xt, groupFileText as y, iceServerSetting as yt, FORWARD_MESSAGE_GONE as z, decodeGroupEntryLink as zt };
14880
14960
 
14881
- //# sourceMappingURL=irohWeb-mnOi2Jp7.js.map
14961
+ //# sourceMappingURL=irohWeb-BXgunUhu.js.map