Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
James Zuccon
2024-09-06 15:54:50 +10:00
parent 9aa43d6e97
commit f66de86eb3
18 changed files with 149 additions and 37 deletions
+9 -18
View File
@@ -1,3 +1,4 @@
import { Transaction } from '@xo/primitives';
import { Blockchain, WalletHD } from '@xo/wallet';
const blockchain = new Blockchain(
@@ -8,24 +9,6 @@ const blockchain = new Blockchain(
await blockchain.start();
console.log(
await blockchain.request(
'blockchain.address.get_history',
'bitcoincash:qqyy3mss5vmthgnu0m5sm39pcfq8z799ku2nxernca',
861_606,
861_607
)
);
/*
console.log(
await blockchain.request(
'blockchain.transaction.get',
'da776b9c273ec406f7ecd488950216aa17a04018201298f263e2fcdb0b903d29'
)
);
*/
const wallet = WalletHD.fromMnemonic(
'harsh gospel job ordinary garden clay eight cactus replace general prison permit',
blockchain
@@ -33,4 +16,12 @@ const wallet = WalletHD.fromMnemonic(
await wallet.scan();
const transactions = wallet.getTransactions();
transactions.forEach((tx) => {
blockchain.broadcastTransaction(tx);
});
console.log(blockchain.pendingTransactions.deriveUtxoState());
console.log(wallet.privateKey());