(defaults?: Partial<Utxo>)
| 365 | * @returns A synthetic UTXO with random `txid`, `vout`, and `satoshis`. |
| 366 | */ |
| 367 | export const randomUtxo = (defaults?: Partial<Utxo>): Utxo => ({ |
| 368 | ...{ |
| 369 | txid: binToHex(sha256(bigIntToVmNumber(randomInt()))), |
| 370 | vout: Math.floor(Math.random() * 10), |
| 371 | satoshis: 100_000n + randomInt(), |
| 372 | }, |
| 373 | ...defaults, |
| 374 | }); |
| 375 | |
| 376 | /** |
| 377 | * Generate random fungible `TokenDetails` for use in tests and examples. Fields can be overridden |
no test coverage detected