@btc-vision/transaction 1.0.89 → 1.0.90
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 +3 -152
- package/browser/_version.d.ts +1 -1
- package/browser/index.js +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/metadata/tokens.js +1 -1
- package/build/transaction/builders/TransactionBuilder.js +6 -3
- package/{Deploy.md → examples/Deploy.md} +2 -0
- package/{Unwrap.md → examples/Unwrap.md} +2 -0
- package/{Wrap.md → examples/Wrap.md} +2 -0
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/transaction/builders/TransactionBuilder.ts +8 -4
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.90";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.90';
|
package/build/metadata/tokens.js
CHANGED
|
@@ -11,7 +11,7 @@ export const MOTO_ADDRESS_TESTNET = 'tb1q4tyhf8hpu04qjj3qaag20knun0spctultxzakw'
|
|
|
11
11
|
export const ROUTER_ADDRESS_TESTNET = 'tb1qnh9mj95nnej25dwhjvvsppwmdm0myhxv7tllgt';
|
|
12
12
|
export const FACTORY_ADDRESS_FRACTAL = 'bc1qr4g85824m58wu0zffjtnf56n425fp0e8azhc7q';
|
|
13
13
|
export const POOL_ADDRESS_FRACTAL = 'bc1qv55cht4zzlt29ea7vdgwsedsn63a2sxtkgpv6h';
|
|
14
|
-
export const WBTC_ADDRESS_FRACTAL = '
|
|
14
|
+
export const WBTC_ADDRESS_FRACTAL = 'bc1qdtzlucslvrvu4useyh9r69supqrw3w4xn9t4yv';
|
|
15
15
|
export const MOTO_ADDRESS_FRACTAL = 'bc1qfzq6w5uvgg5489egv0lj4shlqx4dagqt0ewdnu';
|
|
16
16
|
export const ROUTER_ADDRESS_FRACTAL = 'bc1q9w2zvmkzlezt2fu34u57y9vuw6rll5sp2090kn';
|
|
17
17
|
export var OPNetNetwork;
|
|
@@ -38,9 +38,6 @@ export class TransactionBuilder extends TweakedTransaction {
|
|
|
38
38
|
this.priorityFee = parameters.priorityFee ?? 0n;
|
|
39
39
|
this.utxos = parameters.utxos;
|
|
40
40
|
this.to = parameters.to || undefined;
|
|
41
|
-
if (!this.utxos.length) {
|
|
42
|
-
throw new Error('No UTXOs specified');
|
|
43
|
-
}
|
|
44
41
|
this.from = TransactionBuilder.getFrom(parameters.from, this.signer, this.network);
|
|
45
42
|
this.totalInputAmount = this.calculateTotalUTXOAmount();
|
|
46
43
|
const totalVOut = this.calculateTotalVOutAmount();
|
|
@@ -98,6 +95,9 @@ export class TransactionBuilder extends TweakedTransaction {
|
|
|
98
95
|
this._maximumFeeRate = feeRate;
|
|
99
96
|
}
|
|
100
97
|
async signTransaction() {
|
|
98
|
+
if (!this.utxos.length) {
|
|
99
|
+
throw new Error('No UTXOs specified');
|
|
100
|
+
}
|
|
101
101
|
if (this.to && !EcKeyPair.verifyContractAddress(this.to, this.network)) {
|
|
102
102
|
throw new Error('Invalid contract address. The contract address must be a taproot address.');
|
|
103
103
|
}
|
|
@@ -154,6 +154,9 @@ export class TransactionBuilder extends TweakedTransaction {
|
|
|
154
154
|
return this.tapData?.address;
|
|
155
155
|
}
|
|
156
156
|
async estimateTransactionFees() {
|
|
157
|
+
if (!this.utxos.length) {
|
|
158
|
+
throw new Error('No UTXOs specified');
|
|
159
|
+
}
|
|
157
160
|
if (this.estimatedFees)
|
|
158
161
|
return this.estimatedFees;
|
|
159
162
|
const fakeTx = new Psbt({
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Deploying a Smart Contract on OPNet
|
|
2
2
|
|
|
3
|
+
WARNING: POSSIBLY OUTDATED
|
|
4
|
+
|
|
3
5
|
This guide will walk you through the process of deploying a smart contract on the OPNet protocol. OPNet allows for the
|
|
4
6
|
execution of smart contracts on the Bitcoin network, leveraging the security and stability of Bitcoin.
|
|
5
7
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Unwrapping wBTC Guide
|
|
2
2
|
|
|
3
|
+
WARNING: POSSIBLY OUTDATED
|
|
4
|
+
|
|
3
5
|
This guide will walk you through the process of unwrapping wBTC (Wrapped Bitcoin) using the OPNet protocol. Unwrapping
|
|
4
6
|
wBTC converts it back into regular Bitcoin, enabling you to use it directly on the Bitcoin network.
|
|
5
7
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Wrapping Bitcoin (wBTC) Guide
|
|
2
2
|
|
|
3
|
+
WARNING: POSSIBLY OUTDATED
|
|
4
|
+
|
|
3
5
|
This guide will walk you through the process of wrapping Bitcoin (wBTC) using the OPNet protocol. Wrapping Bitcoin
|
|
4
6
|
allows you to use Bitcoin in smart contracts, similar to how ERC-20 tokens are used on Ethereum.
|
|
5
7
|
|
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.90';
|
|
@@ -119,10 +119,6 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
119
119
|
this.utxos = parameters.utxos;
|
|
120
120
|
this.to = parameters.to || undefined;
|
|
121
121
|
|
|
122
|
-
if (!this.utxos.length) {
|
|
123
|
-
throw new Error('No UTXOs specified');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
122
|
this.from = TransactionBuilder.getFrom(
|
|
127
123
|
parameters.from,
|
|
128
124
|
this.signer as ECPairInterface,
|
|
@@ -226,6 +222,10 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
226
222
|
* @throws {Error} - If something went wrong
|
|
227
223
|
*/
|
|
228
224
|
public async signTransaction(): Promise<Transaction> {
|
|
225
|
+
if (!this.utxos.length) {
|
|
226
|
+
throw new Error('No UTXOs specified');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
229
|
if (this.to && !EcKeyPair.verifyContractAddress(this.to, this.network)) {
|
|
230
230
|
throw new Error(
|
|
231
231
|
'Invalid contract address. The contract address must be a taproot address.',
|
|
@@ -341,6 +341,10 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
341
341
|
* @returns {Promise<bigint>} - The estimated transaction fees
|
|
342
342
|
*/
|
|
343
343
|
public async estimateTransactionFees(): Promise<bigint> {
|
|
344
|
+
if (!this.utxos.length) {
|
|
345
|
+
throw new Error('No UTXOs specified');
|
|
346
|
+
}
|
|
347
|
+
|
|
344
348
|
if (this.estimatedFees) return this.estimatedFees;
|
|
345
349
|
|
|
346
350
|
const fakeTx = new Psbt({
|