@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.
- package/dist/adapters/expo.cjs +7 -7
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +4 -4
- package/dist/{asyncStorageTaskQueue-C0irgPwJ.d.ts → asyncStorageTaskQueue-Dhbe00Ya.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-B6rFkXzW.d.cts → asyncStorageTaskQueue-Y4BlVm41.d.cts} +1 -1
- package/dist/{chunk-WIZCF5IX.cjs → chunk-6TBTL42M.cjs} +92 -5
- package/dist/chunk-6TBTL42M.cjs.map +1 -0
- package/dist/{chunk-DMYHAUTA.cjs → chunk-6WPP4UGN.cjs} +9962 -8635
- package/dist/chunk-6WPP4UGN.cjs.map +1 -0
- package/dist/{chunk-WZ2UHHQ7.cjs → chunk-6XVTGWQK.cjs} +20 -20
- package/dist/{chunk-WZ2UHHQ7.cjs.map → chunk-6XVTGWQK.cjs.map} +1 -1
- package/dist/{chunk-UPIQZRNJ.cjs → chunk-ACIQZLWL.cjs} +379 -20
- package/dist/chunk-ACIQZLWL.cjs.map +1 -0
- package/dist/{chunk-KRKREYKT.js → chunk-BA36SQY2.js} +4 -4
- package/dist/{chunk-KRKREYKT.js.map → chunk-BA36SQY2.js.map} +1 -1
- package/dist/{chunk-VJQMUKPZ.js → chunk-BP4NA7HK.js} +5 -5
- package/dist/{chunk-VJQMUKPZ.js.map → chunk-BP4NA7HK.js.map} +1 -1
- package/dist/{chunk-LKVVWCIW.js → chunk-D4QH6L54.js} +4 -4
- package/dist/{chunk-LKVVWCIW.js.map → chunk-D4QH6L54.js.map} +1 -1
- package/dist/{chunk-DPFD5KBK.js → chunk-GB67AGXG.js} +86 -6
- package/dist/chunk-GB67AGXG.js.map +1 -0
- package/dist/{chunk-5HCDXBBG.cjs → chunk-HS7TKVOZ.cjs} +30 -21
- package/dist/chunk-HS7TKVOZ.cjs.map +1 -0
- package/dist/{chunk-SS5BPVQL.js → chunk-LHLRG2BE.js} +23 -15
- package/dist/chunk-LHLRG2BE.js.map +1 -0
- package/dist/{chunk-HRFWODLP.js → chunk-QSERJPTT.js} +628 -23
- package/dist/chunk-QSERJPTT.js.map +1 -0
- package/dist/{chunk-VLO3JAP3.cjs → chunk-TD4PKK2I.cjs} +680 -68
- package/dist/chunk-TD4PKK2I.cjs.map +1 -0
- package/dist/{chunk-NC6TEEHZ.cjs → chunk-TYSUFG2K.cjs} +11 -11
- package/dist/{chunk-NC6TEEHZ.cjs.map → chunk-TYSUFG2K.cjs.map} +1 -1
- package/dist/{chunk-GEK6QBSY.cjs → chunk-WFJPLXOE.cjs} +21 -21
- package/dist/{chunk-GEK6QBSY.cjs.map → chunk-WFJPLXOE.cjs.map} +1 -1
- package/dist/{chunk-4DUTRRXF.js → chunk-X57WKONW.js} +369 -10
- package/dist/chunk-X57WKONW.js.map +1 -0
- package/dist/{chunk-W2C3KDQA.js → chunk-Y3AWLHQP.js} +9520 -8196
- package/dist/chunk-Y3AWLHQP.js.map +1 -0
- package/dist/compiler.cjs +3 -4
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.js +2 -3
- package/dist/compiler.js.map +1 -1
- package/dist/contracts/handlers/index.cjs +15 -11
- package/dist/contracts/handlers/index.d.cts +5 -5
- package/dist/contracts/handlers/index.d.ts +5 -5
- package/dist/contracts/handlers/index.js +4 -4
- package/dist/{index-Bq349_ly.d.cts → index-BQwrHcOh.d.cts} +524 -23
- package/dist/{index-D4ahI0W6.d.cts → index-BaTItxPx.d.cts} +1 -1
- package/dist/{index-Yh5y9G4E.d.ts → index-BapVvuoI.d.ts} +1 -1
- package/dist/{index-Mn2POBPj.d.ts → index-DuXylQrN.d.ts} +524 -23
- package/dist/index.cjs +403 -368
- package/dist/index.d.cts +82 -71
- package/dist/index.d.ts +82 -71
- package/dist/index.js +6 -7
- package/dist/repositories/realm/index.cjs +39 -40
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +7 -8
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +37 -38
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +7 -8
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-BYxEgwM5.d.ts → taskRunner-BxOmg-O6.d.ts} +1 -1
- package/dist/{taskRunner-Z3LnHfgs.d.cts → taskRunner-D2itCXf6.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +16 -17
- package/dist/wallet/expo/background.cjs.map +1 -1
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +8 -9
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +17 -18
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +2 -2
- package/dist/wallet/expo/index.d.ts +2 -2
- package/dist/wallet/expo/index.js +7 -8
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +11 -12
- package/dist/worker/expo/index.cjs.map +1 -1
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +7 -8
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4DUTRRXF.js.map +0 -1
- package/dist/chunk-5HCDXBBG.cjs.map +0 -1
- package/dist/chunk-DMYHAUTA.cjs.map +0 -1
- package/dist/chunk-DPFD5KBK.js.map +0 -1
- package/dist/chunk-HRFWODLP.js.map +0 -1
- package/dist/chunk-OMZZQTDM.cjs +0 -376
- package/dist/chunk-OMZZQTDM.cjs.map +0 -1
- package/dist/chunk-PXEFYEKL.js +0 -373
- package/dist/chunk-PXEFYEKL.js.map +0 -1
- package/dist/chunk-SS5BPVQL.js.map +0 -1
- package/dist/chunk-UPIQZRNJ.cjs.map +0 -1
- package/dist/chunk-VLO3JAP3.cjs.map +0 -1
- package/dist/chunk-W2C3KDQA.js.map +0 -1
- 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-
|
|
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.
|
|
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
|
|
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(
|
|
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(),
|
|
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
|
|
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 =
|
|
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
|
|
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-
|
|
1890
|
-
//# sourceMappingURL=chunk-
|
|
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
|