You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"use strict";letFs=require("node:fs/promises");letRpcClient=require("@dashevo/dashd-rpc/promise");// TODO read from JSON configletconfig={protocol: "http",user: "app",pass: "4472bd70ac35b572d768478266e31312",host: "10.11.5.101",// mainnet=9998, testnet=19998, regtest=19898port: 9998,};constE_RPC_IN_WARMUP=-28;asyncfunctionmain(){letfile=process.argv[2];letrpc=newRpcClient(config);letready=awaitrpc.getBestBlockHash().catch(function(e){if(e.code===E_RPC_IN_WARMUP){console.info("[INFO] RPC is connected.");console.warn(`[WARN] RPC is not fully synced: ${e.message}`);return;}throwe;});if(ready){console.info("[INFO] RPC is ready.");}letaddrs=["XvZy1npHNGeYHCuDnB6upKqdf6XU9q94qu","Xr5ZkoaLAeoFw7GGiNvuwTYZFeDcM9knMg",];if(file){lettext=awaitFs.readFile(file,"utf8");letlines=text.split(/["',\s\r\n]/).filter(Boolean);addrs=addrs.concat(lines);}awaitgetUtxos(rpc,addrs);}asyncfunctiongetUtxos(rpc,addresses){// getaddressbalance// getaddressutxosletret=awaitrpc.getAddressUtxos({addresses: addresses,});console.log(`${addresses.length} addresses with ${ret.result.length} UTXOs between them`,);}main().catch(function(err){console.error(err.stack);process.exit(1);});
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: