@btc-vision/transaction 1.0.60 → 1.0.62
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/browser/_version.d.ts +1 -1
- package/browser/index.js +1 -1
- package/browser/transaction/TransactionFactory.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/transaction/TransactionFactory.d.ts +1 -0
- package/build/transaction/TransactionFactory.js +4 -0
- package/build/transaction/builders/TransactionBuilder.js +1 -1
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/transaction/TransactionFactory.ts +6 -0
- package/src/transaction/builders/TransactionBuilder.ts +1 -1
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.62";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.62';
|
|
@@ -224,10 +224,14 @@ export class TransactionFactory {
|
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
async createBTCTransfer(parameters) {
|
|
227
|
+
if (!parameters.from) {
|
|
228
|
+
throw new Error('Field "from" not provided.');
|
|
229
|
+
}
|
|
227
230
|
const resp = await this.createFundTransaction(parameters);
|
|
228
231
|
return {
|
|
229
232
|
estimatedFees: resp.estimatedFees,
|
|
230
233
|
tx: resp.tx.toHex(),
|
|
234
|
+
nextUTXOs: this.getUTXOAsTransaction(resp.tx, parameters.from, 1),
|
|
231
235
|
};
|
|
232
236
|
}
|
|
233
237
|
async createFundTransaction(parameters) {
|
|
@@ -158,7 +158,7 @@ export class TransactionBuilder extends TweakedTransaction {
|
|
|
158
158
|
});
|
|
159
159
|
const builtTx = await this.internalBuildTransaction(fakeTx);
|
|
160
160
|
if (builtTx) {
|
|
161
|
-
const tx = fakeTx.extractTransaction(
|
|
161
|
+
const tx = fakeTx.extractTransaction(true, true);
|
|
162
162
|
const size = tx.virtualSize();
|
|
163
163
|
const fee = this.feeRate * size;
|
|
164
164
|
this.estimatedFees = BigInt(Math.ceil(fee) + 1);
|
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.62';
|
|
@@ -406,12 +406,18 @@ export class TransactionFactory {
|
|
|
406
406
|
public async createBTCTransfer(parameters: IFundingTransactionParameters): Promise<{
|
|
407
407
|
estimatedFees: bigint;
|
|
408
408
|
tx: string;
|
|
409
|
+
nextUTXOs: UTXO[];
|
|
409
410
|
}> {
|
|
411
|
+
if(!parameters.from) {
|
|
412
|
+
throw new Error('Field "from" not provided.');
|
|
413
|
+
}
|
|
414
|
+
|
|
410
415
|
const resp = await this.createFundTransaction(parameters);
|
|
411
416
|
|
|
412
417
|
return {
|
|
413
418
|
estimatedFees: resp.estimatedFees,
|
|
414
419
|
tx: resp.tx.toHex(),
|
|
420
|
+
nextUTXOs: this.getUTXOAsTransaction(resp.tx, parameters.from, 1),
|
|
415
421
|
};
|
|
416
422
|
}
|
|
417
423
|
|
|
@@ -345,7 +345,7 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
345
345
|
|
|
346
346
|
const builtTx = await this.internalBuildTransaction(fakeTx);
|
|
347
347
|
if (builtTx) {
|
|
348
|
-
const tx = fakeTx.extractTransaction(
|
|
348
|
+
const tx = fakeTx.extractTransaction(true, true);
|
|
349
349
|
const size = tx.virtualSize();
|
|
350
350
|
const fee: number = this.feeRate * size;
|
|
351
351
|
|