@arkade-os/sdk 0.5.12 → 0.5.14

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 (106) hide show
  1. package/README.md +6 -0
  2. package/dist/adapters/expo.cjs +7 -7
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +4 -4
  6. package/dist/{asyncStorageTaskQueue-DTNS2qfN.d.cts → asyncStorageTaskQueue-DzO5SBcm.d.cts} +2 -2
  7. package/dist/{asyncStorageTaskQueue-Bsty8W7d.d.ts → asyncStorageTaskQueue-p7zeFhA3.d.ts} +2 -2
  8. package/dist/{chunk-4OY5BCIE.js → chunk-4HZQSKWG.js} +628 -23
  9. package/dist/chunk-4HZQSKWG.js.map +1 -0
  10. package/dist/{chunk-4X4SY3RH.cjs → chunk-6J4GABF7.cjs} +28 -20
  11. package/dist/chunk-6J4GABF7.cjs.map +1 -0
  12. package/dist/{chunk-YAVF2PR6.cjs → chunk-6TBTL42M.cjs} +87 -2
  13. package/dist/chunk-6TBTL42M.cjs.map +1 -0
  14. package/dist/{chunk-5NY5EOS2.js → chunk-72EC3ASW.js} +4 -4
  15. package/dist/{chunk-5NY5EOS2.js.map → chunk-72EC3ASW.js.map} +1 -1
  16. package/dist/{chunk-QV7AOZZN.cjs → chunk-7LPT6AYH.cjs} +21 -21
  17. package/dist/{chunk-QV7AOZZN.cjs.map → chunk-7LPT6AYH.cjs.map} +1 -1
  18. package/dist/{chunk-JA4SYFC7.cjs → chunk-ACIQZLWL.cjs} +379 -20
  19. package/dist/chunk-ACIQZLWL.cjs.map +1 -0
  20. package/dist/{chunk-BA3GPO5C.js → chunk-AZHBGWVC.js} +5 -5
  21. package/dist/{chunk-BA3GPO5C.js.map → chunk-AZHBGWVC.js.map} +1 -1
  22. package/dist/{chunk-HNLC6F73.cjs → chunk-EVVLVFY7.cjs} +20 -20
  23. package/dist/{chunk-HNLC6F73.cjs.map → chunk-EVVLVFY7.cjs.map} +1 -1
  24. package/dist/{chunk-2YXVU5TK.js → chunk-GB67AGXG.js} +81 -3
  25. package/dist/chunk-GB67AGXG.js.map +1 -0
  26. package/dist/{chunk-WBZYYRAB.js → chunk-HWWSLCQN.js} +9724 -8151
  27. package/dist/chunk-HWWSLCQN.js.map +1 -0
  28. package/dist/{chunk-4TMJBLJT.js → chunk-J2JZZTOE.js} +20 -14
  29. package/dist/chunk-J2JZZTOE.js.map +1 -0
  30. package/dist/{chunk-3RO63OPW.js → chunk-LCGRZ24T.js} +4 -4
  31. package/dist/{chunk-3RO63OPW.js.map → chunk-LCGRZ24T.js.map} +1 -1
  32. package/dist/{chunk-CJUVKHK4.cjs → chunk-LQH7DACV.cjs} +10204 -8628
  33. package/dist/chunk-LQH7DACV.cjs.map +1 -0
  34. package/dist/{chunk-QDX2HUBK.cjs → chunk-MEIE2AEU.cjs} +11 -11
  35. package/dist/{chunk-QDX2HUBK.cjs.map → chunk-MEIE2AEU.cjs.map} +1 -1
  36. package/dist/{chunk-3ABF4EMM.js → chunk-X57WKONW.js} +369 -10
  37. package/dist/chunk-X57WKONW.js.map +1 -0
  38. package/dist/{chunk-C3NKBKRY.cjs → chunk-XZHTYYW5.cjs} +680 -68
  39. package/dist/chunk-XZHTYYW5.cjs.map +1 -0
  40. package/dist/compiler.cjs +3 -4
  41. package/dist/compiler.cjs.map +1 -1
  42. package/dist/compiler.d.cts +1 -1
  43. package/dist/compiler.d.ts +1 -1
  44. package/dist/compiler.js +2 -3
  45. package/dist/compiler.js.map +1 -1
  46. package/dist/contracts/handlers/index.cjs +15 -11
  47. package/dist/contracts/handlers/index.d.cts +5 -5
  48. package/dist/contracts/handlers/index.d.ts +5 -5
  49. package/dist/contracts/handlers/index.js +4 -4
  50. package/dist/{index-D_zLtU-F.d.ts → index-CaOBA9Ev.d.ts} +2 -2
  51. package/dist/{index-BBmZXXqk.d.cts → index-Cy57QdcL.d.cts} +589 -23
  52. package/dist/{index-DJ32LpfD.d.ts → index-Db5qzYRi.d.ts} +589 -23
  53. package/dist/{index-DenQfCn1.d.cts → index-Lq_u0hqj.d.cts} +2 -2
  54. package/dist/index.cjs +403 -368
  55. package/dist/index.d.cts +197 -117
  56. package/dist/index.d.ts +197 -117
  57. package/dist/index.js +6 -7
  58. package/dist/{program-DPzf5qsk.d.cts → program-ZWUAWy_9.d.cts} +1 -1
  59. package/dist/{program-38A2Twvj.d.ts → program-zdDO4cMt.d.ts} +1 -1
  60. package/dist/repositories/realm/index.cjs +39 -40
  61. package/dist/repositories/realm/index.cjs.map +1 -1
  62. package/dist/repositories/realm/index.d.cts +2 -2
  63. package/dist/repositories/realm/index.d.ts +2 -2
  64. package/dist/repositories/realm/index.js +7 -8
  65. package/dist/repositories/realm/index.js.map +1 -1
  66. package/dist/repositories/sqlite/index.cjs +37 -38
  67. package/dist/repositories/sqlite/index.cjs.map +1 -1
  68. package/dist/repositories/sqlite/index.d.cts +2 -2
  69. package/dist/repositories/sqlite/index.d.ts +2 -2
  70. package/dist/repositories/sqlite/index.js +7 -8
  71. package/dist/repositories/sqlite/index.js.map +1 -1
  72. package/dist/{taskRunner-BBGaN4cq.d.cts → taskRunner-DhZ-KQBW.d.cts} +2 -2
  73. package/dist/{taskRunner-Cck24OnC.d.ts → taskRunner-amPuilMW.d.ts} +2 -2
  74. package/dist/wallet/expo/background.cjs +16 -17
  75. package/dist/wallet/expo/background.cjs.map +1 -1
  76. package/dist/wallet/expo/background.d.cts +3 -3
  77. package/dist/wallet/expo/background.d.ts +3 -3
  78. package/dist/wallet/expo/background.js +8 -9
  79. package/dist/wallet/expo/background.js.map +1 -1
  80. package/dist/wallet/expo/index.cjs +17 -18
  81. package/dist/wallet/expo/index.cjs.map +1 -1
  82. package/dist/wallet/expo/index.d.cts +2 -2
  83. package/dist/wallet/expo/index.d.ts +2 -2
  84. package/dist/wallet/expo/index.js +7 -8
  85. package/dist/wallet/expo/index.js.map +1 -1
  86. package/dist/worker/expo/index.cjs +11 -12
  87. package/dist/worker/expo/index.cjs.map +1 -1
  88. package/dist/worker/expo/index.d.cts +4 -4
  89. package/dist/worker/expo/index.d.ts +4 -4
  90. package/dist/worker/expo/index.js +7 -8
  91. package/dist/worker/expo/index.js.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/chunk-2YXVU5TK.js.map +0 -1
  94. package/dist/chunk-3ABF4EMM.js.map +0 -1
  95. package/dist/chunk-4OY5BCIE.js.map +0 -1
  96. package/dist/chunk-4TMJBLJT.js.map +0 -1
  97. package/dist/chunk-4X4SY3RH.cjs.map +0 -1
  98. package/dist/chunk-C3NKBKRY.cjs.map +0 -1
  99. package/dist/chunk-CJUVKHK4.cjs.map +0 -1
  100. package/dist/chunk-JA4SYFC7.cjs.map +0 -1
  101. package/dist/chunk-PHOJF7OK.cjs +0 -376
  102. package/dist/chunk-PHOJF7OK.cjs.map +0 -1
  103. package/dist/chunk-UXLETBNK.js +0 -373
  104. package/dist/chunk-UXLETBNK.js.map +0 -1
  105. package/dist/chunk-WBZYYRAB.js.map +0 -1
  106. package/dist/chunk-YAVF2PR6.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYAVF2PR6_cjs = require('./chunk-YAVF2PR6.cjs');
