pub mod api;
pub mod decorator;
mod engine;
extern crate async_trait;
use async_trait::async_trait;
use serde_json::Value;
pub struct ReqBit;
#[async_trait]
pub trait IWallet {
async fn loadwallet(&self, wallet_name: &str, load_on_startup: Option<bool>) -> Value;
async fn createwallet(&self, wallet_name: &str) -> Value;
async fn getwalletinfo(&self, wallet_name: &str) -> Value;
async fn getbalance(&self, wallet_name: &str) -> Value;
async fn getnewaddress(
&self,
wallet_name: &str,
label: Option<String>,
address_type: Option<String>,
) -> Value;
async fn listreceivedbyaddress(
&self,
wallet_name: &str,
minconf: Option<u32>,
include_empty: Option<bool>,
) -> Value;
async fn listwallets(&self, wallet_name: &str) -> Value;
async fn sendtoaddress(
&self,
wallet_name: &str,
address: &str,
amount: f64,
comment: Option<String>,
comment_to: Option<String>,
subtract_fee_from_amount: Option<bool>,
) -> Value;
async fn generatetoaddress(&self, nblocks: u32, address: &str, maxtries: Option<u32>) -> Value;
async fn gettransaction(
&self,
wallet_name: &str,
txid: &str,
include_watchonly: Option<bool>,
) -> Value;
async fn setlabel(&self, wallet_name: &str, address: &str, label: &str) -> Value;
async fn listunspent(
&self,
wallet_name: &str,
minconf: Option<u32>,
maxconf: Option<u32>,
addresses: Option<Vec<String>>,
include_unsafe: Option<bool>,
query_options: Option<Value>,
) -> Value;
async fn signrawtransactionwithwallet(
&self,
wallet_name: &str,
hexstring: &str,
prevtxs: Option<Vec<Value>>,
sighash_type: Option<&str>,
) -> Value;
}
#[async_trait]
pub trait IMining {
async fn get_block_template(&self, rules: &str) -> Value;
async fn get_mining_info(&self) -> Value;
async fn getnetworkhashps(&self, nblocks: Option<i32>, height: Option<u32>) -> Value;
}
#[async_trait]
pub trait IBlockchain {
async fn getblock(&self, blockhash: &str, verbosity: Option<u8>) -> Value;
async fn getblockhash(&self, height: u32) -> Value;
async fn getblockchaininfo(&self) -> Value;
}
#[async_trait]
pub trait IRawTransaction {
async fn createrawtransaction(
&self,
inputs: Vec<Value>,
outputs: Vec<Value>,
locktime: Option<u32>,
) -> Value;
async fn signrawtransactionwithkey(
&self,
hexstring: &str,
privkeys: Vec<String>,
sighash_type: Option<&str>,
) -> Value;
async fn sendrawtransaction(&self, hexstring: &str) -> Value;
async fn getrawtransaction(
&self,
txid: &str,
verbose: Option<bool>,
blockhash: Option<&str>,
) -> Value;
async fn decoderawtransaction(&self, hexstring: &str, iswitness: Option<bool>) -> Value;
}
#[async_trait]
pub trait INetwork {
async fn getnetworkinfo(&self) -> Value;
}
#[async_trait]
pub trait IZmq {
async fn getzmqnotifications(&self) -> Value;
}