@arkade-os/sdk 0.4.68 → 0.5.0-rc.0

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 (80) hide show
  1. package/README.md +35 -5
  2. package/dist/adapters/expo.cjs +5 -5
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +3 -3
  6. package/dist/adapters/indexedDB.cjs +5 -5
  7. package/dist/adapters/indexedDB.js +4 -4
  8. package/dist/{asyncStorageTaskQueue-DaZlVTbM.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +1 -1
  9. package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +1 -1
  10. package/dist/{chunk-WCJVKFAP.cjs → chunk-5MJHZHG7.cjs} +726 -468
  11. package/dist/chunk-5MJHZHG7.cjs.map +1 -0
  12. package/dist/{chunk-EJOFL5WH.cjs → chunk-6AFUNKK7.cjs} +19 -7
  13. package/dist/chunk-6AFUNKK7.cjs.map +1 -0
  14. package/dist/{chunk-VBHXBI7F.js → chunk-6F2Q32KA.js} +298 -41
  15. package/dist/chunk-6F2Q32KA.js.map +1 -0
  16. package/dist/{chunk-GQ4NMQGR.js → chunk-ABJPM4JF.js} +4 -4
  17. package/dist/{chunk-GQ4NMQGR.js.map → chunk-ABJPM4JF.js.map} +1 -1
  18. package/dist/{chunk-PJR63FTK.cjs → chunk-CZ32XADN.cjs} +17 -17
  19. package/dist/{chunk-PJR63FTK.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
  20. package/dist/{chunk-33Q2RFET.js → chunk-FVTJJQNM.js} +3 -3
  21. package/dist/{chunk-33Q2RFET.js.map → chunk-FVTJJQNM.js.map} +1 -1
  22. package/dist/{chunk-6YUACVX4.cjs → chunk-HL7EC2Z5.cjs} +52 -53
  23. package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
  24. package/dist/{chunk-G4I6PU5H.js → chunk-JYP7YXT2.js} +4 -4
  25. package/dist/{chunk-G4I6PU5H.js.map → chunk-JYP7YXT2.js.map} +1 -1
  26. package/dist/{chunk-45FKMOJH.js → chunk-KTU44AEH.js} +6 -7
  27. package/dist/chunk-KTU44AEH.js.map +1 -0
  28. package/dist/{chunk-4KCVS4ZN.cjs → chunk-PB5KJI4U.cjs} +10 -10
  29. package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
  30. package/dist/{chunk-4CMXV5SF.js → chunk-PPG6W34P.js} +18 -8
  31. package/dist/chunk-PPG6W34P.js.map +1 -0
  32. package/dist/{chunk-JGMSZIE4.cjs → chunk-RXWKCEZP.cjs} +17 -17
  33. package/dist/{chunk-JGMSZIE4.cjs.map → chunk-RXWKCEZP.cjs.map} +1 -1
  34. package/dist/contracts/handlers/index.cjs +9 -9
  35. package/dist/contracts/handlers/index.d.cts +3 -3
  36. package/dist/contracts/handlers/index.d.ts +3 -3
  37. package/dist/contracts/handlers/index.js +2 -2
  38. package/dist/{delegate-Bffc5f54.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
  39. package/dist/{delegate-AomVWxO_.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
  40. package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
  41. package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
  42. package/dist/{index-jouvy8FD.d.ts → index-D3hmsuKs.d.cts} +6 -6
  43. package/dist/{index-nfyQM33h.d.cts → index-D9tXd-tN.d.ts} +6 -6
  44. package/dist/{index-C7RZCfoY.d.cts → index-Udm5V2xW.d.cts} +168 -19
  45. package/dist/{index-C7RZCfoY.d.ts → index-Udm5V2xW.d.ts} +168 -19
  46. package/dist/index.cjs +306 -290
  47. package/dist/index.d.cts +121 -29
  48. package/dist/index.d.ts +121 -29
  49. package/dist/index.js +4 -4
  50. package/dist/repositories/realm/index.cjs +19 -19
  51. package/dist/repositories/realm/index.d.cts +2 -2
  52. package/dist/repositories/realm/index.d.ts +2 -2
  53. package/dist/repositories/realm/index.js +5 -5
  54. package/dist/repositories/sqlite/index.cjs +18 -18
  55. package/dist/repositories/sqlite/index.d.cts +2 -2
  56. package/dist/repositories/sqlite/index.d.ts +2 -2
  57. package/dist/repositories/sqlite/index.js +5 -5
  58. package/dist/{taskRunner-D2vnpPBT.d.cts → taskRunner-DxZciNaa.d.cts} +1 -1
  59. package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-ZdS16Ypm.d.ts} +1 -1
  60. package/dist/wallet/expo/background.cjs +14 -14
  61. package/dist/wallet/expo/background.d.cts +3 -3
  62. package/dist/wallet/expo/background.d.ts +3 -3
  63. package/dist/wallet/expo/background.js +6 -6
  64. package/dist/wallet/expo/index.cjs +23 -14
  65. package/dist/wallet/expo/index.cjs.map +1 -1
  66. package/dist/wallet/expo/index.d.cts +7 -4
  67. package/dist/wallet/expo/index.d.ts +7 -4
  68. package/dist/wallet/expo/index.js +14 -5
  69. package/dist/wallet/expo/index.js.map +1 -1
  70. package/dist/worker/expo/index.cjs +9 -9
  71. package/dist/worker/expo/index.d.cts +4 -4
  72. package/dist/worker/expo/index.d.ts +4 -4
  73. package/dist/worker/expo/index.js +5 -5
  74. package/package.json +3 -2
  75. package/dist/chunk-45FKMOJH.js.map +0 -1
  76. package/dist/chunk-4CMXV5SF.js.map +0 -1
  77. package/dist/chunk-6YUACVX4.cjs.map +0 -1
  78. package/dist/chunk-EJOFL5WH.cjs.map +0 -1
  79. package/dist/chunk-VBHXBI7F.js.map +0 -1
  80. package/dist/chunk-WCJVKFAP.cjs.map +0 -1
@@ -214,6 +214,7 @@ var getNetwork = (network) => {
214
214
  if (!found) throw new Error(`Unsupported network: ${network}`);
215
215
  return found;
216
216
  };
217
+ var networkFromArkadeInfo = (info) => getNetwork(info.network);
217
218
  var networks = {
218
219
  bitcoin: withArkPrefix(utils_js.NETWORK, "ark", "bitcoin"),
219
220
  testnet: withArkPrefix(utils_js.TEST_NETWORK, "tark", "testnet"),
@@ -1044,7 +1045,7 @@ function resolveEventSource(override) {
1044
1045
  }
1045
1046
 
1046
1047
  // package.json
1047
- var version = "0.4.68";
1048
+ var version = "0.5.0-rc.0";
1048
1049
 
1049
1050
  // src/utils/fetch.ts
1050
1051
  var buildVersion = "0.9.9";
@@ -1642,8 +1643,9 @@ var RestArkProvider = class {
1642
1643
  /** Overrides {@link configureEventSource} for this provider's streams. */
1643
1644
  eventSource;
1644
1645
  /**
1645
- * Last server-info digest seen from {@link getInfo}. Sent as `X-Digest`
1646
- * so arkd can reject stale client configuration.
1646
+ * Last server-info digest seen (from {@link getInfo}). Sent as `X-Digest`
1647
+ * on outgoing requests so arkd can reject a client whose cached info is
1648
+ * stale. Empty until the first {@link getInfo}.
1647
1649
  */
1648
1650
  _digest = "";
1649
1651
  _hasServerInfo = false;
@@ -1721,7 +1723,10 @@ var RestArkProvider = class {
1721
1723
  }
1722
1724
  async getInfo() {
1723
1725
  const url = `${this.serverUrl}/v1/info`;
1724
- const response = await rateGate.runHttp(url, () => fetch(url));
1726
+ const response = await rateGate.runHttp(
1727
+ url,
1728
+ () => fetch(url, { signal: infoFetchSignal() })
1729
+ );
1725
1730
  if (!response.ok) {
1726
1731
  const errorText = await response.text();
1727
1732
  throwIfHttpUnavailable(response, "arkade", errorText);
@@ -2205,11 +2210,16 @@ function decodeMusig2Nonces(noncesObject) {
2205
2210
  })
2206
2211
  );
2207
2212
  }
2213
+ var INFO_FETCH_TIMEOUT_MS = 12e3;
2214
+ function infoFetchSignal() {
2215
+ return typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function" ? AbortSignal.timeout(INFO_FETCH_TIMEOUT_MS) : void 0;
2216
+ }
2208
2217
  function isFetchTimeoutError(err) {
2209
2218
  const checkError = (error) => {
2210
2219
  if (!(error instanceof Error)) return false;
2211
2220
  const isCloudflare524 = error.name === "TypeError" && error.message === "Failed to fetch";
2212
- return isCloudflare524 || error.name === "HeadersTimeoutError" || error.name === "BodyTimeoutError" || error.code === "UND_ERR_HEADERS_TIMEOUT" || error.code === "UND_ERR_BODY_TIMEOUT";
2221
+ return isCloudflare524 || // AbortSignal.timeout rejects with a DOMException named this
2222
+ error.name === "TimeoutError" || error.name === "HeadersTimeoutError" || error.name === "BodyTimeoutError" || error.code === "UND_ERR_HEADERS_TIMEOUT" || error.code === "UND_ERR_BODY_TIMEOUT";
2213
2223
  };
2214
2224
  return checkError(err) || checkError(err.cause);
2215
2225
  }
@@ -2461,6 +2471,7 @@ exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
2461
2471
  exports.DigestMismatchError = DigestMismatchError;
2462
2472
  exports.EventSourceUnavailableError = EventSourceUnavailableError;
2463
2473
  exports.FetchError = FetchError;
2474
+ exports.INFO_FETCH_TIMEOUT_MS = INFO_FETCH_TIMEOUT_MS;
2464
2475
  exports.MUTINYNET_EMULATOR_PUBKEY = MUTINYNET_EMULATOR_PUBKEY;
2465
2476
  exports.OP_RETURN_EMPTY_PKSCRIPT = OP_RETURN_EMPTY_PKSCRIPT;
2466
2477
  exports.PrevArkTxField = PrevArkTxField;
@@ -2510,6 +2521,7 @@ exports.isRetryableProviderError = isRetryableProviderError;
2510
2521
  exports.isSpendable = isSpendable;
2511
2522
  exports.isVirtualCoin = isVirtualCoin;
2512
2523
  exports.maybeArkError = maybeArkError;
2524
+ exports.networkFromArkadeInfo = networkFromArkadeInfo;
2513
2525
  exports.networks = networks;
2514
2526
  exports.normalizeVtxo = normalizeVtxo;
2515
2527
  exports.parseLegacyExpiry = parseLegacyExpiry;
@@ -2527,5 +2539,5 @@ exports.toBatchExpiry = toBatchExpiry;
2527
2539
  exports.toOffchainInputFeeParams = toOffchainInputFeeParams;
2528
2540
  exports.toProviderUnavailable = toProviderUnavailable;
2529
2541
  exports.toVirtualStatus = toVirtualStatus;
2530
- //# sourceMappingURL=chunk-EJOFL5WH.cjs.map
2531
- //# sourceMappingURL=chunk-EJOFL5WH.cjs.map
2542
+ //# sourceMappingURL=chunk-6AFUNKK7.cjs.map
2543
+ //# sourceMappingURL=chunk-6AFUNKK7.cjs.map