@btc-vision/transaction 1.0.58 → 1.0.60

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.
@@ -1 +1 @@
1
- export declare const version = "1.0.58";
1
+ export declare const version = "1.0.60";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.58';
1
+ export const version = '1.0.60';
@@ -76,14 +76,21 @@ export class TransactionFactory {
76
76
  };
77
77
  const finalTransaction = new DeploymentTransaction(newParams);
78
78
  const outTx = await finalTransaction.signTransaction();
79
+ const out2 = signedTransaction.outs[1];
80
+ const refundUTXO = {
81
+ transactionId: signedTransaction.getId(),
82
+ outputIndex: 1,
83
+ scriptPubKey: {
84
+ hex: out2.script.toString('hex'),
85
+ address: deploymentParameters.from,
86
+ },
87
+ value: BigInt(out2.value),
88
+ };
79
89
  return {
80
90
  transaction: [signedTransaction.toHex(), outTx.toHex()],
81
91
  contractAddress: finalTransaction.contractAddress,
82
92
  p2trAddress: finalTransaction.p2trAddress,
83
- utxos: [{
84
- ...newUtxo,
85
- outputIndex: 1,
86
- }],
93
+ utxos: [refundUTXO],
87
94
  };
88
95
  }
89
96
  async wrap(warpParameters) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "author": "BlobMaster41",
5
5
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
6
6
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.58';
1
+ export const version = '1.0.60';
@@ -170,14 +170,22 @@ export class TransactionFactory {
170
170
  // We have to regenerate using the new utxo
171
171
  const outTx: Transaction = await finalTransaction.signTransaction();
172
172
 
173
+ const out2: Output = signedTransaction.outs[1];
174
+ const refundUTXO: UTXO = {
175
+ transactionId: signedTransaction.getId(),
176
+ outputIndex: 1, // always 1
177
+ scriptPubKey: {
178
+ hex: out2.script.toString('hex'),
179
+ address: deploymentParameters.from,
180
+ },
181
+ value: BigInt(out2.value),
182
+ };
183
+
173
184
  return {
174
185
  transaction: [signedTransaction.toHex(), outTx.toHex()],
175
186
  contractAddress: finalTransaction.contractAddress,
176
187
  p2trAddress: finalTransaction.p2trAddress,
177
- utxos: [{
178
- ...newUtxo,
179
- outputIndex: 1, // always 1
180
- }],
188
+ utxos: [refundUTXO],
181
189
  };
182
190
  }
183
191