mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Add BTC.getWalletBalance(xprv) and add API call to access that.
Also improved BTC.WalletAwareUTXOProvider to derive more keys itself instead of throwing and relying on caller to do the work. Added benefit of cleaning up caller code and being more efficient. Needed because not all receiving/change addresses were being picked up.
This commit is contained in:
@@ -73,4 +73,17 @@ public class BtcTests extends Common {
|
||||
btc.buildSpend(xprv58, recipient, amount);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetWalletBalance() {
|
||||
BTC btc = BTC.getInstance();
|
||||
|
||||
String xprv58 = "tprv8ZgxMBicQKsPdahhFSrCdvC1bsWyzHHZfTneTVqUXN6s1wEtZLwAkZXzFP6TYLg2aQMecZLXLre5bTVGajEB55L1HYJcawpdFG66STVAWPJ";
|
||||
|
||||
Long balance = btc.getWalletBalance(xprv58);
|
||||
|
||||
assertNotNull(balance);
|
||||
|
||||
System.out.println(BTC.format(balance));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user