3
+ var chunk6TBTL42M_cjs = require('./chunk-6TBTL42M.cjs');
4
4
  var btcSigner = require('@scure/btc-signer');
5
5
  var psbt_js = require('@scure/btc-signer/psbt.js');
6
6
  var utils_js = require('@scure/btc-signer/utils.js');
@@ -70,13 +70,13 @@ function legacyTapTreeToBIP371(value) {
70
70
  }
71
71
  let leaves;
72
72
  try {
73
- leaves = chunkYAVF2PR6_cjs.TapTreeCoder.decode(value);
73
+ leaves = chunk6TBTL42M_cjs.TapTreeCoder.decode(value);
74
74
  } catch {
75
75
  return void 0;
76
76
  }
77
77
  if (leaves.length === 0 || leaves.some((leaf) => leaf.depth !== 1)) return void 0;
78
78
  try {
79
- return chunkYAVF2PR6_cjs.TapTreeCoder.encode(chunkYAVF2PR6_cjs.toBIP371TapTree(value));
79
+ return chunk6TBTL42M_cjs.TapTreeCoder.encode(chunk6TBTL42M_cjs.toBIP371TapTree(value));
80
80
  } catch {
81
81
  return void 0;
82
82
  }
@@ -277,7 +277,7 @@ var VtxoTreeExpiry = {
277
277
  if (!checkKeyMatch(unknown[0], "expiry" /* VtxoTreeExpiry */)) return null;
278
278
  const v = btcSigner.ScriptNum(6, true).decode(unknown[1]);
279
279
  if (!v) return null;
280
- return chunkYAVF2PR6_cjs.sequenceToTimelock(Number(v));
280
+ return chunk6TBTL42M_cjs.sequenceToTimelock(Number(v));
281
281
  })
