@arkade-os/sdk 0.5.11 → 0.5.13

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 (101) hide show
  1. package/dist/adapters/expo.cjs +7 -7
  2. package/dist/adapters/expo.d.cts +2 -2
  3. package/dist/adapters/expo.d.ts +2 -2
  4. package/dist/adapters/expo.js +4 -4
  5. package/dist/{asyncStorageTaskQueue-C0irgPwJ.d.ts → asyncStorageTaskQueue-Dhbe00Ya.d.ts} +1 -1
  6. package/dist/{asyncStorageTaskQueue-B6rFkXzW.d.cts → asyncStorageTaskQueue-Y4BlVm41.d.cts} +1 -1
  7. package/dist/{chunk-WIZCF5IX.cjs → chunk-6TBTL42M.cjs} +92 -5
  8. package/dist/chunk-6TBTL42M.cjs.map +1 -0
  9. package/dist/{chunk-DMYHAUTA.cjs → chunk-6WPP4UGN.cjs} +9962 -8635
  10. package/dist/chunk-6WPP4UGN.cjs.map +1 -0
  11. package/dist/{chunk-WZ2UHHQ7.cjs → chunk-6XVTGWQK.cjs} +20 -20
  12. package/dist/{chunk-WZ2UHHQ7.cjs.map → chunk-6XVTGWQK.cjs.map} +1 -1
  13. package/dist/{chunk-UPIQZRNJ.cjs → chunk-ACIQZLWL.cjs} +379 -20
  14. package/dist/chunk-ACIQZLWL.cjs.map +1 -0
  15. package/dist/{chunk-KRKREYKT.js → chunk-BA36SQY2.js} +4 -4
  16. package/dist/{chunk-KRKREYKT.js.map → chunk-BA36SQY2.js.map} +1 -1
  17. package/dist/{chunk-VJQMUKPZ.js → chunk-BP4NA7HK.js} +5 -5
  18. package/dist/{chunk-VJQMUKPZ.js.map → chunk-BP4NA7HK.js.map} +1 -1
  19. package/dist/{chunk-LKVVWCIW.js → chunk-D4QH6L54.js} +4 -4
  20. package/dist/{chunk-LKVVWCIW.js.map → chunk-D4QH6L54.js.map} +1 -1
  21. package/dist/{chunk-DPFD5KBK.js → chunk-GB67AGXG.js} +86 -6
  22. package/dist/chunk-GB67AGXG.js.map +1 -0
  23. package/dist/{chunk-5HCDXBBG.cjs → chunk-HS7TKVOZ.cjs} +30 -21
  24. package/dist/chunk-HS7TKVOZ.cjs.map +1 -0
  25. package/dist/{chunk-SS5BPVQL.js → chunk-LHLRG2BE.js} +23 -15
  26. package/dist/chunk-LHLRG2BE.js.map +1 -0
  27. package/dist/{chunk-HRFWODLP.js → chunk-QSERJPTT.js} +628 -23
  28. package/dist/chunk-QSERJPTT.js.map +1 -0
  29. package/dist/{chunk-VLO3JAP3.cjs → chunk-TD4PKK2I.cjs} +680 -68
  30. package/dist/chunk-TD4PKK2I.cjs.map +1 -0
  31. package/dist/{chunk-NC6TEEHZ.cjs → chunk-TYSUFG2K.cjs} +11 -11
  32. package/dist/{chunk-NC6TEEHZ.cjs.map → chunk-TYSUFG2K.cjs.map} +1 -1
  33. package/dist/{chunk-GEK6QBSY.cjs → chunk-WFJPLXOE.cjs} +21 -21
  34. package/dist/{chunk-GEK6QBSY.cjs.map → chunk-WFJPLXOE.cjs.map} +1 -1
  35. package/dist/{chunk-4DUTRRXF.js → chunk-X57WKONW.js} +369 -10
  36. package/dist/chunk-X57WKONW.js.map +1 -0
  37. package/dist/{chunk-W2C3KDQA.js → chunk-Y3AWLHQP.js} +9520 -8196
  38. package/dist/chunk-Y3AWLHQP.js.map +1 -0
  39. package/dist/compiler.cjs +3 -4
  40. package/dist/compiler.cjs.map +1 -1
  41. package/dist/compiler.js +2 -3
  42. package/dist/compiler.js.map +1 -1
  43. package/dist/contracts/handlers/index.cjs +15 -11
  44. package/dist/contracts/handlers/index.d.cts +5 -5
  45. package/dist/contracts/handlers/index.d.ts +5 -5
  46. package/dist/contracts/handlers/index.js +4 -4
  47. package/dist/{index-Bq349_ly.d.cts → index-BQwrHcOh.d.cts} +524 -23
  48. package/dist/{index-D4ahI0W6.d.cts → index-BaTItxPx.d.cts} +1 -1
  49. package/dist/{index-Yh5y9G4E.d.ts → index-BapVvuoI.d.ts} +1 -1
  50. package/dist/{index-Mn2POBPj.d.ts → index-DuXylQrN.d.ts} +524 -23
  51. package/dist/index.cjs +403 -368
  52. package/dist/index.d.cts +82 -71
  53. package/dist/index.d.ts +82 -71
  54. package/dist/index.js +6 -7
  55. package/dist/repositories/realm/index.cjs +39 -40
  56. package/dist/repositories/realm/index.cjs.map +1 -1
  57. package/dist/repositories/realm/index.d.cts +2 -2
  58. package/dist/repositories/realm/index.d.ts +2 -2
  59. package/dist/repositories/realm/index.js +7 -8
  60. package/dist/repositories/realm/index.js.map +1 -1
  61. package/dist/repositories/sqlite/index.cjs +37 -38
  62. package/dist/repositories/sqlite/index.cjs.map +1 -1
  63. package/dist/repositories/sqlite/index.d.cts +2 -2
  64. package/dist/repositories/sqlite/index.d.ts +2 -2
  65. package/dist/repositories/sqlite/index.js +7 -8
  66. package/dist/repositories/sqlite/index.js.map +1 -1
  67. package/dist/{taskRunner-BYxEgwM5.d.ts → taskRunner-BxOmg-O6.d.ts} +1 -1
  68. package/dist/{taskRunner-Z3LnHfgs.d.cts → taskRunner-D2itCXf6.d.cts} +1 -1
  69. package/dist/wallet/expo/background.cjs +16 -17
  70. package/dist/wallet/expo/background.cjs.map +1 -1
  71. package/dist/wallet/expo/background.d.cts +3 -3
  72. package/dist/wallet/expo/background.d.ts +3 -3
  73. package/dist/wallet/expo/background.js +8 -9
  74. package/dist/wallet/expo/background.js.map +1 -1
  75. package/dist/wallet/expo/index.cjs +17 -18
  76. package/dist/wallet/expo/index.cjs.map +1 -1
  77. package/dist/wallet/expo/index.d.cts +2 -2
  78. package/dist/wallet/expo/index.d.ts +2 -2
  79. package/dist/wallet/expo/index.js +7 -8
  80. package/dist/wallet/expo/index.js.map +1 -1
  81. package/dist/worker/expo/index.cjs +11 -12
  82. package/dist/worker/expo/index.cjs.map +1 -1
  83. package/dist/worker/expo/index.d.cts +4 -4
  84. package/dist/worker/expo/index.d.ts +4 -4
  85. package/dist/worker/expo/index.js +7 -8
  86. package/dist/worker/expo/index.js.map +1 -1
  87. package/package.json +1 -1
  88. package/dist/chunk-4DUTRRXF.js.map +0 -1
  89. package/dist/chunk-5HCDXBBG.cjs.map +0 -1
  90. package/dist/chunk-DMYHAUTA.cjs.map +0 -1
  91. package/dist/chunk-DPFD5KBK.js.map +0 -1
  92. package/dist/chunk-HRFWODLP.js.map +0 -1
  93. package/dist/chunk-OMZZQTDM.cjs +0 -376
  94. package/dist/chunk-OMZZQTDM.cjs.map +0 -1
  95. package/dist/chunk-PXEFYEKL.js +0 -373
  96. package/dist/chunk-PXEFYEKL.js.map +0 -1
  97. package/dist/chunk-SS5BPVQL.js.map +0 -1
  98. package/dist/chunk-UPIQZRNJ.cjs.map +0 -1
  99. package/dist/chunk-VLO3JAP3.cjs.map +0 -1
  100. package/dist/chunk-W2C3KDQA.js.map +0 -1
  101. package/dist/chunk-WIZCF5IX.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { VtxoScript, getSequence, proofTapLeafScriptOf, TapTreeCoder, toBIP371TapTree, sequenceToTimelock, DEFAULT_ARKADE_SERVER_URL } from './chunk-DPFD5KBK.js';
