@arkade-os/sdk 0.4.39 → 0.4.41
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/README.md +24 -0
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{ark-BzUNnkoc.d.cts → ark-CSqMJczW.d.cts} +111 -4
- package/dist/{ark-BzUNnkoc.d.ts → ark-CSqMJczW.d.ts} +111 -4
- package/dist/{asyncStorageTaskQueue-C0kQoY1x.d.cts → asyncStorageTaskQueue-79XdGsdW.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CIYeI6GM.d.ts → asyncStorageTaskQueue-SZPrhw23.d.ts} +1 -1
- package/dist/{chunk-GUTKJMSF.cjs → chunk-32YKLQPS.cjs} +29 -29
- package/dist/{chunk-GUTKJMSF.cjs.map → chunk-32YKLQPS.cjs.map} +1 -1
- package/dist/{chunk-P5FKMIGY.cjs → chunk-3MPXMLP4.cjs} +538 -282
- package/dist/chunk-3MPXMLP4.cjs.map +1 -0
- package/dist/{chunk-D744IES4.js → chunk-5XAYUPK4.js} +15 -6
- package/dist/chunk-5XAYUPK4.js.map +1 -0
- package/dist/{chunk-LJLEFPWD.cjs → chunk-ALISWEQ5.cjs} +20 -11
- package/dist/chunk-ALISWEQ5.cjs.map +1 -0
- package/dist/{chunk-OUVTG72A.js → chunk-BE5MUB7T.js} +5 -3
- package/dist/chunk-BE5MUB7T.js.map +1 -0
- package/dist/{chunk-SYEGCMNV.js → chunk-D5MQYYYF.js} +355 -104
- package/dist/chunk-D5MQYYYF.js.map +1 -0
- package/dist/{chunk-VGXTJ7HR.js → chunk-DDG4RE5F.js} +4 -4
- package/dist/{chunk-VGXTJ7HR.js.map → chunk-DDG4RE5F.js.map} +1 -1
- package/dist/{chunk-CMPJR3HS.cjs → chunk-HXDZ2QTW.cjs} +5 -3
- package/dist/chunk-HXDZ2QTW.cjs.map +1 -0
- package/dist/{chunk-A5RLZCPO.cjs → chunk-KNASU3QI.cjs} +7 -7
- package/dist/{chunk-A5RLZCPO.cjs.map → chunk-KNASU3QI.cjs.map} +1 -1
- package/dist/{chunk-UIFBMKI7.js → chunk-MYI333YH.js} +3 -3
- package/dist/{chunk-UIFBMKI7.js.map → chunk-MYI333YH.js.map} +1 -1
- package/dist/{chunk-N56IDZON.cjs → chunk-WBF3FNS3.cjs} +14 -14
- package/dist/{chunk-N56IDZON.cjs.map → chunk-WBF3FNS3.cjs.map} +1 -1
- package/dist/{chunk-CUSABEUQ.js → chunk-YNEDJTX2.js} +3 -3
- package/dist/{chunk-CUSABEUQ.js.map → chunk-YNEDJTX2.js.map} +1 -1
- package/dist/contracts/handlers/index.cjs +7 -7
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-BjPbX-MR.d.ts → delegate-BTn9BK8E.d.ts} +1 -1
- package/dist/{delegate-DHAgMIS9.d.cts → delegate-Bqwe-kbj.d.cts} +1 -1
- package/dist/{index-YkMAtSfw.d.cts → index-aYiHTMkX.d.cts} +2 -2
- package/dist/{index-BOQKDCmS.d.ts → index-kITujXlS.d.ts} +2 -2
- package/dist/index.cjs +163 -139
- package/dist/index.d.cts +53 -11
- package/dist/index.d.ts +53 -11
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +13 -13
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/realm/index.js +4 -4
- package/dist/repositories/sqlite/index.cjs +13 -13
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +4 -4
- package/dist/{taskRunner-Dfmt7ZPN.d.ts → taskRunner-BuBAZQwB.d.ts} +1 -1
- package/dist/{taskRunner-CVEgBO6d.d.cts → taskRunner-DRHElPMG.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +44 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +14 -4
- package/dist/wallet/expo/index.d.ts +14 -4
- package/dist/wallet/expo/index.js +36 -6
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/{wallet-C4Pide44.d.ts → wallet-BZgRfnAE.d.cts} +15 -2
- package/dist/{wallet-_PTv-lMe.d.cts → wallet-CTEQpKG9.d.ts} +15 -2
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-CMPJR3HS.cjs.map +0 -1
- package/dist/chunk-D744IES4.js.map +0 -1
- package/dist/chunk-LJLEFPWD.cjs.map +0 -1
- package/dist/chunk-OUVTG72A.js.map +0 -1
- package/dist/chunk-P5FKMIGY.cjs.map +0 -1
- package/dist/chunk-SYEGCMNV.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHXDZ2QTW_cjs = require('./chunk-HXDZ2QTW.cjs');
|
|
4
4
|
var chunk5BLDMQED_cjs = require('./chunk-5BLDMQED.cjs');
|
|
5
5
|
var btcSigner = require('@scure/btc-signer');
|
|
6
6
|
var base = require('@scure/base');
|
|
@@ -106,7 +106,7 @@ var VtxoTreeExpiry = {
|
|
|
106
106
|
if (!checkKeyIncludes(unknown[0], "expiry" /* VtxoTreeExpiry */)) return null;
|
|
107
107
|
const v = btcSigner.ScriptNum(6, true).decode(unknown[1]);
|
|
108
108
|
if (!v) return null;
|
|
109
|
-
return
|
|
109
|
+
return chunkHXDZ2QTW_cjs.sequenceToTimelock(Number(v));
|
|
110
110
|
})
|
|
111
111
|
};
|
|
112
112
|
var encodedPsbtFieldKey = Object.fromEntries(
|
|
@@ -179,7 +179,7 @@ exports.Intent = void 0;
|
|
|
179
179
|
if (!validateInputs(inputs)) ;
|
|
180
180
|
if (!validateOutputs(outputs)) ;
|
|
181
181
|
const toSpend = craftToSpendTx(message, inputs[0].witnessUtxo.script);
|
|
182
|
-
return craftToSignTx(toSpend, inputs, outputs);
|
|
182
|
+
return craftToSignTx(toSpend, inputs, outputs, message);
|
|
183
183
|
}
|
|
184
184
|
Intent2.create = create;
|
|
185
185
|
function fee(proof) {
|
|
@@ -232,6 +232,7 @@ var OP_RETURN_EMPTY_PKSCRIPT = new Uint8Array([btcSigner.OP.RETURN]);
|
|
|
232
232
|
var ZERO_32 = new Uint8Array(32).fill(0);
|
|
233
233
|
var MAX_INDEX = 4294967295;
|
|
234
234
|
var TAG_INTENT_PROOF = "ark-intent-proof-message";
|
|
235
|
+
var PSBT_GLOBAL_GENERIC_SIGNED_MESSAGE = 9;
|
|
235
236
|
function validateInput(input) {
|
|
236
237
|
if (input.index === void 0) throw new Error("intent proof input requires index");
|
|
237
238
|
if (input.txid === void 0) throw new Error("intent proof input requires txid");
|
|
@@ -272,7 +273,7 @@ function craftToSpendTx(message, pkScript, tag = TAG_INTENT_PROOF) {
|
|
|
272
273
|
});
|
|
273
274
|
return tx;
|
|
274
275
|
}
|
|
275
|
-
function craftToSignTx(toSpend, inputs, outputs) {
|
|
276
|
+
function craftToSignTx(toSpend, inputs, outputs, message) {
|
|
276
277
|
const firstInput = inputs[0];
|
|
277
278
|
const tx = new Transaction({
|
|
278
279
|
version: 2,
|
|
@@ -313,6 +314,14 @@ function craftToSignTx(toSpend, inputs, outputs) {
|
|
|
313
314
|
script: output.script
|
|
314
315
|
});
|
|
315
316
|
}
|
|
317
|
+
const global = tx.global;
|
|
318
|
+
global.unknown = [
|
|
319
|
+
...global.unknown ?? [],
|
|
320
|
+
[
|
|
321
|
+
{ type: PSBT_GLOBAL_GENERIC_SIGNED_MESSAGE, key: new Uint8Array() },
|
|
322
|
+
new TextEncoder().encode(message)
|
|
323
|
+
]
|
|
324
|
+
];
|
|
316
325
|
return tx;
|
|
317
326
|
}
|
|
318
327
|
function hashMessage(message, tag = TAG_INTENT_PROOF) {
|
|
@@ -322,8 +331,8 @@ function prepareCoinAsIntentProofInput(coin) {
|
|
|
322
331
|
if (!("tapTree" in coin)) {
|
|
323
332
|
return coin;
|
|
324
333
|
}
|
|
325
|
-
const vtxoScript =
|
|
326
|
-
const sequence =
|
|
334
|
+
const vtxoScript = chunkHXDZ2QTW_cjs.VtxoScript.decode(coin.tapTree);
|
|
335
|
+
const sequence = chunkHXDZ2QTW_cjs.getSequence(coin.intentTapLeafScript);
|
|
327
336
|
const unknown = [VtxoTaprootTree.encode(coin.tapTree)];
|
|
328
337
|
if (coin.extraWitness) {
|
|
329
338
|
unknown.push(ConditionWitness.encode(coin.extraWitness));
|
|
@@ -342,7 +351,7 @@ function prepareCoinAsIntentProofInput(coin) {
|
|
|
342
351
|
}
|
|
343
352
|
|
|
344
353
|
// package.json
|
|
345
|
-
var version = "0.4.
|
|
354
|
+
var version = "0.4.41";
|
|
346
355
|
|
|
347
356
|
// src/utils/fetch.ts
|
|
348
357
|
var buildVersion = "0.9.9";
|
|
@@ -480,7 +489,7 @@ var SettlementEventType = /* @__PURE__ */ ((SettlementEventType2) => {
|
|
|
480
489
|
return SettlementEventType2;
|
|
481
490
|
})(SettlementEventType || {});
|
|
482
491
|
var RestArkProvider = class {
|
|
483
|
-
constructor(serverUrl =
|
|
492
|
+
constructor(serverUrl = chunkHXDZ2QTW_cjs.DEFAULT_ARKADE_SERVER_URL) {
|
|
484
493
|
this.serverUrl = serverUrl;
|
|
485
494
|
}
|
|
486
495
|
/**
|
|
@@ -2287,7 +2296,7 @@ var ChainTxType = /* @__PURE__ */ ((ChainTxType2) => {
|
|
|
2287
2296
|
return ChainTxType2;
|
|
2288
2297
|
})(ChainTxType || {});
|
|
2289
2298
|
var RestIndexerProvider = class {
|
|
2290
|
-
constructor(serverUrl =
|
|
2299
|
+
constructor(serverUrl = chunkHXDZ2QTW_cjs.DEFAULT_ARKADE_SERVER_URL) {
|
|
2291
2300
|
this.serverUrl = serverUrl;
|
|
2292
2301
|
}
|
|
2293
2302
|
async getVtxoTree(batchOutpoint, opts) {
|
|
@@ -2800,5 +2809,5 @@ exports.isFetchTimeoutError = isFetchTimeoutError;
|
|
|
2800
2809
|
exports.maybeArkError = maybeArkError;
|
|
2801
2810
|
exports.sdkVersion = sdkVersion;
|
|
2802
2811
|
exports.setArkPsbtField = setArkPsbtField;
|
|
2803
|
-
//# sourceMappingURL=chunk-
|
|
2804
|
-
//# sourceMappingURL=chunk-
|
|
2812
|
+
//# sourceMappingURL=chunk-ALISWEQ5.cjs.map
|
|
2813
|
+
//# sourceMappingURL=chunk-ALISWEQ5.cjs.map
|