deriv_api_schema/sell_contract_for_multiple_accounts_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/sell_contract_for_multiple_accounts/send.json
4
5// Use direct crate names for imports
6use serde::{Deserialize, Serialize};
7use serde_json::Value;
8
9
10
11// Import required types from the *same* crate
12
13/// Sell contracts for multiple accounts simultaneously. Uses the shortcode response from `buy_contract_for_multiple_accounts` to identify the contract, and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected. This will not sell the contract on the currently-authorised account unless you include the token for the current account.
14#[derive(Debug, Clone, Serialize, Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub struct SellContractForMultipleAccountsRequest {
17 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
18 // Correct serde attribute construction - Use helper
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub loginid: Option<String>,
21 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
22 // Correct serde attribute construction - Use helper
23 #[serde(skip_serializing_if = "Option::is_none")]
24 pub passthrough: Option<Value>,
25 /// Minimum price at which to sell the contract, or `0` for 'sell at market'.\n
26 // Correct serde attribute construction - Use helper
27
28 pub price: String,
29 /// [Optional] Used to map request to response.\n
30 // Correct serde attribute construction - Use helper
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub req_id: Option<i64>,
33 /// Must be `1`\n
34 // Correct serde attribute construction - Use helper
35
36 pub sell_contract_for_multiple_accounts: i64,
37 /// An internal ID used to identify the contract which was originally bought. This is returned from the `buy` and `buy_contract_for_multiple_accounts` calls.\n
38 // Correct serde attribute construction - Use helper
39
40 pub shortcode: String,
41 /// Authorisation tokens which select the accounts to sell use for the affected accounts.\n
42 // Correct serde attribute construction - Use helper
43
44 pub tokens: Vec<String>,
45}
46