1
1
"use strict" ;
2
2
3
- let Tx = require ( "./tx.js" ) ;
3
+ let Tx = require ( "./" ) ;
4
+ let toVarInt = Tx . utils . toVarInt ;
5
+ let toVarIntSize = Tx . utils . toVarIntSize ;
4
6
5
7
/** @type {import('node:crypto') } */
6
8
//@ts -ignore
@@ -38,6 +40,7 @@ Secp256k1.utils.hmacSha256 = async function (key, message) {
38
40
return new Uint8Array ( buffer ) ;
39
41
} ;
40
42
43
+ /* jshint maxstatements: 200 */
41
44
async function main ( ) {
42
45
//let expectedBytes = "00ff0ff0fff00f00";
43
46
//let u8 = Tx.utils.hexToU8("00ff0ff0fff00f00");
@@ -61,9 +64,8 @@ async function main() {
61
64
] ,
62
65
outputs : [
63
66
{
64
- // TODO pubkeyhash or pubKeyHash, but NOT BOTH
65
- pubkeyhash : "f93af105187d21ed6adfa5d71bfada7d7324e53c" ,
66
- units : 190968096 ,
67
+ pubKeyHash : "f93af105187d21ed6adfa5d71bfada7d7324e53c" ,
68
+ satoshis : 190968096 ,
67
69
} ,
68
70
] ,
69
71
} ;
@@ -169,21 +171,21 @@ async function main() {
169
171
] ,
170
172
outputs : [
171
173
{
172
- pubkeyhash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
173
- //pubkeyhash : "1e0a6ef6085bb8af443a9e7f8941e61deb09fb54",
174
- units : quarterValue ,
174
+ pubKeyHash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
175
+ //pubKeyHash : "1e0a6ef6085bb8af443a9e7f8941e61deb09fb54",
176
+ satoshis : quarterValue ,
175
177
} ,
176
178
{
177
- pubkeyhash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
178
- units : quarterValue ,
179
+ pubKeyHash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
180
+ satoshis : quarterValue ,
179
181
} ,
180
182
{
181
- pubkeyhash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
182
- units : quarterValue ,
183
+ pubKeyHash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
184
+ satoshis : quarterValue ,
183
185
} ,
184
186
{
185
- pubkeyhash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
186
- units : quarterValue ,
187
+ pubKeyHash : "5bcd0d776a7252310b9f1a7eee1a749d42126944" ,
188
+ satoshis : quarterValue ,
187
189
} ,
188
190
] ,
189
191
} ;
@@ -267,8 +269,8 @@ async function main() {
267
269
] ,
268
270
outputs : [
269
271
{
270
- pubkeyhash : "f93af105187d21ed6adfa5d71bfada7d7324e53c" ,
271
- units : 190968096 ,
272
+ pubKeyHash : "f93af105187d21ed6adfa5d71bfada7d7324e53c" ,
273
+ satoshis : 190968096 ,
272
274
} ,
273
275
] ,
274
276
} ) ;
0 commit comments