282
282
  };
283
283
  var encodedPsbtFieldKey = Object.fromEntries(
@@ -302,7 +302,7 @@ function checkKeyMatch(key, arkPsbtFieldKey, prefixOnly = false) {
302
302
  }
303
303
 
304
304
  // package.json
305
- var version = "0.5.12";
305
+ var version = "0.5.14";
306
306
 
307
307
  // src/utils/sdkVersionHeaders.ts
308
308
  var sdkVersion = `ts-sdk/${version}`;
@@ -331,28 +331,31 @@ var FetchError = class extends Error {
331
331
  };
332
332
  var READ_TIMEOUT_MS = 3e4;
333
333
  var warnedNoTimeoutSupport = false;
334
- function readDeadline(input, init) {
335
- if (init?.signal || input instanceof Request) return void 0;
336
- const { method } = describeRequest(input, init);
337
- const verb = method.toUpperCase();
338
- if (verb !== "GET" && verb !== "HEAD") return void 0;
334
+ function timeoutSignal(ms) {
339
335
  if (typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function") {
340
- return AbortSignal.timeout(READ_TIMEOUT_MS);
336
+ return AbortSignal.timeout(ms);
341
337
  }
342
338
  if (typeof AbortController === "function") {
343
339
  const controller = new AbortController();
344
- const timer = setTimeout(() => controller.abort(), READ_TIMEOUT_MS);
340
+ const timer = setTimeout(() => controller.abort(), ms);
345
341
  timer?.unref?.();
346
342
  return controller.signal;
347
343
  }
348
344
  if (!warnedNoTimeoutSupport) {
349
345
  warnedNoTimeoutSupport = true;
350
346
  console.warn(
351
- "Neither AbortSignal.timeout nor AbortController is available in this runtime: provider reads are UNBOUNDED and READ_TIMEOUT_MS is not being applied."
347
+ "Neither AbortSignal.timeout nor AbortController is available in this runtime: request deadlines (READ_TIMEOUT_MS on provider reads) are NOT applied, so those requests are UNBOUNDED."
352
348
  );
353
349
  }
354
350
  return void 0;
355
351
  }
352
+ function readDeadline(input, init) {
353
+ if (init?.signal || input instanceof Request) return void 0;
354
+ const { method } = describeRequest(input, init);
355
+ const verb = method.toUpperCase();
356
+ if (verb !== "GET" && verb !== "HEAD") return void 0;
357
+ return timeoutSignal(READ_TIMEOUT_MS);
358
+ }
356
359
  function baseFetch(input, init) {
357
360
  if (typeof globalThis.fetch !== "function") {
358
361
  throw new Error("Fetch API is not available in this environment.");
@@ -886,8 +889,8 @@ function prepareProofInput(coin) {
886
889
  if (!("tapTree" in coin)) {
887
890
  return coin;
888
891
  }
889
- const vtxoScript = chunkYAVF2PR6_cjs.VtxoScript.decode(coin.tapTree);
890
- const sequence = chunkYAVF2PR6_cjs.getSequence(chunkYAVF2PR6_cjs.proofTapLeafScriptOf(coin));
892
+ const vtxoScript = chunk6TBTL42M_cjs.VtxoScript.decode(coin.tapTree);
893
+ const sequence = chunk6TBTL42M_cjs.getSequence(chunk6TBTL42M_cjs.proofTapLeafScriptOf(coin));
891
894
  const unknown = [VtxoTaprootTree.encode(coin.tapTree)];
892
895
  if (coin.extraWitness) {
893
896
  unknown.push(ConditionWitness.encode(coin.extraWitness));
@@ -903,7 +906,7 @@ function prepareProofInput(coin) {
903
906
  script: vtxoScript.pkScript
904
907
  },
905
908
  sequence,
906
- tapLeafScript: [chunkYAVF2PR6_cjs.proofTapLeafScriptOf(coin)],
909
+ tapLeafScript: [chunk6TBTL42M_cjs.proofTapLeafScriptOf(coin)],
907
910
  unknown
908
911
  };
909
912
  }
@@ -1087,7 +1090,7 @@ function predatesOnchainCosign(version2) {
1087
1090
  return major === 0 && (minor < 9 || minor === 9 && patch < 22);
1088
1091
  }
1089
1092
  var RestOperatorProvider = class {
1090
- constructor(serverUrl = chunkYAVF2PR6_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1093
+ constructor(serverUrl = chunk6TBTL42M_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1091
1094
  this.serverUrl = serverUrl;
1092
1095
  this.eventSource = options.eventSource;
1093
1096
  }
@@ -1677,7 +1680,7 @@ function isFetchTimeoutError(err) {
1677
1680
  return isCloudflare524 || // AbortSignal.timeout rejects with a DOMException named this
1678
1681
  error.name === "TimeoutError" || error.name === "HeadersTimeoutError" || error.name === "BodyTimeoutError" || error.code === "UND_ERR_HEADERS_TIMEOUT" || error.code === "UND_ERR_BODY_TIMEOUT";
1679
1682
  };
1680
- return checkError(err) || checkError(err.cause);
1683
+ return checkError(err) || checkError(err?.cause);
1681
1684
  }
1682
1685
  function mapTxNotification(data) {
1683
1686
  return {
@@ -1719,6 +1722,9 @@ var RestArkProvider = RestOperatorProvider;
1719
1722
  function isRetryableProviderError(error) {
1720
1723
  return error instanceof ProviderUnavailableError || error instanceof FetchError || isFetchTimeoutError(error);
1721
1724
  }
1725
+ function isTransientOperatorError(error) {
1726
+ return isRetryableProviderError(error) || error instanceof DigestMismatchError;
1727
+ }
1722
1728
 
1723
1729
  // src/contracts/constants.ts
1724
1730
  var DEFAULT_PAGE_SIZE = 500;
@@ -1953,6 +1959,7 @@ exports.isEventSourceUnavailableError = isEventSourceUnavailableError;
1953
1959
  exports.isFetchTimeoutError = isFetchTimeoutError;
1954
1960
  exports.isPastExpiry = isPastExpiry;
1955
1961
  exports.isRetryableProviderError = isRetryableProviderError;
1962
+ exports.isTransientOperatorError = isTransientOperatorError;
1956
1963
  exports.isVirtualCoin = isVirtualCoin;
1957
1964
  exports.isVtxoSpent = isVtxoSpent;
1958
1965
  exports.maybeArkError = maybeArkError;
@@ -1968,7 +1975,8 @@ exports.sdkVersionHeaders = sdkVersionHeaders;
1968
1975
  exports.setArkPsbtField = setArkPsbtField;
1969
1976
  exports.streamFailureError = streamFailureError;
1970
1977
  exports.throwIfHttpUnavailable = throwIfHttpUnavailable;
1978
+ exports.timeoutSignal = timeoutSignal;
1971
1979
  exports.toOffchainInputFeeParams = toOffchainInputFeeParams;
1972
1980
  exports.toProviderUnavailable = toProviderUnavailable;
1973
- //# sourceMappingURL=chunk-4X4SY3RH.cjs.map
1974
- //# sourceMappingURL=chunk-4X4SY3RH.cjs.map
1981
+ //# sourceMappingURL=chunk-6J4GABF7.cjs.map
1982
+ //# sourceMappingURL=chunk-6J4GABF7.cjs.map