@btc-vision/transaction 1.8.3 → 1.8.5
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 +153 -152
- package/browser/transaction/TransactionFactory.d.ts.map +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/generators/Generator.js +1 -1
- package/build/generators/Generator.js.map +1 -1
- package/build/transaction/TransactionFactory.d.ts.map +1 -1
- package/build/transaction/TransactionFactory.js +7 -1
- package/build/transaction/TransactionFactory.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/generators/Generator.ts +1 -1
- package/src/transaction/TransactionFactory.ts +8 -1
package/package.json
CHANGED
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.8.
|
|
1
|
+
export const version = '1.8.5';
|
|
@@ -182,7 +182,7 @@ export abstract class Generator {
|
|
|
182
182
|
writer.writeBytes(feature.data.solution);
|
|
183
183
|
|
|
184
184
|
if (feature.data.graffiti) {
|
|
185
|
-
writer.
|
|
185
|
+
writer.writeBytesWithLength(feature.data.graffiti);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
finalBuffer.writeBytesWithLength(writer.getBuffer());
|
|
@@ -274,7 +274,10 @@ export class TransactionFactory {
|
|
|
274
274
|
0n,
|
|
275
275
|
);
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
const adjusted = total > optionalInputValue ? total - optionalInputValue : 0n;
|
|
278
|
+
return adjusted < TransactionBuilder.MINIMUM_DUST
|
|
279
|
+
? TransactionBuilder.MINIMUM_DUST
|
|
280
|
+
: adjusted;
|
|
278
281
|
}
|
|
279
282
|
|
|
280
283
|
return total;
|
|
@@ -975,6 +978,10 @@ export class TransactionFactory {
|
|
|
975
978
|
throw new Error(`Failed to converge on ${debugPrefix} funding amount`);
|
|
976
979
|
}
|
|
977
980
|
|
|
981
|
+
if (estimatedFundingAmount === 0n) {
|
|
982
|
+
throw new Error(`Impossible. Transaction cant be free.`);
|
|
983
|
+
}
|
|
984
|
+
|
|
978
985
|
return {
|
|
979
986
|
finalTransaction: finalPreTransaction,
|
|
980
987
|
estimatedAmount: estimatedFundingAmount,
|