Skip to content

Commit b7d9c95

Browse files
committed
Redefine serializedData
1 parent ea42ebb commit b7d9c95

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

src/lib.rs

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ extern crate throttled_json_rpc;
77

88
use std::collections::HashMap;
99

10+
pub type SerializedData = String;
11+
1012
#[derive(Serialize, Deserialize, Clone, Debug)]
1113
pub struct Block {
1214
pub hash: String,
@@ -35,7 +37,7 @@ pub struct FullBlock {
3537
pub merkleroot: String,
3638
pub acc_checkpoint: String,
3739
pub finalsaplingroot: String,
38-
pub tx: Vec<String>,
40+
pub tx: Vec<Transaction>,
3941
pub time: u32,
4042
pub mediantime: u32,
4143
pub nonce: i64,
@@ -351,31 +353,31 @@ pub struct MasternodeList {
351353

352354
#[derive(Serialize, Debug, Deserialize, Clone)]
353355
pub struct PivxStatus {
354-
staking_status: bool,
355-
staking_enabled: bool,
356-
coldstaking_enabled: bool,
357-
haveconnections: bool,
358-
mnsync: bool,
359-
walletunlocked: bool,
360-
stakeablecoins: i128,
361-
stakingbalance: f64,
362-
stakesplitthreshold: f64,
363-
lastattempt_age: i64,
364-
lastattempt_depth: i64,
365-
lastattempt_hash: String,
366-
lastattempt_coins: i128,
367-
lastattempt_tries: i64,
356+
pub staking_status: bool,
357+
pub staking_enabled: bool,
358+
pub coldstaking_enabled: bool,
359+
pub haveconnections: bool,
360+
pub mnsync: bool,
361+
pub walletunlocked: bool,
362+
pub stakeablecoins: i128,
363+
pub stakingbalance: f64,
364+
pub stakesplitthreshold: f64,
365+
pub lastattempt_age: i64,
366+
pub lastattempt_depth: i64,
367+
pub lastattempt_hash: String,
368+
pub lastattempt_coins: i128,
369+
pub lastattempt_tries: i64,
368370
}
369371

370372
#[derive(Serialize, Debug, Deserialize, Clone)]
371373
pub struct MasternodeCount {
372-
total: i32,
373-
stable: i32,
374-
enabled: i32,
375-
inqueue: i32,
376-
ipv4: i32,
377-
ipv6: i32,
378-
onion: i32,
374+
pub total: i32,
375+
pub stable: i32,
376+
pub enabled: i32,
377+
pub inqueue: i32,
378+
pub ipv4: i32,
379+
pub ipv6: i32,
380+
pub onion: i32,
379381
}
380382

381383
#[derive(Serialize, Deserialize, Debug)]
@@ -461,6 +463,14 @@ pub struct ListColdUtxos {
461463
pub coldutxos: Vec<ColdUtxo>,
462464
}
463465

466+
#[derive(Debug, Deserialize, Serialize)]
467+
pub struct MoneySupply {
468+
pub update: i64,
469+
pub transparentsupply: f64,
470+
pub shieldsupply: f64,
471+
pub totalsupply: f64,
472+
}
473+
464474
jsonrpc_client!(pub struct BitcoinRpcClient {
465475
single:
466476
pub fn createrawtransaction(&self, inputs: &[TxInput], outputs: &HashMap<&str, f64>, locktime: Option<u32>) -> Result<String>;
@@ -479,13 +489,15 @@ jsonrpc_client!(pub struct BitcoinRpcClient {
479489
pub fn getnewaddress(&self, account: Option<&str>, address_type: Option<&str>) -> Result<String>;
480490
pub fn getrawmempool(&self, format: bool) -> Result<RawMemPool>;
481491
pub fn getrawtransaction(&self, txid: String, verbose: bool) -> Result<GetRawTransactionInfo>;
492+
pub fn getsupplyinfo(&self, update: bool) -> Result<MoneySupply>;
482493
pub fn listmasternodes(&self, mn_addr: Option<&str>) -> Result<Vec<MasternodeList>>;
483494
pub fn listcoldutxos(&self) -> Result<Vec<ListColdUtxos>>;
484495
pub fn sendrawtransaction(&self, transaction: &str, allow_high_fee: Option<bool>) -> Result<String>;
485496
pub fn sendtoaddress(&self, address: &str, amount: f64, comment: Option<&str>, comment_to: Option<&str>, include_fee: Option<bool>) -> Result<String>;
486497
pub fn signrawtransaction(&self, transaction: &str, outputs: Option<&[TxOutput]>, privkeys: Option<&[&str]>, sig_hash_type: Option<&str>) -> Result<SignedTx>;
487498
pub fn gettxout(&self, txid: &str, vout: u32, unconfirmed: bool) -> Result<Option<TxOut>>;
488499
pub fn getstakingstatus(&self) -> Result<PivxStatus>;
500+
pub fn relaymasternodebroadcast(&self, hex_mnb: &str) -> Result<String>;
489501
enum:
490502
#[cfg(all(not(feature = "btc")))] pub fn getblockinfo(&self) -> Result<Zero(SerializedData)|One(Block)|Two(FullBlock)>;
491503
});

0 commit comments

Comments
 (0)