@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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkWIZCF5IX_cjs = require('./chunk-WIZCF5IX.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 = chunkWIZCF5IX_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 chunkWIZCF5IX_cjs.TapTreeCoder.encode(chunkWIZCF5IX_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 chunkWIZCF5IX_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.11";
305
+ var version = "0.5.13";
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 = chunkWIZCF5IX_cjs.VtxoScript.decode(coin.tapTree);
890
- const sequence = chunkWIZCF5IX_cjs.getSequence(chunkWIZCF5IX_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: [chunkWIZCF5IX_cjs.proofTapLeafScriptOf(coin)],
909
+ tapLeafScript: [chunk6TBTL42M_cjs.proofTapLeafScriptOf(coin)],
907
910
  unknown
908
911
  };
909
912
  }
@@ -1082,8 +1085,12 @@ function advertisedLimit(fromServer) {
1082
1085
  const limit = BigInt(fromServer);
1083
1086
  return limit > 0n ? limit : void 0;
1084
1087
  }
1088
+ function predatesOnchainCosign(version2) {
1089
+ const [major, minor, patch] = (/^v?(\d+)\.(\d+)\.(\d+)/.exec(version2) ?? []).slice(1).map(Number);
1090
+ return major === 0 && (minor < 9 || minor === 9 && patch < 22);
1091
+ }
1085
1092
  var RestOperatorProvider = class {
1086
- constructor(serverUrl = chunkWIZCF5IX_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1093
+ constructor(serverUrl = chunk6TBTL42M_cjs.DEFAULT_ARKADE_SERVER_URL, options = {}) {
1087
1094
  this.serverUrl = serverUrl;
1088
1095
  this.eventSource = options.eventSource;
1089
1096
  }
@@ -1112,7 +1119,7 @@ var RestOperatorProvider = class {
1112
1119
  };
1113
1120
  }
1114
1121
  emitServerInfoChanged(info) {
1115
- this._onchainCosignUnsupported = false;
1122
+ this._onchainCosignUnsupported = predatesOnchainCosign(info.version);
1116
1123
  for (const listener of this._serverInfoListeners) {
1117
1124
  try {
1118
1125
  listener(info);
@@ -1246,6 +1253,7 @@ var RestOperatorProvider = class {
1246
1253
  if (hadServerInfo && previousDigest !== info.digest && !this._suppressNextGetInfoChangeEmit) {
1247
1254
  this.emitServerInfoChanged(info);
1248
1255
  }
1256
+ if (predatesOnchainCosign(info.version)) this._onchainCosignUnsupported = true;
1249
1257
  return info;
1250
1258
  }
1251
1259
  async submitTx(signedArkTx, checkpointTxs) {
@@ -1294,7 +1302,7 @@ var RestOperatorProvider = class {
1294
1302
  const arkError = maybeArkError(new Error(text));
1295
1303
  if (!arkError && (response.status === 404 || response.status === 501)) {
1296
1304
  this._onchainCosignUnsupported = true;
1297
- throw new OnchainCosignUnsupportedError();
1305
+ throw new OnchainCosignAmbiguousError(`${response.status} with no cosign endpoint`);
1298
1306
  }
1299
1307
  if (!arkError || arkError.name === ArkErrorName.INTERNAL_ERROR) {
1300
1308
  throw new OnchainCosignAmbiguousError(
@@ -1963,7 +1971,8 @@ exports.sdkVersionHeaders = sdkVersionHeaders;
1963
1971
  exports.setArkPsbtField = setArkPsbtField;
1964
1972
  exports.streamFailureError = streamFailureError;
1965
1973
  exports.throwIfHttpUnavailable = throwIfHttpUnavailable;
1974
+ exports.timeoutSignal = timeoutSignal;
1966
1975
  exports.toOffchainInputFeeParams = toOffchainInputFeeParams;
1967
1976
  exports.toProviderUnavailable = toProviderUnavailable;
1968
- //# sourceMappingURL=chunk-5HCDXBBG.cjs.map
1969
- //# sourceMappingURL=chunk-5HCDXBBG.cjs.map
1977
+ //# sourceMappingURL=chunk-HS7TKVOZ.cjs.map
1978
+ //# sourceMappingURL=chunk-HS7TKVOZ.cjs.map