@arkade-os/sdk 0.1.4 → 0.2.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/README.md +157 -174
- package/dist/cjs/arknote/index.js +61 -58
- package/dist/cjs/bip322/errors.js +13 -0
- package/dist/cjs/bip322/index.js +178 -0
- package/dist/cjs/forfeit.js +14 -25
- package/dist/cjs/identity/singleKey.js +68 -0
- package/dist/cjs/index.js +43 -17
- package/dist/cjs/providers/ark.js +261 -321
- package/dist/cjs/providers/indexer.js +525 -0
- package/dist/cjs/providers/onchain.js +193 -15
- package/dist/cjs/script/address.js +48 -17
- package/dist/cjs/script/base.js +120 -3
- package/dist/cjs/script/default.js +18 -4
- package/dist/cjs/script/tapscript.js +61 -20
- package/dist/cjs/script/vhtlc.js +85 -7
- package/dist/cjs/tree/signingSession.js +63 -106
- package/dist/cjs/tree/txTree.js +193 -0
- package/dist/cjs/tree/validation.js +79 -155
- package/dist/cjs/utils/anchor.js +35 -0
- package/dist/cjs/utils/arkTransaction.js +108 -0
- package/dist/cjs/utils/transactionHistory.js +84 -72
- package/dist/cjs/utils/txSizeEstimator.js +12 -0
- package/dist/cjs/utils/unknownFields.js +211 -0
- package/dist/cjs/wallet/index.js +12 -0
- package/dist/cjs/wallet/onchain.js +201 -0
- package/dist/cjs/wallet/ramps.js +95 -0
- package/dist/cjs/wallet/serviceWorker/db/vtxo/idb.js +32 -0
- package/dist/cjs/wallet/serviceWorker/request.js +15 -12
- package/dist/cjs/wallet/serviceWorker/response.js +22 -27
- package/dist/cjs/wallet/serviceWorker/utils.js +8 -0
- package/dist/cjs/wallet/serviceWorker/wallet.js +61 -34
- package/dist/cjs/wallet/serviceWorker/worker.js +120 -108
- package/dist/cjs/wallet/unroll.js +270 -0
- package/dist/cjs/wallet/wallet.js +701 -454
- package/dist/esm/arknote/index.js +61 -57
- package/dist/esm/bip322/errors.js +9 -0
- package/dist/esm/bip322/index.js +174 -0
- package/dist/esm/forfeit.js +15 -26
- package/dist/esm/identity/singleKey.js +64 -0
- package/dist/esm/index.js +31 -12
- package/dist/esm/providers/ark.js +259 -320
- package/dist/esm/providers/indexer.js +521 -0
- package/dist/esm/providers/onchain.js +193 -15
- package/dist/esm/script/address.js +48 -17
- package/dist/esm/script/base.js +120 -3
- package/dist/esm/script/default.js +18 -4
- package/dist/esm/script/tapscript.js +61 -20
- package/dist/esm/script/vhtlc.js +85 -7
- package/dist/esm/tree/signingSession.js +65 -108
- package/dist/esm/tree/txTree.js +189 -0
- package/dist/esm/tree/validation.js +75 -152
- package/dist/esm/utils/anchor.js +31 -0
- package/dist/esm/utils/arkTransaction.js +105 -0
- package/dist/esm/utils/transactionHistory.js +84 -72
- package/dist/esm/utils/txSizeEstimator.js +12 -0
- package/dist/esm/utils/unknownFields.js +173 -0
- package/dist/esm/wallet/index.js +9 -0
- package/dist/esm/wallet/onchain.js +196 -0
- package/dist/esm/wallet/ramps.js +91 -0
- package/dist/esm/wallet/serviceWorker/db/vtxo/idb.js +32 -0
- package/dist/esm/wallet/serviceWorker/request.js +15 -12
- package/dist/esm/wallet/serviceWorker/response.js +22 -27
- package/dist/esm/wallet/serviceWorker/utils.js +8 -0
- package/dist/esm/wallet/serviceWorker/wallet.js +62 -35
- package/dist/esm/wallet/serviceWorker/worker.js +120 -108
- package/dist/esm/wallet/unroll.js +267 -0
- package/dist/esm/wallet/wallet.js +674 -461
- package/dist/types/arknote/index.d.ts +40 -13
- package/dist/types/bip322/errors.d.ts +6 -0
- package/dist/types/bip322/index.d.ts +57 -0
- package/dist/types/forfeit.d.ts +2 -14
- package/dist/types/identity/singleKey.d.ts +27 -0
- package/dist/types/index.d.ts +24 -12
- package/dist/types/providers/ark.d.ts +114 -95
- package/dist/types/providers/indexer.d.ts +186 -0
- package/dist/types/providers/onchain.d.ts +41 -11
- package/dist/types/script/address.d.ts +26 -2
- package/dist/types/script/base.d.ts +13 -3
- package/dist/types/script/default.d.ts +22 -0
- package/dist/types/script/tapscript.d.ts +61 -5
- package/dist/types/script/vhtlc.d.ts +27 -0
- package/dist/types/tree/signingSession.d.ts +5 -5
- package/dist/types/tree/txTree.d.ts +28 -0
- package/dist/types/tree/validation.d.ts +15 -22
- package/dist/types/utils/anchor.d.ts +19 -0
- package/dist/types/utils/arkTransaction.d.ts +27 -0
- package/dist/types/utils/transactionHistory.d.ts +7 -1
- package/dist/types/utils/txSizeEstimator.d.ts +3 -0
- package/dist/types/utils/unknownFields.d.ts +83 -0
- package/dist/types/wallet/index.d.ts +51 -50
- package/dist/types/wallet/onchain.d.ts +49 -0
- package/dist/types/wallet/ramps.d.ts +32 -0
- package/dist/types/wallet/serviceWorker/db/vtxo/idb.d.ts +2 -0
- package/dist/types/wallet/serviceWorker/db/vtxo/index.d.ts +2 -0
- package/dist/types/wallet/serviceWorker/request.d.ts +14 -16
- package/dist/types/wallet/serviceWorker/response.d.ts +17 -19
- package/dist/types/wallet/serviceWorker/utils.d.ts +8 -0
- package/dist/types/wallet/serviceWorker/wallet.d.ts +36 -8
- package/dist/types/wallet/serviceWorker/worker.d.ts +7 -3
- package/dist/types/wallet/unroll.d.ts +102 -0
- package/dist/types/wallet/wallet.d.ts +71 -25
- package/package.json +37 -35
- package/dist/cjs/identity/inMemoryKey.js +0 -40
- package/dist/cjs/tree/vtxoTree.js +0 -231
- package/dist/cjs/utils/coinselect.js +0 -73
- package/dist/cjs/utils/psbt.js +0 -137
- package/dist/esm/identity/inMemoryKey.js +0 -36
- package/dist/esm/tree/vtxoTree.js +0 -191
- package/dist/esm/utils/coinselect.js +0 -69
- package/dist/esm/utils/psbt.js +0 -131
- package/dist/types/identity/inMemoryKey.d.ts +0 -12
- package/dist/types/tree/vtxoTree.d.ts +0 -33
- package/dist/types/utils/coinselect.d.ts +0 -21
- package/dist/types/utils/psbt.d.ts +0 -11
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BIP322 = void 0;
|
|
4
|
+
exports.craftToSpendTx = craftToSpendTx;
|
|
5
|
+
const btc_signer_1 = require("@scure/btc-signer");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
const secp256k1_1 = require("@noble/curves/secp256k1");
|
|
8
|
+
const base_1 = require("@scure/base");
|
|
9
|
+
/**
|
|
10
|
+
* BIP-322 signature implementation for Bitcoin message signing.
|
|
11
|
+
*
|
|
12
|
+
* BIP-322 defines a standard for signing Bitcoin messages as well as proving
|
|
13
|
+
* ownership of coins. This namespace provides utilities for creating and
|
|
14
|
+
* validating BIP-322.
|
|
15
|
+
*
|
|
16
|
+
* @see https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Create a BIP-322 proof
|
|
21
|
+
* const proof = BIP322.create(
|
|
22
|
+
* "Hello Bitcoin!",
|
|
23
|
+
* [input],
|
|
24
|
+
* [output]
|
|
25
|
+
* );
|
|
26
|
+
*
|
|
27
|
+
* // Sign the proof
|
|
28
|
+
* const signedProof = await identity.sign(proof);
|
|
29
|
+
*
|
|
30
|
+
* // Extract the signature
|
|
31
|
+
* const signature = BIP322.signature(signedProof);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
var BIP322;
|
|
35
|
+
(function (BIP322) {
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new BIP-322 "full" proof of funds unsigned transaction.
|
|
38
|
+
*
|
|
39
|
+
* This function constructs a special transaction that can be signed to prove
|
|
40
|
+
* ownership of VTXOs and UTXOs. The proof includes the message to be
|
|
41
|
+
* signed and the inputs/outputs that demonstrate ownership.
|
|
42
|
+
*
|
|
43
|
+
* @param message - The BIP-322 message to be signed
|
|
44
|
+
* @param inputs - Array of transaction inputs to prove ownership of
|
|
45
|
+
* @param outputs - Optional array of transaction outputs
|
|
46
|
+
* @returns An unsigned BIP-322 proof transaction
|
|
47
|
+
*/
|
|
48
|
+
function create(message, inputs, outputs = []) {
|
|
49
|
+
if (inputs.length == 0)
|
|
50
|
+
throw errors_1.ErrMissingInputs;
|
|
51
|
+
if (!validateInputs(inputs))
|
|
52
|
+
throw errors_1.ErrMissingData;
|
|
53
|
+
if (!validateOutputs(outputs))
|
|
54
|
+
throw errors_1.ErrMissingData;
|
|
55
|
+
// create the initial transaction to spend
|
|
56
|
+
const toSpend = craftToSpendTx(message, inputs[0].witnessUtxo.script);
|
|
57
|
+
// create the transaction to sign
|
|
58
|
+
return craftToSignTx(toSpend, inputs, outputs);
|
|
59
|
+
}
|
|
60
|
+
BIP322.create = create;
|
|
61
|
+
/**
|
|
62
|
+
* Finalizes and extracts the FullProof transaction into a BIP-322 signature.
|
|
63
|
+
*
|
|
64
|
+
* This function takes a signed proof transaction and converts it into a
|
|
65
|
+
* base64-encoded signature string. If the proof's inputs have special
|
|
66
|
+
* spending conditions, a custom finalizer can be provided.
|
|
67
|
+
*
|
|
68
|
+
* @param signedProof - The signed BIP-322 proof transaction
|
|
69
|
+
* @param finalizer - Optional custom finalizer function
|
|
70
|
+
* @returns Base64-encoded BIP-322 signature
|
|
71
|
+
*/
|
|
72
|
+
function signature(signedProof, finalizer = (tx) => tx.finalize()) {
|
|
73
|
+
finalizer(signedProof);
|
|
74
|
+
return base_1.base64.encode(signedProof.extract());
|
|
75
|
+
}
|
|
76
|
+
BIP322.signature = signature;
|
|
77
|
+
})(BIP322 || (exports.BIP322 = BIP322 = {}));
|
|
78
|
+
const OP_RETURN_EMPTY_PKSCRIPT = new Uint8Array([btc_signer_1.OP.RETURN]);
|
|
79
|
+
const ZERO_32 = new Uint8Array(32).fill(0);
|
|
80
|
+
const MAX_INDEX = 0xffffffff;
|
|
81
|
+
const TAG_BIP322 = "BIP0322-signed-message";
|
|
82
|
+
function validateInput(input) {
|
|
83
|
+
if (input.index === undefined)
|
|
84
|
+
throw errors_1.ErrMissingData;
|
|
85
|
+
if (input.txid === undefined)
|
|
86
|
+
throw errors_1.ErrMissingData;
|
|
87
|
+
if (input.witnessUtxo === undefined)
|
|
88
|
+
throw errors_1.ErrMissingWitnessUtxo;
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
function validateInputs(inputs) {
|
|
92
|
+
inputs.forEach(validateInput);
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
function validateOutput(output) {
|
|
96
|
+
if (output.amount === undefined)
|
|
97
|
+
throw errors_1.ErrMissingData;
|
|
98
|
+
if (output.script === undefined)
|
|
99
|
+
throw errors_1.ErrMissingData;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
function validateOutputs(outputs) {
|
|
103
|
+
outputs.forEach(validateOutput);
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
// craftToSpendTx creates the initial transaction that will be spent in the proof
|
|
107
|
+
function craftToSpendTx(message, pkScript) {
|
|
108
|
+
const messageHash = hashMessage(message);
|
|
109
|
+
const tx = new btc_signer_1.Transaction({
|
|
110
|
+
version: 0,
|
|
111
|
+
allowUnknownOutputs: true,
|
|
112
|
+
allowUnknown: true,
|
|
113
|
+
allowUnknownInputs: true,
|
|
114
|
+
});
|
|
115
|
+
// add input with zero hash and max index
|
|
116
|
+
tx.addInput({
|
|
117
|
+
txid: ZERO_32, // zero hash
|
|
118
|
+
index: MAX_INDEX,
|
|
119
|
+
sequence: 0,
|
|
120
|
+
});
|
|
121
|
+
// add output with zero value and provided pkScript
|
|
122
|
+
tx.addOutput({
|
|
123
|
+
amount: 0n,
|
|
124
|
+
script: pkScript,
|
|
125
|
+
});
|
|
126
|
+
tx.updateInput(0, {
|
|
127
|
+
finalScriptSig: btc_signer_1.Script.encode(["OP_0", messageHash]),
|
|
128
|
+
});
|
|
129
|
+
return tx;
|
|
130
|
+
}
|
|
131
|
+
// craftToSignTx creates the transaction that will be signed for the proof
|
|
132
|
+
function craftToSignTx(toSpend, inputs, outputs) {
|
|
133
|
+
const firstInput = inputs[0];
|
|
134
|
+
const tx = new btc_signer_1.Transaction({
|
|
135
|
+
version: 2,
|
|
136
|
+
allowUnknownOutputs: outputs.length === 0,
|
|
137
|
+
allowUnknown: true,
|
|
138
|
+
allowUnknownInputs: true,
|
|
139
|
+
lockTime: 0,
|
|
140
|
+
});
|
|
141
|
+
// add the first "toSpend" input
|
|
142
|
+
tx.addInput({
|
|
143
|
+
...firstInput,
|
|
144
|
+
txid: toSpend.id,
|
|
145
|
+
index: 0,
|
|
146
|
+
witnessUtxo: {
|
|
147
|
+
script: firstInput.witnessUtxo.script,
|
|
148
|
+
amount: 0n,
|
|
149
|
+
},
|
|
150
|
+
sighashType: btc_signer_1.SigHash.ALL,
|
|
151
|
+
});
|
|
152
|
+
// add other inputs
|
|
153
|
+
for (const input of inputs) {
|
|
154
|
+
tx.addInput({
|
|
155
|
+
...input,
|
|
156
|
+
sighashType: btc_signer_1.SigHash.ALL,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// add the special OP_RETURN output if no outputs are provided
|
|
160
|
+
if (outputs.length === 0) {
|
|
161
|
+
outputs = [
|
|
162
|
+
{
|
|
163
|
+
amount: 0n,
|
|
164
|
+
script: OP_RETURN_EMPTY_PKSCRIPT,
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
for (const output of outputs) {
|
|
169
|
+
tx.addOutput({
|
|
170
|
+
amount: output.amount,
|
|
171
|
+
script: output.script,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return tx;
|
|
175
|
+
}
|
|
176
|
+
function hashMessage(message) {
|
|
177
|
+
return secp256k1_1.schnorr.utils.taggedHash(TAG_BIP322, new TextEncoder().encode(message));
|
|
178
|
+
}
|
package/dist/cjs/forfeit.js
CHANGED
|
@@ -2,37 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildForfeitTx = buildForfeitTx;
|
|
4
4
|
const btc_signer_1 = require("@scure/btc-signer");
|
|
5
|
-
|
|
5
|
+
const anchor_1 = require("./utils/anchor");
|
|
6
|
+
function buildForfeitTx(inputs, forfeitPkScript, txLocktime) {
|
|
6
7
|
const tx = new btc_signer_1.Transaction({
|
|
7
|
-
version:
|
|
8
|
+
version: 3,
|
|
8
9
|
lockTime: txLocktime,
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
sequence: 0xffffffff,
|
|
19
|
-
});
|
|
20
|
-
// Add VTXO input
|
|
21
|
-
tx.addInput({
|
|
22
|
-
txid: vtxoInput.txid,
|
|
23
|
-
index: vtxoInput.vout,
|
|
24
|
-
witnessUtxo: {
|
|
25
|
-
script: vtxoPkScript,
|
|
26
|
-
amount: vtxoAmount,
|
|
27
|
-
},
|
|
28
|
-
sequence: txLocktime ? 0xfffffffe : 0xffffffff, // MAX_SEQUENCE - 1 if locktime is set
|
|
29
|
-
sighashType: btc_signer_1.SigHash.DEFAULT,
|
|
30
|
-
});
|
|
31
|
-
const amount = BigInt(vtxoAmount) + BigInt(connectorAmount) - BigInt(feeAmount);
|
|
11
|
+
let amount = 0n;
|
|
12
|
+
for (const input of inputs) {
|
|
13
|
+
if (!input.witnessUtxo) {
|
|
14
|
+
throw new Error("input needs witness utxo");
|
|
15
|
+
}
|
|
16
|
+
amount += input.witnessUtxo.amount;
|
|
17
|
+
tx.addInput(input);
|
|
18
|
+
}
|
|
32
19
|
// Add main output to server
|
|
33
20
|
tx.addOutput({
|
|
34
|
-
script:
|
|
21
|
+
script: forfeitPkScript,
|
|
35
22
|
amount,
|
|
36
23
|
});
|
|
24
|
+
// Add P2A output
|
|
25
|
+
tx.addOutput(anchor_1.P2A);
|
|
37
26
|
return tx;
|
|
38
27
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SingleKey = void 0;
|
|
4
|
+
const utils_1 = require("@scure/btc-signer/utils");
|
|
5
|
+
const base_1 = require("@scure/base");
|
|
6
|
+
const btc_signer_1 = require("@scure/btc-signer");
|
|
7
|
+
const signingSession_1 = require("../tree/signingSession");
|
|
8
|
+
const ZERO_32 = new Uint8Array(32).fill(0);
|
|
9
|
+
const ALL_SIGHASH = Object.values(btc_signer_1.SigHash).filter((x) => typeof x === "number");
|
|
10
|
+
/**
|
|
11
|
+
* In-memory single key implementation for Bitcoin transaction signing.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Create from hex string
|
|
16
|
+
* const key = SingleKey.fromHex('your_private_key_hex');
|
|
17
|
+
*
|
|
18
|
+
* // Create from raw bytes
|
|
19
|
+
* const key = SingleKey.fromPrivateKey(privateKeyBytes);
|
|
20
|
+
*
|
|
21
|
+
* // Sign a transaction
|
|
22
|
+
* const signedTx = await key.sign(transaction);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
class SingleKey {
|
|
26
|
+
constructor(key) {
|
|
27
|
+
this.key = key || (0, utils_1.randomPrivateKeyBytes)();
|
|
28
|
+
}
|
|
29
|
+
static fromPrivateKey(privateKey) {
|
|
30
|
+
return new SingleKey(privateKey);
|
|
31
|
+
}
|
|
32
|
+
static fromHex(privateKeyHex) {
|
|
33
|
+
return new SingleKey(base_1.hex.decode(privateKeyHex));
|
|
34
|
+
}
|
|
35
|
+
async sign(tx, inputIndexes) {
|
|
36
|
+
const txCpy = tx.clone();
|
|
37
|
+
if (!inputIndexes) {
|
|
38
|
+
try {
|
|
39
|
+
if (!txCpy.sign(this.key, ALL_SIGHASH, ZERO_32)) {
|
|
40
|
+
throw new Error("Failed to sign transaction");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
if (e instanceof Error &&
|
|
45
|
+
e.message.includes("No inputs signed")) {
|
|
46
|
+
// ignore
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return txCpy;
|
|
53
|
+
}
|
|
54
|
+
for (const inputIndex of inputIndexes) {
|
|
55
|
+
if (!txCpy.signIdx(this.key, inputIndex, ALL_SIGHASH, ZERO_32)) {
|
|
56
|
+
throw new Error(`Failed to sign input #${inputIndex}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return txCpy;
|
|
60
|
+
}
|
|
61
|
+
xOnlyPublicKey() {
|
|
62
|
+
return (0, utils_1.pubSchnorr)(this.key);
|
|
63
|
+
}
|
|
64
|
+
signerSession() {
|
|
65
|
+
return signingSession_1.TreeSignerSession.random();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SingleKey = SingleKey;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndexedDBVtxoRepository = exports.networks = exports.
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.Transaction = exports.Unroll = exports.P2A = exports.TxTree = exports.BIP322 = exports.IndexedDBVtxoRepository = exports.networks = exports.ArkNote = exports.waitForIncomingFunds = exports.buildOffchainTx = exports.ConditionWitness = exports.VtxoTaprootTree = exports.VtxoTreeExpiry = exports.CosignerPublicKey = exports.getArkPsbtFields = exports.setArkPsbtField = exports.ArkPsbtFieldKeyType = exports.ArkPsbtFieldKey = exports.CLTVMultisigTapscript = exports.ConditionMultisigTapscript = exports.ConditionCSVMultisigTapscript = exports.CSVMultisigTapscript = exports.MultisigTapscript = exports.decodeTapscript = exports.Response = exports.Request = exports.ServiceWorkerWallet = exports.Worker = exports.setupServiceWorker = exports.SettlementEventType = exports.ChainTxType = exports.IndexerTxType = exports.TxType = exports.VHTLC = exports.VtxoScript = exports.DefaultVtxo = exports.ArkAddress = exports.RestIndexerProvider = exports.RestArkProvider = exports.EsploraProvider = exports.ESPLORA_URL = exports.Ramps = exports.OnchainWallet = exports.SingleKey = exports.Wallet = void 0;
|
|
4
|
+
const btc_signer_1 = require("@scure/btc-signer");
|
|
5
|
+
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return btc_signer_1.Transaction; } });
|
|
6
|
+
const singleKey_1 = require("./identity/singleKey");
|
|
7
|
+
Object.defineProperty(exports, "SingleKey", { enumerable: true, get: function () { return singleKey_1.SingleKey; } });
|
|
6
8
|
const address_1 = require("./script/address");
|
|
7
9
|
Object.defineProperty(exports, "ArkAddress", { enumerable: true, get: function () { return address_1.ArkAddress; } });
|
|
8
10
|
const vhtlc_1 = require("./script/vhtlc");
|
|
@@ -11,12 +13,19 @@ const default_1 = require("./script/default");
|
|
|
11
13
|
Object.defineProperty(exports, "DefaultVtxo", { enumerable: true, get: function () { return default_1.DefaultVtxo; } });
|
|
12
14
|
const base_1 = require("./script/base");
|
|
13
15
|
Object.defineProperty(exports, "VtxoScript", { enumerable: true, get: function () { return base_1.VtxoScript; } });
|
|
14
|
-
const
|
|
15
|
-
Object.defineProperty(exports, "TxType", { enumerable: true, get: function () { return
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const wallet_1 = require("./wallet");
|
|
17
|
+
Object.defineProperty(exports, "TxType", { enumerable: true, get: function () { return wallet_1.TxType; } });
|
|
18
|
+
const wallet_2 = require("./wallet/wallet");
|
|
19
|
+
Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return wallet_2.Wallet; } });
|
|
20
|
+
Object.defineProperty(exports, "waitForIncomingFunds", { enumerable: true, get: function () { return wallet_2.waitForIncomingFunds; } });
|
|
21
|
+
const txTree_1 = require("./tree/txTree");
|
|
22
|
+
Object.defineProperty(exports, "TxTree", { enumerable: true, get: function () { return txTree_1.TxTree; } });
|
|
23
|
+
const ramps_1 = require("./wallet/ramps");
|
|
24
|
+
Object.defineProperty(exports, "Ramps", { enumerable: true, get: function () { return ramps_1.Ramps; } });
|
|
25
|
+
const wallet_3 = require("./wallet/serviceWorker/wallet");
|
|
26
|
+
Object.defineProperty(exports, "ServiceWorkerWallet", { enumerable: true, get: function () { return wallet_3.ServiceWorkerWallet; } });
|
|
27
|
+
const onchain_1 = require("./wallet/onchain");
|
|
28
|
+
Object.defineProperty(exports, "OnchainWallet", { enumerable: true, get: function () { return onchain_1.OnchainWallet; } });
|
|
20
29
|
const utils_1 = require("./wallet/serviceWorker/utils");
|
|
21
30
|
Object.defineProperty(exports, "setupServiceWorker", { enumerable: true, get: function () { return utils_1.setupServiceWorker; } });
|
|
22
31
|
const worker_1 = require("./wallet/serviceWorker/worker");
|
|
@@ -25,11 +34,12 @@ const request_1 = require("./wallet/serviceWorker/request");
|
|
|
25
34
|
Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return request_1.Request; } });
|
|
26
35
|
const response_1 = require("./wallet/serviceWorker/response");
|
|
27
36
|
Object.defineProperty(exports, "Response", { enumerable: true, get: function () { return response_1.Response; } });
|
|
28
|
-
const
|
|
29
|
-
Object.defineProperty(exports, "ESPLORA_URL", { enumerable: true, get: function () { return
|
|
30
|
-
Object.defineProperty(exports, "EsploraProvider", { enumerable: true, get: function () { return
|
|
37
|
+
const onchain_2 = require("./providers/onchain");
|
|
38
|
+
Object.defineProperty(exports, "ESPLORA_URL", { enumerable: true, get: function () { return onchain_2.ESPLORA_URL; } });
|
|
39
|
+
Object.defineProperty(exports, "EsploraProvider", { enumerable: true, get: function () { return onchain_2.EsploraProvider; } });
|
|
31
40
|
const ark_1 = require("./providers/ark");
|
|
32
41
|
Object.defineProperty(exports, "RestArkProvider", { enumerable: true, get: function () { return ark_1.RestArkProvider; } });
|
|
42
|
+
Object.defineProperty(exports, "SettlementEventType", { enumerable: true, get: function () { return ark_1.SettlementEventType; } });
|
|
33
43
|
const tapscript_1 = require("./script/tapscript");
|
|
34
44
|
Object.defineProperty(exports, "CLTVMultisigTapscript", { enumerable: true, get: function () { return tapscript_1.CLTVMultisigTapscript; } });
|
|
35
45
|
Object.defineProperty(exports, "ConditionCSVMultisigTapscript", { enumerable: true, get: function () { return tapscript_1.ConditionCSVMultisigTapscript; } });
|
|
@@ -37,14 +47,30 @@ Object.defineProperty(exports, "ConditionMultisigTapscript", { enumerable: true,
|
|
|
37
47
|
Object.defineProperty(exports, "CSVMultisigTapscript", { enumerable: true, get: function () { return tapscript_1.CSVMultisigTapscript; } });
|
|
38
48
|
Object.defineProperty(exports, "decodeTapscript", { enumerable: true, get: function () { return tapscript_1.decodeTapscript; } });
|
|
39
49
|
Object.defineProperty(exports, "MultisigTapscript", { enumerable: true, get: function () { return tapscript_1.MultisigTapscript; } });
|
|
40
|
-
const
|
|
41
|
-
Object.defineProperty(exports, "
|
|
42
|
-
|
|
43
|
-
Object.defineProperty(exports, "
|
|
50
|
+
const arkTransaction_1 = require("./utils/arkTransaction");
|
|
51
|
+
Object.defineProperty(exports, "buildOffchainTx", { enumerable: true, get: function () { return arkTransaction_1.buildOffchainTx; } });
|
|
52
|
+
const unknownFields_1 = require("./utils/unknownFields");
|
|
53
|
+
Object.defineProperty(exports, "VtxoTaprootTree", { enumerable: true, get: function () { return unknownFields_1.VtxoTaprootTree; } });
|
|
54
|
+
Object.defineProperty(exports, "ConditionWitness", { enumerable: true, get: function () { return unknownFields_1.ConditionWitness; } });
|
|
55
|
+
Object.defineProperty(exports, "getArkPsbtFields", { enumerable: true, get: function () { return unknownFields_1.getArkPsbtFields; } });
|
|
56
|
+
Object.defineProperty(exports, "setArkPsbtField", { enumerable: true, get: function () { return unknownFields_1.setArkPsbtField; } });
|
|
57
|
+
Object.defineProperty(exports, "ArkPsbtFieldKey", { enumerable: true, get: function () { return unknownFields_1.ArkPsbtFieldKey; } });
|
|
58
|
+
Object.defineProperty(exports, "ArkPsbtFieldKeyType", { enumerable: true, get: function () { return unknownFields_1.ArkPsbtFieldKeyType; } });
|
|
59
|
+
Object.defineProperty(exports, "CosignerPublicKey", { enumerable: true, get: function () { return unknownFields_1.CosignerPublicKey; } });
|
|
60
|
+
Object.defineProperty(exports, "VtxoTreeExpiry", { enumerable: true, get: function () { return unknownFields_1.VtxoTreeExpiry; } });
|
|
61
|
+
const bip322_1 = require("./bip322");
|
|
62
|
+
Object.defineProperty(exports, "BIP322", { enumerable: true, get: function () { return bip322_1.BIP322; } });
|
|
44
63
|
const arknote_1 = require("./arknote");
|
|
45
64
|
Object.defineProperty(exports, "ArkNote", { enumerable: true, get: function () { return arknote_1.ArkNote; } });
|
|
46
|
-
Object.defineProperty(exports, "ArkNoteData", { enumerable: true, get: function () { return arknote_1.ArkNoteData; } });
|
|
47
65
|
const idb_1 = require("./wallet/serviceWorker/db/vtxo/idb");
|
|
48
66
|
Object.defineProperty(exports, "IndexedDBVtxoRepository", { enumerable: true, get: function () { return idb_1.IndexedDBVtxoRepository; } });
|
|
49
67
|
const networks_1 = require("./networks");
|
|
50
68
|
Object.defineProperty(exports, "networks", { enumerable: true, get: function () { return networks_1.networks; } });
|
|
69
|
+
const indexer_1 = require("./providers/indexer");
|
|
70
|
+
Object.defineProperty(exports, "RestIndexerProvider", { enumerable: true, get: function () { return indexer_1.RestIndexerProvider; } });
|
|
71
|
+
Object.defineProperty(exports, "IndexerTxType", { enumerable: true, get: function () { return indexer_1.IndexerTxType; } });
|
|
72
|
+
Object.defineProperty(exports, "ChainTxType", { enumerable: true, get: function () { return indexer_1.ChainTxType; } });
|
|
73
|
+
const anchor_1 = require("./utils/anchor");
|
|
74
|
+
Object.defineProperty(exports, "P2A", { enumerable: true, get: function () { return anchor_1.P2A; } });
|
|
75
|
+
const unroll_1 = require("./wallet/unroll");
|
|
76
|
+
Object.defineProperty(exports, "Unroll", { enumerable: true, get: function () { return unroll_1.Unroll; } });
|