@arkade-os/sdk 0.3.0-alpha.0 → 0.3.0-alpha.1
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/cjs/arknote/index.js +4 -4
- package/dist/cjs/bip322/index.js +9 -7
- package/dist/cjs/forfeit.js +2 -2
- package/dist/cjs/identity/singleKey.js +7 -7
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/musig2/keys.js +1 -1
- package/dist/cjs/musig2/nonces.js +1 -1
- package/dist/cjs/musig2/sign.js +1 -1
- package/dist/cjs/networks.js +6 -6
- package/dist/cjs/script/address.js +3 -3
- package/dist/cjs/script/base.js +7 -7
- package/dist/cjs/script/tapscript.js +21 -21
- package/dist/cjs/script/vhtlc.js +2 -2
- package/dist/cjs/tree/signingSession.js +8 -7
- package/dist/cjs/tree/txTree.js +6 -6
- package/dist/cjs/tree/validation.js +5 -5
- package/dist/cjs/utils/arkTransaction.js +5 -5
- package/dist/cjs/utils/unknownFields.js +5 -5
- package/dist/cjs/wallet/onchain.js +5 -5
- package/dist/cjs/wallet/unroll.js +6 -6
- package/dist/cjs/wallet/wallet.js +16 -16
- package/dist/esm/arknote/index.js +2 -2
- package/dist/esm/bip322/index.js +3 -1
- package/dist/esm/forfeit.js +1 -1
- package/dist/esm/identity/singleKey.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/musig2/keys.js +1 -1
- package/dist/esm/musig2/nonces.js +1 -1
- package/dist/esm/musig2/sign.js +1 -1
- package/dist/esm/networks.js +1 -1
- package/dist/esm/script/address.js +1 -1
- package/dist/esm/script/base.js +3 -3
- package/dist/esm/script/tapscript.js +2 -2
- package/dist/esm/script/vhtlc.js +1 -1
- package/dist/esm/tree/signingSession.js +3 -2
- package/dist/esm/tree/txTree.js +2 -2
- package/dist/esm/tree/validation.js +2 -2
- package/dist/esm/utils/arkTransaction.js +2 -2
- package/dist/esm/utils/unknownFields.js +1 -1
- package/dist/esm/wallet/onchain.js +2 -2
- package/dist/esm/wallet/unroll.js +2 -2
- package/dist/esm/wallet/wallet.js +4 -4
- package/dist/types/arknote/index.d.ts +1 -1
- package/dist/types/bip322/index.d.ts +2 -2
- package/dist/types/forfeit.d.ts +1 -1
- package/dist/types/identity/index.d.ts +1 -1
- package/dist/types/identity/singleKey.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/script/address.d.ts +1 -1
- package/dist/types/script/base.d.ts +1 -1
- package/dist/types/script/default.d.ts +1 -1
- package/dist/types/script/tapscript.d.ts +1 -1
- package/dist/types/script/vhtlc.d.ts +1 -1
- package/dist/types/tree/txTree.d.ts +1 -1
- package/dist/types/tree/validation.d.ts +1 -1
- package/dist/types/utils/anchor.d.ts +1 -1
- package/dist/types/utils/arkTransaction.d.ts +3 -3
- package/dist/types/utils/unknownFields.d.ts +1 -1
- package/dist/types/wallet/index.d.ts +1 -1
- package/dist/types/wallet/onchain.d.ts +2 -2
- package/dist/types/wallet/unroll.d.ts +1 -1
- package/dist/types/wallet/wallet.d.ts +1 -1
- package/package.json +2 -2
|
@@ -37,7 +37,7 @@ exports.VtxoTreeExpiry = exports.CosignerPublicKey = exports.ConditionWitness =
|
|
|
37
37
|
exports.setArkPsbtField = setArkPsbtField;
|
|
38
38
|
exports.getArkPsbtFields = getArkPsbtFields;
|
|
39
39
|
const bip68 = __importStar(require("bip68"));
|
|
40
|
-
const
|
|
40
|
+
const script_js_1 = require("@scure/btc-signer/script.js");
|
|
41
41
|
const base_1 = require("@scure/base");
|
|
42
42
|
/**
|
|
43
43
|
* ArkPsbtFieldKey is the key values for ark psbt fields.
|
|
@@ -126,12 +126,12 @@ exports.ConditionWitness = {
|
|
|
126
126
|
type: exports.ArkPsbtFieldKeyType,
|
|
127
127
|
key: encodedPsbtFieldKey[ArkPsbtFieldKey.ConditionWitness],
|
|
128
128
|
},
|
|
129
|
-
|
|
129
|
+
script_js_1.RawWitness.encode(value),
|
|
130
130
|
],
|
|
131
131
|
decode: (value) => nullIfCatch(() => {
|
|
132
132
|
if (!checkKeyIncludes(value[0], ArkPsbtFieldKey.ConditionWitness))
|
|
133
133
|
return null;
|
|
134
|
-
return
|
|
134
|
+
return script_js_1.RawWitness.decode(value[1]);
|
|
135
135
|
}),
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
@@ -176,12 +176,12 @@ exports.VtxoTreeExpiry = {
|
|
|
176
176
|
type: exports.ArkPsbtFieldKeyType,
|
|
177
177
|
key: encodedPsbtFieldKey[ArkPsbtFieldKey.VtxoTreeExpiry],
|
|
178
178
|
},
|
|
179
|
-
(0,
|
|
179
|
+
(0, script_js_1.ScriptNum)(6, true).encode(value.value === 0n ? 0n : value.value),
|
|
180
180
|
],
|
|
181
181
|
decode: (unknown) => nullIfCatch(() => {
|
|
182
182
|
if (!checkKeyIncludes(unknown[0], ArkPsbtFieldKey.VtxoTreeExpiry))
|
|
183
183
|
return null;
|
|
184
|
-
const v = (0,
|
|
184
|
+
const v = (0, script_js_1.ScriptNum)(6, true).decode(unknown[1]);
|
|
185
185
|
if (!v)
|
|
186
186
|
return null;
|
|
187
187
|
const { blocks, seconds } = bip68.decode(Number(v));
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OnchainWallet = void 0;
|
|
4
4
|
exports.selectCoins = selectCoins;
|
|
5
|
-
const
|
|
5
|
+
const payment_js_1 = require("@scure/btc-signer/payment.js");
|
|
6
6
|
const networks_1 = require("../networks");
|
|
7
7
|
const onchain_1 = require("../providers/onchain");
|
|
8
|
-
const
|
|
8
|
+
const transaction_js_1 = require("@scure/btc-signer/transaction.js");
|
|
9
9
|
const anchor_1 = require("../utils/anchor");
|
|
10
10
|
const txSizeEstimator_1 = require("../utils/txSizeEstimator");
|
|
11
11
|
/**
|
|
@@ -39,7 +39,7 @@ class OnchainWallet {
|
|
|
39
39
|
}
|
|
40
40
|
const network = (0, networks_1.getNetwork)(networkName);
|
|
41
41
|
const onchainProvider = provider || new onchain_1.EsploraProvider(onchain_1.ESPLORA_URL[networkName]);
|
|
42
|
-
const onchainP2TR = (0,
|
|
42
|
+
const onchainP2TR = (0, payment_js_1.p2tr)(pubkey, undefined, network);
|
|
43
43
|
return new OnchainWallet(identity, network, onchainP2TR, onchainProvider);
|
|
44
44
|
}
|
|
45
45
|
get address() {
|
|
@@ -80,7 +80,7 @@ class OnchainWallet {
|
|
|
80
80
|
// Select coins
|
|
81
81
|
const selected = selectCoins(coins, totalNeeded);
|
|
82
82
|
// Create transaction
|
|
83
|
-
let tx = new
|
|
83
|
+
let tx = new transaction_js_1.Transaction();
|
|
84
84
|
// Add inputs
|
|
85
85
|
for (const input of selected.inputs) {
|
|
86
86
|
tx.addInput({
|
|
@@ -108,7 +108,7 @@ class OnchainWallet {
|
|
|
108
108
|
}
|
|
109
109
|
async bumpP2A(parent) {
|
|
110
110
|
const parentVsize = parent.vsize;
|
|
111
|
-
let child = new
|
|
111
|
+
let child = new transaction_js_1.Transaction({
|
|
112
112
|
allowUnknownInputs: true,
|
|
113
113
|
allowLegacyWitnessUtxo: true,
|
|
114
114
|
version: 3,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Unroll = void 0;
|
|
4
|
-
const
|
|
4
|
+
const transaction_js_1 = require("@scure/btc-signer/transaction.js");
|
|
5
5
|
const indexer_1 = require("../providers/indexer");
|
|
6
6
|
const base_1 = require("@scure/base");
|
|
7
7
|
const base_2 = require("../script/base");
|
|
8
|
-
const
|
|
8
|
+
const psbt_js_1 = require("@scure/btc-signer/psbt.js");
|
|
9
9
|
const txSizeEstimator_1 = require("../utils/txSizeEstimator");
|
|
10
10
|
const wallet_1 = require("./wallet");
|
|
11
11
|
var Unroll;
|
|
@@ -106,7 +106,7 @@ var Unroll;
|
|
|
106
106
|
if (virtualTxs.txs.length === 0) {
|
|
107
107
|
throw new Error(`Tx ${nextTxToBroadcast.txid} not found`);
|
|
108
108
|
}
|
|
109
|
-
const tx =
|
|
109
|
+
const tx = transaction_js_1.Transaction.fromPSBT(base_1.base64.decode(virtualTxs.txs[0]), {
|
|
110
110
|
allowUnknownInputs: true,
|
|
111
111
|
});
|
|
112
112
|
// finalize the tree transaction
|
|
@@ -197,11 +197,11 @@ var Unroll;
|
|
|
197
197
|
amount: BigInt(vtxo.value),
|
|
198
198
|
script: base_2.VtxoScript.decode(vtxo.tapTree).pkScript,
|
|
199
199
|
},
|
|
200
|
-
sighashType:
|
|
200
|
+
sighashType: transaction_js_1.SigHash.DEFAULT,
|
|
201
201
|
});
|
|
202
|
-
txWeightEstimator.addTapscriptInput(64, spendingLeaf[1].length,
|
|
202
|
+
txWeightEstimator.addTapscriptInput(64, spendingLeaf[1].length, psbt_js_1.TaprootControlBlock.encode(spendingLeaf[0]).length);
|
|
203
203
|
}
|
|
204
|
-
const tx = new
|
|
204
|
+
const tx = new transaction_js_1.Transaction({ allowUnknownInputs: true, version: 2 });
|
|
205
205
|
for (const input of inputs) {
|
|
206
206
|
tx.addInput(input);
|
|
207
207
|
}
|
|
@@ -37,9 +37,9 @@ exports.Wallet = void 0;
|
|
|
37
37
|
exports.waitForIncomingFunds = waitForIncomingFunds;
|
|
38
38
|
const base_1 = require("@scure/base");
|
|
39
39
|
const bip68 = __importStar(require("bip68"));
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
40
|
+
const payment_js_1 = require("@scure/btc-signer/payment.js");
|
|
41
|
+
const transaction_js_1 = require("@scure/btc-signer/transaction.js");
|
|
42
|
+
const psbt_js_1 = require("@scure/btc-signer/psbt.js");
|
|
43
43
|
const transactionHistory_1 = require("../utils/transactionHistory");
|
|
44
44
|
const address_1 = require("../script/address");
|
|
45
45
|
const default_1 = require("../script/default");
|
|
@@ -49,7 +49,7 @@ const ark_1 = require("../providers/ark");
|
|
|
49
49
|
const forfeit_1 = require("../forfeit");
|
|
50
50
|
const validation_1 = require("../tree/validation");
|
|
51
51
|
const _1 = require(".");
|
|
52
|
-
const
|
|
52
|
+
const utils_js_1 = require("@scure/btc-signer/utils.js");
|
|
53
53
|
const base_2 = require("../script/base");
|
|
54
54
|
const tapscript_1 = require("../script/tapscript");
|
|
55
55
|
const arkTransaction_1 = require("../utils/arkTransaction");
|
|
@@ -141,8 +141,8 @@ class Wallet {
|
|
|
141
141
|
});
|
|
142
142
|
// parse the server forfeit address
|
|
143
143
|
// server is expecting funds to be sent to this address
|
|
144
|
-
const forfeitAddress = (0,
|
|
145
|
-
const forfeitOutputScript =
|
|
144
|
+
const forfeitAddress = (0, payment_js_1.Address)(network).decode(info.forfeitAddress);
|
|
145
|
+
const forfeitOutputScript = payment_js_1.OutScript.encode(forfeitAddress);
|
|
146
146
|
// Set up storage and repositories
|
|
147
147
|
const storage = config.storage || new inMemory_1.InMemoryStorageAdapter();
|
|
148
148
|
const walletRepository = new walletRepository_1.WalletRepositoryImpl(storage);
|
|
@@ -402,7 +402,7 @@ class Wallet {
|
|
|
402
402
|
// TODO persist final virtual tx and checkpoints to repository
|
|
403
403
|
// sign the checkpoints
|
|
404
404
|
const finalCheckpoints = await Promise.all(signedCheckpointTxs.map(async (c) => {
|
|
405
|
-
const tx =
|
|
405
|
+
const tx = transaction_js_1.Transaction.fromPSBT(base_1.base64.decode(c));
|
|
406
406
|
const signedCheckpoint = await this.identity.sign(tx);
|
|
407
407
|
return base_1.base64.encode(signedCheckpoint.toPSBT());
|
|
408
408
|
}));
|
|
@@ -458,8 +458,8 @@ class Wallet {
|
|
|
458
458
|
}
|
|
459
459
|
catch {
|
|
460
460
|
// onchain
|
|
461
|
-
const addr = (0,
|
|
462
|
-
script =
|
|
461
|
+
const addr = (0, payment_js_1.Address)(this.network).decode(output.address);
|
|
462
|
+
script = payment_js_1.OutScript.encode(addr);
|
|
463
463
|
onchainOutputIndexes.push(index);
|
|
464
464
|
}
|
|
465
465
|
outputs.push({
|
|
@@ -697,7 +697,7 @@ class Wallet {
|
|
|
697
697
|
}
|
|
698
698
|
async handleBatchStartedEvent(event, intentId, serverPubKey, forfeitOutputScript) {
|
|
699
699
|
const utf8IntentId = new TextEncoder().encode(intentId);
|
|
700
|
-
const intentIdHash = (0,
|
|
700
|
+
const intentIdHash = (0, utils_js_1.sha256)(utf8IntentId);
|
|
701
701
|
const intentIdHashStr = base_1.hex.encode(new Uint8Array(intentIdHash));
|
|
702
702
|
let skip = true;
|
|
703
703
|
// check if our intent ID hash matches any in the event
|
|
@@ -720,7 +720,7 @@ class Wallet {
|
|
|
720
720
|
},
|
|
721
721
|
pubkeys: [serverPubKey],
|
|
722
722
|
}).script;
|
|
723
|
-
const sweepTapTreeRoot = (0,
|
|
723
|
+
const sweepTapTreeRoot = (0, payment_js_1.tapLeafHash)(sweepTapscript);
|
|
724
724
|
return {
|
|
725
725
|
roundId: event.id,
|
|
726
726
|
sweepTapTreeRoot,
|
|
@@ -731,7 +731,7 @@ class Wallet {
|
|
|
731
731
|
// validates the vtxo tree, creates a signing session and generates the musig2 nonces
|
|
732
732
|
async handleSettlementSigningEvent(event, sweepTapTreeRoot, session, vtxoGraph) {
|
|
733
733
|
// validate the unsigned vtxo tree
|
|
734
|
-
const commitmentTx =
|
|
734
|
+
const commitmentTx = transaction_js_1.Transaction.fromPSBT(base_1.base64.decode(event.unsignedCommitmentTx));
|
|
735
735
|
(0, validation_1.validateVtxoTxGraph)(vtxoGraph, commitmentTx, sweepTapTreeRoot);
|
|
736
736
|
// TODO check if our registered outputs are in the vtxo tree
|
|
737
737
|
const sharedOutput = commitmentTx.getOutput(0);
|
|
@@ -750,7 +750,7 @@ class Wallet {
|
|
|
750
750
|
// the signed forfeits transactions to submit
|
|
751
751
|
const signedForfeits = [];
|
|
752
752
|
const vtxos = await this.getVirtualCoins();
|
|
753
|
-
let settlementPsbt =
|
|
753
|
+
let settlementPsbt = transaction_js_1.Transaction.fromPSBT(base_1.base64.decode(event.commitmentTx));
|
|
754
754
|
let hasBoardingUtxos = false;
|
|
755
755
|
let connectorIndex = 0;
|
|
756
756
|
const connectorsLeaves = connectorsGraph?.leaves() || [];
|
|
@@ -792,7 +792,7 @@ class Wallet {
|
|
|
792
792
|
throw new Error("not enough connectors received");
|
|
793
793
|
}
|
|
794
794
|
const connectorLeaf = connectorsLeaves[connectorIndex];
|
|
795
|
-
const connectorTxId = base_1.hex.encode((0,
|
|
795
|
+
const connectorTxId = base_1.hex.encode((0, utils_js_1.sha256x2)(connectorLeaf.toBytes(true)).reverse());
|
|
796
796
|
const connectorOutput = connectorLeaf.getOutput(0);
|
|
797
797
|
if (!connectorOutput) {
|
|
798
798
|
throw new Error("connector output not found");
|
|
@@ -811,7 +811,7 @@ class Wallet {
|
|
|
811
811
|
amount: BigInt(vtxo.value),
|
|
812
812
|
script: base_2.VtxoScript.decode(input.tapTree).pkScript,
|
|
813
813
|
},
|
|
814
|
-
sighashType:
|
|
814
|
+
sighashType: transaction_js_1.SigHash.DEFAULT,
|
|
815
815
|
tapLeafScript: [input.forfeitTapLeafScript],
|
|
816
816
|
},
|
|
817
817
|
{
|
|
@@ -917,7 +917,7 @@ function finalizeWithExtraWitnesses(inputExtraWitnesses) {
|
|
|
917
917
|
tx.updateInput(i, {
|
|
918
918
|
finalScriptWitness: [
|
|
919
919
|
script,
|
|
920
|
-
|
|
920
|
+
psbt_js_1.TaprootControlBlock.encode(cb),
|
|
921
921
|
],
|
|
922
922
|
});
|
|
923
923
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { base58, hex } from "@scure/base";
|
|
2
2
|
import { VtxoScript } from '../script/base.js';
|
|
3
|
-
import { sha256 } from "@scure/btc-signer/utils";
|
|
4
|
-
import { Script } from "@scure/btc-signer";
|
|
3
|
+
import { sha256 } from "@scure/btc-signer/utils.js";
|
|
4
|
+
import { Script } from "@scure/btc-signer/script.js";
|
|
5
5
|
/**
|
|
6
6
|
* ArkNotes are special virtual coins in the Ark protocol that can be created
|
|
7
7
|
* and spent without requiring any transactions. The server mints them, and they
|
package/dist/esm/bip322/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { OP
|
|
1
|
+
import { OP } from "@scure/btc-signer/script.js";
|
|
2
|
+
import { Transaction, SigHash } from "@scure/btc-signer/transaction.js";
|
|
3
|
+
import { Script } from "@scure/btc-signer/script.js";
|
|
2
4
|
import { ErrMissingData, ErrMissingInputs, ErrMissingWitnessUtxo, } from './errors.js';
|
|
3
5
|
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
4
6
|
import { base64 } from "@scure/base";
|
package/dist/esm/forfeit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { pubSchnorr, randomPrivateKeyBytes, sha256, } from "@scure/btc-signer/utils";
|
|
1
|
+
import { pubSchnorr, randomPrivateKeyBytes, sha256, } from "@scure/btc-signer/utils.js";
|
|
2
2
|
import { hex } from "@scure/base";
|
|
3
|
-
import { SigHash } from "@scure/btc-signer";
|
|
3
|
+
import { SigHash } from "@scure/btc-signer/transaction.js";
|
|
4
4
|
import { TreeSignerSession } from '../tree/signingSession.js';
|
|
5
5
|
import { schnorr } from "@noble/secp256k1";
|
|
6
6
|
const ZERO_32 = new Uint8Array(32).fill(0);
|
package/dist/esm/index.js
CHANGED
package/dist/esm/musig2/keys.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as musig from "@scure/btc-signer/musig2";
|
|
1
|
+
import * as musig from "@scure/btc-signer/musig2.js";
|
|
2
2
|
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
3
3
|
// Aggregates multiple public keys according to the MuSig2 algorithm
|
|
4
4
|
export function aggregateKeys(publicKeys, sort, options = {}) {
|
package/dist/esm/musig2/sign.js
CHANGED
package/dist/esm/networks.js
CHANGED
package/dist/esm/script/base.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Address, p2tr, TAP_LEAF_VERSION, taprootListToTree, } from "@scure/btc-signer/payment";
|
|
2
|
-
import { TAPROOT_UNSPENDABLE_KEY, } from "@scure/btc-signer/utils";
|
|
1
|
+
import { Address, p2tr, TAP_LEAF_VERSION, taprootListToTree, } from "@scure/btc-signer/payment.js";
|
|
2
|
+
import { TAPROOT_UNSPENDABLE_KEY, } from "@scure/btc-signer/utils.js";
|
|
3
3
|
import { ArkAddress } from './address.js';
|
|
4
|
-
import { Script } from "@scure/btc-signer";
|
|
4
|
+
import { Script } from "@scure/btc-signer/script.js";
|
|
5
5
|
import { hex } from "@scure/base";
|
|
6
6
|
import { ConditionCSVMultisigTapscript, CSVMultisigTapscript, } from './tapscript.js';
|
|
7
7
|
export function scriptFromTapLeafScript(leaf) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as bip68 from "bip68";
|
|
2
|
-
import { Script, ScriptNum } from "@scure/btc-signer/script";
|
|
3
|
-
import { p2tr_ms } from "@scure/btc-signer/payment";
|
|
2
|
+
import { Script, ScriptNum } from "@scure/btc-signer/script.js";
|
|
3
|
+
import { p2tr_ms } from "@scure/btc-signer/payment.js";
|
|
4
4
|
import { hex } from "@scure/base";
|
|
5
5
|
const MinimalScriptNum = ScriptNum(undefined, true);
|
|
6
6
|
export var TapscriptType;
|
package/dist/esm/script/vhtlc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Script } from "@scure/btc-signer";
|
|
1
|
+
import { Script } from "@scure/btc-signer/script.js";
|
|
2
2
|
import { CLTVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, CSVMultisigTapscript, MultisigTapscript, } from './tapscript.js';
|
|
3
3
|
import { hex } from "@scure/base";
|
|
4
4
|
import { VtxoScript } from './base.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as musig2 from '../musig2/index.js';
|
|
2
|
-
import { Script
|
|
2
|
+
import { Script } from "@scure/btc-signer/script.js";
|
|
3
|
+
import { SigHash } from "@scure/btc-signer/transaction.js";
|
|
3
4
|
import { hex } from "@scure/base";
|
|
4
5
|
import { schnorr, secp256k1 } from "@noble/curves/secp256k1.js";
|
|
5
|
-
import { randomPrivateKeyBytes, sha256x2 } from "@scure/btc-signer/utils";
|
|
6
|
+
import { randomPrivateKeyBytes, sha256x2 } from "@scure/btc-signer/utils.js";
|
|
6
7
|
import { CosignerPublicKey, getArkPsbtFields } from '../utils/unknownFields.js';
|
|
7
8
|
export const ErrMissingVtxoGraph = new Error("missing vtxo graph");
|
|
8
9
|
export const ErrMissingAggregateKey = new Error("missing aggregate key");
|
package/dist/esm/tree/txTree.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { base64 } from "@scure/base";
|
|
3
3
|
import { hex } from "@scure/base";
|
|
4
|
-
import { sha256x2 } from "@scure/btc-signer/utils";
|
|
4
|
+
import { sha256x2 } from "@scure/btc-signer/utils.js";
|
|
5
5
|
/**
|
|
6
6
|
* TxTree is a graph of bitcoin transactions.
|
|
7
7
|
* It is used to represent batch tree created during settlement session
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hex } from "@scure/base";
|
|
2
|
-
import { Transaction } from "@scure/btc-signer";
|
|
2
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
3
3
|
import { base64 } from "@scure/base";
|
|
4
|
-
import { sha256x2 } from "@scure/btc-signer/utils";
|
|
4
|
+
import { sha256x2 } from "@scure/btc-signer/utils.js";
|
|
5
5
|
import { aggregateKeys } from '../musig2/index.js';
|
|
6
6
|
import { CosignerPublicKey, getArkPsbtFields } from '../utils/unknownFields.js';
|
|
7
7
|
export const ErrInvalidSettlementTx = (tx) => new Error(`invalid settlement transaction: ${tx}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DEFAULT_SEQUENCE, Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { DEFAULT_SEQUENCE, Transaction, } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { CLTVMultisigTapscript, decodeTapscript } from '../script/tapscript.js';
|
|
3
3
|
import { scriptFromTapLeafScript, VtxoScript, } from '../script/base.js';
|
|
4
4
|
import { P2A } from './anchor.js';
|
|
5
5
|
import { hex } from "@scure/base";
|
|
6
|
-
import { sha256x2 } from "@scure/btc-signer/utils";
|
|
6
|
+
import { sha256x2 } from "@scure/btc-signer/utils.js";
|
|
7
7
|
import { setArkPsbtField, VtxoTaprootTree } from './unknownFields.js';
|
|
8
8
|
/**
|
|
9
9
|
* Builds an offchain transaction with checkpoint transactions.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p2tr } from "@scure/btc-signer/payment";
|
|
1
|
+
import { p2tr } from "@scure/btc-signer/payment.js";
|
|
2
2
|
import { getNetwork } from '../networks.js';
|
|
3
3
|
import { ESPLORA_URL, EsploraProvider, } from '../providers/onchain.js';
|
|
4
|
-
import { Transaction } from "@scure/btc-signer";
|
|
4
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
5
5
|
import { findP2AOutput, P2A } from '../utils/anchor.js';
|
|
6
6
|
import { TxWeightEstimator } from '../utils/txSizeEstimator.js';
|
|
7
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SigHash, Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { SigHash, Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { ChainTxType } from '../providers/indexer.js';
|
|
3
3
|
import { base64, hex } from "@scure/base";
|
|
4
4
|
import { VtxoScript } from '../script/base.js';
|
|
5
|
-
import { TaprootControlBlock, } from "@scure/btc-signer/psbt";
|
|
5
|
+
import { TaprootControlBlock, } from "@scure/btc-signer/psbt.js";
|
|
6
6
|
import { TxWeightEstimator } from '../utils/txSizeEstimator.js';
|
|
7
7
|
import { Wallet } from './wallet.js';
|
|
8
8
|
export var Unroll;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { base64, hex } from "@scure/base";
|
|
2
2
|
import * as bip68 from "bip68";
|
|
3
|
-
import { Address, OutScript, tapLeafHash } from "@scure/btc-signer/payment";
|
|
4
|
-
import { SigHash, Transaction } from "@scure/btc-signer";
|
|
5
|
-
import { TaprootControlBlock, } from "@scure/btc-signer/psbt";
|
|
3
|
+
import { Address, OutScript, tapLeafHash } from "@scure/btc-signer/payment.js";
|
|
4
|
+
import { SigHash, Transaction } from "@scure/btc-signer/transaction.js";
|
|
5
|
+
import { TaprootControlBlock, } from "@scure/btc-signer/psbt.js";
|
|
6
6
|
import { vtxosToTxs } from '../utils/transactionHistory.js';
|
|
7
7
|
import { ArkAddress } from '../script/address.js';
|
|
8
8
|
import { DefaultVtxo } from '../script/default.js';
|
|
@@ -12,7 +12,7 @@ import { SettlementEventType, RestArkProvider, } from '../providers/ark.js';
|
|
|
12
12
|
import { buildForfeitTx } from '../forfeit.js';
|
|
13
13
|
import { validateConnectorsTxGraph, validateVtxoTxGraph, } from '../tree/validation.js';
|
|
14
14
|
import { isRecoverable, isSpendable, isSubdust, TxType, } from './index.js';
|
|
15
|
-
import { sha256, sha256x2 } from "@scure/btc-signer/utils";
|
|
15
|
+
import { sha256, sha256x2 } from "@scure/btc-signer/utils.js";
|
|
16
16
|
import { VtxoScript } from '../script/base.js';
|
|
17
17
|
import { CSVMultisigTapscript } from '../script/tapscript.js';
|
|
18
18
|
import { buildOffchainTx } from '../utils/arkTransaction.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TapLeafScript, VtxoScript } from "../script/base";
|
|
2
|
-
import { Bytes } from "@scure/btc-signer/utils";
|
|
2
|
+
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
3
3
|
import { ExtendedCoin, Status } from "../wallet";
|
|
4
4
|
/**
|
|
5
5
|
* ArkNotes are special virtual coins in the Ark protocol that can be created
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
2
|
-
import { TransactionInput, TransactionOutput } from "@scure/btc-signer/psbt";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
|
+
import { TransactionInput, TransactionOutput } from "@scure/btc-signer/psbt.js";
|
|
3
3
|
/**
|
|
4
4
|
* BIP-322 signature implementation for Bitcoin message signing.
|
|
5
5
|
*
|
package/dist/types/forfeit.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { TransactionInputUpdate } from "@scure/btc-signer/psbt";
|
|
3
3
|
export declare function buildForfeitTx(inputs: TransactionInputUpdate[], forfeitPkScript: Uint8Array, txLocktime?: number): Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { SignerSession } from "../tree/signingSession";
|
|
3
3
|
export interface Identity {
|
|
4
4
|
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BTC_NETWORK, Bytes } from "@scure/btc-signer/utils";
|
|
1
|
+
import { BTC_NETWORK, Bytes } from "@scure/btc-signer/utils.js";
|
|
2
2
|
import { ArkAddress } from "./address";
|
|
3
3
|
import { ConditionCSVMultisigTapscript, CSVMultisigTapscript } from "./tapscript";
|
|
4
4
|
export type TapLeafScript = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { TxTree } from "./txTree";
|
|
3
3
|
export declare const ErrInvalidSettlementTx: (tx: string) => Error;
|
|
4
4
|
export declare const ErrInvalidSettlementTxOutputs: Error;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { TransactionInputUpdate } from "@scure/btc-signer/psbt";
|
|
3
3
|
export declare const ANCHOR_VALUE = 0n;
|
|
4
4
|
export declare const ANCHOR_PKSCRIPT: Uint8Array<ArrayBuffer>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { VirtualCoin } from "../wallet";
|
|
3
3
|
import { EncodedVtxoScript, TapLeafScript } from "../script/base";
|
|
4
4
|
import { CSVMultisigTapscript } from "../script/tapscript";
|
|
5
|
-
import { TransactionOutput } from "@scure/btc-signer/psbt";
|
|
6
|
-
import { Bytes } from "@scure/btc-signer/utils";
|
|
5
|
+
import { TransactionOutput } from "@scure/btc-signer/psbt.js";
|
|
6
|
+
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
7
7
|
export type ArkTxInput = {
|
|
8
8
|
tapLeafScript: TapLeafScript;
|
|
9
9
|
checkpointTapLeafScript?: Bytes;
|
|
@@ -2,7 +2,7 @@ import { Output, SettlementEvent } from "../providers/ark";
|
|
|
2
2
|
import { Identity } from "../identity";
|
|
3
3
|
import { RelativeTimelock } from "../script/tapscript";
|
|
4
4
|
import { EncodedVtxoScript, TapLeafScript } from "../script/base";
|
|
5
|
-
import { Bytes } from "@scure/btc-signer/utils";
|
|
5
|
+
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
6
6
|
import { StorageAdapter } from "../storage";
|
|
7
7
|
/**
|
|
8
8
|
* Configuration options for wallet initialization.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P2TR } from "@scure/btc-signer/payment";
|
|
1
|
+
import { P2TR } from "@scure/btc-signer/payment.js";
|
|
2
2
|
import { Coin, SendBitcoinParams } from ".";
|
|
3
3
|
import { Identity } from "../identity";
|
|
4
4
|
import { Network, NetworkName } from "../networks";
|
|
5
5
|
import { OnchainProvider } from "../providers/onchain";
|
|
6
|
-
import { Transaction } from "@scure/btc-signer";
|
|
6
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
7
7
|
import { AnchorBumper } from "../utils/anchor";
|
|
8
8
|
/**
|
|
9
9
|
* Onchain Bitcoin wallet implementation for traditional Bitcoin transactions.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
1
|
+
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
2
|
import { ChainTx, IndexerProvider } from "../providers/indexer";
|
|
3
3
|
import { AnchorBumper } from "../utils/anchor";
|
|
4
4
|
import { OnchainProvider } from "../providers/onchain";
|
|
@@ -5,7 +5,7 @@ import { OnchainProvider } from "../providers/onchain";
|
|
|
5
5
|
import { SettlementEvent, ArkProvider } from "../providers/ark";
|
|
6
6
|
import { Identity } from "../identity";
|
|
7
7
|
import { ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IWallet, SendBitcoinParams, SettleParams, VirtualCoin, WalletBalance, WalletConfig } from ".";
|
|
8
|
-
import { Bytes } from "@scure/btc-signer/utils";
|
|
8
|
+
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
9
9
|
import { CSVMultisigTapscript } from "../script/tapscript";
|
|
10
10
|
import { IndexerProvider } from "../providers/indexer";
|
|
11
11
|
import { WalletRepository } from "../repositories/walletRepository";
|