pub struct DerivConfig {
pub token: Option<String>,
pub app_id: Option<String>,
pub account_id: Option<String>,
pub base_url: String,
pub public_ws_url: String,
pub account: AccountSelection,
pub currency: Option<String>,
pub stake_referencia: f64,
pub transport: TransportConfig,
pub limites: LimitesTasa,
}Expand description
Configuración del adaptador Deriv.
Dos modos:
- Público (sin
token): solo mercado, sin cuenta ni órdenes. - Autenticado (
token+account_id): OTP, balance y ejecución.
Fields§
§token: Option<String>PAT o access token OAuth. Nunca se serializa ni se imprime.
app_id: Option<String>App ID de la aplicación (obligatorio con PAT).
account_id: Option<String>Cuenta sobre la que se opera (CR…, VRTC…). Si falta, se elige la
primera del tipo pedido en account.
base_url: String§public_ws_url: String§account: AccountSelection§currency: Option<String>Divisa para propuestas; si falta se usa la del balance.
stake_referencia: f64Importe de referencia para cotizar payout (Deriv cotiza por importe).
transport: TransportConfig§limites: LimitesTasaImplementations§
Source§impl DerivConfig
impl DerivConfig
Sourcepub fn es_publico(&self) -> bool
pub fn es_publico(&self) -> bool
¿Opera sin credenciales?
Sourcepub fn validar(&self) -> Result<(), BrokerError>
pub fn validar(&self) -> Result<(), BrokerError>
Valida la configuración antes de abrir red.
Trait Implementations§
Source§impl Clone for DerivConfig
impl Clone for DerivConfig
Source§impl Debug for DerivConfig
impl Debug for DerivConfig
Source§impl Default for DerivConfig
impl Default for DerivConfig
Source§impl<'de> Deserialize<'de> for DerivConfig
impl<'de> Deserialize<'de> for DerivConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DerivConfig
impl PartialEq for DerivConfig
Source§impl Serialize for DerivConfig
impl Serialize for DerivConfig
impl StructuralPartialEq for DerivConfig
Auto Trait Implementations§
impl Forget for DerivConfig
impl Freeze for DerivConfig
impl RefUnwindSafe for DerivConfig
impl Send for DerivConfig
impl Sync for DerivConfig
impl Unpin for DerivConfig
impl UnsafeUnpin for DerivConfig
impl UnwindSafe for DerivConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more