diff --git a/.gitignore b/.gitignore index 110d010..3da05a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ target Cargo.lock -.vscode \ No newline at end of file +.vscode +.idea + diff --git a/json/src/account.rs b/json/src/account.rs index 94e38d2..399912b 100644 --- a/json/src/account.rs +++ b/json/src/account.rs @@ -94,7 +94,7 @@ pub struct BalanceTransferAccountOptions { utxos: Option>, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)] #[serde(rename_all = "camelCase")] pub struct AccountHistory { pub owner: String, @@ -102,8 +102,8 @@ pub struct AccountHistory { block_hash: Option, block_time: Option, r#type: String, - txn: u64, - txid: String, + txn: Option, + txid: Option, pub amounts: Vec, } @@ -112,17 +112,49 @@ pub struct AccountHistory { pub struct AccountHistoryOptions { max_block_height: Option, depth: Option, + #[serde(rename = "no_rewards")] no_rewards: Option, token: Option, txtype: Option, txtypes: Option>, limit: Option, start: Option, + #[serde(rename = "including_start")] including_start: Option, txn: Option, format: Option, } +impl AccountHistoryOptions { + pub fn new( + max_block_height: Option, + depth: Option, + no_rewards: Option, + token: Option, + txtype: Option, + txtypes: Option>, + limit: Option, + start: Option, + including_start: Option, + txn: Option, + format: Option, + ) -> Self { + Self { + max_block_height, + depth, + no_rewards, + token, + txtype, + txtypes, + limit, + start, + including_start, + txn, + format, + } + } +} + #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct AccountHistoryCountOptions {