1
+ import { VtxoScript, getSequence, proofTapLeafScriptOf, TapTreeCoder, toBIP371TapTree, sequenceToTimelock, DEFAULT_ARKADE_SERVER_URL } from './chunk-GB67AGXG.js';
2
2
  import { OP, Script, SigHash, RawWitness, Transaction as Transaction$1, RawTx, ScriptNum } from '@scure/btc-signer';
3
3
  import { PSBTOutput } from '@scure/btc-signer/psbt.js';
4
4
  import { concatBytes } from '@scure/btc-signer/utils.js';
@@ -300,7 +300,7 @@ function checkKeyMatch(key, arkPsbtFieldKey, prefixOnly = false) {
300
300
  }
301
301
 
302
302
  // package.json
303
- var version = "0.5.11";
303
+ var version = "0.5.13";
304
304
 
305
305
  // src/utils/sdkVersionHeaders.ts
306
306
  var sdkVersion = `ts-sdk/${version}`;
@@ -329,28 +329,31 @@ var FetchError = class extends Error {
329
329
  };
330
330
  var READ_TIMEOUT_MS = 3e4;
331
331
  var warnedNoTimeoutSupport = false;
332
- function readDeadline(input, init) {
333
- if (init?.signal || input instanceof Request) return void 0;
334
- const { method } = describeRequest(input, init);
335
- const verb = method.toUpperCase();
336
- if (verb !== "GET" && verb !== "HEAD") return void 0;
332
+ function timeoutSignal(ms) {
337
333
  if (typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function") {
338
- return AbortSignal.timeout(READ_TIMEOUT_MS);
334
+ return AbortSignal.timeout(ms);
339
335
  }
340
336
  if (typeof AbortController === "function") {
341
337
  const controller = new AbortController();
342
- const timer = setTimeout(() => controller.abort(), READ_TIMEOUT_MS);
338
+ const timer = setTimeout(() => controller.abort(), ms);
343
339
  timer?.unref?.();
344
340
  return controller.signal;
345
341
  }
346
342
  if (!warnedNoTimeoutSupport) {
347
343
  warnedNoTimeoutSupport = true;
348
344
  console.warn(
349
- "Neither AbortSignal.timeout nor AbortController is available in this runtime: provider reads are UNBOUNDED and READ_TIMEOUT_MS is not being applied."
345
+ "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."
350
346
  );
351
347
  }
352
348
  return void 0;
353
349
  }
350
+ function readDeadline(input, init) {
351
+ if (init?.signal || input instanceof Request) return void 0;
352
+ const { method } = describeRequest(input, init);
353
+ const verb = method.toUpperCase();
354
+ if (verb !== "GET" && verb !== "HEAD") return void 0;
355
+ return timeoutSignal(READ_TIMEOUT_MS);
356
+ }
354
357
  function baseFetch(input, init) {
355
358
  if (typeof globalThis.fetch !== "function") {
356
359
  throw new Error("Fetch API is not available in this environment.");
@@ -1080,6 +1083,10 @@ function advertisedLimit(fromServer) {
1080
1083
  const limit = BigInt(fromServer);
1081
1084
  return limit > 0n ? limit : void 0;
1082
1085
  }
1086
+ function predatesOnchainCosign(version2) {
1087
+ const [major, minor, patch] = (/^v?(\d+)\.(\d+)\.(\d+)/.exec(version2) ?? []).slice(1).map(Number);
1088
+ return major === 0 && (minor < 9 || minor === 9 && patch < 22);
1089
+ }
1083
1090
  var RestOperatorProvider = class {
1084
1091
  constructor(serverUrl = DEFAULT_ARKADE_SERVER_URL, options = {}) {
1085
1092
  this.serverUrl = serverUrl;
@@ -1110,7 +1117,7 @@ var RestOperatorProvider = class {
1110
1117
  };
1111
1118
  }
1112
1119
  emitServerInfoChanged(info) {
1113
- this._onchainCosignUnsupported = false;
1120
+ this._onchainCosignUnsupported = predatesOnchainCosign(info.version);
1114
1121
  for (const listener of this._serverInfoListeners) {
1115
1122
  try {
1116
1123
  listener(info);
@@ -1244,6 +1251,7 @@ var RestOperatorProvider = class {
1244
1251
  if (hadServerInfo && previousDigest !== info.digest && !this._suppressNextGetInfoChangeEmit) {
1245
1252
  this.emitServerInfoChanged(info);
1246
1253
  }
1254
+ if (predatesOnchainCosign(info.version)) this._onchainCosignUnsupported = true;
1247
1255
  return info;
1248
1256
  }
1249
1257
  async submitTx(signedArkTx, checkpointTxs) {
@@ -1292,7 +1300,7 @@ var RestOperatorProvider = class {
1292
1300
  const arkError = maybeArkError(new Error(text));
1293
1301
  if (!arkError && (response.status === 404 || response.status === 501)) {
1294
1302
  this._onchainCosignUnsupported = true;
1295
- throw new OnchainCosignUnsupportedError();
1303
+ throw new OnchainCosignAmbiguousError(`${response.status} with no cosign endpoint`);
1296
1304
  }
1297
1305
  if (!arkError || arkError.name === ArkErrorName.INTERNAL_ERROR) {
1298
1306
  throw new OnchainCosignAmbiguousError(
@@ -1885,6 +1893,6 @@ function isVirtualCoin(input) {
1885
1893
  return typeof input === "object" && input !== null && typeof input.script === "string";
1886
1894
  }
1887
1895
 
1888
- export { ARKADE_VERSION_HEADERS, ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ConditionWitness, CosignerPublicKey, DEFAULT_PAGE_SIZE, DigestMismatchError, EXPIRY_MIN_PLAUSIBLE_MS, EventSourceUnavailableError, FetchError, HttpResponseError, INFO_FETCH_TIMEOUT_MS, Intent, MAX_COOLDOWN_MS, ONCHAIN_COSIGN_AMBIGUOUS_PREFIX, ONCHAIN_COSIGN_REJECTED_PREFIX, ONCHAIN_COSIGN_UNSUPPORTED_PREFIX, OP_RETURN_EMPTY_PKSCRIPT, OUTPOINT_QUERY_CHUNK_SIZE, OnchainCosignAmbiguousError, OnchainCosignRejectedError, OnchainCosignUnsupportedError, PrevArkTxField, PrevoutTxField, Proof, ProviderUnavailableError, READ_TIMEOUT_MS, RestArkProvider, RestOperatorProvider, SCRIPT_QUERY_CHUNK_SIZE, ServerResponseMismatchError, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, assertAllowedSighashTypes, assertNonNegativeMs, assertTimerMs, baseFetch, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, convertVtxo, craftToSpendTx, eventSourceIterator, fetchVtxoCreatedAtByTxid, formatSighash, getAllNormalizedVtxos, getArkPsbtFields, getConfiguredEventSource, getNormalizedVtxos, indexerPages, isArkError, isEventSourceError, isEventSourceUnavailableError, isFetchTimeoutError, isPastExpiry, isRetryableProviderError, isVirtualCoin, isVtxoSpent, maybeArkError, normalizeVtxo, rateGate, readSseFrames, requiresForfeit, resolveEventSource, resolveTimeHeight, retryAfterMsFromError, sdkVersion, sdkVersionHeaders, setArkPsbtField, streamFailureError, throwIfHttpUnavailable, toOffchainInputFeeParams, toProviderUnavailable };
1889
- //# sourceMappingURL=chunk-SS5BPVQL.js.map
1890
- //# sourceMappingURL=chunk-SS5BPVQL.js.map
1896
+ export { ARKADE_VERSION_HEADERS, ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ConditionWitness, CosignerPublicKey, DEFAULT_PAGE_SIZE, DigestMismatchError, EXPIRY_MIN_PLAUSIBLE_MS, EventSourceUnavailableError, FetchError, HttpResponseError, INFO_FETCH_TIMEOUT_MS, Intent, MAX_COOLDOWN_MS, ONCHAIN_COSIGN_AMBIGUOUS_PREFIX, ONCHAIN_COSIGN_REJECTED_PREFIX, ONCHAIN_COSIGN_UNSUPPORTED_PREFIX, OP_RETURN_EMPTY_PKSCRIPT, OUTPOINT_QUERY_CHUNK_SIZE, OnchainCosignAmbiguousError, OnchainCosignRejectedError, OnchainCosignUnsupportedError, PrevArkTxField, PrevoutTxField, Proof, ProviderUnavailableError, READ_TIMEOUT_MS, RestArkProvider, RestOperatorProvider, SCRIPT_QUERY_CHUNK_SIZE, ServerResponseMismatchError, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, assertAllowedSighashTypes, assertNonNegativeMs, assertTimerMs, baseFetch, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, convertVtxo, craftToSpendTx, eventSourceIterator, fetchVtxoCreatedAtByTxid, formatSighash, getAllNormalizedVtxos, getArkPsbtFields, getConfiguredEventSource, getNormalizedVtxos, indexerPages, isArkError, isEventSourceError, isEventSourceUnavailableError, isFetchTimeoutError, isPastExpiry, isRetryableProviderError, isVirtualCoin, isVtxoSpent, maybeArkError, normalizeVtxo, rateGate, readSseFrames, requiresForfeit, resolveEventSource, resolveTimeHeight, retryAfterMsFromError, sdkVersion, sdkVersionHeaders, setArkPsbtField, streamFailureError, throwIfHttpUnavailable, timeoutSignal, toOffchainInputFeeParams, toProviderUnavailable };
1897
+ //# sourceMappingURL=chunk-LHLRG2BE.js.map
1898
+ //# sourceMappingURL=chunk-LHLRG2BE.js.map