Closed agubarev closed 2 years ago
although perhaps AccountUpdateEvent should be updated instead of a new variant, just pointing out the issue.
now account update payload looks like this:
"e": "outboundAccountPosition", //Event type
"E": 1564034571105, //Event Time
"u": 1564034571073, //Time of last account update
"B": [ //Balances Array
{
"a": "ETH", //Asset
"f": "10000.000000", //Free
"l": "0.000000" //Locked
}
]
}```
@agubarev The clippy error was fixed in the master branch by @siegfried . If you sync with master your PR will build properly
Could you review whether this update is redundant, maybe AccountUpdate should be tweaked, I would but wasn't sure if it's going to break anything. I'm using only Spot atm.
@agubarev Have you added the field below to AccountUpdateEvent?
#[serde(rename = "u")]
pub last_account_update_time: u64,
I can't see a reason why it would cause problems.
Have you added the field below to AccountUpdateEvent?
No, I've added a new event BalanceUpdateEvent and wired into WebsocketEvent.
@agubarev I think we only need to tweak AccountUpdateEvent and add the missing field.
@wisespace-io was AccountUpdateEvent intended to update balances or it has additional uses? new event payload has fewer fields
#[serde(rename_all = "camelCase")]
pub struct AccountUpdateEvent {
#[serde(rename = "e")]
pub event_type: String,
#[serde(rename = "E")]
pub event_time: u64,
m: u64,
t: u64,
b: u64,
s: u64,
#[serde(rename = "T")]
t_ignore: bool,
#[serde(rename = "W")]
w_ignore: bool,
#[serde(rename = "D")]
d_ignore: bool,
#[serde(rename = "B")]
pub balance: Vec<EventBalance>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BalanceUpdateEvent {
#[serde(rename = "B")]
pub balance: Vec<EventBalance>,
#[serde(rename = "e")]
pub event_type: String,
#[serde(rename = "E")]
pub event_time: u64,
#[serde(rename = "u")]
pub last_account_update_time: u64,
}```
close/reopen misclicked.
@wisespace-io outboundAccountPosition payload has fewer fields than AccountUpdateEvent
#[serde(rename_all = "camelCase")]
pub struct AccountUpdateEvent {
#[serde(rename = "e")]
pub event_type: String,
#[serde(rename = "E")]
pub event_time: u64,
m: u64,
t: u64,
b: u64,
s: u64,
#[serde(rename = "T")]
t_ignore: bool,
#[serde(rename = "W")]
w_ignore: bool,
#[serde(rename = "D")]
d_ignore: bool,
#[serde(rename = "B")]
pub balance: Vec<EventBalance>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BalanceUpdateEvent {
#[serde(rename = "B")]
pub balance: Vec<EventBalance>,
#[serde(rename = "e")]
pub event_type: String,
#[serde(rename = "E")]
pub event_time: u64,
#[serde(rename = "u")]
pub last_account_update_time: u64,
}
@agubarev To be honest, I am 100% sure. So, it seems safer to have the BalanceUpdateEvent that you have introduced
AccountUpdate event never fired, now the balance updates can be caught