// This file is generated from multiple API specs.
// Do not edit manually.
#![allow(clippy::derivable_impls)]
#![allow(clippy::type_complexity)]
#![allow(clippy::should_implement_trait)]
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(
&self,
f: &mut ::std::fmt::Formatter<'_>,
) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///`AccountFeeInfo`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "base_fee_discount",
/// "rfq_maker_discount",
/// "rfq_taker_discount"
/// ],
/// "properties": {
/// "base_fee_discount": {
/// "type": "string"
/// },
/// "option_maker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "option_taker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "perp_maker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "perp_taker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "rfq_maker_discount": {
/// "type": "string"
/// },
/// "rfq_taker_discount": {
/// "type": "string"
/// },
/// "spot_maker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "spot_taker_fee": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountFeeInfo {
pub base_fee_discount: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub option_maker_fee: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub option_taker_fee: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub perp_maker_fee: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub perp_taker_fee: ::std::option::Option<::std::string::String>,
pub rfq_maker_discount: ::std::string::String,
pub rfq_taker_discount: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub spot_maker_fee: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub spot_taker_fee: ::std::option::Option<::std::string::String>,
}
impl AccountFeeInfo {
pub fn builder() -> builder::AccountFeeInfo {
Default::default()
}
}
///EIP-712 typed-data Action struct that you sign; its fields are defined below.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "EIP-712 typed-data Action struct that you sign; its fields are defined below.",
/// "type": "object",
/// "required": [
/// "data",
/// "expiry",
/// "module",
/// "nonce",
/// "owner",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "data": {
/// "description": "ABI-encoded action data (`bytes`).",
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint8",
/// "minimum": 0.0
/// }
/// },
/// "expiry": {
/// "description": "Unix timestamp after which the action is invalid (`uint256`).",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "module": {
/// "description": "Module address that will process this action (`address`).",
/// "$ref": "#/definitions/Address"
/// },
/// "nonce": {
/// "description": "Replay-protection nonce (`uint256`), interpreted as a UTC-**nanosecond** timestamp: it must fall within the nonce validity window (one day) of the action's timestamp.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "owner": {
/// "description": "Owner of the subaccount (`address`).",
/// "$ref": "#/definitions/Address"
/// },
/// "signer": {
/// "description": "Address that signed this action (`address`).",
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "Subaccount identifier (`uint256`).",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Action {
///ABI-encoded action data (`bytes`).
pub data: ::std::vec::Vec<u8>,
///Unix timestamp after which the action is invalid (`uint256`).
pub expiry: u64,
///Module address that will process this action (`address`).
pub module: Address,
///Replay-protection nonce (`uint256`), interpreted as a UTC-**nanosecond** timestamp: it must fall within the nonce validity window (one day) of the action's timestamp.
pub nonce: u64,
///Owner of the subaccount (`address`).
pub owner: Address,
///Address that signed this action (`address`).
pub signer: Address,
///Subaccount identifier (`uint256`).
pub subaccount_id: u64,
}
impl Action {
pub fn builder() -> builder::Action {
Default::default()
}
}
///20-byte Ethereum address as a 0x-prefixed lowercase hex string.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "20-byte Ethereum address as a 0x-prefixed lowercase hex string.",
/// "type": "string",
/// "maxLength": 42,
/// "minLength": 42,
/// "pattern": "^0x[0-9a-fA-F]{40}$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Address(::std::string::String);
impl ::std::ops::Deref for Address {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Address> for ::std::string::String {
fn from(value: Address) -> Self {
value.0
}
}
impl ::std::str::FromStr for Address {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 42usize {
return Err("longer than 42 characters".into());
}
if value.chars().count() < 42usize {
return Err("shorter than 42 characters".into());
}
static PATTERN: ::std::sync::LazyLock<::regress::Regex> = ::std::sync::LazyLock::new(||
{ ::regress::Regex::new("^0x[0-9a-fA-F]{40}$").unwrap() });
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^0x[0-9a-fA-F]{40}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for Address {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Address {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Address {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for Address {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`AggregatedOrdersResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "orders",
/// "subaccount_id"
/// ],
/// "properties": {
/// "orders": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Order"
/// }
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AggregatedOrdersResult {
pub orders: ::std::vec::Vec<Order>,
pub subaccount_id: i64,
}
impl AggregatedOrdersResult {
pub fn builder() -> builder::AggregatedOrdersResult {
Default::default()
}
}
///`AggregatedTriggerOrdersResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "orders",
/// "subaccount_id"
/// ],
/// "properties": {
/// "orders": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Order"
/// }
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AggregatedTriggerOrdersResult {
pub orders: ::std::vec::Vec<Order>,
pub subaccount_id: i64,
}
impl AggregatedTriggerOrdersResult {
pub fn builder() -> builder::AggregatedTriggerOrdersResult {
Default::default()
}
}
///`AlgoType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "twap"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum AlgoType {
#[serde(rename = "twap")]
Twap,
}
impl ::std::fmt::Display for AlgoType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Twap => f.write_str("twap"),
}
}
}
impl ::std::str::FromStr for AlgoType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"twap" => Ok(Self::Twap),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AlgoType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AlgoType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AlgoType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`Asset`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "address",
/// "asset_id",
/// "asset_name",
/// "asset_type",
/// "currency",
/// "is_collateral",
/// "is_position",
/// "sub_id"
/// ],
/// "properties": {
/// "address": {
/// "type": "string"
/// },
/// "asset_id": {
/// "type": "string"
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "asset_type": {
/// "$ref": "#/definitions/AssetType"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "erc20_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/SpotPublicDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "is_collateral": {
/// "type": "boolean"
/// },
/// "is_position": {
/// "type": "boolean"
/// },
/// "option_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/OptionDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "perp_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/PerpDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "sub_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Asset {
pub address: ::std::string::String,
pub asset_id: ::std::string::String,
pub asset_name: ::std::string::String,
pub asset_type: AssetType,
pub currency: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub erc20_details: ::std::option::Option<SpotPublicDetails>,
pub is_collateral: bool,
pub is_position: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub option_details: ::std::option::Option<OptionDetails>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub perp_details: ::std::option::Option<PerpDetails>,
pub sub_id: ::std::string::String,
}
impl Asset {
pub fn builder() -> builder::Asset {
Default::default()
}
}
///A non-spot asset (option or perp) and its per-universe risk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A non-spot asset (option or perp) and its per-universe risk.",
/// "type": "object",
/// "required": [
/// "address",
/// "name",
/// "universes"
/// ],
/// "properties": {
/// "address": {
/// "description": "EIP-55 checksummed protocol asset address.",
/// "type": "string"
/// },
/// "name": {
/// "description": "Registered asset name (e.g. \"ETH-OPTION\", \"ETH-PERP\").",
/// "type": "string"
/// },
/// "universes": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/AssetUniverse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AssetEntry {
///EIP-55 checksummed protocol asset address.
pub address: ::std::string::String,
///Registered asset name (e.g. "ETH-OPTION", "ETH-PERP").
pub name: ::std::string::String,
pub universes: ::std::vec::Vec<AssetUniverse>,
}
impl AssetEntry {
pub fn builder() -> builder::AssetEntry {
Default::default()
}
}
///Asset type of the instrument: `"option"`, `"perp"`, or `"erc20"`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Asset type of the instrument: `\"option\"`, `\"perp\"`, or `\"erc20\"`.",
/// "type": "string",
/// "enum": [
/// "option",
/// "perp",
/// "erc20"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum AssetType {
#[serde(rename = "option")]
Option,
#[serde(rename = "perp")]
Perp,
#[serde(rename = "erc20")]
Erc20,
}
impl ::std::fmt::Display for AssetType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Option => f.write_str("option"),
Self::Perp => f.write_str("perp"),
Self::Erc20 => f.write_str("erc20"),
}
}
}
impl ::std::str::FromStr for AssetType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"option" => Ok(Self::Option),
"perp" => Ok(Self::Perp),
"erc20" => Ok(Self::Erc20),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AssetType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AssetType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AssetType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Per-`(asset, universe)` open interest for an option/perp asset.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Per-`(asset, universe)` open interest for an option/perp asset.",
/// "type": "object",
/// "required": [
/// "oi",
/// "risk_universe_id"
/// ],
/// "properties": {
/// "oi": {
/// "$ref": "#/definitions/OpenInterestStats"
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "risk_universe_name": {
/// "description": "Display name of the universe (uppercase, e.g. \"PRIME\"); absent until set by the exchange.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AssetUniverse {
pub oi: OpenInterestStats,
pub risk_universe_id: u32,
///Display name of the universe (uppercase, e.g. "PRIME"); absent until set by the exchange.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub risk_universe_name: ::std::option::Option<::std::string::String>,
}
impl AssetUniverse {
pub fn builder() -> builder::AssetUniverse {
Default::default()
}
}
///One executed bid within an auction. Amounts are decimal strings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One executed bid within an auction. Amounts are decimal strings.",
/// "type": "object",
/// "required": [
/// "amounts_liquidated",
/// "cash_received",
/// "discount_pnl",
/// "percent_liquidated",
/// "positions_realized_pnl",
/// "positions_realized_pnl_excl_fees",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "timestamp",
/// "tx_hash"
/// ],
/// "properties": {
/// "amounts_liquidated": {
/// "description": "Amounts of each asset that were closed. Always empty — see the module TODO; the protocol event does not carry the per-asset breakdown.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "cash_received": {
/// "description": "Cash the liquidated account received for the slice: what the bidder paid in the solvent phase, and negative in the insolvent phase, where the security module pays the bidder instead.",
/// "type": "string"
/// },
/// "discount_pnl": {
/// "description": "Always \"0\" — see the module TODO.",
/// "type": "string"
/// },
/// "percent_liquidated": {
/// "description": "Fraction of the account this bid took; \"1\" is the whole account.",
/// "type": "string"
/// },
/// "positions_realized_pnl": {
/// "description": "Always empty — see the module TODO.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "positions_realized_pnl_excl_fees": {
/// "description": "Always empty — see the module TODO.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "realized_pnl": {
/// "description": "Always \"0\" — see the module TODO.",
/// "type": "string"
/// },
/// "realized_pnl_excl_fees": {
/// "description": "Always \"0\" — see the module TODO.",
/// "type": "string"
/// },
/// "timestamp": {
/// "description": "When the sequencer applied the bid, unix ms.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "tx_hash": {
/// "description": "Settling L1 transaction; empty until the bid's batch settles.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuctionBidEvent {
///Amounts of each asset that were closed. Always empty — see the module TODO; the protocol event does not carry the per-asset breakdown.
pub amounts_liquidated: ::std::collections::HashMap<
::std::string::String,
::std::string::String,
>,
///Cash the liquidated account received for the slice: what the bidder paid in the solvent phase, and negative in the insolvent phase, where the security module pays the bidder instead.
pub cash_received: ::std::string::String,
///Always "0" — see the module TODO.
pub discount_pnl: ::std::string::String,
///Fraction of the account this bid took; "1" is the whole account.
pub percent_liquidated: ::std::string::String,
///Always empty — see the module TODO.
pub positions_realized_pnl: ::std::collections::HashMap<
::std::string::String,
::std::string::String,
>,
///Always empty — see the module TODO.
pub positions_realized_pnl_excl_fees: ::std::collections::HashMap<
::std::string::String,
::std::string::String,
>,
///Always "0" — see the module TODO.
pub realized_pnl: ::std::string::String,
///Always "0" — see the module TODO.
pub realized_pnl_excl_fees: ::std::string::String,
///When the sequencer applied the bid, unix ms.
pub timestamp: u64,
///Settling L1 transaction; empty until the bid's batch settles.
pub tx_hash: ::std::string::String,
}
impl AuctionBidEvent {
pub fn builder() -> builder::AuctionBidEvent {
Default::default()
}
}
///`AuctionDetails`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "estimated_bid_price",
/// "estimated_discount_pnl",
/// "estimated_mtm",
/// "estimated_percent_bid",
/// "last_seen_trade_id",
/// "margin_type",
/// "min_cash_transfer",
/// "min_price_limit",
/// "subaccount_balances"
/// ],
/// "properties": {
/// "currency": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "estimated_bid_price": {
/// "type": "string"
/// },
/// "estimated_discount_pnl": {
/// "type": "string"
/// },
/// "estimated_mtm": {
/// "type": "string"
/// },
/// "estimated_percent_bid": {
/// "type": "string"
/// },
/// "last_seen_trade_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "margin_type": {
/// "type": "string"
/// },
/// "min_cash_transfer": {
/// "type": "string"
/// },
/// "min_price_limit": {
/// "type": "string"
/// },
/// "subaccount_balances": {
/// "description": "Balance per asset name, as a decimal string.",
/// "type": "object",
/// "properties": {
/// "{key}": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuctionDetails {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
pub estimated_bid_price: ::std::string::String,
pub estimated_discount_pnl: ::std::string::String,
pub estimated_mtm: ::std::string::String,
pub estimated_percent_bid: ::std::string::String,
pub last_seen_trade_id: i64,
pub margin_type: ::std::string::String,
pub min_cash_transfer: ::std::string::String,
pub min_price_limit: ::std::string::String,
pub subaccount_balances: AuctionDetailsSubaccountBalances,
}
impl AuctionDetails {
pub fn builder() -> builder::AuctionDetails {
Default::default()
}
}
///Balance per asset name, as a decimal string.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Balance per asset name, as a decimal string.",
/// "type": "object",
/// "properties": {
/// "{key}": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": {
/// "type": "string"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuctionDetailsSubaccountBalances {
#[serde(
rename = "{key}",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub key: ::std::option::Option<::std::string::String>,
#[serde(flatten)]
pub extra: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
}
impl AuctionDetailsSubaccountBalances {
pub fn builder() -> builder::AuctionDetailsSubaccountBalances {
Default::default()
}
}
///One auction phase and the bids that filled it.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One auction phase and the bids that filled it.",
/// "type": "object",
/// "required": [
/// "auction_id",
/// "auction_type",
/// "bids",
/// "fee",
/// "start_timestamp",
/// "subaccount_id",
/// "tx_hash"
/// ],
/// "properties": {
/// "auction_id": {
/// "description": "`{subaccount_id}-{start_time_sec}` — see the module docs.",
/// "type": "string"
/// },
/// "auction_type": {
/// "$ref": "#/definitions/AuctionType"
/// },
/// "bids": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/AuctionBidEvent"
/// }
/// },
/// "end_timestamp": {
/// "description": "When the auction ended, unix ms; `null` while still live.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "fee": {
/// "description": "Liquidation fee charged at auction start; \"0\" for a phase opened by conversion to insolvent.",
/// "type": "string"
/// },
/// "start_timestamp": {
/// "description": "Auction/phase clock start, unix ms.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "description": "The liquidated (auctioned) subaccount.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "tx_hash": {
/// "description": "Settling L1 transaction of the op that opened the auction; empty until that batch settles.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuctionHistory {
///`{subaccount_id}-{start_time_sec}` — see the module docs.
pub auction_id: ::std::string::String,
pub auction_type: AuctionType,
pub bids: ::std::vec::Vec<AuctionBidEvent>,
///When the auction ended, unix ms; `null` while still live.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Liquidation fee charged at auction start; "0" for a phase opened by conversion to insolvent.
pub fee: ::std::string::String,
///Auction/phase clock start, unix ms.
pub start_timestamp: u64,
///The liquidated (auctioned) subaccount.
pub subaccount_id: u64,
///Settling L1 transaction of the op that opened the auction; empty until that batch settles.
pub tx_hash: ::std::string::String,
}
impl AuctionHistory {
pub fn builder() -> builder::AuctionHistory {
Default::default()
}
}
///Payload for `auctions.watch`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for `auctions.watch`.",
/// "type": "object",
/// "required": [
/// "state",
/// "subaccount_id",
/// "timestamp"
/// ],
/// "properties": {
/// "details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AuctionDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "state": {
/// "$ref": "#/definitions/AuctionStateType"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuctionResult {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub details: ::std::option::Option<AuctionDetails>,
pub state: AuctionStateType,
pub subaccount_id: i64,
pub timestamp: i64,
}
impl AuctionResult {
pub fn builder() -> builder::AuctionResult {
Default::default()
}
}
///`AuctionStateType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "ongoing",
/// "ended"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum AuctionStateType {
#[serde(rename = "ongoing")]
Ongoing,
#[serde(rename = "ended")]
Ended,
}
impl ::std::fmt::Display for AuctionStateType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ongoing => f.write_str("ongoing"),
Self::Ended => f.write_str("ended"),
}
}
}
impl ::std::str::FromStr for AuctionStateType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ongoing" => Ok(Self::Ongoing),
"ended" => Ok(Self::Ended),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AuctionStateType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AuctionStateType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AuctionStateType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Which phase of the auction this entry describes.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Which phase of the auction this entry describes.",
/// "type": "string",
/// "enum": [
/// "solvent",
/// "insolvent"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum AuctionType {
#[serde(rename = "solvent")]
Solvent,
#[serde(rename = "insolvent")]
Insolvent,
}
impl ::std::fmt::Display for AuctionType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Solvent => f.write_str("solvent"),
Self::Insolvent => f.write_str("insolvent"),
}
}
}
impl ::std::str::FromStr for AuctionType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"solvent" => Ok(Self::Solvent),
"insolvent" => Ok(Self::Insolvent),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AuctionType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AuctionType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AuctionType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`AuctionsWatchNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/AuctionResult"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct AuctionsWatchNotification(pub AuctionResult);
impl ::std::ops::Deref for AuctionsWatchNotification {
type Target = AuctionResult;
fn deref(&self) -> &AuctionResult {
&self.0
}
}
impl ::std::convert::From<AuctionsWatchNotification> for AuctionResult {
fn from(value: AuctionsWatchNotification) -> Self {
value.0
}
}
impl ::std::convert::From<AuctionResult> for AuctionsWatchNotification {
fn from(value: AuctionResult) -> Self {
Self(value)
}
}
///`BalanceUpdate`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name",
/// "new_balance",
/// "previous_balance",
/// "update_type"
/// ],
/// "properties": {
/// "name": {
/// "type": "string"
/// },
/// "new_balance": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "previous_balance": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "update_type": {
/// "$ref": "#/definitions/BalanceUpdateType"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BalanceUpdate {
pub name: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub new_balance: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub previous_balance: ::bigdecimal::BigDecimal,
pub update_type: BalanceUpdateType,
}
impl BalanceUpdate {
pub fn builder() -> builder::BalanceUpdate {
Default::default()
}
}
///`BalanceUpdateType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "trade",
/// "asset_deposit",
/// "asset_withdrawal",
/// "transfer",
/// "subaccount_deposit",
/// "subaccount_withdrawal",
/// "liquidation",
/// "liquidator",
/// "onchain_drift_fix",
/// "perp_settlement",
/// "option_settlement",
/// "interest_accrual",
/// "onchain_revert",
/// "double_revert"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum BalanceUpdateType {
#[serde(rename = "trade")]
Trade,
#[serde(rename = "asset_deposit")]
AssetDeposit,
#[serde(rename = "asset_withdrawal")]
AssetWithdrawal,
#[serde(rename = "transfer")]
Transfer,
#[serde(rename = "subaccount_deposit")]
SubaccountDeposit,
#[serde(rename = "subaccount_withdrawal")]
SubaccountWithdrawal,
#[serde(rename = "liquidation")]
Liquidation,
#[serde(rename = "liquidator")]
Liquidator,
#[serde(rename = "onchain_drift_fix")]
OnchainDriftFix,
#[serde(rename = "perp_settlement")]
PerpSettlement,
#[serde(rename = "option_settlement")]
OptionSettlement,
#[serde(rename = "interest_accrual")]
InterestAccrual,
#[serde(rename = "onchain_revert")]
OnchainRevert,
#[serde(rename = "double_revert")]
DoubleRevert,
}
impl ::std::fmt::Display for BalanceUpdateType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Trade => f.write_str("trade"),
Self::AssetDeposit => f.write_str("asset_deposit"),
Self::AssetWithdrawal => f.write_str("asset_withdrawal"),
Self::Transfer => f.write_str("transfer"),
Self::SubaccountDeposit => f.write_str("subaccount_deposit"),
Self::SubaccountWithdrawal => f.write_str("subaccount_withdrawal"),
Self::Liquidation => f.write_str("liquidation"),
Self::Liquidator => f.write_str("liquidator"),
Self::OnchainDriftFix => f.write_str("onchain_drift_fix"),
Self::PerpSettlement => f.write_str("perp_settlement"),
Self::OptionSettlement => f.write_str("option_settlement"),
Self::InterestAccrual => f.write_str("interest_accrual"),
Self::OnchainRevert => f.write_str("onchain_revert"),
Self::DoubleRevert => f.write_str("double_revert"),
}
}
}
impl ::std::str::FromStr for BalanceUpdateType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"trade" => Ok(Self::Trade),
"asset_deposit" => Ok(Self::AssetDeposit),
"asset_withdrawal" => Ok(Self::AssetWithdrawal),
"transfer" => Ok(Self::Transfer),
"subaccount_deposit" => Ok(Self::SubaccountDeposit),
"subaccount_withdrawal" => Ok(Self::SubaccountWithdrawal),
"liquidation" => Ok(Self::Liquidation),
"liquidator" => Ok(Self::Liquidator),
"onchain_drift_fix" => Ok(Self::OnchainDriftFix),
"perp_settlement" => Ok(Self::PerpSettlement),
"option_settlement" => Ok(Self::OptionSettlement),
"interest_accrual" => Ok(Self::InterestAccrual),
"onchain_revert" => Ok(Self::OnchainRevert),
"double_revert" => Ok(Self::DoubleRevert),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BalanceUpdateType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BalanceUpdateType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BalanceUpdateType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding `...Error` variant meaning that stage failed. Serialized as the variant name (string) in API responses.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding `...Error` variant meaning that stage failed. Serialized as the variant name (string) in API responses.",
/// "type": "string",
/// "enum": [
/// "Batching",
/// "Executing",
/// "Proving",
/// "Settling",
/// "Settled",
/// "BatchingError",
/// "ExecutingError",
/// "ProvingError",
/// "SettlingError",
/// "SettledError"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum BatchStatus {
Batching,
Executing,
Proving,
Settling,
Settled,
BatchingError,
ExecutingError,
ProvingError,
SettlingError,
SettledError,
}
impl ::std::fmt::Display for BatchStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Batching => f.write_str("Batching"),
Self::Executing => f.write_str("Executing"),
Self::Proving => f.write_str("Proving"),
Self::Settling => f.write_str("Settling"),
Self::Settled => f.write_str("Settled"),
Self::BatchingError => f.write_str("BatchingError"),
Self::ExecutingError => f.write_str("ExecutingError"),
Self::ProvingError => f.write_str("ProvingError"),
Self::SettlingError => f.write_str("SettlingError"),
Self::SettledError => f.write_str("SettledError"),
}
}
}
impl ::std::str::FromStr for BatchStatus {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"Batching" => Ok(Self::Batching),
"Executing" => Ok(Self::Executing),
"Proving" => Ok(Self::Proving),
"Settling" => Ok(Self::Settling),
"Settled" => Ok(Self::Settled),
"BatchingError" => Ok(Self::BatchingError),
"ExecutingError" => Ok(Self::ExecutingError),
"ProvingError" => Ok(Self::ProvingError),
"SettlingError" => Ok(Self::SettlingError),
"SettledError" => Ok(Self::SettledError),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BatchStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BatchStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BatchStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Payload for `{subaccount_id}.best.quotes`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for `{subaccount_id}.best.quotes`.",
/// "type": "object",
/// "required": [
/// "rfq_id"
/// ],
/// "properties": {
/// "error": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RPCError"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "result": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RfqGetBestQuoteResponse"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BestQuoteChannelResult {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<RpcError>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub result: ::std::option::Option<RfqGetBestQuoteResponse>,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
}
impl BestQuoteChannelResult {
pub fn builder() -> builder::BestQuoteChannelResult {
Default::default()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "nonce",
/// "request_id",
/// "share_price",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id",
/// "withdraw_hash"
/// ],
/// "properties": {
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "request_id": {
/// "$ref": "#/definitions/VaultRequestId"
/// },
/// "share_price": {
/// "description": "Quoted share price in USD per share, as a decimal string (e.g. `\"1\"`).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "withdraw_hash": {
/// "description": "0x-prefixed hex of the 32-byte user withdraw-action hash.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BurnSharesRequest {
pub nonce: u64,
pub request_id: VaultRequestId,
///Quoted share price in USD per share, as a decimal string (e.g. `"1"`).
pub share_price: ::bigdecimal::BigDecimal,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
///0x-prefixed hex of the 32-byte user withdraw-action hash.
pub withdraw_hash: ::std::string::String,
}
impl BurnSharesRequest {
pub fn builder() -> builder::BurnSharesRequest {
Default::default()
}
}
///`CancelAlgoOrderRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "order_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "order_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelAlgoOrderRequest {
///UUID v4 string
pub order_id: ::uuid::Uuid,
pub subaccount_id: i64,
}
impl CancelAlgoOrderRequest {
pub fn builder() -> builder::CancelAlgoOrderRequest {
Default::default()
}
}
///`CancelAllAlgoOrdersRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelAllAlgoOrdersRequest {
pub subaccount_id: i64,
}
impl CancelAllAlgoOrdersRequest {
pub fn builder() -> builder::CancelAllAlgoOrdersRequest {
Default::default()
}
}
///The literal string `"ok"` returned on success.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The literal string `\"ok\"` returned on success.",
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CancelAllAlgoOrdersResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for CancelAllAlgoOrdersResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for CancelAllAlgoOrdersResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CancelAllAlgoOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CancelAllAlgoOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CancelAllAlgoOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CancelAllRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "cancel_algo_orders": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "cancel_trigger_orders": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelAllRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cancel_algo_orders: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cancel_trigger_orders: ::std::option::Option<bool>,
pub subaccount_id: i64,
}
impl CancelAllRequest {
pub fn builder() -> builder::CancelAllRequest {
Default::default()
}
}
///The literal string `"ok"` returned on success.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The literal string `\"ok\"` returned on success.",
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CancelAllResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for CancelAllResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for CancelAllResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CancelAllResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CancelAllResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CancelAllResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CancelAllTriggerOrdersRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelAllTriggerOrdersRequest {
pub subaccount_id: i64,
}
impl CancelAllTriggerOrdersRequest {
pub fn builder() -> builder::CancelAllTriggerOrdersRequest {
Default::default()
}
}
///The literal string `"ok"` returned on success.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The literal string `\"ok\"` returned on success.",
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CancelAllTriggerOrdersResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for CancelAllTriggerOrdersResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for CancelAllTriggerOrdersResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CancelAllTriggerOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CancelAllTriggerOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CancelAllTriggerOrdersResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CancelBatchQuotesRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "nonce": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "quote_id": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelBatchQuotesRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nonce: ::std::option::Option<i64>,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id: ::std::option::Option<::uuid::Uuid>,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: u64,
}
impl CancelBatchQuotesRequest {
pub fn builder() -> builder::CancelBatchQuotesRequest {
Default::default()
}
}
///`CancelBatchResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_ids"
/// ],
/// "properties": {
/// "cancelled_ids": {
/// "type": "array",
/// "items": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelBatchResult {
pub cancelled_ids: ::std::vec::Vec<::uuid::Uuid>,
}
impl CancelBatchResult {
pub fn builder() -> builder::CancelBatchResult {
Default::default()
}
}
///`CancelBatchRfqsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "nonce": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelBatchRfqsRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nonce: ::std::option::Option<i64>,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: u64,
}
impl CancelBatchRfqsRequest {
pub fn builder() -> builder::CancelBatchRfqsRequest {
Default::default()
}
}
///`CancelBatchRfqsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_ids"
/// ],
/// "properties": {
/// "cancelled_ids": {
/// "type": "array",
/// "items": {
/// "type": "string",
/// "format": "uuid"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelBatchRfqsResponse {
pub cancelled_ids: ::std::vec::Vec<::uuid::Uuid>,
}
impl CancelBatchRfqsResponse {
pub fn builder() -> builder::CancelBatchRfqsResponse {
Default::default()
}
}
///`CancelByInstrumentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instrument_name",
/// "subaccount_id"
/// ],
/// "properties": {
/// "instrument_name": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByInstrumentRequest {
pub instrument_name: ::std::string::String,
pub subaccount_id: i64,
}
impl CancelByInstrumentRequest {
pub fn builder() -> builder::CancelByInstrumentRequest {
Default::default()
}
}
///`CancelByInstrumentResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_orders"
/// ],
/// "properties": {
/// "cancelled_orders": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByInstrumentResponse {
pub cancelled_orders: i64,
}
impl CancelByInstrumentResponse {
pub fn builder() -> builder::CancelByInstrumentResponse {
Default::default()
}
}
///`CancelByLabelRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "label",
/// "subaccount_id"
/// ],
/// "properties": {
/// "instrument_name": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "label": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByLabelRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instrument_name: ::std::option::Option<::std::string::String>,
pub label: ::std::string::String,
pub subaccount_id: i64,
}
impl CancelByLabelRequest {
pub fn builder() -> builder::CancelByLabelRequest {
Default::default()
}
}
///`CancelByLabelResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_orders"
/// ],
/// "properties": {
/// "cancelled_orders": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByLabelResponse {
pub cancelled_orders: i64,
}
impl CancelByLabelResponse {
pub fn builder() -> builder::CancelByLabelResponse {
Default::default()
}
}
///`CancelByNonceRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instrument_name",
/// "nonce",
/// "subaccount_id"
/// ],
/// "properties": {
/// "instrument_name": {
/// "type": "string"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByNonceRequest {
pub instrument_name: ::std::string::String,
pub nonce: i64,
pub subaccount_id: i64,
}
impl CancelByNonceRequest {
pub fn builder() -> builder::CancelByNonceRequest {
Default::default()
}
}
///`CancelByNonceResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_orders"
/// ],
/// "properties": {
/// "cancelled_orders": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelByNonceResponse {
pub cancelled_orders: i64,
}
impl CancelByNonceResponse {
pub fn builder() -> builder::CancelByNonceResponse {
Default::default()
}
}
///`CancelOrderRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instrument_name",
/// "order_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "instrument_name": {
/// "type": "string"
/// },
/// "order_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelOrderRequest {
pub instrument_name: ::std::string::String,
///UUID v4 string
pub order_id: ::uuid::Uuid,
pub subaccount_id: i64,
}
impl CancelOrderRequest {
pub fn builder() -> builder::CancelOrderRequest {
Default::default()
}
}
///`CancelQuoteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "quote_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "nonce": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelQuoteRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nonce: ::std::option::Option<i64>,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: u64,
}
impl CancelQuoteRequest {
pub fn builder() -> builder::CancelQuoteRequest {
Default::default()
}
}
///`CancelReason`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "",
/// "user_request",
/// "mmp_trigger",
/// "insufficient_margin",
/// "signed_max_fee_too_low",
/// "cancel_on_disconnect",
/// "ioc_or_market_partial_fill",
/// "session_key_deregistered",
/// "subaccount_withdrawn",
/// "compliance",
/// "trigger_failed",
/// "validation_failed",
/// "algo_completed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CancelReason {
#[serde(rename = "")]
X,
#[serde(rename = "user_request")]
UserRequest,
#[serde(rename = "mmp_trigger")]
MmpTrigger,
#[serde(rename = "insufficient_margin")]
InsufficientMargin,
#[serde(rename = "signed_max_fee_too_low")]
SignedMaxFeeTooLow,
#[serde(rename = "cancel_on_disconnect")]
CancelOnDisconnect,
#[serde(rename = "ioc_or_market_partial_fill")]
IocOrMarketPartialFill,
#[serde(rename = "session_key_deregistered")]
SessionKeyDeregistered,
#[serde(rename = "subaccount_withdrawn")]
SubaccountWithdrawn,
#[serde(rename = "compliance")]
Compliance,
#[serde(rename = "trigger_failed")]
TriggerFailed,
#[serde(rename = "validation_failed")]
ValidationFailed,
#[serde(rename = "algo_completed")]
AlgoCompleted,
}
impl ::std::fmt::Display for CancelReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::X => f.write_str(""),
Self::UserRequest => f.write_str("user_request"),
Self::MmpTrigger => f.write_str("mmp_trigger"),
Self::InsufficientMargin => f.write_str("insufficient_margin"),
Self::SignedMaxFeeTooLow => f.write_str("signed_max_fee_too_low"),
Self::CancelOnDisconnect => f.write_str("cancel_on_disconnect"),
Self::IocOrMarketPartialFill => f.write_str("ioc_or_market_partial_fill"),
Self::SessionKeyDeregistered => f.write_str("session_key_deregistered"),
Self::SubaccountWithdrawn => f.write_str("subaccount_withdrawn"),
Self::Compliance => f.write_str("compliance"),
Self::TriggerFailed => f.write_str("trigger_failed"),
Self::ValidationFailed => f.write_str("validation_failed"),
Self::AlgoCompleted => f.write_str("algo_completed"),
}
}
}
impl ::std::str::FromStr for CancelReason {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"" => Ok(Self::X),
"user_request" => Ok(Self::UserRequest),
"mmp_trigger" => Ok(Self::MmpTrigger),
"insufficient_margin" => Ok(Self::InsufficientMargin),
"signed_max_fee_too_low" => Ok(Self::SignedMaxFeeTooLow),
"cancel_on_disconnect" => Ok(Self::CancelOnDisconnect),
"ioc_or_market_partial_fill" => Ok(Self::IocOrMarketPartialFill),
"session_key_deregistered" => Ok(Self::SessionKeyDeregistered),
"subaccount_withdrawn" => Ok(Self::SubaccountWithdrawn),
"compliance" => Ok(Self::Compliance),
"trigger_failed" => Ok(Self::TriggerFailed),
"validation_failed" => Ok(Self::ValidationFailed),
"algo_completed" => Ok(Self::AlgoCompleted),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CancelRfqRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "rfq_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelRfqRequest {
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub subaccount_id: u64,
}
impl CancelRfqRequest {
pub fn builder() -> builder::CancelRfqRequest {
Default::default()
}
}
///The literal string `"ok"` returned on success.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The literal string `\"ok\"` returned on success.",
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum CancelRfqResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for CancelRfqResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for CancelRfqResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CancelRfqResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CancelRfqResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CancelRfqResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CancelTriggerOrderRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "order_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "order_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelTriggerOrderRequest {
///UUID v4 string
pub order_id: ::uuid::Uuid,
pub subaccount_id: i64,
}
impl CancelTriggerOrderRequest {
pub fn builder() -> builder::CancelTriggerOrderRequest {
Default::default()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id",
/// "vault_subaccount_id"
/// ],
/// "properties": {
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "vault_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CancelVaultRequestRequest {
pub nonce: u64,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
pub vault_subaccount_id: u64,
}
impl CancelVaultRequestRequest {
pub fn builder() -> builder::CancelVaultRequestRequest {
Default::default()
}
}
///`ChangeSubaccountLabelRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "label",
/// "subaccount_id"
/// ],
/// "properties": {
/// "label": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ChangeSubaccountLabelRequest {
pub label: ::std::string::String,
pub subaccount_id: u64,
}
impl ChangeSubaccountLabelRequest {
pub fn builder() -> builder::ChangeSubaccountLabelRequest {
Default::default()
}
}
///`Collateral`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "amount_step",
/// "asset_name",
/// "asset_type",
/// "average_price",
/// "average_price_excl_fees",
/// "creation_timestamp",
/// "cumulative_interest",
/// "currency",
/// "delta",
/// "delta_currency",
/// "initial_margin",
/// "maintenance_margin",
/// "mark_price",
/// "mark_value",
/// "open_orders_margin",
/// "pending_interest",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "total_fees",
/// "unrealized_pnl",
/// "unrealized_pnl_excl_fees"
/// ],
/// "properties": {
/// "amount": {
/// "type": "string"
/// },
/// "amount_step": {
/// "type": "string"
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "asset_type": {
/// "type": "string"
/// },
/// "average_price": {
/// "type": "string"
/// },
/// "average_price_excl_fees": {
/// "type": "string"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "cumulative_interest": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "delta": {
/// "type": "string"
/// },
/// "delta_currency": {
/// "type": "string"
/// },
/// "initial_margin": {
/// "type": "string"
/// },
/// "maintenance_margin": {
/// "type": "string"
/// },
/// "mark_price": {
/// "type": "string"
/// },
/// "mark_value": {
/// "type": "string"
/// },
/// "open_orders_margin": {
/// "type": "string"
/// },
/// "pending_interest": {
/// "type": "string"
/// },
/// "realized_pnl": {
/// "type": "string"
/// },
/// "realized_pnl_excl_fees": {
/// "type": "string"
/// },
/// "total_fees": {
/// "type": "string"
/// },
/// "unrealized_pnl": {
/// "type": "string"
/// },
/// "unrealized_pnl_excl_fees": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Collateral {
pub amount: ::std::string::String,
pub amount_step: ::std::string::String,
pub asset_name: ::std::string::String,
pub asset_type: ::std::string::String,
pub average_price: ::std::string::String,
pub average_price_excl_fees: ::std::string::String,
pub creation_timestamp: i64,
pub cumulative_interest: ::std::string::String,
pub currency: ::std::string::String,
pub delta: ::std::string::String,
pub delta_currency: ::std::string::String,
pub initial_margin: ::std::string::String,
pub maintenance_margin: ::std::string::String,
pub mark_price: ::std::string::String,
pub mark_value: ::std::string::String,
pub open_orders_margin: ::std::string::String,
pub pending_interest: ::std::string::String,
pub realized_pnl: ::std::string::String,
pub realized_pnl_excl_fees: ::std::string::String,
pub total_fees: ::std::string::String,
pub unrealized_pnl: ::std::string::String,
pub unrealized_pnl_excl_fees: ::std::string::String,
}
impl Collateral {
pub fn builder() -> builder::Collateral {
Default::default()
}
}
///`private/order` params.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`private/order` params.",
/// "type": "object",
/// "required": [
/// "amount",
/// "direction",
/// "instrument_name",
/// "limit_price",
/// "max_fee",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "algo_duration_sec": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_num_slices": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AlgoType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "amount": {
/// "description": "Order amount in units of the base, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "client": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "is_atomic_signing": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "limit_price": {
/// "description": "Limit price in quote currency, as a decimal string (e.g. `\"3100.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "max_fee": {
/// "description": "Max fee per unit of volume in quote currency, as a decimal string or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "order_type": {
/// "default": "limit",
/// "$ref": "#/definitions/OrderType"
/// },
/// "reduce_only": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "referral_code": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "reject_post_only": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "reject_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "time_in_force": {
/// "default": "gtc",
/// "$ref": "#/definitions/TimeInForce"
/// },
/// "trigger_price": {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_price_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerPriceType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateOrderRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_duration_sec: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_num_slices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_type: ::std::option::Option<AlgoType>,
///Order amount in units of the base, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub amount: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub client: ::std::option::Option<::std::string::String>,
pub direction: Direction,
///Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra_fee: ::std::option::Option<::bigdecimal::BigDecimal>,
pub instrument_name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_atomic_signing: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
///Limit price in quote currency, as a decimal string (e.g. `"3100.5"`) or a JSON number.
pub limit_price: ::bigdecimal::BigDecimal,
///Max fee per unit of volume in quote currency, as a decimal string or a JSON number.
pub max_fee: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mmp: ::std::option::Option<bool>,
pub nonce: ::std::string::String,
#[serde(default = "defaults::create_order_request_order_type")]
pub order_type: OrderType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reduce_only: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub referral_code: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reject_post_only: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reject_timestamp: ::std::option::Option<i64>,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: ::std::string::String,
pub subaccount_id: i64,
#[serde(default = "defaults::create_order_request_time_in_force")]
pub time_in_force: TimeInForce,
///Trigger price as a decimal string or JSON number; omit for non-trigger orders.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price_type: ::std::option::Option<TriggerPriceType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_type: ::std::option::Option<TriggerType>,
}
impl CreateOrderRequest {
pub fn builder() -> builder::CreateOrderRequest {
Default::default()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "cooldown_sec",
/// "deposit_spot_asset",
/// "initial_deposit",
/// "initial_share_price_usd",
/// "management_fee_bps",
/// "manager_id",
/// "max_fee_usd",
/// "max_slippage_bps",
/// "nonce",
/// "performance_fee_bps",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "benchmark_asset": {
/// "description": "Spot asset to denominate the high-water mark in. Omit (or null) for the feed-less USD default; set it to charge performance fees only on outperformance measured against that asset.",
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Address"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "cooldown_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "deposit_spot_asset": {
/// "$ref": "#/definitions/Address"
/// },
/// "initial_deposit": {
/// "description": "Initial deposit in the vault's deposit asset, as a USD decimal string (e.g. `\"15000\"`).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "initial_share_price_usd": {
/// "description": "Initial share price the vault is seeded at, in USD, as a decimal string (e.g. `\"1\"` or `\"100\"`). Must lie within the protocol's permitted range.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "management_fee_bps": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "manager_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "max_fee_usd": {
/// "description": "Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "max_slippage_bps": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "performance_fee_bps": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateVaultRequest {
///Spot asset to denominate the high-water mark in. Omit (or null) for the feed-less USD default; set it to charge performance fees only on outperformance measured against that asset.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub benchmark_asset: ::std::option::Option<Address>,
pub cooldown_sec: u64,
pub deposit_spot_asset: Address,
///Initial deposit in the vault's deposit asset, as a USD decimal string (e.g. `"15000"`).
pub initial_deposit: ::bigdecimal::BigDecimal,
///Initial share price the vault is seeded at, in USD, as a decimal string (e.g. `"1"` or `"100"`). Must lie within the protocol's permitted range.
pub initial_share_price_usd: ::bigdecimal::BigDecimal,
pub management_fee_bps: u64,
pub manager_id: u64,
///Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`).
pub max_fee_usd: ::bigdecimal::BigDecimal,
pub max_slippage_bps: u64,
pub nonce: u64,
pub performance_fee_bps: u64,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
}
impl CreateVaultRequest {
pub fn builder() -> builder::CreateVaultRequest {
Default::default()
}
}
///A currency's spot price and its assets grouped by type. Managers risking the currency are listed per universe under `managers`; asset-level risk — OI, lending, and discounts — lives under each asset's `universes`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A currency's spot price and its assets grouped by type. Managers risking the currency are listed per universe under `managers`; asset-level risk — OI, lending, and discounts — lives under each asset's `universes`.",
/// "type": "object",
/// "required": [
/// "currency",
/// "managers",
/// "market_type",
/// "spot",
/// "spot_price"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "managers": {
/// "description": "Managers risk-pricing this currency, one entry per universe where at least one manager covers it.",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/UniverseManagers"
/// }
/// },
/// "market_type": {
/// "description": "Which instrument/collateral classes the currency is enabled for.",
/// "$ref": "#/definitions/MarketType"
/// },
/// "option": {
/// "description": "The option asset for this currency, if one is registered.",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AssetEntry"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "perp": {
/// "description": "The perp asset for this currency, if one is registered.",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AssetEntry"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "spot": {
/// "description": "Every spot asset registered to this currency (e.g. lending \"USDC\" and non-lending \"USDC-NL\").",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/SpotAssetEntry"
/// }
/// },
/// "spot_price": {
/// "type": "string"
/// },
/// "spot_price_24h": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Currency {
pub currency: ::std::string::String,
///Managers risk-pricing this currency, one entry per universe where at least one manager covers it.
pub managers: ::std::vec::Vec<UniverseManagers>,
///Which instrument/collateral classes the currency is enabled for.
pub market_type: MarketType,
///The option asset for this currency, if one is registered.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub option: ::std::option::Option<AssetEntry>,
///The perp asset for this currency, if one is registered.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub perp: ::std::option::Option<AssetEntry>,
///Every spot asset registered to this currency (e.g. lending "USDC" and non-lending "USDC-NL").
pub spot: ::std::vec::Vec<SpotAssetEntry>,
pub spot_price: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub spot_price_24h: ::std::option::Option<::std::string::String>,
}
impl Currency {
pub fn builder() -> builder::Currency {
Default::default()
}
}
///`DailyTradingStatistics`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "c",
/// "h",
/// "l",
/// "n",
/// "oi",
/// "p",
/// "pr",
/// "v"
/// ],
/// "properties": {
/// "c": {
/// "description": "Number of contracts traded during last 24 hours",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "h": {
/// "description": "Highest trade price during last 24h",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "l": {
/// "description": "Lowest trade price during last 24h",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "n": {
/// "description": "Number of trades during last 24h",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "oi": {
/// "description": "Current total open interest",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "p": {
/// "description": "Options: 24hr percent change in premium; Perps: 24hr percent change in mark price",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "pr": {
/// "description": "Premium volume traded during last 24 hours",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "v": {
/// "description": "Notional volume traded during last 24 hours",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DailyTradingStatistics {
///Number of contracts traded during last 24 hours
pub c: ::bigdecimal::BigDecimal,
///Highest trade price during last 24h
pub h: ::bigdecimal::BigDecimal,
///Lowest trade price during last 24h
pub l: ::bigdecimal::BigDecimal,
///Number of trades during last 24h
pub n: u64,
///Current total open interest
pub oi: ::bigdecimal::BigDecimal,
///Options: 24hr percent change in premium; Perps: 24hr percent change in mark price
pub p: ::bigdecimal::BigDecimal,
///Premium volume traded during last 24 hours
pub pr: ::bigdecimal::BigDecimal,
///Notional volume traded during last 24 hours
pub v: ::bigdecimal::BigDecimal,
}
impl DailyTradingStatistics {
pub fn builder() -> builder::DailyTradingStatistics {
Default::default()
}
}
///`amount` and `fee` are decimal strings (e.g. `"1.1"`); the net credited amount is `amount - fee`. `operation_id`/`batch_uuid` are stable uuids.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`amount` and `fee` are decimal strings (e.g. `\"1.1\"`); the net credited amount is `amount - fee`. `operation_id`/`batch_uuid` are stable uuids.",
/// "type": "object",
/// "required": [
/// "amount",
/// "asset",
/// "batch_status",
/// "batch_uuid",
/// "fee",
/// "new_subaccount",
/// "operation_id",
/// "subaccount_id",
/// "timestamp",
/// "wallet"
/// ],
/// "properties": {
/// "action_id": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "asset": {
/// "type": "string"
/// },
/// "batch_status": {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// "batch_uuid": {
/// "type": "string"
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "new_subaccount": {
/// "type": "boolean"
/// },
/// "operation_id": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DepositEntry {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub action_id: ::std::option::Option<u64>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
pub asset: ::std::string::String,
pub batch_status: BatchStatus,
pub batch_uuid: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
pub new_subaccount: bool,
pub operation_id: ::std::string::String,
pub subaccount_id: u64,
pub timestamp: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
pub wallet: ::std::string::String,
}
impl DepositEntry {
pub fn builder() -> builder::DepositEntry {
Default::default()
}
}
///`DepositHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "deposits"
/// ],
/// "properties": {
/// "deposits": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/DepositEntry"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DepositHistoryResult {
pub deposits: ::std::vec::Vec<DepositEntry>,
}
impl DepositHistoryResult {
pub fn builder() -> builder::DepositHistoryResult {
Default::default()
}
}
///How a deposit reached the protocol. `Standard` and `Instant` are the two CEX deposit-address flows: `Standard` (formerly `slow`) credits the depositor's own subaccount on-chain via its factory; `Instant` (formerly `fast`) pools every deposit and credits the owner off-chain from the factory's `DepositProcessed` events. `Direct` is a plain wallet deposit straight into a subaccount — no escrow, no factory. Only `Standard`/`Instant` are factory-routed (and registerable / sweepable); `Direct` is a read-only provenance tag.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How a deposit reached the protocol. `Standard` and `Instant` are the two CEX deposit-address flows: `Standard` (formerly `slow`) credits the depositor's own subaccount on-chain via its factory; `Instant` (formerly `fast`) pools every deposit and credits the owner off-chain from the factory's `DepositProcessed` events. `Direct` is a plain wallet deposit straight into a subaccount — no escrow, no factory. Only `Standard`/`Instant` are factory-routed (and registerable / sweepable); `Direct` is a read-only provenance tag.",
/// "type": "string",
/// "enum": [
/// "standard",
/// "instant",
/// "direct"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum DepositType {
#[serde(rename = "standard")]
Standard,
#[serde(rename = "instant")]
Instant,
#[serde(rename = "direct")]
Direct,
}
impl ::std::fmt::Display for DepositType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Standard => f.write_str("standard"),
Self::Instant => f.write_str("instant"),
Self::Direct => f.write_str("direct"),
}
}
}
impl ::std::str::FromStr for DepositType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"standard" => Ok(Self::Standard),
"instant" => Ok(Self::Instant),
"direct" => Ok(Self::Direct),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for DepositType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DepositType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DepositType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`Direction`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "buy",
/// "sell"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum Direction {
#[serde(rename = "buy")]
Buy,
#[serde(rename = "sell")]
Sell,
}
impl ::std::fmt::Display for Direction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Buy => f.write_str("buy"),
Self::Sell => f.write_str("sell"),
}
}
}
impl ::std::str::FromStr for Direction {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"buy" => Ok(Self::Buy),
"sell" => Ok(Self::Sell),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for Direction {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for Direction {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for Direction {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`EditSessionKeyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "public_session_key",
/// "wallet"
/// ],
/// "properties": {
/// "ip_whitelist": {
/// "default": null,
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "offchain_scopes": {
/// "default": null,
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "public_session_key": {
/// "type": "string"
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EditSessionKeyRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ip_whitelist: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offchain_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub public_session_key: ::std::string::String,
pub wallet: ::std::string::String,
}
impl EditSessionKeyRequest {
pub fn builder() -> builder::EditSessionKeyRequest {
Default::default()
}
}
///This method takes no parameters; send an empty object `{}`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "This method takes no parameters; send an empty object `{}`.",
/// "type": "null"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct EmptyRequest(pub ());
impl ::std::ops::Deref for EmptyRequest {
type Target = ();
fn deref(&self) -> &() {
&self.0
}
}
impl ::std::convert::From<EmptyRequest> for () {
fn from(value: EmptyRequest) -> Self {
value.0
}
}
impl ::std::convert::From<()> for EmptyRequest {
fn from(value: ()) -> Self {
Self(value)
}
}
///`Erc20Details`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "decimals"
/// ],
/// "properties": {
/// "decimals": {
/// "type": "integer",
/// "format": "uint8",
/// "minimum": 0.0
/// },
/// "underlying_erc20": {
/// "description": "On-chain ERC20 token deposited into the spot asset (informational).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Erc20Details {
pub decimals: u8,
///On-chain ERC20 token deposited into the spot asset (informational).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub underlying_erc20: ::std::option::Option<::std::string::String>,
}
impl Erc20Details {
pub fn builder() -> builder::Erc20Details {
Default::default()
}
}
///`ExecuteQuoteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "quote_id",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "enable_taker_protection": {
/// "default": false,
/// "type": "boolean"
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "referral_code": {
/// "default": "",
/// "type": "string"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExecuteQuoteRequest {
#[serde(default)]
pub client: ::std::string::String,
pub direction: Direction,
#[serde(default)]
pub enable_taker_protection: bool,
#[serde(default)]
pub label: ::std::string::String,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub nonce: i64,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
#[serde(default)]
pub referral_code: ::std::string::String,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: u64,
}
impl ExecuteQuoteRequest {
pub fn builder() -> builder::ExecuteQuoteRequest {
Default::default()
}
}
///One settled expiry and its settlement price.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One settled expiry and its settlement price.",
/// "type": "object",
/// "required": [
/// "expiry_date",
/// "utc_expiry_sec"
/// ],
/// "properties": {
/// "expiry_date": {
/// "description": "Expiry date in `YYYYMMDD` format.",
/// "type": "string"
/// },
/// "price": {
/// "description": "Settlement price. Only settled expiries are returned, so never null.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "utc_expiry_sec": {
/// "description": "UTC timestamp of expiry, unix seconds.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExpirySettlementPrice {
///Expiry date in `YYYYMMDD` format.
pub expiry_date: ::std::string::String,
///Settlement price. Only settled expiries are returned, so never null.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub price: ::std::option::Option<::std::string::String>,
///UTC timestamp of expiry, unix seconds.
pub utc_expiry_sec: u64,
}
impl ExpirySettlementPrice {
pub fn builder() -> builder::ExpirySettlementPrice {
Default::default()
}
}
///`ForceBurnRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "holder",
/// "subaccount_id"
/// ],
/// "properties": {
/// "holder": {
/// "description": "The shareholder being exited.",
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The vault's subaccount ID.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ForceBurnRequest {
///The shareholder being exited.
pub holder: Address,
///The vault's subaccount ID.
pub subaccount_id: u64,
}
impl ForceBurnRequest {
pub fn builder() -> builder::ForceBurnRequest {
Default::default()
}
}
///`ForwardFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "expiry",
/// "fwd_diff",
/// "signatures",
/// "spot_aggregate_latest",
/// "spot_aggregate_start",
/// "timestamp"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "expiry": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "fwd_diff": {
/// "type": "string"
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "spot_aggregate_latest": {
/// "type": "string"
/// },
/// "spot_aggregate_start": {
/// "type": "string"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ForwardFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
pub expiry: u64,
pub fwd_diff: ::std::string::String,
pub signatures: OracleSignatureDataResponse,
pub spot_aggregate_latest: ::std::string::String,
pub spot_aggregate_start: ::std::string::String,
pub timestamp: u64,
}
impl ForwardFeedDataResponse {
pub fn builder() -> builder::ForwardFeedDataResponse {
Default::default()
}
}
///`FundingFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "funding_rate",
/// "signatures",
/// "timestamp"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "funding_rate": {
/// "description": "Per-hour funding rate as a decimal string.",
/// "type": "string"
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct FundingFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
///Per-hour funding rate as a decimal string.
pub funding_rate: ::std::string::String,
pub signatures: OracleSignatureDataResponse,
pub timestamp: u64,
}
impl FundingFeedDataResponse {
pub fn builder() -> builder::FundingFeedDataResponse {
Default::default()
}
}
///Single funding-rate OHLC candle. `funding_rate` mirrors `close` for backward compatibility with the pre-OHLC response shape; `timestamp` is the bucket start in UTC milliseconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Single funding-rate OHLC candle. `funding_rate` mirrors `close` for backward compatibility with the pre-OHLC response shape; `timestamp` is the bucket start in UTC milliseconds.",
/// "type": "object",
/// "required": [
/// "close",
/// "currency",
/// "funding_rate",
/// "high",
/// "low",
/// "open",
/// "risk_universe_id",
/// "timestamp"
/// ],
/// "properties": {
/// "close": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "funding_rate": {
/// "type": "string"
/// },
/// "high": {
/// "type": "string"
/// },
/// "low": {
/// "type": "string"
/// },
/// "open": {
/// "type": "string"
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct FundingRateCandle {
pub close: ::std::string::String,
pub currency: ::std::string::String,
pub funding_rate: ::std::string::String,
pub high: ::std::string::String,
pub low: ::std::string::String,
pub open: ::std::string::String,
pub risk_universe_id: u32,
pub timestamp: i64,
}
impl FundingRateCandle {
pub fn builder() -> builder::FundingRateCandle {
Default::default()
}
}
///Response shape for `public/get_funding_rate_history`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response shape for `public/get_funding_rate_history`.",
/// "type": "object",
/// "required": [
/// "funding_rate_history"
/// ],
/// "properties": {
/// "funding_rate_history": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/FundingRateCandle"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct FundingRateHistoryResult {
pub funding_rate_history: ::std::vec::Vec<FundingRateCandle>,
}
impl FundingRateHistoryResult {
pub fn builder() -> builder::FundingRateHistoryResult {
Default::default()
}
}
///`GetAccountRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAccountRequest {
pub wallet: Address,
}
impl GetAccountRequest {
pub fn builder() -> builder::GetAccountRequest {
Default::default()
}
}
///`GetAlgoOrdersRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAlgoOrdersRequest {
pub subaccount_id: i64,
}
impl GetAlgoOrdersRequest {
pub fn builder() -> builder::GetAlgoOrdersRequest {
Default::default()
}
}
///`GetAllInstrumentsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expired",
/// "instrument_type"
/// ],
/// "properties": {
/// "currency": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expired": {
/// "type": "boolean"
/// },
/// "instrument_type": {
/// "$ref": "#/definitions/AssetType"
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "risk_universe_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAllInstrumentsRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
pub expired: bool,
pub instrument_type: AssetType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub risk_universe_id: ::std::option::Option<u32>,
}
impl GetAllInstrumentsRequest {
pub fn builder() -> builder::GetAllInstrumentsRequest {
Default::default()
}
}
///`GetAllInstrumentsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instruments",
/// "pagination"
/// ],
/// "properties": {
/// "instruments": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Instrument"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAllInstrumentsResponse {
pub instruments: ::std::vec::Vec<Instrument>,
pub pagination: Pagination,
}
impl GetAllInstrumentsResponse {
pub fn builder() -> builder::GetAllInstrumentsResponse {
Default::default()
}
}
///`GetAllPortfoliosRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAllPortfoliosRequest {
pub wallet: Address,
}
impl GetAllPortfoliosRequest {
pub fn builder() -> builder::GetAllPortfoliosRequest {
Default::default()
}
}
///`GetAllReferralCodesParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct GetAllReferralCodesParams(
pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
);
impl ::std::ops::Deref for GetAllReferralCodesParams {
type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<GetAllReferralCodesParams>
for ::serde_json::Map<::std::string::String, ::serde_json::Value> {
fn from(value: GetAllReferralCodesParams) -> Self {
value.0
}
}
impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
for GetAllReferralCodesParams {
fn from(
value: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
) -> Self {
Self(value)
}
}
///`GetAssetsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "asset_type",
/// "currency",
/// "expired"
/// ],
/// "properties": {
/// "asset_type": {
/// "$ref": "#/definitions/AssetType"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "expired": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAssetsRequest {
pub asset_type: AssetType,
pub currency: ::std::string::String,
pub expired: bool,
}
impl GetAssetsRequest {
pub fn builder() -> builder::GetAssetsRequest {
Default::default()
}
}
///`GetCollateralsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetCollateralsRequest {
pub subaccount_id: u64,
}
impl GetCollateralsRequest {
pub fn builder() -> builder::GetCollateralsRequest {
Default::default()
}
}
///`GetCuratedVaultsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "description": "The curator wallet (0x hex).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetCuratedVaultsRequest {
///The curator wallet (0x hex).
pub wallet: ::std::string::String,
}
impl GetCuratedVaultsRequest {
pub fn builder() -> builder::GetCuratedVaultsRequest {
Default::default()
}
}
///`GetCurrencyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "currency"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetCurrencyRequest {
pub currency: ::std::string::String,
}
impl GetCurrencyRequest {
pub fn builder() -> builder::GetCurrencyRequest {
Default::default()
}
}
///Parameters for `private/get_deposit_history`. Takes `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's deposits. Results are capped at 1000 rows.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_deposit_history`. Takes `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's deposits. Results are capped at 1000 rows.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "description": "End of the window, unix milliseconds (default: unbounded / now).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "description": "Start of the window, unix milliseconds (default 0).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetDepositHistoryRequest {
///End of the window, unix milliseconds (default: unbounded / now).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Start of the window, unix milliseconds (default 0).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetDepositHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetDepositHistoryRequest {
pub fn builder() -> builder::GetDepositHistoryRequest {
Default::default()
}
}
///Parameters for `private/get_erc20_transfer_history`. Matches `get_withdrawal_history`: `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's transfers. Results are capped at 1000 rows.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_erc20_transfer_history`. Matches `get_withdrawal_history`: `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's transfers. Results are capped at 1000 rows.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "description": "End of the window, unix milliseconds (default: unbounded / now).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "description": "Start of the window, unix milliseconds (default 0).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetErc20TransferHistoryRequest {
///End of the window, unix milliseconds (default: unbounded / now).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Start of the window, unix milliseconds (default 0).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetErc20TransferHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetErc20TransferHistoryRequest {
pub fn builder() -> builder::GetErc20TransferHistoryRequest {
Default::default()
}
}
/**Parameters for `private/get_funding_history`.
`subaccount_id`, `start_timestamp`, and `end_timestamp` accept either a JSON number or a string-encoded integer. Pagination is `page` >= 1, `page_size` in 1..=1000.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_funding_history`.\n\n`subaccount_id`, `start_timestamp`, and `end_timestamp` accept either a JSON number or a string-encoded integer. Pagination is `page` >= 1, `page_size` in 1..=1000.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "instrument_name": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetFundingHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instrument_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetFundingHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
instrument_name: Default::default(),
page: Default::default(),
page_size: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetFundingHistoryRequest {
pub fn builder() -> builder::GetFundingHistoryRequest {
Default::default()
}
}
///Parameters for `public/get_funding_rate_history`. Timestamp fields accept either a JSON number or a string-encoded integer, and are UTC milliseconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_funding_rate_history`. Timestamp fields accept either a JSON number or a string-encoded integer, and are UTC milliseconds.",
/// "type": "object",
/// "required": [
/// "instrument_name"
/// ],
/// "properties": {
/// "end_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "period": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "start_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetFundingRateHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<i64>,
pub instrument_name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub period: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<i64>,
}
impl GetFundingRateHistoryRequest {
pub fn builder() -> builder::GetFundingRateHistoryRequest {
Default::default()
}
}
///Parameters for `public/get_index_chart_data`. Numeric fields accept either a JSON number or a string-encoded integer. Timestamps are UTC seconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_index_chart_data`. Numeric fields accept either a JSON number or a string-encoded integer. Timestamps are UTC seconds.",
/// "type": "object",
/// "required": [
/// "currency",
/// "end_timestamp",
/// "period",
/// "start_timestamp"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "end_timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "period": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetIndexChartDataRequest {
pub currency: ::std::string::String,
pub end_timestamp: u64,
pub period: u64,
pub start_timestamp: u64,
}
impl GetIndexChartDataRequest {
pub fn builder() -> builder::GetIndexChartDataRequest {
Default::default()
}
}
///`GetInstrumentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instrument_name"
/// ],
/// "properties": {
/// "instrument_name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetInstrumentRequest {
pub instrument_name: ::std::string::String,
}
impl GetInstrumentRequest {
pub fn builder() -> builder::GetInstrumentRequest {
Default::default()
}
}
///Parameters for `private/get_interest_history`. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's settlements. `[start_timestamp, end_timestamp]` is a unix-millisecond window. Results are capped at 1000 rows, newest first.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_interest_history`. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's settlements. `[start_timestamp, end_timestamp]` is a unix-millisecond window. Results are capped at 1000 rows, newest first.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "description": "End of the window, unix milliseconds (default: now / unbounded).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "description": "Start of the window, unix milliseconds (default 0).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetInterestHistoryRequest {
///End of the window, unix milliseconds (default: now / unbounded).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Start of the window, unix milliseconds (default 0).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetInterestHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetInterestHistoryRequest {
pub fn builder() -> builder::GetInterestHistoryRequest {
Default::default()
}
}
///Parameters for `public/get_interest_rate_history`. Timestamp fields accept either a JSON number or a string-encoded integer, and are UTC milliseconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_interest_rate_history`. Timestamp fields accept either a JSON number or a string-encoded integer, and are UTC milliseconds.",
/// "type": "object",
/// "required": [
/// "currency"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "end_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "period": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "risk_universe_id": {
/// "description": "Restrict to one risk universe's pool. Omit to return every universe's candles for the currency (each candle is tagged with its universe).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetInterestRateHistoryRequest {
pub currency: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub period: ::std::option::Option<i64>,
///Restrict to one risk universe's pool. Omit to return every universe's candles for the currency (each candle is tagged with its universe).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub risk_universe_id: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<i64>,
}
impl GetInterestRateHistoryRequest {
pub fn builder() -> builder::GetInterestRateHistoryRequest {
Default::default()
}
}
///`GetLatestSignedFeedsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "currency": {
/// "description": "Currency filter, (defaults to all currencies)",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expiry": {
/// "description": "Expiry filter for options and forward data (defaults to all expiries). Use `0` to get data only for spot and perpetuals.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLatestSignedFeedsRequest {
///Currency filter, (defaults to all currencies)
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
///Expiry filter for options and forward data (defaults to all expiries). Use `0` to get data only for spot and perpetuals.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expiry: ::std::option::Option<u64>,
}
impl ::std::default::Default for GetLatestSignedFeedsRequest {
fn default() -> Self {
Self {
currency: Default::default(),
expiry: Default::default(),
}
}
}
impl GetLatestSignedFeedsRequest {
pub fn builder() -> builder::GetLatestSignedFeedsRequest {
Default::default()
}
}
///`GetLatestSignedFeedsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "funding_data",
/// "fwd_data",
/// "perp_data",
/// "rate_data",
/// "spot_data",
/// "vol_data"
/// ],
/// "properties": {
/// "funding_data": {
/// "description": "currency -> latest funding-rate feed data",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/FundingFeedDataResponse"
/// }
/// },
/// "fwd_data": {
/// "description": "currency -> expiry -> latest forward feed data",
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/ForwardFeedDataResponse"
/// }
/// }
/// },
/// "perp_data": {
/// "description": "currency -> feed type -> latest perp feed data",
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/PerpFeedDataResponse"
/// }
/// }
/// },
/// "rate_data": {
/// "description": "currency -> expiry -> latest rate feed data",
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/RateFeedDataResponse"
/// }
/// }
/// },
/// "spot_data": {
/// "description": "currency -> latest spot feed data",
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/SpotFeedDataResponse"
/// }
/// },
/// "vol_data": {
/// "description": "currency -> expiry -> latest vol feed data",
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/VolFeedDataResponse"
/// }
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLatestSignedFeedsResponse {
///currency -> latest funding-rate feed data
pub funding_data: ::std::collections::HashMap<
::std::string::String,
FundingFeedDataResponse,
>,
///currency -> expiry -> latest forward feed data
pub fwd_data: ::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<::std::string::String, ForwardFeedDataResponse>,
>,
///currency -> feed type -> latest perp feed data
pub perp_data: ::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<::std::string::String, PerpFeedDataResponse>,
>,
///currency -> expiry -> latest rate feed data
pub rate_data: ::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<::std::string::String, RateFeedDataResponse>,
>,
///currency -> latest spot feed data
pub spot_data: ::std::collections::HashMap<
::std::string::String,
SpotFeedDataResponse,
>,
///currency -> expiry -> latest vol feed data
pub vol_data: ::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<::std::string::String, VolFeedDataResponse>,
>,
}
impl GetLatestSignedFeedsResponse {
pub fn builder() -> builder::GetLatestSignedFeedsResponse {
Default::default()
}
}
///Parameters for `public/get_liquidation_history`. Omit `subaccount_id` to span every account. `[start_timestamp, end_timestamp]` is a unix-millisecond window over the auction *start*.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_liquidation_history`. Omit `subaccount_id` to span every account. `[start_timestamp, end_timestamp]` is a unix-millisecond window over the auction *start*.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "description": "End of the window, unix milliseconds (default: unbounded).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page": {
/// "description": "Page number, 1-based (default 1).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "description": "Results per page (default 100, max 1000).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "description": "Start of the window, unix milliseconds (default 0).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLiquidationHistoryRequest {
///End of the window, unix milliseconds (default: unbounded).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Page number, 1-based (default 1).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
///Results per page (default 100, max 1000).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
///Start of the window, unix milliseconds (default 0).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<u64>,
}
impl ::std::default::Default for GetLiquidationHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
page: Default::default(),
page_size: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
}
}
}
impl GetLiquidationHistoryRequest {
pub fn builder() -> builder::GetLiquidationHistoryRequest {
Default::default()
}
}
///`GetLiveBurnRequestsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "limit",
/// "subaccount_id"
/// ],
/// "properties": {
/// "limit": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLiveBurnRequestsRequest {
pub limit: u64,
pub subaccount_id: u64,
}
impl GetLiveBurnRequestsRequest {
pub fn builder() -> builder::GetLiveBurnRequestsRequest {
Default::default()
}
}
///`GetLiveMintRequestsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "limit",
/// "subaccount_id"
/// ],
/// "properties": {
/// "limit": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLiveMintRequestsRequest {
pub limit: u64,
pub subaccount_id: u64,
}
impl GetLiveMintRequestsRequest {
pub fn builder() -> builder::GetLiveMintRequestsRequest {
Default::default()
}
}
///`GetLiveVaultRequestsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "description": "The shareholder wallet (0x hex).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetLiveVaultRequestsRequest {
///The shareholder wallet (0x hex).
pub wallet: ::std::string::String,
}
impl GetLiveVaultRequestsRequest {
pub fn builder() -> builder::GetLiveVaultRequestsRequest {
Default::default()
}
}
///`GetOnchainActionHistoryParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "action_type": {
/// "description": "On-chain `actionType` id.",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "end_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "description": "L1 sender of the action (any hex casing).",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOnchainActionHistoryParams {
///On-chain `actionType` id.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub action_type: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<i64>,
///L1 sender of the action (any hex casing).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetOnchainActionHistoryParams {
fn default() -> Self {
Self {
action_type: Default::default(),
end_timestamp: Default::default(),
page: Default::default(),
page_size: Default::default(),
start_timestamp: Default::default(),
wallet: Default::default(),
}
}
}
impl GetOnchainActionHistoryParams {
pub fn builder() -> builder::GetOnchainActionHistoryParams {
Default::default()
}
}
///`GetOnchainActionHistoryResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "actions",
/// "pagination"
/// ],
/// "properties": {
/// "actions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/OnchainActionHistoryEntry"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOnchainActionHistoryResponse {
pub actions: ::std::vec::Vec<OnchainActionHistoryEntry>,
pub pagination: Pagination,
}
impl GetOnchainActionHistoryResponse {
pub fn builder() -> builder::GetOnchainActionHistoryResponse {
Default::default()
}
}
///`GetOpenOrdersRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOpenOrdersRequest {
pub subaccount_id: i64,
}
impl GetOpenOrdersRequest {
pub fn builder() -> builder::GetOpenOrdersRequest {
Default::default()
}
}
///Parameters for `private/get_option_settlement_history`. One of `wallet` or `subaccount_id` must be provided; `wallet` returns every subaccount's settlements.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_option_settlement_history`. One of `wallet` or `subaccount_id` must be provided; `wallet` returns every subaccount's settlements.",
/// "type": "object",
/// "properties": {
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOptionSettlementHistoryParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetOptionSettlementHistoryParams {
fn default() -> Self {
Self {
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetOptionSettlementHistoryParams {
pub fn builder() -> builder::GetOptionSettlementHistoryParams {
Default::default()
}
}
///Parameters for `public/get_option_settlement_prices`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_option_settlement_prices`.",
/// "type": "object",
/// "required": [
/// "currency"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOptionSettlementPricesRequest {
pub currency: ::std::string::String,
}
impl GetOptionSettlementPricesRequest {
pub fn builder() -> builder::GetOptionSettlementPricesRequest {
Default::default()
}
}
///`GetOrderHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "from_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOrderHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub from_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub to_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetOrderHistoryRequest {
fn default() -> Self {
Self {
from_timestamp: Default::default(),
page: Default::default(),
page_size: Default::default(),
subaccount_id: Default::default(),
to_timestamp: Default::default(),
wallet: Default::default(),
}
}
}
impl GetOrderHistoryRequest {
pub fn builder() -> builder::GetOrderHistoryRequest {
Default::default()
}
}
///`GetOrderRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "order_id",
/// "subaccount_id"
/// ],
/// "properties": {
/// "order_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetOrderRequest {
///UUID v4 string
pub order_id: ::uuid::Uuid,
pub subaccount_id: i64,
}
impl GetOrderRequest {
pub fn builder() -> builder::GetOrderRequest {
Default::default()
}
}
///`GetPendingDepositsParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "description": "Wallet the pending deposits credit.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPendingDepositsParams {
///Wallet the pending deposits credit.
pub wallet: ::std::string::String,
}
impl GetPendingDepositsParams {
pub fn builder() -> builder::GetPendingDepositsParams {
Default::default()
}
}
///`GetPendingDepositsResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pending_deposits",
/// "wallet"
/// ],
/// "properties": {
/// "pending_deposits": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PendingDepositEntry"
/// }
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPendingDepositsResult {
pub pending_deposits: ::std::vec::Vec<PendingDepositEntry>,
pub wallet: ::std::string::String,
}
impl GetPendingDepositsResult {
pub fn builder() -> builder::GetPendingDepositsResult {
Default::default()
}
}
///`GetPositionsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPositionsRequest {
pub subaccount_id: u64,
}
impl GetPositionsRequest {
pub fn builder() -> builder::GetPositionsRequest {
Default::default()
}
}
///`GetPublicTradeHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "batch_status": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "currency": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "from_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "instrument_name": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "instrument_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AssetType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "trade_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetPublicTradeHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub from_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instrument_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instrument_type: ::std::option::Option<AssetType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub to_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trade_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetPublicTradeHistoryRequest {
fn default() -> Self {
Self {
batch_status: Default::default(),
currency: Default::default(),
from_timestamp: Default::default(),
instrument_name: Default::default(),
instrument_type: Default::default(),
page: Default::default(),
page_size: Default::default(),
subaccount_id: Default::default(),
to_timestamp: Default::default(),
trade_id: Default::default(),
}
}
}
impl GetPublicTradeHistoryRequest {
pub fn builder() -> builder::GetPublicTradeHistoryRequest {
Default::default()
}
}
///`GetQuotesRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "from_timestamp": {
/// "default": 0,
/// "type": "integer",
/// "format": "int64"
/// },
/// "page": {
/// "default": 1,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": 20,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "quote_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "rfq_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": 9223372036854775807,
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetQuotesRequest {
#[serde(default)]
pub from_timestamp: i64,
#[serde(default = "defaults::default_u64::<u64, 1>")]
pub page: u64,
#[serde(default = "defaults::default_u64::<u64, 20>")]
pub page_size: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
pub subaccount_id: i64,
#[serde(default = "defaults::default_u64::<i64, 9223372036854775807>")]
pub to_timestamp: i64,
}
impl GetQuotesRequest {
pub fn builder() -> builder::GetQuotesRequest {
Default::default()
}
}
///`GetReferralPerformanceParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "end_ms",
/// "start_ms"
/// ],
/// "properties": {
/// "end_ms": {
/// "description": "End timestamp in UTC milliseconds.",
/// "type": "integer",
/// "format": "int64"
/// },
/// "referral_code": {
/// "description": "(Optional) referral code.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "start_ms": {
/// "description": "Start timestamp in UTC milliseconds.",
/// "type": "integer",
/// "format": "int64"
/// },
/// "wallet": {
/// "description": "(Optional) wallet of the referrer.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetReferralPerformanceParams {
///End timestamp in UTC milliseconds.
pub end_ms: i64,
///(Optional) referral code.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub referral_code: ::std::option::Option<::std::string::String>,
///Start timestamp in UTC milliseconds.
pub start_ms: i64,
///(Optional) wallet of the referrer.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl GetReferralPerformanceParams {
pub fn builder() -> builder::GetReferralPerformanceParams {
Default::default()
}
}
///`GetReferralPerformanceResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "fee_share_percentage",
/// "referral_code",
/// "rewards",
/// "stdrv_balance",
/// "total_builder_fee_collected",
/// "total_fee_rewards",
/// "total_notional_volume",
/// "total_referred_fees"
/// ],
/// "properties": {
/// "fee_share_percentage": {
/// "type": "string"
/// },
/// "referral_code": {
/// "type": "string"
/// },
/// "rewards": {
/// "description": "Performance by liquidity role / currency / instrument type.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/ReferralPerformanceByInstrumentType"
/// }
/// }
/// }
/// },
/// "stdrv_balance": {
/// "type": "string"
/// },
/// "total_builder_fee_collected": {
/// "type": "string"
/// },
/// "total_fee_rewards": {
/// "type": "string"
/// },
/// "total_notional_volume": {
/// "type": "string"
/// },
/// "total_referred_fees": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetReferralPerformanceResult {
pub fee_share_percentage: ::std::string::String,
pub referral_code: ::std::string::String,
///Performance by liquidity role / currency / instrument type.
pub rewards: ::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
ReferralPerformanceByInstrumentType,
>,
>,
>,
pub stdrv_balance: ::std::string::String,
pub total_builder_fee_collected: ::std::string::String,
pub total_fee_rewards: ::std::string::String,
pub total_notional_volume: ::std::string::String,
pub total_referred_fees: ::std::string::String,
}
impl GetReferralPerformanceResult {
pub fn builder() -> builder::GetReferralPerformanceResult {
Default::default()
}
}
///`GetRfqsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "from_timestamp": {
/// "default": 0,
/// "type": "integer",
/// "format": "int64"
/// },
/// "page": {
/// "default": 1,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": 20,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "rfq_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": 9223372036854775807,
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetRfqsRequest {
#[serde(default)]
pub from_timestamp: i64,
#[serde(default = "defaults::default_u64::<u64, 1>")]
pub page: u64,
#[serde(default = "defaults::default_u64::<u64, 20>")]
pub page_size: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
pub subaccount_id: i64,
#[serde(default = "defaults::default_u64::<i64, 9223372036854775807>")]
pub to_timestamp: i64,
}
impl GetRfqsRequest {
pub fn builder() -> builder::GetRfqsRequest {
Default::default()
}
}
///`GetShareholderVaultsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "description": "The shareholder wallet (0x hex).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetShareholderVaultsRequest {
///The shareholder wallet (0x hex).
pub wallet: ::std::string::String,
}
impl GetShareholderVaultsRequest {
pub fn builder() -> builder::GetShareholderVaultsRequest {
Default::default()
}
}
///`GetSubaccountRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetSubaccountRequest {
pub subaccount_id: u64,
}
impl GetSubaccountRequest {
pub fn builder() -> builder::GetSubaccountRequest {
Default::default()
}
}
///`GetSubaccountsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetSubaccountsRequest {
pub wallet: Address,
}
impl GetSubaccountsRequest {
pub fn builder() -> builder::GetSubaccountsRequest {
Default::default()
}
}
///`GetTickerRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "instrument_name"
/// ],
/// "properties": {
/// "instrument_name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTickerRequest {
pub instrument_name: ::std::string::String,
}
impl GetTickerRequest {
pub fn builder() -> builder::GetTickerRequest {
Default::default()
}
}
///Parameters for `public/get_tickers`. `expiry_date` accepts either a JSON number or a string-encoded 8-digit date (e.g. `20260511`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_tickers`. `expiry_date` accepts either a JSON number or a string-encoded 8-digit date (e.g. `20260511`).",
/// "type": "object",
/// "required": [
/// "instrument_type"
/// ],
/// "properties": {
/// "currency": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expiry_date": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "instrument_type": {
/// "$ref": "#/definitions/AssetType"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTickersRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expiry_date: ::std::option::Option<i64>,
pub instrument_type: AssetType,
}
impl GetTickersRequest {
pub fn builder() -> builder::GetTickersRequest {
Default::default()
}
}
///A map of instrument name to ticker: `{"tickers": {<instrument_name>: <ticker_data>}}`. Each ticker value matches the payload of a `ticker_slim.{instrument_name}.{interval}` subscription update.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A map of instrument name to ticker: `{\"tickers\": {<instrument_name>: <ticker_data>}}`. Each ticker value matches the payload of a `ticker_slim.{instrument_name}.{interval}` subscription update.",
/// "type": "object",
/// "required": [
/// "tickers"
/// ],
/// "properties": {
/// "tickers": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/TickerSlimSnapshot"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTickersResponse {
pub tickers: ::std::collections::HashMap<
::std::string::String,
crate::models::ticker_slim_schema::TickerSlimSchema,
>,
}
impl GetTickersResponse {
pub fn builder() -> builder::GetTickersResponse {
Default::default()
}
}
///`GetTradeHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "from_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "instrument_name": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "order_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "quote_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTradeHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub from_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub instrument_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub order_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub to_timestamp: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetTradeHistoryRequest {
fn default() -> Self {
Self {
from_timestamp: Default::default(),
instrument_name: Default::default(),
order_id: Default::default(),
page: Default::default(),
page_size: Default::default(),
quote_id: Default::default(),
subaccount_id: Default::default(),
to_timestamp: Default::default(),
wallet: Default::default(),
}
}
}
impl GetTradeHistoryRequest {
pub fn builder() -> builder::GetTradeHistoryRequest {
Default::default()
}
}
///Parameters for `public/get_tradingview_chart_data`. Numeric fields accept either a JSON number or a string-encoded integer. Timestamps are UTC seconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/get_tradingview_chart_data`. Numeric fields accept either a JSON number or a string-encoded integer. Timestamps are UTC seconds.",
/// "type": "object",
/// "required": [
/// "end_timestamp",
/// "instrument_name",
/// "period",
/// "start_timestamp"
/// ],
/// "properties": {
/// "end_timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "period": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTradingviewChartDataRequest {
pub end_timestamp: u64,
pub instrument_name: ::std::string::String,
pub period: u64,
pub start_timestamp: u64,
}
impl GetTradingviewChartDataRequest {
pub fn builder() -> builder::GetTradingviewChartDataRequest {
Default::default()
}
}
///`GetTransactionParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTransactionParams {
pub op_uuid: ::std::string::String,
}
impl GetTransactionParams {
pub fn builder() -> builder::GetTransactionParams {
Default::default()
}
}
///`status` is the operation's batch status; `null` until the operation has been picked up for settlement.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`status` is the operation's batch status; `null` until the operation has been picked up for settlement.",
/// "type": "object",
/// "required": [
/// "data"
/// ],
/// "properties": {
/// "data": {
/// "type": "string"
/// },
/// "error_log": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "transaction_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTransactionResult {
pub data: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error_log: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<BatchStatus>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub transaction_hash: ::std::option::Option<::std::string::String>,
}
impl GetTransactionResult {
pub fn builder() -> builder::GetTransactionResult {
Default::default()
}
}
///`GetTriggerOrdersRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetTriggerOrdersRequest {
pub subaccount_id: i64,
}
impl GetTriggerOrdersRequest {
pub fn builder() -> builder::GetTriggerOrdersRequest {
Default::default()
}
}
///`GetVaultActionHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "event_type": {
/// "description": "Optional: \"vault_deposit\" | \"vault_withdraw\" | \"vault_fee_accrual\".",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultActionHistoryRequest {
///Optional: "vault_deposit" | "vault_withdraw" | "vault_fee_accrual".
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_type: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
pub subaccount_id: u64,
}
impl GetVaultActionHistoryRequest {
pub fn builder() -> builder::GetVaultActionHistoryRequest {
Default::default()
}
}
///`GetVaultPerformanceHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "resolution",
/// "subaccount_id"
/// ],
/// "properties": {
/// "from": {
/// "description": "Optional inclusive lower bound (unix seconds).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "limit": {
/// "description": "Max points to return, newest first (default 1000, capped at 10000).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "resolution": {
/// "$ref": "#/definitions/PerformanceResolution"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "to": {
/// "description": "Optional exclusive upper bound (unix seconds).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultPerformanceHistoryRequest {
///Optional inclusive lower bound (unix seconds).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub from: ::std::option::Option<i64>,
///Max points to return, newest first (default 1000, capped at 10000).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<u64>,
pub resolution: PerformanceResolution,
pub subaccount_id: u64,
///Optional exclusive upper bound (unix seconds).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub to: ::std::option::Option<i64>,
}
impl GetVaultPerformanceHistoryRequest {
pub fn builder() -> builder::GetVaultPerformanceHistoryRequest {
Default::default()
}
}
///`GetVaultRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultRequest {
pub subaccount_id: u64,
}
impl GetVaultRequest {
pub fn builder() -> builder::GetVaultRequest {
Default::default()
}
}
///`GetVaultRequestHistoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "page": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "description": "The shareholder wallet (0x hex).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultRequestHistoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub page_size: ::std::option::Option<u32>,
///The shareholder wallet (0x hex).
pub wallet: ::std::string::String,
}
impl GetVaultRequestHistoryRequest {
pub fn builder() -> builder::GetVaultRequestHistoryRequest {
Default::default()
}
}
///`GetVaultSharesRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "description": "The shareholder wallet (0x hex).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultSharesRequest {
///The shareholder wallet (0x hex).
pub wallet: ::std::string::String,
}
impl GetVaultSharesRequest {
pub fn builder() -> builder::GetVaultSharesRequest {
Default::default()
}
}
///`GetVaultsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "page": {
/// "default": 1,
/// "type": "integer",
/// "format": "uint",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": 100,
/// "type": "integer",
/// "format": "uint",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetVaultsRequest {
#[serde(default = "defaults::default_u64::<u32, 1>")]
pub page: u32,
#[serde(default = "defaults::default_u64::<u32, 100>")]
pub page_size: u32,
}
impl ::std::default::Default for GetVaultsRequest {
fn default() -> Self {
Self {
page: defaults::default_u64::<u32, 1>(),
page_size: defaults::default_u64::<u32, 100>(),
}
}
}
impl GetVaultsRequest {
pub fn builder() -> builder::GetVaultsRequest {
Default::default()
}
}
///`GetWalletsFromSessionKeyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "public_session_key"
/// ],
/// "properties": {
/// "public_session_key": {
/// "type": "string"
/// },
/// "scope": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/OffchainKeyScope"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetWalletsFromSessionKeyRequest {
pub public_session_key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scope: ::std::option::Option<OffchainKeyScope>,
}
impl GetWalletsFromSessionKeyRequest {
pub fn builder() -> builder::GetWalletsFromSessionKeyRequest {
Default::default()
}
}
///Parameters for `private/get_withdrawal_history`. Matches `get_deposit_history`: `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's withdrawals. Results are capped at 1000 rows.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `private/get_withdrawal_history`. Matches `get_deposit_history`: `subaccount_id` plus an optional `[start_timestamp, end_timestamp]` window in unix milliseconds. `wallet`, when set, takes precedence over `subaccount_id` and returns the whole wallet's withdrawals. Results are capped at 1000 rows.",
/// "type": "object",
/// "properties": {
/// "end_timestamp": {
/// "description": "End of the window, unix milliseconds (default: unbounded / now).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "start_timestamp": {
/// "description": "Start of the window, unix milliseconds (default 0).",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetWithdrawalHistoryRequest {
///End of the window, unix milliseconds (default: unbounded / now).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub end_timestamp: ::std::option::Option<u64>,
///Start of the window, unix milliseconds (default 0).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub start_timestamp: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for GetWithdrawalHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Default::default(),
start_timestamp: Default::default(),
subaccount_id: Default::default(),
wallet: Default::default(),
}
}
}
impl GetWithdrawalHistoryRequest {
pub fn builder() -> builder::GetWithdrawalHistoryRequest {
Default::default()
}
}
///Single spot OHLC candle in `public/get_index_chart_data`. `price` mirrors the close; `timestamp` and `timestamp_bucket` are the bucket start in UTC seconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Single spot OHLC candle in `public/get_index_chart_data`. `price` mirrors the close; `timestamp` and `timestamp_bucket` are the bucket start in UTC seconds.",
/// "type": "object",
/// "required": [
/// "close_price",
/// "high_price",
/// "low_price",
/// "open_price",
/// "price",
/// "timestamp",
/// "timestamp_bucket"
/// ],
/// "properties": {
/// "close_price": {
/// "type": "string"
/// },
/// "high_price": {
/// "type": "string"
/// },
/// "low_price": {
/// "type": "string"
/// },
/// "open_price": {
/// "type": "string"
/// },
/// "price": {
/// "type": "string"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp_bucket": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IndexCandle {
pub close_price: ::std::string::String,
pub high_price: ::std::string::String,
pub low_price: ::std::string::String,
pub open_price: ::std::string::String,
pub price: ::std::string::String,
pub timestamp: i64,
pub timestamp_bucket: i64,
}
impl IndexCandle {
pub fn builder() -> builder::IndexCandle {
Default::default()
}
}
///`Instrument`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount_step",
/// "base_asset_address",
/// "base_asset_sub_id",
/// "base_currency",
/// "base_fee",
/// "fifo_min_allocation",
/// "instrument_name",
/// "instrument_type",
/// "is_active",
/// "maker_fee_rate",
/// "maximum_amount",
/// "minimum_amount",
/// "pro_rata_amount_step",
/// "pro_rata_fraction",
/// "quote_currency",
/// "scheduled_activation",
/// "scheduled_deactivation",
/// "taker_fee_rate",
/// "tick_size"
/// ],
/// "properties": {
/// "amount_step": {
/// "type": "string"
/// },
/// "base_asset_address": {
/// "description": "The traded asset's contract address — word 0 (`asset`) of the order action `data`. Use this (not `erc20_details`) when signing an order.",
/// "type": "string"
/// },
/// "base_asset_sub_id": {
/// "description": "The traded asset's sub-id — word 1 (`subId`) of the order action `data`. Decimal string; `\"0\"` for perps and spot.",
/// "type": "string"
/// },
/// "base_currency": {
/// "type": "string"
/// },
/// "base_fee": {
/// "type": "string"
/// },
/// "erc20_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/SpotPublicDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "fifo_min_allocation": {
/// "type": "string"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "instrument_type": {
/// "$ref": "#/definitions/AssetType"
/// },
/// "is_active": {
/// "type": "boolean"
/// },
/// "maker_fee_rate": {
/// "type": "string"
/// },
/// "mark_price_fee_rate_cap": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "maximum_amount": {
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "minimum_amount": {
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "option_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/OptionDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "perp_details": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/PerpDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "pro_rata_amount_step": {
/// "type": "string"
/// },
/// "pro_rata_fraction": {
/// "type": "string"
/// },
/// "quote_currency": {
/// "type": "string"
/// },
/// "scheduled_activation": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "scheduled_deactivation": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "taker_fee_rate": {
/// "type": "string"
/// },
/// "tick_size": {
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Instrument {
pub amount_step: ::std::string::String,
///The traded asset's contract address — word 0 (`asset`) of the order action `data`. Use this (not `erc20_details`) when signing an order.
pub base_asset_address: ::std::string::String,
///The traded asset's sub-id — word 1 (`subId`) of the order action `data`. Decimal string; `"0"` for perps and spot.
pub base_asset_sub_id: ::std::string::String,
pub base_currency: ::std::string::String,
pub base_fee: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub erc20_details: ::std::option::Option<SpotPublicDetails>,
pub fifo_min_allocation: ::std::string::String,
pub instrument_name: ::std::string::String,
pub instrument_type: AssetType,
pub is_active: bool,
pub maker_fee_rate: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mark_price_fee_rate_cap: ::std::option::Option<::std::string::String>,
pub maximum_amount: ::bigdecimal::BigDecimal,
pub minimum_amount: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub option_details: ::std::option::Option<OptionDetails>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub perp_details: ::std::option::Option<PerpDetails>,
pub pro_rata_amount_step: ::std::string::String,
pub pro_rata_fraction: ::std::string::String,
pub quote_currency: ::std::string::String,
pub scheduled_activation: i64,
pub scheduled_deactivation: i64,
pub taker_fee_rate: ::std::string::String,
pub tick_size: ::bigdecimal::BigDecimal,
}
impl Instrument {
pub fn builder() -> builder::Instrument {
Default::default()
}
}
///`InterestHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "events"
/// ],
/// "properties": {
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/InterestPayment"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InterestHistoryResult {
pub events: ::std::vec::Vec<InterestPayment>,
}
impl InterestHistoryResult {
pub fn builder() -> builder::InterestHistoryResult {
Default::default()
}
}
///One realized interest settlement. `interest` is a decimal string; negative = paid, positive = received. `timestamp` is unix ms.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One realized interest settlement. `interest` is a decimal string; negative = paid, positive = received. `timestamp` is unix ms.",
/// "type": "object",
/// "required": [
/// "interest",
/// "subaccount_id",
/// "timestamp"
/// ],
/// "properties": {
/// "interest": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InterestPayment {
pub interest: ::std::string::String,
pub subaccount_id: u64,
pub timestamp: i64,
}
impl InterestPayment {
pub fn builder() -> builder::InterestPayment {
Default::default()
}
}
///One interest-rate candle: OHLC of the annualized borrow and supply APY plus the pool totals at the bucket close. `timestamp` is the bucket start in UTC milliseconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One interest-rate candle: OHLC of the annualized borrow and supply APY plus the pool totals at the bucket close. `timestamp` is the bucket start in UTC milliseconds.",
/// "type": "object",
/// "required": [
/// "borrow_apy",
/// "risk_universe_id",
/// "supply_apy",
/// "timestamp",
/// "total_borrow",
/// "total_supply"
/// ],
/// "properties": {
/// "borrow_apy": {
/// "$ref": "#/definitions/Ohlc"
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "supply_apy": {
/// "$ref": "#/definitions/Ohlc"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "total_borrow": {
/// "type": "string"
/// },
/// "total_supply": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InterestRateCandle {
pub borrow_apy: Ohlc,
pub risk_universe_id: u32,
pub supply_apy: Ohlc,
pub timestamp: i64,
pub total_borrow: ::std::string::String,
pub total_supply: ::std::string::String,
}
impl InterestRateCandle {
pub fn builder() -> builder::InterestRateCandle {
Default::default()
}
}
///Response shape for `public/get_interest_rate_history`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response shape for `public/get_interest_rate_history`.",
/// "type": "object",
/// "required": [
/// "interest_rate_history"
/// ],
/// "properties": {
/// "interest_rate_history": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/InterestRateCandle"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InterestRateHistoryResult {
pub interest_rate_history: ::std::vec::Vec<InterestRateCandle>,
}
impl InterestRateHistoryResult {
pub fn builder() -> builder::InterestRateHistoryResult {
Default::default()
}
}
///`JsonRpcId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "anyOf": [
/// {
/// "type": "string"
/// },
/// {
/// "type": "number"
/// },
/// {
/// "type": "null"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum JsonRpcId {
String(::std::string::String),
Number(f64),
Null,
}
impl ::std::convert::From<f64> for JsonRpcId {
fn from(value: f64) -> Self {
Self::Number(value)
}
}
///`LegUnpricedParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "direction",
/// "instrument_name"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "instrument_name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LegUnpricedParams {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
pub direction: Direction,
pub instrument_name: ::std::string::String,
}
impl LegUnpricedParams {
pub fn builder() -> builder::LegUnpricedParams {
Default::default()
}
}
///Lending pool stats for a `(spot_asset, universe)` pair. The pool's total supply is reported in the `current_open_interest` field.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Lending pool stats for a `(spot_asset, universe)` pair. The pool's total supply is reported in the `current_open_interest` field.",
/// "type": "object",
/// "required": [
/// "borrow_apy",
/// "supply_apy",
/// "total_borrow",
/// "total_borrow_cap"
/// ],
/// "properties": {
/// "borrow_apy": {
/// "type": "string"
/// },
/// "supply_apy": {
/// "type": "string"
/// },
/// "total_borrow": {
/// "type": "string"
/// },
/// "total_borrow_cap": {
/// "description": "Borrow ceiling for this lending asset in this universe.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LendingDetails {
pub borrow_apy: ::std::string::String,
pub supply_apy: ::std::string::String,
pub total_borrow: ::std::string::String,
///Borrow ceiling for this lending asset in this universe.
pub total_borrow_cap: ::std::string::String,
}
impl LendingDetails {
pub fn builder() -> builder::LendingDetails {
Default::default()
}
}
///`LiquidationHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "auctions",
/// "pagination"
/// ],
/// "properties": {
/// "auctions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/AuctionHistory"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LiquidationHistoryResult {
pub auctions: ::std::vec::Vec<AuctionHistory>,
pub pagination: Pagination,
}
impl LiquidationHistoryResult {
pub fn builder() -> builder::LiquidationHistoryResult {
Default::default()
}
}
///`LiquidityRole`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "maker",
/// "taker"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum LiquidityRole {
#[serde(rename = "maker")]
Maker,
#[serde(rename = "taker")]
Taker,
}
impl ::std::fmt::Display for LiquidityRole {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Maker => f.write_str("maker"),
Self::Taker => f.write_str("taker"),
}
}
}
impl ::std::str::FromStr for LiquidityRole {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"maker" => Ok(Self::Maker),
"taker" => Ok(Self::Taker),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LiquidityRole {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LiquidityRole {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LiquidityRole {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Login params. The wallet/timestamp/signature fields are typically supplied via headers (`X-Derive*`) for REST and via the JSON body for websocket; all are optional on the wire and validated server-side.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Login params. The wallet/timestamp/signature fields are typically supplied via headers (`X-Derive*`) for REST and via the JSON body for websocket; all are optional on the wire and validated server-side.",
/// "type": "object",
/// "properties": {
/// "signature": {
/// "description": "EIP-191 signature of the `timestamp` string, signed by the wallet or session key.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "timestamp": {
/// "description": "Milliseconds since Unix epoch. Accepted as either a JSON number or a string-encoded integer.",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "description": "Owner of account (not the session key).",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LoginRequest {
///EIP-191 signature of the `timestamp` string, signed by the wallet or session key.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub signature: ::std::option::Option<::std::string::String>,
///Milliseconds since Unix epoch. Accepted as either a JSON number or a string-encoded integer.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timestamp: ::std::option::Option<u64>,
///Owner of account (not the session key).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for LoginRequest {
fn default() -> Self {
Self {
signature: Default::default(),
timestamp: Default::default(),
wallet: Default::default(),
}
}
}
impl LoginRequest {
pub fn builder() -> builder::LoginRequest {
Default::default()
}
}
///A spot asset the manager accepts as collateral, with deposit metadata and the manager's margin discounts for it ("1" = full credit, cash).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A spot asset the manager accepts as collateral, with deposit metadata and the manager's margin discounts for it (\"1\" = full credit, cash).",
/// "type": "object",
/// "required": [
/// "address",
/// "erc20",
/// "im_discount",
/// "min_deposit_usd",
/// "mm_discount",
/// "name"
/// ],
/// "properties": {
/// "address": {
/// "description": "EIP-55 checksummed protocol asset address — the `asset` argument when depositing.",
/// "type": "string"
/// },
/// "erc20": {
/// "$ref": "#/definitions/Erc20Details"
/// },
/// "im_discount": {
/// "description": "Initial-margin credit for the asset under this manager.",
/// "type": "string"
/// },
/// "min_deposit_usd": {
/// "type": "string"
/// },
/// "mm_discount": {
/// "description": "Maintenance-margin credit for the asset under this manager.",
/// "type": "string"
/// },
/// "name": {
/// "description": "Registered asset name (e.g. \"USDC\").",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ManagerCollateral {
///EIP-55 checksummed protocol asset address — the `asset` argument when depositing.
pub address: ::std::string::String,
pub erc20: Erc20Details,
///Initial-margin credit for the asset under this manager.
pub im_discount: ::std::string::String,
pub min_deposit_usd: ::std::string::String,
///Maintenance-margin credit for the asset under this manager.
pub mm_discount: ::std::string::String,
///Registered asset name (e.g. "USDC").
pub name: ::std::string::String,
}
impl ManagerCollateral {
pub fn builder() -> builder::ManagerCollateral {
Default::default()
}
}
///Margin model applied by a manager: `SM` (standard, cross-collateral) or `PM2` (portfolio, scenario-based netting).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Margin model applied by a manager: `SM` (standard, cross-collateral) or `PM2` (portfolio, scenario-based netting).",
/// "type": "string",
/// "enum": [
/// "SM",
/// "PM2"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum MarginType {
#[serde(rename = "SM")]
Sm,
#[serde(rename = "PM2")]
Pm2,
}
impl ::std::fmt::Display for MarginType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Sm => f.write_str("SM"),
Self::Pm2 => f.write_str("PM2"),
}
}
}
impl ::std::str::FromStr for MarginType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"SM" => Ok(Self::Sm),
"PM2" => Ok(Self::Pm2),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for MarginType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for MarginType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for MarginType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`MarginWatchNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/MarginWatchResult"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct MarginWatchNotification(pub MarginWatchResult);
impl ::std::ops::Deref for MarginWatchNotification {
type Target = MarginWatchResult;
fn deref(&self) -> &MarginWatchResult {
&self.0
}
}
impl ::std::convert::From<MarginWatchNotification> for MarginWatchResult {
fn from(value: MarginWatchNotification) -> Self {
value.0
}
}
impl ::std::convert::From<MarginWatchResult> for MarginWatchNotification {
fn from(value: MarginWatchResult) -> Self {
Self(value)
}
}
///Payload for `margin.watch`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for `margin.watch`.",
/// "type": "object",
/// "required": [
/// "collaterals",
/// "currency",
/// "initial_margin",
/// "maintenance_margin",
/// "margin_type",
/// "positions",
/// "subaccount_id",
/// "subaccount_value",
/// "valuation_timestamp"
/// ],
/// "properties": {
/// "collaterals": {
/// "type": "array",
/// "items": true
/// },
/// "currency": {
/// "type": "string"
/// },
/// "initial_margin": {
/// "type": "string"
/// },
/// "maintenance_margin": {
/// "type": "string"
/// },
/// "margin_type": {
/// "type": "string"
/// },
/// "positions": {
/// "type": "array",
/// "items": true
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "subaccount_value": {
/// "type": "string"
/// },
/// "valuation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MarginWatchResult {
pub collaterals: ::std::vec::Vec<::serde_json::Value>,
pub currency: ::std::string::String,
pub initial_margin: ::std::string::String,
pub maintenance_margin: ::std::string::String,
pub margin_type: ::std::string::String,
pub positions: ::std::vec::Vec<::serde_json::Value>,
pub subaccount_id: i64,
pub subaccount_value: ::std::string::String,
pub valuation_timestamp: i64,
}
impl MarginWatchResult {
pub fn builder() -> builder::MarginWatchResult {
Default::default()
}
}
///`MarketType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "ALL",
/// "SRM_BASE_ONLY",
/// "SRM_OPTION_ONLY",
/// "SRM_PERP_ONLY",
/// "CASH"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum MarketType {
#[serde(rename = "ALL")]
All,
#[serde(rename = "SRM_BASE_ONLY")]
SrmBaseOnly,
#[serde(rename = "SRM_OPTION_ONLY")]
SrmOptionOnly,
#[serde(rename = "SRM_PERP_ONLY")]
SrmPerpOnly,
#[serde(rename = "CASH")]
Cash,
}
impl ::std::fmt::Display for MarketType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::All => f.write_str("ALL"),
Self::SrmBaseOnly => f.write_str("SRM_BASE_ONLY"),
Self::SrmOptionOnly => f.write_str("SRM_OPTION_ONLY"),
Self::SrmPerpOnly => f.write_str("SRM_PERP_ONLY"),
Self::Cash => f.write_str("CASH"),
}
}
}
impl ::std::str::FromStr for MarketType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ALL" => Ok(Self::All),
"SRM_BASE_ONLY" => Ok(Self::SrmBaseOnly),
"SRM_OPTION_ONLY" => Ok(Self::SrmOptionOnly),
"SRM_PERP_ONLY" => Ok(Self::SrmPerpOnly),
"CASH" => Ok(Self::Cash),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for MarketType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for MarketType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for MarketType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "deposit_hash",
/// "nonce",
/// "request_id",
/// "share_price",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "deposit_hash": {
/// "description": "0x-prefixed hex of the 32-byte user deposit-action hash.",
/// "type": "string"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "request_id": {
/// "$ref": "#/definitions/VaultRequestId"
/// },
/// "share_price": {
/// "description": "Quoted share price in USD per share, as a decimal string (e.g. `\"1.02\"`).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MintSharesRequest {
///0x-prefixed hex of the 32-byte user deposit-action hash.
pub deposit_hash: ::std::string::String,
pub nonce: u64,
pub request_id: VaultRequestId,
///Quoted share price in USD per share, as a decimal string (e.g. `"1.02"`).
pub share_price: ::bigdecimal::BigDecimal,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
}
impl MintSharesRequest {
pub fn builder() -> builder::MintSharesRequest {
Default::default()
}
}
///`MmpConfigResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "currency",
/// "is_frozen",
/// "mmp_amount_limit",
/// "mmp_delta_limit",
/// "mmp_frozen_time",
/// "mmp_interval",
/// "mmp_unfreeze_time",
/// "subaccount_id"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "is_frozen": {
/// "type": "boolean"
/// },
/// "mmp_amount_limit": {
/// "type": "string"
/// },
/// "mmp_delta_limit": {
/// "type": "string"
/// },
/// "mmp_frozen_time": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "mmp_interval": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "mmp_unfreeze_time": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MmpConfigResult {
pub currency: ::std::string::String,
pub is_frozen: bool,
pub mmp_amount_limit: ::std::string::String,
pub mmp_delta_limit: ::std::string::String,
pub mmp_frozen_time: u64,
pub mmp_interval: u64,
pub mmp_unfreeze_time: i64,
pub subaccount_id: u64,
}
impl MmpConfigResult {
pub fn builder() -> builder::MmpConfigResult {
Default::default()
}
}
///`MmpScopeRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "currency": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MmpScopeRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
pub subaccount_id: u64,
}
impl MmpScopeRequest {
pub fn builder() -> builder::MmpScopeRequest {
Default::default()
}
}
///Returned by `get_live_mint_requests` / `get_live_burn_requests`: a FIFO page plus the queue's total live length (so the caller can paginate).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `get_live_mint_requests` / `get_live_burn_requests`: a FIFO page plus the queue's total live length (so the caller can paginate).",
/// "type": "object",
/// "required": [
/// "requests",
/// "total"
/// ],
/// "properties": {
/// "requests": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultRequestResponse"
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MultipleVaultRequestsResponse {
pub requests: ::std::vec::Vec<VaultRequestResponse>,
pub total: u64,
}
impl MultipleVaultRequestsResponse {
pub fn builder() -> builder::MultipleVaultRequestsResponse {
Default::default()
}
}
///A generic `{ "status": "ok" }` acknowledgement returned by fire-and-forget operations that have no data to return (e.g. updating account settings, MMP config, or the active currency).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A generic `{ \"status\": \"ok\" }` acknowledgement returned by fire-and-forget operations that have no data to return (e.g. updating account settings, MMP config, or the active currency).",
/// "type": "object",
/// "required": [
/// "status"
/// ],
/// "properties": {
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OffchainAckResponse {
pub status: ::std::string::String,
}
impl OffchainAckResponse {
pub fn builder() -> builder::OffchainAckResponse {
Default::default()
}
}
///Additional permission scopes enforced off-chain (not part of the on-chain session-key scopes).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Additional permission scopes enforced off-chain (not part of the on-chain session-key scopes).",
/// "type": "string",
/// "enum": [
/// "account_info"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum OffchainKeyScope {
#[serde(rename = "account_info")]
AccountInfo,
}
impl ::std::fmt::Display for OffchainKeyScope {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::AccountInfo => f.write_str("account_info"),
}
}
}
impl ::std::str::FromStr for OffchainKeyScope {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"account_info" => Ok(Self::AccountInfo),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for OffchainKeyScope {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for OffchainKeyScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for OffchainKeyScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Open, high, low, and close for one series, each a decimal string.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Open, high, low, and close for one series, each a decimal string.",
/// "type": "object",
/// "required": [
/// "close",
/// "high",
/// "low",
/// "open"
/// ],
/// "properties": {
/// "close": {
/// "type": "string"
/// },
/// "high": {
/// "type": "string"
/// },
/// "low": {
/// "type": "string"
/// },
/// "open": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Ohlc {
pub close: ::std::string::String,
pub high: ::std::string::String,
pub low: ::std::string::String,
pub open: ::std::string::String,
}
impl Ohlc {
pub fn builder() -> builder::Ohlc {
Default::default()
}
}
///`OnchainActionHistoryEntry`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "acc",
/// "action_id",
/// "action_type",
/// "action_type_label",
/// "block_number",
/// "data",
/// "l1_sender",
/// "queue",
/// "status",
/// "updated_at"
/// ],
/// "properties": {
/// "acc": {
/// "description": "Rolling accumulator from the ActionQueued event, 0x-hex.",
/// "type": "string"
/// },
/// "action_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "action_type": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "action_type_label": {
/// "type": "string"
/// },
/// "block_number": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "data": {
/// "description": "Raw action calldata, 0x-hex.",
/// "type": "string"
/// },
/// "error_code": {
/// "description": "Most recent submit rejection; null if the action never failed. Kept on applied/fallback rows as the reason the action struggled. The verbose error text stays internal (ClickHouse only).",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "error_message": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "fallback_at": {
/// "description": "Unix ms the action was escalated with `fallback=true`; null if never escalated.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "first_failed_at": {
/// "description": "Unix ms of the first failed submit; null if the action never failed.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "l1_sender": {
/// "type": "string"
/// },
/// "last_failed_at": {
/// "description": "Unix ms of the most recent failed submit; null if never failed.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "op_uuid": {
/// "description": "Operation uuid assigned by the sequencer; null until applied.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "queue": {
/// "description": "Onchain queue: 'public' or 'admin'.",
/// "type": "string"
/// },
/// "status": {
/// "description": "Sequencer applied states: 'applied' | 'applied_with_fallback' Failed States: 'instant_fallback' | 'retry_then_fallback' | 'never_escalate'",
/// "type": "string"
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "description": "Unix ms of the latest state change.",
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OnchainActionHistoryEntry {
///Rolling accumulator from the ActionQueued event, 0x-hex.
pub acc: ::std::string::String,
pub action_id: u64,
pub action_type: u64,
pub action_type_label: ::std::string::String,
pub block_number: u64,
///Raw action calldata, 0x-hex.
pub data: ::std::string::String,
///Most recent submit rejection; null if the action never failed. Kept on applied/fallback rows as the reason the action struggled. The verbose error text stays internal (ClickHouse only).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error_code: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error_message: ::std::option::Option<::std::string::String>,
///Unix ms the action was escalated with `fallback=true`; null if never escalated.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub fallback_at: ::std::option::Option<i64>,
///Unix ms of the first failed submit; null if the action never failed.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub first_failed_at: ::std::option::Option<i64>,
pub l1_sender: ::std::string::String,
///Unix ms of the most recent failed submit; null if never failed.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_failed_at: ::std::option::Option<i64>,
///Operation uuid assigned by the sequencer; null until applied.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub op_uuid: ::std::option::Option<::std::string::String>,
///Onchain queue: 'public' or 'admin'.
pub queue: ::std::string::String,
///Sequencer applied states: 'applied' | 'applied_with_fallback' Failed States: 'instant_fallback' | 'retry_then_fallback' | 'never_escalate'
pub status: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
///Unix ms of the latest state change.
pub updated_at: i64,
}
impl OnchainActionHistoryEntry {
pub fn builder() -> builder::OnchainActionHistoryEntry {
Default::default()
}
}
///`OpenInterestStats`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "current_open_interest",
/// "interest_cap"
/// ],
/// "properties": {
/// "current_open_interest": {
/// "type": "string"
/// },
/// "interest_cap": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OpenInterestStats {
pub current_open_interest: ::std::string::String,
pub interest_cap: ::std::string::String,
}
impl OpenInterestStats {
pub fn builder() -> builder::OpenInterestStats {
Default::default()
}
}
///`OptionDetails`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expiry",
/// "index",
/// "option_type",
/// "strike"
/// ],
/// "properties": {
/// "expiry": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "index": {
/// "type": "string"
/// },
/// "option_type": {
/// "type": "string"
/// },
/// "settlement_price": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "strike": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OptionDetails {
pub expiry: u64,
pub index: ::std::string::String,
pub option_type: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub settlement_price: ::std::option::Option<::std::string::String>,
pub strike: ::std::string::String,
}
impl OptionDetails {
pub fn builder() -> builder::OptionDetails {
Default::default()
}
}
///`OptionPricing`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ai",
/// "bi",
/// "d",
/// "df",
/// "f",
/// "g",
/// "i",
/// "m",
/// "r",
/// "t",
/// "v"
/// ],
/// "properties": {
/// "ai": {
/// "description": "Implied volatility of the current best ask.",
/// "type": "string"
/// },
/// "bi": {
/// "description": "Implied volatility of the current best bid.",
/// "type": "string"
/// },
/// "d": {
/// "description": "Delta of the option.",
/// "type": "string"
/// },
/// "df": {
/// "description": "Discount factor used to calculate the option premium.",
/// "type": "string"
/// },
/// "f": {
/// "description": "Forward price used to calculate the option premium.",
/// "type": "string"
/// },
/// "g": {
/// "description": "Gamma of the option.",
/// "type": "string"
/// },
/// "i": {
/// "description": "Implied volatility of the option.",
/// "type": "string"
/// },
/// "m": {
/// "description": "Mark price of the option.",
/// "type": "string"
/// },
/// "r": {
/// "description": "Rho of the option.",
/// "type": "string"
/// },
/// "t": {
/// "description": "Theta of the option.",
/// "type": "string"
/// },
/// "v": {
/// "description": "Vega of the option.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OptionPricing {
///Implied volatility of the current best ask.
pub ai: ::std::string::String,
///Implied volatility of the current best bid.
pub bi: ::std::string::String,
///Delta of the option.
pub d: ::std::string::String,
///Discount factor used to calculate the option premium.
pub df: ::std::string::String,
///Forward price used to calculate the option premium.
pub f: ::std::string::String,
///Gamma of the option.
pub g: ::std::string::String,
///Implied volatility of the option.
pub i: ::std::string::String,
///Mark price of the option.
pub m: ::std::string::String,
///Rho of the option.
pub r: ::std::string::String,
///Theta of the option.
pub t: ::std::string::String,
///Vega of the option.
pub v: ::std::string::String,
}
impl OptionPricing {
pub fn builder() -> builder::OptionPricing {
Default::default()
}
}
///`OptionSettlementHistoryResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "settlements"
/// ],
/// "properties": {
/// "settlements": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/OptionSettlementResponse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OptionSettlementHistoryResponse {
pub settlements: ::std::vec::Vec<OptionSettlementResponse>,
}
impl OptionSettlementHistoryResponse {
pub fn builder() -> builder::OptionSettlementHistoryResponse {
Default::default()
}
}
///`OptionSettlementPricesResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expiries"
/// ],
/// "properties": {
/// "expiries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ExpirySettlementPrice"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OptionSettlementPricesResult {
pub expiries: ::std::vec::Vec<ExpirySettlementPrice>,
}
impl OptionSettlementPricesResult {
pub fn builder() -> builder::OptionSettlementPricesResult {
Default::default()
}
}
///One settled option position.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One settled option position.",
/// "type": "object",
/// "required": [
/// "amount",
/// "expiry",
/// "instrument_name",
/// "settlement_price",
/// "settlement_value",
/// "subaccount_id"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Settled balance (negative = short, positive = long).",
/// "type": "string"
/// },
/// "expiry": {
/// "description": "Expiry of the option, unix seconds.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "settlement_price": {
/// "type": "string"
/// },
/// "settlement_value": {
/// "description": "Crystallized cash value = intrinsic value * amount.",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OptionSettlementResponse {
///Settled balance (negative = short, positive = long).
pub amount: ::std::string::String,
///Expiry of the option, unix seconds.
pub expiry: u64,
pub instrument_name: ::std::string::String,
pub settlement_price: ::std::string::String,
///Crystallized cash value = intrinsic value * amount.
pub settlement_value: ::std::string::String,
pub subaccount_id: u64,
}
impl OptionSettlementResponse {
pub fn builder() -> builder::OptionSettlementResponse {
Default::default()
}
}
///`OracleSignatureDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "signatures",
/// "signers"
/// ],
/// "properties": {
/// "signatures": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "signers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Address"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OracleSignatureDataResponse {
pub signatures: ::std::vec::Vec<::std::string::String>,
pub signers: ::std::vec::Vec<Address>,
}
impl OracleSignatureDataResponse {
pub fn builder() -> builder::OracleSignatureDataResponse {
Default::default()
}
}
///`Order`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "average_price",
/// "creation_timestamp",
/// "direction",
/// "extra_fee",
/// "filled_amount",
/// "instrument_name",
/// "is_transfer",
/// "last_update_timestamp",
/// "limit_price",
/// "max_fee",
/// "mmp",
/// "nonce",
/// "order_fee",
/// "order_id",
/// "order_status",
/// "order_type",
/// "quote_id",
/// "replaced_order_id",
/// "signature",
/// "signature_expiry_sec",
/// "signed_limit_price",
/// "signer",
/// "subaccount_id",
/// "time_in_force",
/// "trigger_price"
/// ],
/// "properties": {
/// "algo_duration_sec": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_num_slices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_slices_completed": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_type": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AlgoType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "average_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "cancel_reason": {
/// "default": "",
/// "$ref": "#/definitions/CancelReason"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "filled_amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "limit_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "max_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "order_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "order_id": {
/// "type": "string"
/// },
/// "order_status": {
/// "$ref": "#/definitions/OrderStatus"
/// },
/// "order_type": {
/// "$ref": "#/definitions/OrderType"
/// },
/// "quote_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "replaced_order_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signed_limit_price": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "time_in_force": {
/// "$ref": "#/definitions/TimeInForce"
/// },
/// "trigger_price": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_price_type": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerPriceType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_reject_message": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "trigger_type": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Order {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_duration_sec: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_num_slices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_slices_completed: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_type: ::std::option::Option<AlgoType>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub average_price: ::bigdecimal::BigDecimal,
#[serde(default = "defaults::order_cancel_reason")]
pub cancel_reason: CancelReason,
pub creation_timestamp: i64,
pub direction: Direction,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub filled_amount: ::bigdecimal::BigDecimal,
pub instrument_name: ::std::string::String,
pub is_transfer: bool,
#[serde(default)]
pub label: ::std::string::String,
pub last_update_timestamp: i64,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub limit_price: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub mmp: bool,
pub nonce: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub order_fee: ::bigdecimal::BigDecimal,
pub order_id: ::std::string::String,
pub order_status: OrderStatus,
pub order_type: OrderType,
///Optional UUID v4 string
pub quote_id: ::std::option::Option<::uuid::Uuid>,
///Optional UUID v4 string
pub replaced_order_id: ::std::option::Option<::uuid::Uuid>,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub signed_limit_price: ::std::option::Option<::bigdecimal::BigDecimal>,
pub signer: ::std::string::String,
pub subaccount_id: i64,
pub time_in_force: TimeInForce,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub trigger_price: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price_type: ::std::option::Option<TriggerPriceType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_reject_message: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_type: ::std::option::Option<TriggerType>,
}
impl Order {
pub fn builder() -> builder::Order {
Default::default()
}
}
///`OrderActionDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "asset_address",
/// "asset_sub_id",
/// "desired_amount",
/// "is_bid",
/// "limit_price",
/// "recipient_id",
/// "worst_fee"
/// ],
/// "properties": {
/// "asset_address": {
/// "type": "string"
/// },
/// "asset_sub_id": {
/// "type": "string"
/// },
/// "desired_amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "is_bid": {
/// "type": "boolean"
/// },
/// "limit_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "recipient_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "worst_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderActionDataResponse {
pub asset_address: ::std::string::String,
pub asset_sub_id: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub desired_amount: ::bigdecimal::BigDecimal,
pub is_bid: bool,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub limit_price: ::bigdecimal::BigDecimal,
pub recipient_id: u64,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub worst_fee: ::bigdecimal::BigDecimal,
}
impl OrderActionDataResponse {
pub fn builder() -> builder::OrderActionDataResponse {
Default::default()
}
}
///The `Action` envelope a debug route rebuilt from the request inputs, plus its decoded action data — i.e. what the signature commits to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The `Action` envelope a debug route rebuilt from the request inputs, plus its decoded action data — i.e. what the signature commits to.",
/// "type": "object",
/// "required": [
/// "data",
/// "expiry",
/// "module",
/// "nonce",
/// "owner",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "data": {
/// "$ref": "#/definitions/OrderActionDataResponse"
/// },
/// "expiry": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "module": {
/// "type": "string"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "owner": {
/// "type": "string"
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderActionInputData {
pub data: OrderActionDataResponse,
pub expiry: u64,
pub module: ::std::string::String,
pub nonce: u64,
pub owner: ::std::string::String,
pub signer: ::std::string::String,
pub subaccount_id: u64,
}
impl OrderActionInputData {
pub fn builder() -> builder::OrderActionInputData {
Default::default()
}
}
///`OrderCreatedResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "order",
/// "trades"
/// ],
/// "properties": {
/// "order": {
/// "$ref": "#/definitions/Order"
/// },
/// "trades": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Trade"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderCreatedResponse {
pub order: Order,
pub trades: ::std::vec::Vec<Trade>,
}
impl OrderCreatedResponse {
pub fn builder() -> builder::OrderCreatedResponse {
Default::default()
}
}
///Debug-route payload for one rebuilt action: the EIP-712 hashes plus the action input fields.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Debug-route payload for one rebuilt action: the EIP-712 hashes plus the action input fields.",
/// "type": "object",
/// "required": [
/// "action_hash",
/// "action_typehash",
/// "domain_separator",
/// "encoded_data",
/// "encoded_data_hashed",
/// "expected_signer",
/// "input_data",
/// "module",
/// "owner",
/// "typed_data_hash"
/// ],
/// "properties": {
/// "action_hash": {
/// "description": "EIP-712 struct hash of the `Action`: `keccak256(abi.encode(action_typehash, …, encoded_data_hashed, …))`.",
/// "type": "string"
/// },
/// "action_typehash": {
/// "description": "`ACTION_TYPEHASH` — keccak of the `Action` struct type string; invariant across deployments.",
/// "type": "string"
/// },
/// "domain_separator": {
/// "description": "EIP-712 domain separator of the Matching contract for this deployment.",
/// "type": "string"
/// },
/// "encoded_data": {
/// "description": "ABI-encoded, module-specific action payload (the `data` bytes), 0x-hex.",
/// "type": "string"
/// },
/// "encoded_data_hashed": {
/// "description": "`keccak256(encoded_data)` — the value packed into the struct hash.",
/// "type": "string"
/// },
/// "expected_signer": {
/// "description": "The signer the signature is checked against.",
/// "type": "string"
/// },
/// "input_data": {
/// "description": "The rebuilt `Action` envelope and its decoded module-specific `data`.",
/// "$ref": "#/definitions/OrderActionInputData"
/// },
/// "module": {
/// "description": "Per-action module contract address bound into the signed struct.",
/// "type": "string"
/// },
/// "owner": {
/// "description": "Wallet that owns the subaccount the action applies to.",
/// "type": "string"
/// },
/// "recovered_signer": {
/// "description": "null on the debug routes (no signature is checked there); on a signature-mismatch error this is the address actually recovered.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "typed_data_hash": {
/// "description": "Final EIP-712 digest the client signs: `keccak256(0x1901 || domain_separator || action_hash)`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderDebugResponse {
///EIP-712 struct hash of the `Action`: `keccak256(abi.encode(action_typehash, …, encoded_data_hashed, …))`.
pub action_hash: ::std::string::String,
///`ACTION_TYPEHASH` — keccak of the `Action` struct type string; invariant across deployments.
pub action_typehash: ::std::string::String,
///EIP-712 domain separator of the Matching contract for this deployment.
pub domain_separator: ::std::string::String,
///ABI-encoded, module-specific action payload (the `data` bytes), 0x-hex.
pub encoded_data: ::std::string::String,
///`keccak256(encoded_data)` — the value packed into the struct hash.
pub encoded_data_hashed: ::std::string::String,
///The signer the signature is checked against.
pub expected_signer: ::std::string::String,
///The rebuilt `Action` envelope and its decoded module-specific `data`.
pub input_data: OrderActionInputData,
///Per-action module contract address bound into the signed struct.
pub module: ::std::string::String,
///Wallet that owns the subaccount the action applies to.
pub owner: ::std::string::String,
///null on the debug routes (no signature is checked there); on a signature-mismatch error this is the address actually recovered.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recovered_signer: ::std::option::Option<::std::string::String>,
///Final EIP-712 digest the client signs: `keccak256(0x1901 || domain_separator || action_hash)`.
pub typed_data_hash: ::std::string::String,
}
impl OrderDebugResponse {
pub fn builder() -> builder::OrderDebugResponse {
Default::default()
}
}
///Parameters for `public/order_quote` and `private/order_quote`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Parameters for `public/order_quote` and `private/order_quote`.",
/// "type": "object",
/// "required": [
/// "amount",
/// "direction",
/// "instrument_name",
/// "limit_price",
/// "max_fee",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Order amount in units of the base, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "direction": {
/// "description": "Order direction",
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "instrument_name": {
/// "description": "Instrument name",
/// "type": "string"
/// },
/// "is_atomic_signing": {
/// "default": false,
/// "type": "boolean"
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "limit_price": {
/// "description": "Limit price in quote currency, as a decimal string or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "max_fee": {
/// "description": "Max fee per unit of volume in quote currency, as a decimal string or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "default": false,
/// "type": "boolean"
/// },
/// "nonce": {
/// "description": "Nonce.",
/// "type": "string"
/// },
/// "order_type": {
/// "default": "limit",
/// "$ref": "#/definitions/OrderType"
/// },
/// "reduce_only": {
/// "default": false,
/// "type": "boolean"
/// },
/// "referral_code": {
/// "default": "",
/// "type": "string"
/// },
/// "reject_post_only": {
/// "default": true,
/// "type": "boolean"
/// },
/// "reject_timestamp": {
/// "default": 9223372036854775807,
/// "type": "integer",
/// "format": "int64"
/// },
/// "signature": {
/// "description": "Ethereum signature of the order.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "description": "Signature expiry (unix seconds).",
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "description": "Owner wallet or session key that signed the order.",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "description": "Subaccount ID",
/// "type": "integer",
/// "format": "int64"
/// },
/// "time_in_force": {
/// "default": "gtc",
/// "$ref": "#/definitions/TimeInForce"
/// },
/// "trigger_price": {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_price_type": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerPriceType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_type": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderQuoteRequest {
///Order amount in units of the base, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub amount: ::bigdecimal::BigDecimal,
#[serde(default)]
pub client: ::std::string::String,
///Order direction
pub direction: Direction,
///Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra_fee: ::std::option::Option<::bigdecimal::BigDecimal>,
///Instrument name
pub instrument_name: ::std::string::String,
#[serde(default)]
pub is_atomic_signing: bool,
#[serde(default)]
pub label: ::std::string::String,
///Limit price in quote currency, as a decimal string or a JSON number.
pub limit_price: ::bigdecimal::BigDecimal,
///Max fee per unit of volume in quote currency, as a decimal string or a JSON number.
pub max_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub mmp: bool,
///Nonce.
pub nonce: ::std::string::String,
#[serde(default = "defaults::order_quote_request_order_type")]
pub order_type: OrderType,
#[serde(default)]
pub reduce_only: bool,
#[serde(default)]
pub referral_code: ::std::string::String,
#[serde(default = "defaults::default_bool::<true>")]
pub reject_post_only: bool,
#[serde(default = "defaults::default_u64::<i64, 9223372036854775807>")]
pub reject_timestamp: i64,
///Ethereum signature of the order.
pub signature: ::std::string::String,
///Signature expiry (unix seconds).
pub signature_expiry_sec: i64,
///Owner wallet or session key that signed the order.
pub signer: ::std::string::String,
///Subaccount ID
pub subaccount_id: i64,
#[serde(default = "defaults::order_quote_request_time_in_force")]
pub time_in_force: TimeInForce,
///Trigger price as a decimal string or JSON number; omit for non-trigger orders.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price_type: ::std::option::Option<TriggerPriceType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_type: ::std::option::Option<TriggerType>,
}
impl OrderQuoteRequest {
pub fn builder() -> builder::OrderQuoteRequest {
Default::default()
}
}
///Estimated fill price, fees, and resulting margin for a proposed order — a non-binding dry-run. All price, fee, and margin fields are decimal strings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Estimated fill price, fees, and resulting margin for a proposed order — a non-binding dry-run. All price, fee, and margin fields are decimal strings.",
/// "type": "object",
/// "required": [
/// "estimated_fee",
/// "estimated_fill_amount",
/// "estimated_fill_price",
/// "estimated_order_status",
/// "estimated_realized_pnl",
/// "estimated_realized_pnl_excl_fees",
/// "is_valid",
/// "post_initial_margin",
/// "pre_initial_margin",
/// "suggested_max_fee"
/// ],
/// "properties": {
/// "estimated_fee": {
/// "type": "string"
/// },
/// "estimated_fill_amount": {
/// "type": "string"
/// },
/// "estimated_fill_price": {
/// "type": "string"
/// },
/// "estimated_order_status": {
/// "$ref": "#/definitions/OrderStatus"
/// },
/// "estimated_realized_pnl": {
/// "type": "string"
/// },
/// "estimated_realized_pnl_excl_fees": {
/// "type": "string"
/// },
/// "invalid_reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "is_valid": {
/// "type": "boolean"
/// },
/// "max_amount": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "post_initial_margin": {
/// "type": "string"
/// },
/// "post_liquidation_price": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pre_initial_margin": {
/// "type": "string"
/// },
/// "suggested_max_fee": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderQuoteResponse {
pub estimated_fee: ::std::string::String,
pub estimated_fill_amount: ::std::string::String,
pub estimated_fill_price: ::std::string::String,
pub estimated_order_status: OrderStatus,
pub estimated_realized_pnl: ::std::string::String,
pub estimated_realized_pnl_excl_fees: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invalid_reason: ::std::option::Option<::std::string::String>,
pub is_valid: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_amount: ::std::option::Option<::std::string::String>,
pub post_initial_margin: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub post_liquidation_price: ::std::option::Option<::std::string::String>,
pub pre_initial_margin: ::std::string::String,
pub suggested_max_fee: ::std::string::String,
}
impl OrderQuoteResponse {
pub fn builder() -> builder::OrderQuoteResponse {
Default::default()
}
}
///`OrderSnapshot`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "price"
/// ],
/// "properties": {
/// "amount": {
/// "type": "string"
/// },
/// "price": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderSnapshot {
pub amount: ::std::string::String,
pub price: ::std::string::String,
}
impl OrderSnapshot {
pub fn builder() -> builder::OrderSnapshot {
Default::default()
}
}
///`OrderStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "open",
/// "filled",
/// "rejected",
/// "cancelled",
/// "expired",
/// "untriggered",
/// "algo_active"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum OrderStatus {
#[serde(rename = "open")]
Open,
#[serde(rename = "filled")]
Filled,
#[serde(rename = "rejected")]
Rejected,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "expired")]
Expired,
#[serde(rename = "untriggered")]
Untriggered,
#[serde(rename = "algo_active")]
AlgoActive,
}
impl ::std::fmt::Display for OrderStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Open => f.write_str("open"),
Self::Filled => f.write_str("filled"),
Self::Rejected => f.write_str("rejected"),
Self::Cancelled => f.write_str("cancelled"),
Self::Expired => f.write_str("expired"),
Self::Untriggered => f.write_str("untriggered"),
Self::AlgoActive => f.write_str("algo_active"),
}
}
}
impl ::std::str::FromStr for OrderStatus {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"open" => Ok(Self::Open),
"filled" => Ok(Self::Filled),
"rejected" => Ok(Self::Rejected),
"cancelled" => Ok(Self::Cancelled),
"expired" => Ok(Self::Expired),
"untriggered" => Ok(Self::Untriggered),
"algo_active" => Ok(Self::AlgoActive),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for OrderStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for OrderStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for OrderStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`OrderType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "limit",
/// "market"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum OrderType {
#[serde(rename = "limit")]
Limit,
#[serde(rename = "market")]
Market,
}
impl ::std::fmt::Display for OrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Limit => f.write_str("limit"),
Self::Market => f.write_str("market"),
}
}
}
impl ::std::str::FromStr for OrderType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"limit" => Ok(Self::Limit),
"market" => Ok(Self::Market),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for OrderType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for OrderType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for OrderType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`OrderbookNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/OrderbookSnapshot"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OrderbookNotification(pub OrderbookSnapshot);
impl ::std::ops::Deref for OrderbookNotification {
type Target = OrderbookSnapshot;
fn deref(&self) -> &OrderbookSnapshot {
&self.0
}
}
impl ::std::convert::From<OrderbookNotification> for OrderbookSnapshot {
fn from(value: OrderbookNotification) -> Self {
value.0
}
}
impl ::std::convert::From<OrderbookSnapshot> for OrderbookNotification {
fn from(value: OrderbookSnapshot) -> Self {
Self(value)
}
}
///`OrderbookSnapshot`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "asks",
/// "bids",
/// "instrument_name",
/// "publish_id",
/// "timestamp"
/// ],
/// "properties": {
/// "asks": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/OrderSnapshot"
/// }
/// },
/// "bids": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/OrderSnapshot"
/// }
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "publish_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderbookSnapshot {
pub asks: ::std::vec::Vec<OrderSnapshot>,
pub bids: ::std::vec::Vec<OrderSnapshot>,
pub instrument_name: ::std::string::String,
pub publish_id: u64,
pub timestamp: i64,
}
impl OrderbookSnapshot {
pub fn builder() -> builder::OrderbookSnapshot {
Default::default()
}
}
///`PaginatedOrdersResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "orders",
/// "pagination",
/// "subaccount_id"
/// ],
/// "properties": {
/// "orders": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Order"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedOrdersResult {
pub orders: ::std::vec::Vec<Order>,
pub pagination: Pagination,
pub subaccount_id: i64,
}
impl PaginatedOrdersResult {
pub fn builder() -> builder::PaginatedOrdersResult {
Default::default()
}
}
///`PaginatedTradesResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "subaccount_id",
/// "trades"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "trades": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/TradeHistoryResponse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedTradesResult {
pub pagination: Pagination,
pub subaccount_id: i64,
pub trades: ::std::vec::Vec<TradeHistoryResponse>,
}
impl PaginatedTradesResult {
pub fn builder() -> builder::PaginatedTradesResult {
Default::default()
}
}
///`PaginatedVaultActionHistory`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "events",
/// "pagination",
/// "subaccount_id"
/// ],
/// "properties": {
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PublicVaultActionResponse"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedVaultActionHistory {
pub events: ::std::vec::Vec<PublicVaultActionResponse>,
pub pagination: Pagination,
pub subaccount_id: u64,
}
impl PaginatedVaultActionHistory {
pub fn builder() -> builder::PaginatedVaultActionHistory {
Default::default()
}
}
///`PaginatedVaultRequestHistory`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "actions",
/// "pagination",
/// "wallet"
/// ],
/// "properties": {
/// "actions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultActionResponse"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedVaultRequestHistory {
pub actions: ::std::vec::Vec<VaultActionResponse>,
pub pagination: Pagination,
pub wallet: ::std::string::String,
}
impl PaginatedVaultRequestHistory {
pub fn builder() -> builder::PaginatedVaultRequestHistory {
Default::default()
}
}
///Response envelope for paginated RPCs.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response envelope for paginated RPCs.",
/// "type": "object",
/// "required": [
/// "count",
/// "num_pages"
/// ],
/// "properties": {
/// "count": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "num_pages": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Pagination {
pub count: u64,
pub num_pages: u64,
}
impl Pagination {
pub fn builder() -> builder::Pagination {
Default::default()
}
}
///`PendingDepositEntry`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "action_id",
/// "action_type",
/// "amount",
/// "asset",
/// "block_number",
/// "deposit_type",
/// "log_index",
/// "manager_id",
/// "status",
/// "subaccount_id",
/// "timestamp",
/// "tx_hash",
/// "updated_at_ms"
/// ],
/// "properties": {
/// "action_id": {
/// "description": "Per-queue id assigned by the `OnchainActionManager`; `0` for fast deposits (indexed from the factory event, not the pooled OAM action).",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "action_type": {
/// "description": "`Deposit` (existing subaccount), `DepositToNewSubaccount`, or `FastDeposit` (pooled, credited off-chain).",
/// "type": "string"
/// },
/// "amount": {
/// "description": "Amount in the asset's native ERC-20 units, as a decimal string.",
/// "type": "string"
/// },
/// "asset": {
/// "type": "string"
/// },
/// "block_number": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "credit_nonce": {
/// "description": "Fast only: the credit transfer's nonce, disambiguating a deposit's entries. Absent on slow entries and the uncredited remainder. Decimal string — the value exceeds JS number precision.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deposit_type": {
/// "description": "`slow` or `fast`.",
/// "type": "string"
/// },
/// "log_index": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "manager_id": {
/// "description": "Manager of the new subaccount; `0` for existing-subaccount deposits.",
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "status": {
/// "description": "`detected` (transfer seen at the tip, pre-confirmation) `pending` (escrow swept, awaiting confirmation) `confirmed` (sweep tx past the confirmation range) `reverted` (the sweep reorged out — or uncreditable: no valid destination exists) Fast deposits additionally show: `crediting` (transfer in flight), `credited` (paid out) `partial_revert` (reorged out after a chunk was paid)",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "description": "Credited subaccount; `0` for new-subaccount deposits.",
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp": {
/// "description": "Milliseconds when the tracker first picked up the deposit - approximates the block timestamp of `block_number`. Shared by all of a deposit's entries.",
/// "type": "integer",
/// "format": "int64"
/// },
/// "tx_hash": {
/// "type": "string"
/// },
/// "updated_at_ms": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PendingDepositEntry {
///Per-queue id assigned by the `OnchainActionManager`; `0` for fast deposits (indexed from the factory event, not the pooled OAM action).
pub action_id: u64,
///`Deposit` (existing subaccount), `DepositToNewSubaccount`, or `FastDeposit` (pooled, credited off-chain).
pub action_type: ::std::string::String,
///Amount in the asset's native ERC-20 units, as a decimal string.
pub amount: ::std::string::String,
pub asset: ::std::string::String,
pub block_number: u64,
///Fast only: the credit transfer's nonce, disambiguating a deposit's entries. Absent on slow entries and the uncredited remainder. Decimal string — the value exceeds JS number precision.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub credit_nonce: ::std::option::Option<::std::string::String>,
///`slow` or `fast`.
pub deposit_type: ::std::string::String,
pub log_index: u64,
///Manager of the new subaccount; `0` for existing-subaccount deposits.
pub manager_id: u32,
///`detected` (transfer seen at the tip, pre-confirmation) `pending` (escrow swept, awaiting confirmation) `confirmed` (sweep tx past the confirmation range) `reverted` (the sweep reorged out — or uncreditable: no valid destination exists) Fast deposits additionally show: `crediting` (transfer in flight), `credited` (paid out) `partial_revert` (reorged out after a chunk was paid)
pub status: ::std::string::String,
///Credited subaccount; `0` for new-subaccount deposits.
pub subaccount_id: i64,
///Milliseconds when the tracker first picked up the deposit - approximates the block timestamp of `block_number`. Shared by all of a deposit's entries.
pub timestamp: i64,
pub tx_hash: ::std::string::String,
pub updated_at_ms: i64,
}
impl PendingDepositEntry {
pub fn builder() -> builder::PendingDepositEntry {
Default::default()
}
}
///Quantization of the hourly samples, requested by the caller.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Quantization of the hourly samples, requested by the caller.",
/// "type": "string",
/// "enum": [
/// "1h",
/// "8h",
/// "24h",
/// "1wk"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum PerformanceResolution {
#[serde(rename = "1h")]
X1h,
#[serde(rename = "8h")]
X8h,
#[serde(rename = "24h")]
X24h,
#[serde(rename = "1wk")]
X1wk,
}
impl ::std::fmt::Display for PerformanceResolution {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::X1h => f.write_str("1h"),
Self::X8h => f.write_str("8h"),
Self::X24h => f.write_str("24h"),
Self::X1wk => f.write_str("1wk"),
}
}
}
impl ::std::str::FromStr for PerformanceResolution {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"1h" => Ok(Self::X1h),
"8h" => Ok(Self::X8h),
"24h" => Ok(Self::X24h),
"1wk" => Ok(Self::X1wk),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PerformanceResolution {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PerformanceResolution {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PerformanceResolution {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PerpDetails`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "aggregate_funding",
/// "funding_rate",
/// "index",
/// "max_rate_per_hour",
/// "min_rate_per_hour"
/// ],
/// "properties": {
/// "aggregate_funding": {
/// "type": "string"
/// },
/// "funding_rate": {
/// "type": "string"
/// },
/// "index": {
/// "type": "string"
/// },
/// "max_rate_per_hour": {
/// "type": "string"
/// },
/// "min_rate_per_hour": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerpDetails {
pub aggregate_funding: ::std::string::String,
pub funding_rate: ::std::string::String,
pub index: ::std::string::String,
pub max_rate_per_hour: ::std::string::String,
pub min_rate_per_hour: ::std::string::String,
}
impl PerpDetails {
pub fn builder() -> builder::PerpDetails {
Default::default()
}
}
///`PerpFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "signatures",
/// "spot_diff_value",
/// "timestamp",
/// "type"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "spot_diff_value": {
/// "type": "string"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "type": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerpFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
pub signatures: OracleSignatureDataResponse,
pub spot_diff_value: ::std::string::String,
pub timestamp: u64,
#[serde(rename = "type")]
pub type_: ::std::string::String,
}
impl PerpFeedDataResponse {
pub fn builder() -> builder::PerpFeedDataResponse {
Default::default()
}
}
///`PerpSettlementEventResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "batch_status",
/// "batch_uuid",
/// "funding",
/// "instrument_name",
/// "pnl",
/// "subaccount_id",
/// "timestamp"
/// ],
/// "properties": {
/// "batch_status": {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// "batch_uuid": {
/// "description": "UUID of the settlement batch; a settlement in a reverted or errored batch reflects that status.",
/// "type": "string"
/// },
/// "funding": {
/// "type": "string"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "pnl": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerpSettlementEventResponse {
pub batch_status: BatchStatus,
///UUID of the settlement batch; a settlement in a reverted or errored batch reflects that status.
pub batch_uuid: ::std::string::String,
pub funding: ::std::string::String,
pub instrument_name: ::std::string::String,
pub pnl: ::std::string::String,
pub subaccount_id: u64,
pub timestamp: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl PerpSettlementEventResponse {
pub fn builder() -> builder::PerpSettlementEventResponse {
Default::default()
}
}
///`PerpSettlementHistoryResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "events",
/// "pagination"
/// ],
/// "properties": {
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PerpSettlementEventResponse"
/// }
/// },
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerpSettlementHistoryResponse {
pub events: ::std::vec::Vec<PerpSettlementEventResponse>,
pub pagination: Pagination,
}
impl PerpSettlementHistoryResponse {
pub fn builder() -> builder::PerpSettlementHistoryResponse {
Default::default()
}
}
///`PollQuotesRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "from_timestamp": {
/// "default": 0,
/// "type": "integer",
/// "format": "int64"
/// },
/// "page": {
/// "default": 1,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": 20,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "quote_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "rfq_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": 9223372036854775807,
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PollQuotesRequest {
#[serde(default)]
pub from_timestamp: i64,
#[serde(default = "defaults::default_u64::<u64, 1>")]
pub page: u64,
#[serde(default = "defaults::default_u64::<u64, 20>")]
pub page_size: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
pub subaccount_id: i64,
#[serde(default = "defaults::default_u64::<i64, 9223372036854775807>")]
pub to_timestamp: i64,
}
impl PollQuotesRequest {
pub fn builder() -> builder::PollQuotesRequest {
Default::default()
}
}
///`PollRfqsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "from_timestamp": {
/// "default": 0,
/// "type": "integer",
/// "format": "int64"
/// },
/// "page": {
/// "default": 1,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "page_size": {
/// "default": 20,
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "rfq_id": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "rfq_subaccount_id": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "status": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "to_timestamp": {
/// "default": 9223372036854775807,
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PollRfqsRequest {
#[serde(default)]
pub from_timestamp: i64,
#[serde(default = "defaults::default_u64::<u64, 1>")]
pub page: u64,
#[serde(default = "defaults::default_u64::<u64, 20>")]
pub page_size: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_subaccount_id: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
pub subaccount_id: i64,
#[serde(default = "defaults::default_u64::<i64, 9223372036854775807>")]
pub to_timestamp: i64,
}
impl PollRfqsRequest {
pub fn builder() -> builder::PollRfqsRequest {
Default::default()
}
}
///`Position`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "amount_step",
/// "average_price",
/// "average_price_excl_fees",
/// "creation_timestamp",
/// "cumulative_funding",
/// "delta",
/// "gamma",
/// "index_price",
/// "initial_margin",
/// "instrument_name",
/// "instrument_type",
/// "maintenance_margin",
/// "mark_price",
/// "mark_value",
/// "net_settlements",
/// "open_orders_margin",
/// "pending_funding",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "theta",
/// "total_fees",
/// "unrealized_pnl",
/// "unrealized_pnl_excl_fees",
/// "vega"
/// ],
/// "properties": {
/// "amount": {
/// "type": "string"
/// },
/// "amount_step": {
/// "type": "string"
/// },
/// "average_price": {
/// "type": "string"
/// },
/// "average_price_excl_fees": {
/// "type": "string"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "cumulative_funding": {
/// "type": "string"
/// },
/// "delta": {
/// "type": "string"
/// },
/// "gamma": {
/// "type": "string"
/// },
/// "index_price": {
/// "type": "string"
/// },
/// "initial_margin": {
/// "type": "string"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "instrument_type": {
/// "$ref": "#/definitions/AssetType"
/// },
/// "leverage": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "liquidation_price": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "maintenance_margin": {
/// "type": "string"
/// },
/// "mark_price": {
/// "type": "string"
/// },
/// "mark_value": {
/// "type": "string"
/// },
/// "net_settlements": {
/// "type": "string"
/// },
/// "open_orders_margin": {
/// "type": "string"
/// },
/// "pending_funding": {
/// "type": "string"
/// },
/// "realized_pnl": {
/// "type": "string"
/// },
/// "realized_pnl_excl_fees": {
/// "type": "string"
/// },
/// "theta": {
/// "type": "string"
/// },
/// "total_fees": {
/// "type": "string"
/// },
/// "unrealized_pnl": {
/// "type": "string"
/// },
/// "unrealized_pnl_excl_fees": {
/// "type": "string"
/// },
/// "vega": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Position {
pub amount: ::std::string::String,
pub amount_step: ::std::string::String,
pub average_price: ::std::string::String,
pub average_price_excl_fees: ::std::string::String,
pub creation_timestamp: i64,
pub cumulative_funding: ::std::string::String,
pub delta: ::std::string::String,
pub gamma: ::std::string::String,
pub index_price: ::std::string::String,
pub initial_margin: ::std::string::String,
pub instrument_name: ::std::string::String,
pub instrument_type: AssetType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub leverage: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub liquidation_price: ::std::option::Option<::std::string::String>,
pub maintenance_margin: ::std::string::String,
pub mark_price: ::std::string::String,
pub mark_value: ::std::string::String,
pub net_settlements: ::std::string::String,
pub open_orders_margin: ::std::string::String,
pub pending_funding: ::std::string::String,
pub realized_pnl: ::std::string::String,
pub realized_pnl_excl_fees: ::std::string::String,
pub theta: ::std::string::String,
pub total_fees: ::std::string::String,
pub unrealized_pnl: ::std::string::String,
pub unrealized_pnl_excl_fees: ::std::string::String,
pub vega: ::std::string::String,
}
impl Position {
pub fn builder() -> builder::Position {
Default::default()
}
}
///`PricedLegParamsAndResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "direction",
/// "instrument_name",
/// "price"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "price": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PricedLegParamsAndResponse {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
pub direction: Direction,
pub instrument_name: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub price: ::bigdecimal::BigDecimal,
}
impl PricedLegParamsAndResponse {
pub fn builder() -> builder::PricedLegParamsAndResponse {
Default::default()
}
}
///`PrivateChangeSubaccountLabelResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "label",
/// "subaccount_id"
/// ],
/// "properties": {
/// "label": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateChangeSubaccountLabelResponse {
pub label: ::std::string::String,
pub subaccount_id: u64,
}
impl PrivateChangeSubaccountLabelResponse {
pub fn builder() -> builder::PrivateChangeSubaccountLabelResponse {
Default::default()
}
}
///`PrivateGetAccountResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancel_on_disconnect",
/// "fallback_subaccount_id",
/// "fee_info",
/// "is_rfq_maker",
/// "per_endpoint_tps",
/// "subaccount_ids",
/// "wallet",
/// "websocket_matching_tps",
/// "websocket_non_matching_tps",
/// "websocket_option_tps",
/// "websocket_perp_tps",
/// "whitelisted_recipients"
/// ],
/// "properties": {
/// "cancel_on_disconnect": {
/// "type": "boolean"
/// },
/// "creation_timestamp_sec": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "fallback_subaccount_id": {
/// "description": "Subaccount that receives deposits whose requested destination is unusable — unknown manager id, or the per-wallet subaccount cap already reached. Allocated with the account, and always in the fallback risk universe (id 0).",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "fee_info": {
/// "$ref": "#/definitions/AccountFeeInfo"
/// },
/// "is_rfq_maker": {
/// "type": "boolean"
/// },
/// "per_endpoint_tps": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// }
/// },
/// "referral_code": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_ids": {
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// },
/// "wallet": {
/// "type": "string"
/// },
/// "websocket_matching_tps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "websocket_non_matching_tps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "websocket_option_tps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "websocket_perp_tps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "whitelisted_recipients": {
/// "description": "Recipients that session keys may withdraw or transfer ERC-20s to. The owner and `Admin`-scoped session keys bypass this list.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateGetAccountResponse {
pub cancel_on_disconnect: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_timestamp_sec: ::std::option::Option<u64>,
///Subaccount that receives deposits whose requested destination is unusable — unknown manager id, or the per-wallet subaccount cap already reached. Allocated with the account, and always in the fallback risk universe (id 0).
pub fallback_subaccount_id: u64,
pub fee_info: AccountFeeInfo,
pub is_rfq_maker: bool,
pub per_endpoint_tps: ::std::collections::HashMap<::std::string::String, u16>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub referral_code: ::std::option::Option<::std::string::String>,
pub subaccount_ids: ::std::vec::Vec<u64>,
pub wallet: ::std::string::String,
pub websocket_matching_tps: u16,
pub websocket_non_matching_tps: u16,
pub websocket_option_tps: u16,
pub websocket_perp_tps: u16,
///Recipients that session keys may withdraw or transfer ERC-20s to. The owner and `Admin`-scoped session keys bypass this list.
pub whitelisted_recipients: ::std::vec::Vec<::std::string::String>,
}
impl PrivateGetAccountResponse {
pub fn builder() -> builder::PrivateGetAccountResponse {
Default::default()
}
}
///`PrivateGetCollateralsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "collaterals",
/// "subaccount_id"
/// ],
/// "properties": {
/// "collaterals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Collateral"
/// }
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateGetCollateralsResponse {
pub collaterals: ::std::vec::Vec<Collateral>,
pub subaccount_id: u64,
}
impl PrivateGetCollateralsResponse {
pub fn builder() -> builder::PrivateGetCollateralsResponse {
Default::default()
}
}
///`PrivateGetPositionsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "positions",
/// "subaccount_id"
/// ],
/// "properties": {
/// "positions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Position"
/// }
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateGetPositionsResponse {
pub positions: ::std::vec::Vec<Position>,
pub subaccount_id: u64,
}
impl PrivateGetPositionsResponse {
pub fn builder() -> builder::PrivateGetPositionsResponse {
Default::default()
}
}
///`PrivateGetSubaccountsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_ids",
/// "wallet"
/// ],
/// "properties": {
/// "subaccount_ids": {
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateGetSubaccountsResponse {
pub subaccount_ids: ::std::vec::Vec<u64>,
pub wallet: ::std::string::String,
}
impl PrivateGetSubaccountsResponse {
pub fn builder() -> builder::PrivateGetSubaccountsResponse {
Default::default()
}
}
///`PrivateLiquidateRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cash_transfer",
/// "last_seen_trade_id",
/// "liquidate_subaccount_id",
/// "merge_account",
/// "nonce",
/// "percent_of_acc",
/// "price_limit",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "cash_transfer": {
/// "description": "Cash to transfer during liquidation, in USD as a decimal string (e.g. `\"5.0\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "last_seen_trade_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "liquidate_subaccount_id": {
/// "description": "Subaccount being liquidated.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "merge_account": {
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "percent_of_acc": {
/// "description": "Fraction of the account to liquidate (`\"1.0\"` = 100%), decimal string or JSON number. Must be a whole percent, i.e. a multiple of `\"0.01\"`.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "price_limit": {
/// "description": "Signed limit price (`\"0\"` opts out), decimal string or JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "description": "Bidder subaccount.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateLiquidateRequest {
///Cash to transfer during liquidation, in USD as a decimal string (e.g. `"5.0"`) or a JSON number.
pub cash_transfer: ::bigdecimal::BigDecimal,
pub last_seen_trade_id: u64,
///Subaccount being liquidated.
pub liquidate_subaccount_id: u64,
pub merge_account: bool,
pub nonce: i64,
///Fraction of the account to liquidate (`"1.0"` = 100%), decimal string or JSON number. Must be a whole percent, i.e. a multiple of `"0.01"`.
pub percent_of_acc: ::bigdecimal::BigDecimal,
///Signed limit price (`"0"` opts out), decimal string or JSON number.
pub price_limit: ::bigdecimal::BigDecimal,
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
///Bidder subaccount.
pub subaccount_id: u64,
}
impl PrivateLiquidateRequest {
pub fn builder() -> builder::PrivateLiquidateRequest {
Default::default()
}
}
///`PrivateLiquidateResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateLiquidateResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl PrivateLiquidateResponse {
pub fn builder() -> builder::PrivateLiquidateResponse {
Default::default()
}
}
///`PrivateSessionKeysResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "public_session_keys"
/// ],
/// "properties": {
/// "public_session_keys": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/SessionKey"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateSessionKeysResponse {
pub public_session_keys: ::std::vec::Vec<SessionKey>,
}
impl PrivateSessionKeysResponse {
pub fn builder() -> builder::PrivateSessionKeysResponse {
Default::default()
}
}
///`PrivateSetCancelOnDisconnectRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "headers": {
/// "description": "Non-standard; used by `auth/login`.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": true
/// },
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// },
/// "method": {
/// "type": "string",
/// "const": "private/set_cancel_on_disconnect"
/// },
/// "params": {
/// "$ref": "#/definitions/SetCancelOnDisconnectRequest"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateSetCancelOnDisconnectRequest {
///Non-standard; used by `auth/login`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub headers: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
pub id: JsonRpcId,
pub method: ::std::string::String,
pub params: SetCancelOnDisconnectRequest,
}
impl PrivateSetCancelOnDisconnectRequest {
pub fn builder() -> builder::PrivateSetCancelOnDisconnectRequest {
Default::default()
}
}
///`PrivateSetCancelOnDisconnectResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "anyOf": [
/// {
/// "title": "Success",
/// "type": "object",
/// "required": [
/// "result"
/// ],
/// "properties": {
/// "result": {
/// "$ref": "#/definitions/SetCancelOnDisconnectResponse"
/// }
/// }
/// },
/// {
/// "title": "Error",
/// "type": "object",
/// "required": [
/// "error"
/// ],
/// "properties": {
/// "error": {
/// "$ref": "#/definitions/RPCError"
/// }
/// }
/// }
/// ],
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PrivateSetCancelOnDisconnectResponse {
Variant0 { id: JsonRpcId, result: SetCancelOnDisconnectResponse },
Variant1 { error: RpcError, id: JsonRpcId },
}
///`PrivateSetSessionKeyResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expiry_sec",
/// "ip_whitelist",
/// "offchain_scopes",
/// "protocol_scopes",
/// "public_session_key",
/// "subaccount_ids"
/// ],
/// "properties": {
/// "expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "ip_whitelist": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "label": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "offchain_scopes": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "protocol_scopes": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "public_session_key": {
/// "type": "string"
/// },
/// "subaccount_ids": {
/// "description": "Subaccounts the key may act on. Empty/omitted request (all subaccounts) is expanded to the wallet's current subaccount list.",
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateSetSessionKeyResponse {
pub expiry_sec: u64,
pub ip_whitelist: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
pub offchain_scopes: ::std::vec::Vec<::std::string::String>,
pub protocol_scopes: ::std::vec::Vec<::std::string::String>,
pub public_session_key: ::std::string::String,
///Subaccounts the key may act on. Empty/omitted request (all subaccounts) is expanded to the wallet's current subaccount list.
pub subaccount_ids: ::std::vec::Vec<u64>,
}
impl PrivateSetSessionKeyResponse {
pub fn builder() -> builder::PrivateSetSessionKeyResponse {
Default::default()
}
}
///`PrivateTransferSpotExternalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "asset_name",
/// "max_fee_usd",
/// "new_subaccount_manager",
/// "nonce",
/// "recipient_address",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "sub_id",
/// "subaccount_id",
/// "to_subaccount_id"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Transfer amount in units of the asset, as a decimal string (e.g. `\"1.5\"`) or JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "max_fee_usd": {
/// "description": "Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`) or a JSON number. Must cover both the transfer fee and any subaccount-creation fee.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "new_subaccount_manager": {
/// "description": "Manager id for the new subaccount when `to_subaccount_id == 0`.",
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "recipient_address": {
/// "description": "Owner of the destination account/subaccount.",
/// "type": "string"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "sub_id": {
/// "type": "integer",
/// "format": "uint128",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "to_subaccount_id": {
/// "description": "Recipient's existing destination subaccount. `0` → create a new subaccount for `recipient_address` under `new_subaccount_manager`.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateTransferSpotExternalRequest {
///Transfer amount in units of the asset, as a decimal string (e.g. `"1.5"`) or JSON number.
pub amount: ::bigdecimal::BigDecimal,
pub asset_name: ::std::string::String,
///Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`) or a JSON number. Must cover both the transfer fee and any subaccount-creation fee.
pub max_fee_usd: ::bigdecimal::BigDecimal,
///Manager id for the new subaccount when `to_subaccount_id == 0`.
pub new_subaccount_manager: u32,
pub nonce: i64,
///Owner of the destination account/subaccount.
pub recipient_address: ::std::string::String,
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
pub sub_id: u64,
pub subaccount_id: u64,
///Recipient's existing destination subaccount. `0` → create a new subaccount for `recipient_address` under `new_subaccount_manager`.
pub to_subaccount_id: u64,
}
impl PrivateTransferSpotExternalRequest {
pub fn builder() -> builder::PrivateTransferSpotExternalRequest {
Default::default()
}
}
///`PrivateTransferSpotExternalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateTransferSpotExternalResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl PrivateTransferSpotExternalResponse {
pub fn builder() -> builder::PrivateTransferSpotExternalResponse {
Default::default()
}
}
///`PrivateTransferSpotRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "asset_name",
/// "max_fee_usd",
/// "new_subaccount_manager",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "sub_id",
/// "subaccount_id",
/// "to_subaccount_id"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Transfer amount in units of the asset, as a decimal string (e.g. `\"1.5\"`) or JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "max_fee_usd": {
/// "description": "Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "new_subaccount_manager": {
/// "description": "Non-zero → create a new sender-owned subaccount under this manager id.",
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "sub_id": {
/// "type": "integer",
/// "format": "uint128",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "to_subaccount_id": {
/// "description": "Existing destination subaccount. Ignored when `new_subaccount_manager != 0`.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateTransferSpotRequest {
///Transfer amount in units of the asset, as a decimal string (e.g. `"1.5"`) or JSON number.
pub amount: ::bigdecimal::BigDecimal,
pub asset_name: ::std::string::String,
///Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub max_fee_usd: ::bigdecimal::BigDecimal,
///Non-zero → create a new sender-owned subaccount under this manager id.
pub new_subaccount_manager: u32,
pub nonce: i64,
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
pub sub_id: u64,
pub subaccount_id: u64,
///Existing destination subaccount. Ignored when `new_subaccount_manager != 0`.
pub to_subaccount_id: u64,
}
impl PrivateTransferSpotRequest {
pub fn builder() -> builder::PrivateTransferSpotRequest {
Default::default()
}
}
///`PrivateTransferSpotResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateTransferSpotResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl PrivateTransferSpotResponse {
pub fn builder() -> builder::PrivateTransferSpotResponse {
Default::default()
}
}
///`PrivateWithdrawRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount_in_underlying",
/// "asset_name",
/// "force_batch",
/// "max_fee_usd",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "amount_in_underlying": {
/// "type": "string"
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "force_batch": {
/// "type": "boolean"
/// },
/// "max_fee_usd": {
/// "description": "Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "recipient": {
/// "description": "L1 address the funds are paid out to. Defaults to the subaccount's owner wallet when omitted.\n\nA non-owner signer (session key) may only pay out to an address on the owner's `whitelisted_recipients`, unless the key holds `Admin`.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateWithdrawRequest {
pub amount_in_underlying: ::std::string::String,
pub asset_name: ::std::string::String,
pub force_batch: bool,
///Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub max_fee_usd: ::bigdecimal::BigDecimal,
pub nonce: i64,
/**L1 address the funds are paid out to. Defaults to the subaccount's owner wallet when omitted.
A non-owner signer (session key) may only pay out to an address on the owner's `whitelisted_recipients`, unless the key holds `Admin`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recipient: ::std::option::Option<::std::string::String>,
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
pub subaccount_id: u64,
}
impl PrivateWithdrawRequest {
pub fn builder() -> builder::PrivateWithdrawRequest {
Default::default()
}
}
///`PrivateWithdrawResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivateWithdrawResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl PrivateWithdrawResponse {
pub fn builder() -> builder::PrivateWithdrawResponse {
Default::default()
}
}
///`ProtocolVault`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "closed",
/// "config",
/// "global_hwm",
/// "last_fee_settled_at_sec",
/// "protocol_fee_share_bps",
/// "subaccount_id",
/// "total_shares"
/// ],
/// "properties": {
/// "closed": {
/// "type": "boolean"
/// },
/// "config": {
/// "$ref": "#/definitions/VaultConfig"
/// },
/// "global_hwm": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "last_fee_settled_at_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "protocol_fee_share_bps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "total_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProtocolVault {
pub closed: bool,
pub config: VaultConfig,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub global_hwm: ::bigdecimal::BigDecimal,
pub last_fee_settled_at_sec: u64,
pub protocol_fee_share_bps: u16,
pub subaccount_id: u64,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub total_shares: ::bigdecimal::BigDecimal,
}
impl ProtocolVault {
pub fn builder() -> builder::ProtocolVault {
Default::default()
}
}
///`PublicExecuteQuoteDebugRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "quote_id",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicExecuteQuoteDebugRequest {
pub direction: Direction,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub nonce: i64,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: u64,
}
impl PublicExecuteQuoteDebugRequest {
pub fn builder() -> builder::PublicExecuteQuoteDebugRequest {
Default::default()
}
}
///`PublicGetWalletsFromSessionKeyResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallets"
/// ],
/// "properties": {
/// "wallets": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicGetWalletsFromSessionKeyResponse {
pub wallets: ::std::vec::Vec<::std::string::String>,
}
impl PublicGetWalletsFromSessionKeyResponse {
pub fn builder() -> builder::PublicGetWalletsFromSessionKeyResponse {
Default::default()
}
}
///`PublicLoginRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "headers": {
/// "description": "Non-standard; used by `auth/login`.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": true
/// },
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// },
/// "method": {
/// "type": "string",
/// "const": "public/login"
/// },
/// "params": {
/// "$ref": "#/definitions/LoginRequest"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicLoginRequest {
///Non-standard; used by `auth/login`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub headers: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
pub id: JsonRpcId,
pub method: ::std::string::String,
pub params: LoginRequest,
}
impl PublicLoginRequest {
pub fn builder() -> builder::PublicLoginRequest {
Default::default()
}
}
///`PublicLoginResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "anyOf": [
/// {
/// "title": "Success",
/// "type": "object",
/// "required": [
/// "result"
/// ],
/// "properties": {
/// "result": {
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
/// }
/// },
/// {
/// "title": "Error",
/// "type": "object",
/// "required": [
/// "error"
/// ],
/// "properties": {
/// "error": {
/// "$ref": "#/definitions/RPCError"
/// }
/// }
/// }
/// ],
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PublicLoginResponse {
Variant0 { id: JsonRpcId, result: ::std::vec::Vec<u64> },
Variant1 { error: RpcError, id: JsonRpcId },
}
///`PublicQuote`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancel_reason",
/// "creation_timestamp",
/// "direction",
/// "fill_pct",
/// "last_update_timestamp",
/// "legs",
/// "legs_hash",
/// "liquidity_role",
/// "quote_id",
/// "rfq_id",
/// "status",
/// "subaccount_id",
/// "wallet"
/// ],
/// "properties": {
/// "cancel_reason": {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "fill_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "legs_hash": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicQuote {
pub cancel_reason: RfqCancelReason,
pub creation_timestamp: i64,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fill_pct: ::bigdecimal::BigDecimal,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
pub legs_hash: ::std::string::String,
pub liquidity_role: LiquidityRole,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub status: RfqStatus,
pub subaccount_id: i64,
pub wallet: Address,
}
impl PublicQuote {
pub fn builder() -> builder::PublicQuote {
Default::default()
}
}
///`PublicRfq`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancel_reason",
/// "creation_timestamp",
/// "fill_rate",
/// "filled_pct",
/// "last_update_timestamp",
/// "legs",
/// "partial_fill_step",
/// "recent_fill_rate",
/// "rfq_id",
/// "status",
/// "subaccount_id",
/// "total_cost",
/// "valid_until",
/// "wallet"
/// ],
/// "properties": {
/// "cancel_reason": {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "fill_rate": {
/// "description": "Lifetime taker fill rate as a decimal string; null until the wallet has enough lifetime RFQs for the rate to be meaningful.",
/// "anyOf": [
/// {
/// "description": "Lifetime taker fill rate as a decimal string; null until the wallet has enough lifetime RFQs for the rate to be meaningful.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "filled_direction": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Direction"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "filled_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/LegUnpricedParams"
/// }
/// },
/// "partial_fill_step": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "recent_fill_rate": {
/// "description": "Decayed-recent taker fill rate as a decimal string; null until enough recent RFQ activity has accumulated for the rate to be meaningful.",
/// "anyOf": [
/// {
/// "description": "Decayed-recent taker fill rate as a decimal string; null until enough recent RFQ activity has accumulated for the rate to be meaningful.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "valid_until": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicRfq {
pub cancel_reason: RfqCancelReason,
pub creation_timestamp: i64,
///Lifetime taker fill rate as a decimal string; null until the wallet has enough lifetime RFQs for the rate to be meaningful.
pub fill_rate: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub filled_direction: ::std::option::Option<Direction>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub filled_pct: ::bigdecimal::BigDecimal,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<LegUnpricedParams>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub partial_fill_step: ::bigdecimal::BigDecimal,
///Decayed-recent taker fill rate as a decimal string; null until enough recent RFQ activity has accumulated for the rate to be meaningful.
pub recent_fill_rate: ::std::option::Option<::bigdecimal::BigDecimal>,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub status: RfqStatus,
pub subaccount_id: i64,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
pub valid_until: i64,
pub wallet: Address,
}
impl PublicRfq {
pub fn builder() -> builder::PublicRfq {
Default::default()
}
}
///`PublicSendQuoteDebugRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicSendQuoteDebugRequest {
pub direction: Direction,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub nonce: i64,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: u64,
}
impl PublicSendQuoteDebugRequest {
pub fn builder() -> builder::PublicSendQuoteDebugRequest {
Default::default()
}
}
///`PublicStartAuctionRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "subaccount_id": {
/// "description": "Subaccount to auction.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicStartAuctionRequest {
///Subaccount to auction.
pub subaccount_id: u64,
}
impl PublicStartAuctionRequest {
pub fn builder() -> builder::PublicStartAuctionRequest {
Default::default()
}
}
///`PublicStartAuctionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicStartAuctionResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl PublicStartAuctionResponse {
pub fn builder() -> builder::PublicStartAuctionResponse {
Default::default()
}
}
///`PublicTrade`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "index_price",
/// "instrument_name",
/// "mark_price",
/// "timestamp",
/// "trade_amount",
/// "trade_id",
/// "trade_price"
/// ],
/// "properties": {
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "index_price": {
/// "type": "string"
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "mark_price": {
/// "type": "string"
/// },
/// "quote_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "rfq_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "trade_amount": {
/// "type": "string"
/// },
/// "trade_id": {
/// "type": "string"
/// },
/// "trade_price": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicTrade {
pub direction: Direction,
pub index_price: ::std::string::String,
pub instrument_name: ::std::string::String,
pub mark_price: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::std::string::String>,
pub timestamp: i64,
pub trade_amount: ::std::string::String,
pub trade_id: ::std::string::String,
pub trade_price: ::std::string::String,
}
impl PublicTrade {
pub fn builder() -> builder::PublicTrade {
Default::default()
}
}
///`PublicTradesResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "trades"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "trades": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/SettledTrade"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicTradesResult {
pub pagination: Pagination,
pub trades: ::std::vec::Vec<SettledTrade>,
}
impl PublicTradesResult {
pub fn builder() -> builder::PublicTradesResult {
Default::default()
}
}
///A vault action at the aggregate, vault level. Per-holder position details (entry/exit price, before/after balances) are omitted — those are available on the private endpoints. Monetary fields (share price, NAV, high-water marks) are decimal strings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A vault action at the aggregate, vault level. Per-holder position details (entry/exit price, before/after balances) are omitted — those are available on the private endpoints. Monetary fields (share price, NAV, high-water marks) are decimal strings.",
/// "type": "object",
/// "required": [
/// "curator_shares_minted",
/// "event_ts",
/// "event_type",
/// "holder",
/// "management_shares_minted",
/// "nav",
/// "new_high_water_mark",
/// "old_high_water_mark",
/// "operation_uuid",
/// "performance_shares_minted",
/// "protocol_shares_minted",
/// "share_price",
/// "shares_delta",
/// "status",
/// "subaccount_id",
/// "total_shares"
/// ],
/// "properties": {
/// "curator_shares_minted": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "event_ts": {
/// "description": "Timestamp of this event (ms).",
/// "type": "integer",
/// "format": "int64"
/// },
/// "event_type": {
/// "description": "\"vault_deposit\" | \"vault_withdraw\" | \"vault_force_withdraw\".",
/// "type": "string"
/// },
/// "holder": {
/// "type": "string"
/// },
/// "management_shares_minted": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nav": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "new_high_water_mark": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "old_high_water_mark": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "operation_uuid": {
/// "type": "string"
/// },
/// "performance_shares_minted": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "protocol_shares_minted": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "share_price": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "shares_delta": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "status": {
/// "description": "While the action is in the queue, one of: \"enqueued\" | \"sequencer_applied\" | \"user_cancel\" | \"curator_reject\" | \"protocol_reject\" | \"expired\".\n\nOnce the action is in the protocol, the status takes on `BatchStatus` values: \"Batching\" | \"Executing\" | \"Proving\" | \"Settling\" | \"Settled\" or an error.",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "total_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicVaultActionResponse {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub curator_shares_minted: ::bigdecimal::BigDecimal,
///Timestamp of this event (ms).
pub event_ts: i64,
///"vault_deposit" | "vault_withdraw" | "vault_force_withdraw".
pub event_type: ::std::string::String,
pub holder: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub management_shares_minted: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub nav: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub new_high_water_mark: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub old_high_water_mark: ::bigdecimal::BigDecimal,
pub operation_uuid: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub performance_shares_minted: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub protocol_shares_minted: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub share_price: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub shares_delta: ::bigdecimal::BigDecimal,
/**While the action is in the queue, one of: "enqueued" | "sequencer_applied" | "user_cancel" | "curator_reject" | "protocol_reject" | "expired".
Once the action is in the protocol, the status takes on `BatchStatus` values: "Batching" | "Executing" | "Proving" | "Settling" | "Settled" or an error.*/
pub status: ::std::string::String,
pub subaccount_id: u64,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub total_shares: ::bigdecimal::BigDecimal,
}
impl PublicVaultActionResponse {
pub fn builder() -> builder::PublicVaultActionResponse {
Default::default()
}
}
///`PublicWithdrawDebugRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount_in_underlying",
/// "asset_name",
/// "force_batch",
/// "max_fee_usd",
/// "nonce",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "amount_in_underlying": {
/// "type": "string"
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "force_batch": {
/// "type": "boolean"
/// },
/// "max_fee_usd": {
/// "description": "Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "recipient": {
/// "description": "L1 address the funds are paid out to. Defaults to the subaccount's owner wallet when omitted — matching what `private/withdraw` reconstructs.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicWithdrawDebugRequest {
pub amount_in_underlying: ::std::string::String,
pub asset_name: ::std::string::String,
pub force_batch: bool,
///Maximum sequencer fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub max_fee_usd: ::bigdecimal::BigDecimal,
pub nonce: i64,
///L1 address the funds are paid out to. Defaults to the subaccount's owner wallet when omitted — matching what `private/withdraw` reconstructs.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recipient: ::std::option::Option<::std::string::String>,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
pub subaccount_id: u64,
}
impl PublicWithdrawDebugRequest {
pub fn builder() -> builder::PublicWithdrawDebugRequest {
Default::default()
}
}
///`Quote`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancel_reason",
/// "creation_timestamp",
/// "direction",
/// "extra_fee",
/// "fee",
/// "fill_pct",
/// "is_transfer",
/// "label",
/// "last_update_timestamp",
/// "legs",
/// "legs_hash",
/// "liquidity_role",
/// "max_fee",
/// "mmp",
/// "nonce",
/// "quote_id",
/// "rfq_id",
/// "signature_expiry_sec",
/// "status",
/// "subaccount_id"
/// ],
/// "properties": {
/// "batch_status": {
/// "description": "Settlement batch status (only for executed quotes).",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "cancel_reason": {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fill_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "type": "string"
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "legs_hash": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "tx_hash": {
/// "description": "Blockchain transaction hash (only for executed quotes).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Quote {
///Settlement batch status (only for executed quotes).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
pub cancel_reason: RfqCancelReason,
pub creation_timestamp: i64,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fill_pct: ::bigdecimal::BigDecimal,
pub is_transfer: bool,
pub label: ::std::string::String,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
pub legs_hash: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub mmp: bool,
pub nonce: ::std::string::String,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature_expiry_sec: i64,
pub status: RfqStatus,
pub subaccount_id: i64,
///Blockchain transaction hash (only for executed quotes).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl Quote {
pub fn builder() -> builder::Quote {
Default::default()
}
}
///`QuoteExecuteDebugResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "action_hash",
/// "encoded_data",
/// "encoded_data_hashed",
/// "encoded_legs",
/// "legs_hash",
/// "typed_data_hash"
/// ],
/// "properties": {
/// "action_hash": {
/// "type": "string"
/// },
/// "encoded_data": {
/// "type": "string"
/// },
/// "encoded_data_hashed": {
/// "type": "string"
/// },
/// "encoded_legs": {
/// "type": "string"
/// },
/// "legs_hash": {
/// "type": "string"
/// },
/// "typed_data_hash": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuoteExecuteDebugResult {
pub action_hash: ::std::string::String,
pub encoded_data: ::std::string::String,
pub encoded_data_hashed: ::std::string::String,
pub encoded_legs: ::std::string::String,
pub legs_hash: ::std::string::String,
pub typed_data_hash: ::std::string::String,
}
impl QuoteExecuteDebugResult {
pub fn builder() -> builder::QuoteExecuteDebugResult {
Default::default()
}
}
///`QuoteExecuteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancel_reason",
/// "creation_timestamp",
/// "direction",
/// "extra_fee",
/// "fee",
/// "fill_pct",
/// "is_transfer",
/// "label",
/// "last_update_timestamp",
/// "legs",
/// "legs_hash",
/// "liquidity_role",
/// "max_fee",
/// "mmp",
/// "nonce",
/// "quote_id",
/// "rfq_filled_pct",
/// "rfq_id",
/// "signature_expiry_sec",
/// "status",
/// "subaccount_id"
/// ],
/// "properties": {
/// "cancel_reason": {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fill_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "type": "string"
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "legs_hash": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_filled_pct": {
/// "description": "Cumulative fraction of the RFQ filled after this execution, as a decimal string (e.g. `\"0.5\"` = 50% filled).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuoteExecuteResponse {
pub cancel_reason: RfqCancelReason,
pub creation_timestamp: i64,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fill_pct: ::bigdecimal::BigDecimal,
pub is_transfer: bool,
pub label: ::std::string::String,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
pub legs_hash: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub mmp: bool,
pub nonce: ::std::string::String,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///Cumulative fraction of the RFQ filled after this execution, as a decimal string (e.g. `"0.5"` = 50% filled).
pub rfq_filled_pct: ::bigdecimal::BigDecimal,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature_expiry_sec: i64,
pub status: RfqStatus,
pub subaccount_id: i64,
}
impl QuoteExecuteResponse {
pub fn builder() -> builder::QuoteExecuteResponse {
Default::default()
}
}
///`QuoteGetResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "quotes"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "quotes": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Quote"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuoteGetResponse {
pub pagination: Pagination,
pub quotes: ::std::vec::Vec<Quote>,
}
impl QuoteGetResponse {
pub fn builder() -> builder::QuoteGetResponse {
Default::default()
}
}
///`QuotePollResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "quotes"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "quotes": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PublicQuote"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuotePollResponse {
pub pagination: Pagination,
pub quotes: ::std::vec::Vec<PublicQuote>,
}
impl QuotePollResponse {
pub fn builder() -> builder::QuotePollResponse {
Default::default()
}
}
///`QuotePublishResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "creation_timestamp",
/// "direction",
/// "extra_fee",
/// "fee",
/// "fill_pct",
/// "is_transfer",
/// "label",
/// "last_update_timestamp",
/// "legs",
/// "legs_hash",
/// "liquidity_role",
/// "max_fee",
/// "mmp",
/// "nonce",
/// "quote_id",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "status",
/// "subaccount_id"
/// ],
/// "properties": {
/// "batch_status": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "cancel_reason": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "fill_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "type": "string"
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "legs_hash": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "quote_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "type": "string"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuotePublishResult {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cancel_reason: ::std::option::Option<RfqCancelReason>,
pub creation_timestamp: i64,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fill_pct: ::bigdecimal::BigDecimal,
pub is_transfer: bool,
pub label: ::std::string::String,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
pub legs_hash: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
pub mmp: bool,
pub nonce: ::std::string::String,
///UUID v4 string
pub quote_id: ::uuid::Uuid,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: ::std::string::String,
pub status: RfqStatus,
pub subaccount_id: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl QuotePublishResult {
pub fn builder() -> builder::QuotePublishResult {
Default::default()
}
}
///`QuoteReplaceResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_quote"
/// ],
/// "properties": {
/// "cancelled_quote": {
/// "$ref": "#/definitions/Quote"
/// },
/// "create_quote_error": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RPCError"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "quote": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Quote"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuoteReplaceResponse {
pub cancelled_quote: Quote,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub create_quote_error: ::std::option::Option<RpcError>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote: ::std::option::Option<Quote>,
}
impl QuoteReplaceResponse {
pub fn builder() -> builder::QuoteReplaceResponse {
Default::default()
}
}
///`QuoteSendDebugResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "action_hash",
/// "encoded_data",
/// "encoded_data_hashed",
/// "typed_data_hash"
/// ],
/// "properties": {
/// "action_hash": {
/// "type": "string"
/// },
/// "encoded_data": {
/// "type": "string"
/// },
/// "encoded_data_hashed": {
/// "type": "string"
/// },
/// "typed_data_hash": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuoteSendDebugResult {
pub action_hash: ::std::string::String,
pub encoded_data: ::std::string::String,
pub encoded_data_hashed: ::std::string::String,
pub typed_data_hash: ::std::string::String,
}
impl QuoteSendDebugResult {
pub fn builder() -> builder::QuoteSendDebugResult {
Default::default()
}
}
///`RateFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "expiry",
/// "rate",
/// "signatures",
/// "timestamp"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "expiry": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "rate": {
/// "type": "string"
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RateFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
pub expiry: u64,
pub rate: ::std::string::String,
pub signatures: OracleSignatureDataResponse,
pub timestamp: u64,
}
impl RateFeedDataResponse {
pub fn builder() -> builder::RateFeedDataResponse {
Default::default()
}
}
///`RateLimitInfo`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "consumedPoints",
/// "isFirstInDuration",
/// "msBeforeNext",
/// "remainingPoints"
/// ],
/// "properties": {
/// "consumedPoints": {
/// "description": "Total consumed points.",
/// "type": "integer",
/// "format": "int64"
/// },
/// "isFirstInDuration": {
/// "description": "Whether it's the first request in this duration window.",
/// "type": "boolean"
/// },
/// "msBeforeNext": {
/// "description": "Milliseconds before the next request is allowed (0 if none).",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "remainingPoints": {
/// "description": "Number of remaining points (tokens).",
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RateLimitInfo {
///Total consumed points.
#[serde(rename = "consumedPoints")]
pub consumed_points: i64,
///Whether it's the first request in this duration window.
#[serde(rename = "isFirstInDuration")]
pub is_first_in_duration: bool,
///Milliseconds before the next request is allowed (0 if none).
#[serde(rename = "msBeforeNext")]
pub ms_before_next: u64,
///Number of remaining points (tokens).
#[serde(rename = "remainingPoints")]
pub remaining_points: i64,
}
impl RateLimitInfo {
pub fn builder() -> builder::RateLimitInfo {
Default::default()
}
}
///`RateLimitResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "remaining_matching",
/// "remaining_non_matching",
/// "remaining_per_endpoint"
/// ],
/// "properties": {
/// "remaining_connections": {
/// "description": "Remaining WebSocket connection allowance for this account, present only on WebSocket connections.",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RateLimitInfo"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "remaining_matching": {
/// "$ref": "#/definitions/RateLimitInfo"
/// },
/// "remaining_non_matching": {
/// "$ref": "#/definitions/RateLimitInfo"
/// },
/// "remaining_per_endpoint": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/definitions/RateLimitInfo"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RateLimitResult {
///Remaining WebSocket connection allowance for this account, present only on WebSocket connections.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub remaining_connections: ::std::option::Option<RateLimitInfo>,
pub remaining_matching: RateLimitInfo,
pub remaining_non_matching: RateLimitInfo,
pub remaining_per_endpoint: ::std::collections::HashMap<
::std::string::String,
RateLimitInfo,
>,
}
impl RateLimitResult {
pub fn builder() -> builder::RateLimitResult {
Default::default()
}
}
///Referral performance for one `(role, currency, instrument_type)` bucket.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Referral performance for one `(role, currency, instrument_type)` bucket.",
/// "type": "object",
/// "required": [
/// "builder_fee",
/// "fee_reward",
/// "notional_volume",
/// "referred_fee",
/// "unique_traders_referred"
/// ],
/// "properties": {
/// "builder_fee": {
/// "type": "string"
/// },
/// "fee_reward": {
/// "type": "string"
/// },
/// "notional_volume": {
/// "type": "string"
/// },
/// "referred_fee": {
/// "type": "string"
/// },
/// "unique_traders_referred": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReferralPerformanceByInstrumentType {
pub builder_fee: ::std::string::String,
pub fee_reward: ::std::string::String,
pub notional_volume: ::std::string::String,
pub referred_fee: ::std::string::String,
pub unique_traders_referred: u64,
}
impl ReferralPerformanceByInstrumentType {
pub fn builder() -> builder::ReferralPerformanceByInstrumentType {
Default::default()
}
}
///`Referrer`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "referral_code",
/// "wallet"
/// ],
/// "properties": {
/// "receiving_wallet": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "referral_code": {
/// "type": "string"
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Referrer {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub receiving_wallet: ::std::option::Option<::std::string::String>,
pub referral_code: ::std::string::String,
pub wallet: ::std::string::String,
}
impl Referrer {
pub fn builder() -> builder::Referrer {
Default::default()
}
}
///`RegisterDepositAddressParams`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "deposit_type",
/// "wallet"
/// ],
/// "properties": {
/// "deposit_type": {
/// "description": "Which factory to register against. Required: the same `(wallet, subaccount, manager)` has a distinct escrow address per factory, so callers must always be explicit about which flow they want.",
/// "$ref": "#/definitions/DepositType"
/// },
/// "manager_id": {
/// "description": "Manager the deposit routes under. Required (non-zero) when creating a new subaccount (`subaccount_id` omitted or 0); must be 0 or omitted for an existing subaccount — it salts the deposit address, so a nonzero value would mint a distinct escrow for the same destination.",
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "default": 0,
/// "type": "integer",
/// "format": "int64"
/// },
/// "wallet": {
/// "description": "Wallet address to watch for deposits.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RegisterDepositAddressParams {
///Which factory to register against. Required: the same `(wallet, subaccount, manager)` has a distinct escrow address per factory, so callers must always be explicit about which flow they want.
pub deposit_type: DepositType,
///Manager the deposit routes under. Required (non-zero) when creating a new subaccount (`subaccount_id` omitted or 0); must be 0 or omitted for an existing subaccount — it salts the deposit address, so a nonzero value would mint a distinct escrow for the same destination.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub manager_id: ::std::option::Option<u32>,
#[serde(default)]
pub subaccount_id: i64,
///Wallet address to watch for deposits.
pub wallet: ::std::string::String,
}
impl RegisterDepositAddressParams {
pub fn builder() -> builder::RegisterDepositAddressParams {
Default::default()
}
}
///`RegisterDepositAddressResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "deposit_address",
/// "deposit_type",
/// "wallet"
/// ],
/// "properties": {
/// "deposit_address": {
/// "type": "string"
/// },
/// "deposit_type": {
/// "$ref": "#/definitions/DepositType"
/// },
/// "manager_id": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RegisterDepositAddressResult {
pub deposit_address: ::std::string::String,
pub deposit_type: DepositType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub manager_id: ::std::option::Option<u32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_id: ::std::option::Option<i64>,
pub wallet: ::std::string::String,
}
impl RegisterDepositAddressResult {
pub fn builder() -> builder::RegisterDepositAddressResult {
Default::default()
}
}
///`RejectDepositRequestRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "request_id"
/// ],
/// "properties": {
/// "reason": {
/// "description": "Optional human-readable reason for the rejection.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "request_id": {
/// "$ref": "#/definitions/VaultRequestId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RejectDepositRequestRequest {
///Optional human-readable reason for the rejection.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
pub request_id: VaultRequestId,
}
impl RejectDepositRequestRequest {
pub fn builder() -> builder::RejectDepositRequestRequest {
Default::default()
}
}
///`private/replace` parameters: a `private/order` payload plus the cancel-target fields (`order_id_to_cancel`, `nonce_to_cancel`, `expected_filled_amount`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`private/replace` parameters: a `private/order` payload plus the cancel-target fields (`order_id_to_cancel`, `nonce_to_cancel`, `expected_filled_amount`).",
/// "type": "object",
/// "required": [
/// "amount",
/// "direction",
/// "instrument_name",
/// "limit_price",
/// "max_fee",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "algo_duration_sec": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_num_slices": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "algo_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/AlgoType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "amount": {
/// "description": "Order amount in units of the base, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "client": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "expected_filled_amount": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "extra_fee": {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "is_atomic_signing": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "label": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "limit_price": {
/// "description": "Limit price in quote currency, as a decimal string (e.g. `\"3100.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "max_fee": {
/// "description": "Max fee per unit of volume in quote currency, as a decimal string or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "nonce_to_cancel": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "order_id_to_cancel": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "order_type": {
/// "default": "limit",
/// "$ref": "#/definitions/OrderType"
/// },
/// "reduce_only": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "referral_code": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "reject_post_only": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "reject_timestamp": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "time_in_force": {
/// "default": "gtc",
/// "$ref": "#/definitions/TimeInForce"
/// },
/// "trigger_price": {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Trigger price as a decimal string or JSON number; omit for non-trigger orders.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_price_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerPriceType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trigger_type": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/TriggerType"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReplaceOrderRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_duration_sec: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_num_slices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub algo_type: ::std::option::Option<AlgoType>,
///Order amount in units of the base, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub amount: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub client: ::std::option::Option<::std::string::String>,
pub direction: Direction,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expected_filled_amount: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional extra fee per unit of volume, as a decimal string or JSON number. Defaults to zero.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra_fee: ::std::option::Option<::bigdecimal::BigDecimal>,
pub instrument_name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_atomic_signing: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
///Limit price in quote currency, as a decimal string (e.g. `"3100.5"`) or a JSON number.
pub limit_price: ::bigdecimal::BigDecimal,
///Max fee per unit of volume in quote currency, as a decimal string or a JSON number.
pub max_fee: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mmp: ::std::option::Option<bool>,
pub nonce: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nonce_to_cancel: ::std::option::Option<i64>,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub order_id_to_cancel: ::std::option::Option<::uuid::Uuid>,
#[serde(default = "defaults::replace_order_request_order_type")]
pub order_type: OrderType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reduce_only: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub referral_code: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reject_post_only: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reject_timestamp: ::std::option::Option<i64>,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: ::std::string::String,
pub subaccount_id: i64,
#[serde(default = "defaults::replace_order_request_time_in_force")]
pub time_in_force: TimeInForce,
///Trigger price as a decimal string or JSON number; omit for non-trigger orders.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_price_type: ::std::option::Option<TriggerPriceType>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trigger_type: ::std::option::Option<TriggerType>,
}
impl ReplaceOrderRequest {
pub fn builder() -> builder::ReplaceOrderRequest {
Default::default()
}
}
///`ReplaceOrderResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cancelled_order"
/// ],
/// "properties": {
/// "cancelled_order": {
/// "$ref": "#/definitions/Order"
/// },
/// "create_order_error": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/RPCError"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "order": {
/// "default": null,
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Order"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "trades": {
/// "default": null,
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/definitions/Trade"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReplaceOrderResponse {
pub cancelled_order: Order,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub create_order_error: ::std::option::Option<RpcError>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub order: ::std::option::Option<Order>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub trades: ::std::option::Option<::std::vec::Vec<Trade>>,
}
impl ReplaceOrderResponse {
pub fn builder() -> builder::ReplaceOrderResponse {
Default::default()
}
}
///`ReplaceQuoteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "default": false,
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "nonce_to_cancel": {
/// "default": null,
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "quote_id_to_cancel": {
/// "description": "Optional UUID v4 string",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "referral_code": {
/// "default": "",
/// "type": "string"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReplaceQuoteRequest {
#[serde(default)]
pub client: ::std::string::String,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::replace_quote_request_extra_fee")]
pub extra_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub label: ::std::string::String,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub mmp: bool,
pub nonce: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nonce_to_cancel: ::std::option::Option<i64>,
///Optional UUID v4 string
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quote_id_to_cancel: ::std::option::Option<::uuid::Uuid>,
#[serde(default)]
pub referral_code: ::std::string::String,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: u64,
}
impl ReplaceQuoteRequest {
pub fn builder() -> builder::ReplaceQuoteRequest {
Default::default()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "amount",
/// "deposit_spot_asset",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id",
/// "vault_subaccount_id"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Deposit amount in the vault's deposit asset, as a decimal string (e.g. `\"1\"`).",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "deposit_spot_asset": {
/// "$ref": "#/definitions/Address"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "vault_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RequestVaultDepositRequest {
///Deposit amount in the vault's deposit asset, as a decimal string (e.g. `"1"`).
pub amount: ::bigdecimal::BigDecimal,
pub deposit_spot_asset: Address,
pub nonce: u64,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
pub vault_subaccount_id: u64,
}
impl RequestVaultDepositRequest {
pub fn builder() -> builder::RequestVaultDepositRequest {
Default::default()
}
}
///Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Fields common to every signed vault action. They appear alongside each endpoint's action-specific parameters in the same request object.",
/// "type": "object",
/// "required": [
/// "nonce",
/// "shares_to_burn",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id",
/// "vault_subaccount_id"
/// ],
/// "properties": {
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "shares_to_burn": {
/// "description": "Number of vault shares to burn, as a decimal string.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "signature": {
/// "description": "0x-prefixed hex of the 65-byte EOA signature.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "description": "The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "vault_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RequestVaultWithdrawRequest {
pub nonce: u64,
///Number of vault shares to burn, as a decimal string.
pub shares_to_burn: ::bigdecimal::BigDecimal,
///0x-prefixed hex of the 65-byte EOA signature.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: Address,
///The subaccount the action is signed on; which subaccount applies depends on the specific method — see that method's reference.
pub subaccount_id: u64,
pub vault_subaccount_id: u64,
}
impl RequestVaultWithdrawRequest {
pub fn builder() -> builder::RequestVaultWithdrawRequest {
Default::default()
}
}
///`ResetMmpResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum ResetMmpResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for ResetMmpResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for ResetMmpResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ResetMmpResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ResetMmpResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ResetMmpResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`Rfq`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ask_total_cost",
/// "bid_total_cost",
/// "cancel_reason",
/// "creation_timestamp",
/// "filled_pct",
/// "label",
/// "last_update_timestamp",
/// "legs",
/// "mark_total_cost",
/// "max_total_cost",
/// "min_total_cost",
/// "partial_fill_step",
/// "rfq_id",
/// "status",
/// "subaccount_id",
/// "total_cost",
/// "valid_until",
/// "wallet"
/// ],
/// "properties": {
/// "ask_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "bid_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "cancel_reason": {
/// "$ref": "#/definitions/RFQCancelReason"
/// },
/// "counterparties": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/definitions/Address"
/// }
/// },
/// "creation_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "filled_direction": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Direction"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "filled_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "label": {
/// "type": "string"
/// },
/// "last_update_timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/LegUnpricedParams"
/// }
/// },
/// "mark_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "max_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "min_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "partial_fill_step": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "status": {
/// "$ref": "#/definitions/RFQStatus"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "valid_until": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Rfq {
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub ask_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub bid_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
pub cancel_reason: RfqCancelReason,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub counterparties: ::std::option::Option<::std::vec::Vec<Address>>,
pub creation_timestamp: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub filled_direction: ::std::option::Option<Direction>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub filled_pct: ::bigdecimal::BigDecimal,
pub label: ::std::string::String,
pub last_update_timestamp: i64,
pub legs: ::std::vec::Vec<LegUnpricedParams>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub mark_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub max_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub min_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub partial_fill_step: ::bigdecimal::BigDecimal,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub status: RfqStatus,
pub subaccount_id: i64,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
pub valid_until: i64,
pub wallet: Address,
}
impl Rfq {
pub fn builder() -> builder::Rfq {
Default::default()
}
}
///`RfqCancelReason`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "",
/// "user_request",
/// "insufficient_margin",
/// "signed_max_fee_too_low",
/// "mmp_trigger",
/// "cancel_on_disconnect",
/// "session_key_deregistered",
/// "subaccount_withdrawn",
/// "rfq_no_longer_open",
/// "compliance",
/// "validation_failed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum RfqCancelReason {
#[serde(rename = "")]
X,
#[serde(rename = "user_request")]
UserRequest,
#[serde(rename = "insufficient_margin")]
InsufficientMargin,
#[serde(rename = "signed_max_fee_too_low")]
SignedMaxFeeTooLow,
#[serde(rename = "mmp_trigger")]
MmpTrigger,
#[serde(rename = "cancel_on_disconnect")]
CancelOnDisconnect,
#[serde(rename = "session_key_deregistered")]
SessionKeyDeregistered,
#[serde(rename = "subaccount_withdrawn")]
SubaccountWithdrawn,
#[serde(rename = "rfq_no_longer_open")]
RfqNoLongerOpen,
#[serde(rename = "compliance")]
Compliance,
#[serde(rename = "validation_failed")]
ValidationFailed,
}
impl ::std::fmt::Display for RfqCancelReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::X => f.write_str(""),
Self::UserRequest => f.write_str("user_request"),
Self::InsufficientMargin => f.write_str("insufficient_margin"),
Self::SignedMaxFeeTooLow => f.write_str("signed_max_fee_too_low"),
Self::MmpTrigger => f.write_str("mmp_trigger"),
Self::CancelOnDisconnect => f.write_str("cancel_on_disconnect"),
Self::SessionKeyDeregistered => f.write_str("session_key_deregistered"),
Self::SubaccountWithdrawn => f.write_str("subaccount_withdrawn"),
Self::RfqNoLongerOpen => f.write_str("rfq_no_longer_open"),
Self::Compliance => f.write_str("compliance"),
Self::ValidationFailed => f.write_str("validation_failed"),
}
}
}
impl ::std::str::FromStr for RfqCancelReason {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"" => Ok(Self::X),
"user_request" => Ok(Self::UserRequest),
"insufficient_margin" => Ok(Self::InsufficientMargin),
"signed_max_fee_too_low" => Ok(Self::SignedMaxFeeTooLow),
"mmp_trigger" => Ok(Self::MmpTrigger),
"cancel_on_disconnect" => Ok(Self::CancelOnDisconnect),
"session_key_deregistered" => Ok(Self::SessionKeyDeregistered),
"subaccount_withdrawn" => Ok(Self::SubaccountWithdrawn),
"rfq_no_longer_open" => Ok(Self::RfqNoLongerOpen),
"compliance" => Ok(Self::Compliance),
"validation_failed" => Ok(Self::ValidationFailed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for RfqCancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for RfqCancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RfqCancelReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`RfqGetBestQuoteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "direction": {
/// "default": "buy",
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "legs": {
/// "default": [],
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/LegUnpricedParams"
/// }
/// },
/// "rfq_id": {
/// "description": "RFQ ID to get best quote for.\n\nIf not provided, will return estimates based on mark prices.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RfqGetBestQuoteRequest {
#[serde(default)]
pub client: ::std::string::String,
#[serde(default = "defaults::rfq_get_best_quote_request_direction")]
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::rfq_get_best_quote_request_extra_fee")]
pub extra_fee: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub legs: ::std::vec::Vec<LegUnpricedParams>,
/**RFQ ID to get best quote for.
If not provided, will return estimates based on mark prices.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: u64,
}
impl RfqGetBestQuoteRequest {
pub fn builder() -> builder::RfqGetBestQuoteRequest {
Default::default()
}
}
///`RfqGetBestQuoteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "down_liquidation_price",
/// "estimated_fee",
/// "estimated_realized_pnl",
/// "estimated_realized_pnl_excl_fees",
/// "estimated_total_cost",
/// "filled_pct",
/// "is_valid",
/// "orderbook_total_cost",
/// "post_initial_margin",
/// "post_liquidation_price",
/// "pre_initial_margin",
/// "suggested_max_fee",
/// "up_liquidation_price"
/// ],
/// "properties": {
/// "best_quote": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/PublicQuote"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "down_liquidation_price": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "estimated_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "estimated_realized_pnl": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "estimated_realized_pnl_excl_fees": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "estimated_total_cost": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "filled_pct": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "invalid_reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "is_valid": {
/// "type": "boolean"
/// },
/// "orderbook_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "post_initial_margin": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "post_liquidation_price": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "pre_initial_margin": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "suggested_max_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "up_liquidation_price": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RfqGetBestQuoteResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub best_quote: ::std::option::Option<PublicQuote>,
pub direction: Direction,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub down_liquidation_price: ::std::option::Option<::bigdecimal::BigDecimal>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub estimated_fee: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub estimated_realized_pnl: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub estimated_realized_pnl_excl_fees: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub estimated_total_cost: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub filled_pct: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invalid_reason: ::std::option::Option<::std::string::String>,
pub is_valid: bool,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub orderbook_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub post_initial_margin: ::bigdecimal::BigDecimal,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub post_liquidation_price: ::std::option::Option<::bigdecimal::BigDecimal>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub pre_initial_margin: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub suggested_max_fee: ::bigdecimal::BigDecimal,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub up_liquidation_price: ::std::option::Option<::bigdecimal::BigDecimal>,
}
impl RfqGetBestQuoteResponse {
pub fn builder() -> builder::RfqGetBestQuoteResponse {
Default::default()
}
}
///`RfqGetResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "rfqs"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "rfqs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Rfq"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RfqGetResponse {
pub pagination: Pagination,
pub rfqs: ::std::vec::Vec<Rfq>,
}
impl RfqGetResponse {
pub fn builder() -> builder::RfqGetResponse {
Default::default()
}
}
///`RfqPollResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pagination",
/// "rfqs"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "rfqs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PublicRfq"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RfqPollResponse {
pub pagination: Pagination,
pub rfqs: ::std::vec::Vec<PublicRfq>,
}
impl RfqPollResponse {
pub fn builder() -> builder::RfqPollResponse {
Default::default()
}
}
///`RfqStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "open",
/// "filled",
/// "cancelled",
/// "expired"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum RfqStatus {
#[serde(rename = "open")]
Open,
#[serde(rename = "filled")]
Filled,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "expired")]
Expired,
}
impl ::std::fmt::Display for RfqStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Open => f.write_str("open"),
Self::Filled => f.write_str("filled"),
Self::Cancelled => f.write_str("cancelled"),
Self::Expired => f.write_str("expired"),
}
}
}
impl ::std::str::FromStr for RfqStatus {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"open" => Ok(Self::Open),
"filled" => Ok(Self::Filled),
"cancelled" => Ok(Self::Cancelled),
"expired" => Ok(Self::Expired),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for RfqStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for RfqStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RfqStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///One risk universe: its display metadata, managers (each with what it lets you trade and deposit), and the Security Module absorbing the universe's losses. The universe-first mirror of `public/get_all_currencies` — pick a universe, pick a manager in it, and the `manager_id` is what you pass when depositing to a new subaccount.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One risk universe: its display metadata, managers (each with what it lets you trade and deposit), and the Security Module absorbing the universe's losses. The universe-first mirror of `public/get_all_currencies` — pick a universe, pick a manager in it, and the `manager_id` is what you pass when depositing to a new subaccount.",
/// "type": "object",
/// "required": [
/// "managers",
/// "risk_universe_id",
/// "security_module"
/// ],
/// "properties": {
/// "description": {
/// "description": "Short description of the universe; null until set by the exchange.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "managers": {
/// "description": "The universe's managers (at most one Standard and one Portfolio), each with the instruments it risk-prices and the collaterals it accepts.",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/RiskUniverseManager"
/// }
/// },
/// "name": {
/// "description": "Display name (e.g. \"PRIME\"), always uppercase; null until set by the exchange.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "security_module": {
/// "$ref": "#/definitions/SecurityModuleDetails"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RiskUniverse {
///Short description of the universe; null until set by the exchange.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///The universe's managers (at most one Standard and one Portfolio), each with the instruments it risk-prices and the collaterals it accepts.
pub managers: ::std::vec::Vec<RiskUniverseManager>,
///Display name (e.g. "PRIME"), always uppercase; null until set by the exchange.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub risk_universe_id: u32,
pub security_module: SecurityModuleDetails,
}
impl RiskUniverse {
pub fn builder() -> builder::RiskUniverse {
Default::default()
}
}
///A manager and what a subaccount created under it can trade and hold.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A manager and what a subaccount created under it can trade and hold.",
/// "type": "object",
/// "required": [
/// "collaterals",
/// "instruments",
/// "manager_id",
/// "margin_type"
/// ],
/// "properties": {
/// "collaterals": {
/// "description": "Assets this manager accepts as deposit collateral.",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/ManagerCollateral"
/// }
/// },
/// "instruments": {
/// "description": "Live derivative asset names tradeable under this manager, sorted (e.g. \"BTC-OPTION\", \"BTC-PERP\"). An option entry names the family — fetch its individual listings via `public/get_all_instruments`.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "manager_id": {
/// "description": "Pass this as `manager_id` when depositing to a new subaccount.",
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "margin_type": {
/// "$ref": "#/definitions/MarginType"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RiskUniverseManager {
///Assets this manager accepts as deposit collateral.
pub collaterals: ::std::vec::Vec<ManagerCollateral>,
///Live derivative asset names tradeable under this manager, sorted (e.g. "BTC-OPTION", "BTC-PERP"). An option entry names the family — fetch its individual listings via `public/get_all_instruments`.
pub instruments: ::std::vec::Vec<::std::string::String>,
///Pass this as `manager_id` when depositing to a new subaccount.
pub manager_id: u32,
pub margin_type: MarginType,
}
impl RiskUniverseManager {
pub fn builder() -> builder::RiskUniverseManager {
Default::default()
}
}
///`RpcError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "data": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "message": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RpcError {
pub code: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub data: ::std::option::Option<::std::string::String>,
pub message: ::std::string::String,
}
impl RpcError {
pub fn builder() -> builder::RpcError {
Default::default()
}
}
///The universe's Security Module: the subaccount whose funds absorb insolvent losses before any socialization within the universe.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The universe's Security Module: the subaccount whose funds absorb insolvent losses before any socialization within the universe.",
/// "type": "object",
/// "required": [
/// "cash_asset",
/// "cash_currency",
/// "subaccount_id"
/// ],
/// "properties": {
/// "cash_asset": {
/// "description": "EIP-55 checksummed address of the universe's cash asset.",
/// "type": "string"
/// },
/// "cash_currency": {
/// "description": "Currency of the cash asset (e.g. \"USDC\").",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SecurityModuleDetails {
///EIP-55 checksummed address of the universe's cash asset.
pub cash_asset: ::std::string::String,
///Currency of the cash asset (e.g. "USDC").
pub cash_currency: ::std::string::String,
pub subaccount_id: u64,
}
impl SecurityModuleDetails {
pub fn builder() -> builder::SecurityModuleDetails {
Default::default()
}
}
///`SendQuoteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "rfq_id",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp": {
/// "default": false,
/// "type": "boolean"
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "referral_code": {
/// "default": "",
/// "type": "string"
/// },
/// "rfq_id": {
/// "description": "UUID v4 string",
/// "type": "string",
/// "format": "uuid"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SendQuoteRequest {
#[serde(default)]
pub client: ::std::string::String,
pub direction: Direction,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::send_quote_request_extra_fee")]
pub extra_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub label: ::std::string::String,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub max_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub mmp: bool,
pub nonce: i64,
#[serde(default)]
pub referral_code: ::std::string::String,
///UUID v4 string
pub rfq_id: ::uuid::Uuid,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: u64,
}
impl SendQuoteRequest {
pub fn builder() -> builder::SendQuoteRequest {
Default::default()
}
}
///`SendRfqRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "legs",
/// "subaccount_id"
/// ],
/// "properties": {
/// "client": {
/// "default": "",
/// "type": "string"
/// },
/// "counterparties": {
/// "default": null,
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "extra_fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/LegUnpricedParams"
/// }
/// },
/// "max_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "min_total_cost": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "partial_fill_step": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "1",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "referral_code": {
/// "default": "",
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SendRfqRequest {
#[serde(default)]
pub client: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub counterparties: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::send_rfq_request_extra_fee")]
pub extra_fee: ::bigdecimal::BigDecimal,
#[serde(default)]
pub label: ::std::string::String,
pub legs: ::std::vec::Vec<LegUnpricedParams>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub min_total_cost: ::std::option::Option<::bigdecimal::BigDecimal>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::send_rfq_request_partial_fill_step")]
pub partial_fill_step: ::bigdecimal::BigDecimal,
#[serde(default)]
pub referral_code: ::std::string::String,
pub subaccount_id: u64,
}
impl SendRfqRequest {
pub fn builder() -> builder::SendRfqRequest {
Default::default()
}
}
///`SessionKey`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expiry_sec",
/// "ip_whitelist",
/// "label",
/// "offchain_scopes",
/// "protocol_scopes",
/// "public_session_key",
/// "registered_sec",
/// "subaccount_ids"
/// ],
/// "properties": {
/// "expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "ip_whitelist": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "label": {
/// "type": "string"
/// },
/// "offchain_scopes": {
/// "description": "Off-chain scopes (read-tier capabilities).",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "protocol_scopes": {
/// "description": "Protocol-level (on-chain authority) scopes.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "public_session_key": {
/// "type": "string"
/// },
/// "registered_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_ids": {
/// "description": "Subaccounts this key may act on. An empty stored value means \"all subaccounts\" and is expanded to the wallet's current subaccount list.",
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SessionKey {
pub expiry_sec: u64,
pub ip_whitelist: ::std::vec::Vec<::std::string::String>,
pub label: ::std::string::String,
///Off-chain scopes (read-tier capabilities).
pub offchain_scopes: ::std::vec::Vec<::std::string::String>,
///Protocol-level (on-chain authority) scopes.
pub protocol_scopes: ::std::vec::Vec<::std::string::String>,
pub public_session_key: ::std::string::String,
pub registered_sec: u64,
///Subaccounts this key may act on. An empty stored value means "all subaccounts" and is expanded to the wallet's current subaccount list.
pub subaccount_ids: ::std::vec::Vec<u64>,
}
impl SessionKey {
pub fn builder() -> builder::SessionKey {
Default::default()
}
}
///`SessionKeysRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "wallet"
/// ],
/// "properties": {
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SessionKeysRequest {
pub wallet: ::std::string::String,
}
impl SessionKeysRequest {
pub fn builder() -> builder::SessionKeysRequest {
Default::default()
}
}
///`private/set_cancel_on_disconnect` params. `wallet` is captured by the auth context.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`private/set_cancel_on_disconnect` params. `wallet` is captured by the auth context.",
/// "type": "object",
/// "properties": {
/// "enabled": {
/// "description": "Whether to enable or disable cancel on disconnect.",
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "wallet": {
/// "description": "Wallet address.",
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SetCancelOnDisconnectRequest {
///Whether to enable or disable cancel on disconnect.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
///Wallet address.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub wallet: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for SetCancelOnDisconnectRequest {
fn default() -> Self {
Self {
enabled: Default::default(),
wallet: Default::default(),
}
}
}
impl SetCancelOnDisconnectRequest {
pub fn builder() -> builder::SetCancelOnDisconnectRequest {
Default::default()
}
}
///The literal string `"ok"` returned on success.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The literal string `\"ok\"` returned on success.",
/// "type": "string",
/// "enum": [
/// "ok"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum SetCancelOnDisconnectResponse {
#[serde(rename = "ok")]
Ok,
}
impl ::std::fmt::Display for SetCancelOnDisconnectResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for SetCancelOnDisconnectResponse {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SetCancelOnDisconnectResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SetCancelOnDisconnectResponse {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SetCancelOnDisconnectResponse {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`mmp_interval` and `mmp_frozen_time` are specified in milliseconds (rounded down to the nearest whole second).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`mmp_interval` and `mmp_frozen_time` are specified in milliseconds (rounded down to the nearest whole second).",
/// "type": "object",
/// "required": [
/// "currency",
/// "mmp_frozen_time",
/// "mmp_interval",
/// "subaccount_id"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "mmp_amount_limit": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp_delta_limit": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "default": "0",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "mmp_frozen_time": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "mmp_interval": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SetMmpConfigRequest {
pub currency: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::set_mmp_config_request_mmp_amount_limit")]
pub mmp_amount_limit: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
#[serde(default = "defaults::set_mmp_config_request_mmp_delta_limit")]
pub mmp_delta_limit: ::bigdecimal::BigDecimal,
pub mmp_frozen_time: u64,
pub mmp_interval: u64,
pub subaccount_id: u64,
}
impl SetMmpConfigRequest {
pub fn builder() -> builder::SetMmpConfigRequest {
Default::default()
}
}
///Echoes the inbound params back: decimal-string limits, ms intervals.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Echoes the inbound params back: decimal-string limits, ms intervals.",
/// "type": "object",
/// "required": [
/// "currency",
/// "mmp_amount_limit",
/// "mmp_delta_limit",
/// "mmp_frozen_time",
/// "mmp_interval",
/// "subaccount_id"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "mmp_amount_limit": {
/// "type": "string"
/// },
/// "mmp_delta_limit": {
/// "type": "string"
/// },
/// "mmp_frozen_time": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "mmp_interval": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SetMmpConfigResponse {
pub currency: ::std::string::String,
pub mmp_amount_limit: ::std::string::String,
pub mmp_delta_limit: ::std::string::String,
pub mmp_frozen_time: u64,
pub mmp_interval: u64,
pub subaccount_id: u64,
}
impl SetMmpConfigResponse {
pub fn builder() -> builder::SetMmpConfigResponse {
Default::default()
}
}
///Request parameters for registering a scoped session key. Address fields are 0x-prefixed hex strings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Request parameters for registering a scoped session key. Address fields are 0x-prefixed hex strings.",
/// "type": "object",
/// "required": [
/// "expiry_sec",
/// "nonce",
/// "offchain_scopes",
/// "protocol_scopes",
/// "public_session_key",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "wallet"
/// ],
/// "properties": {
/// "expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "ip_whitelist": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "label": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "offchain_scopes": {
/// "description": "Off-chain scopes which are validated in backend only",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "protocol_scopes": {
/// "description": "Scopes granted to the session key, validated by the protocol. Each is a string like `\"trade:orderbook:all\"`.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "public_session_key": {
/// "description": "Session key address being authorized.",
/// "type": "string"
/// },
/// "signature": {
/// "description": "0x-prefixed hex, 65-byte r||s||v.",
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "subaccount_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// },
/// "wallet": {
/// "description": "Wallet the session key is being registered for.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SetSessionKeyRequest {
pub expiry_sec: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ip_whitelist: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
pub nonce: ::std::string::String,
///Off-chain scopes which are validated in backend only
pub offchain_scopes: ::std::vec::Vec<::std::string::String>,
///Scopes granted to the session key, validated by the protocol. Each is a string like `"trade:orderbook:all"`.
pub protocol_scopes: ::std::vec::Vec<::std::string::String>,
///Session key address being authorized.
pub public_session_key: ::std::string::String,
///0x-prefixed hex, 65-byte r||s||v.
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subaccount_ids: ::std::option::Option<::std::vec::Vec<u64>>,
///Wallet the session key is being registered for.
pub wallet: ::std::string::String,
}
impl SetSessionKeyRequest {
pub fn builder() -> builder::SetSessionKeyRequest {
Default::default()
}
}
///A settled trade returned by `public/get_trade_history`. Anonymized: no `order_id` or `label`. `wallet` is included since settled trades are visible on-chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A settled trade returned by `public/get_trade_history`. Anonymized: no `order_id` or `label`. `wallet` is included since settled trades are visible on-chain.",
/// "type": "object",
/// "required": [
/// "direction",
/// "expected_rebate",
/// "extra_fee",
/// "index_price",
/// "instrument_name",
/// "liquidity_role",
/// "mark_price",
/// "quote_id",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "rfq_id",
/// "subaccount_id",
/// "timestamp",
/// "trade_amount",
/// "trade_fee",
/// "trade_id",
/// "trade_price",
/// "tx_hash",
/// "wallet"
/// ],
/// "properties": {
/// "batch_status": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "expected_rebate": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "extra_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "index_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "mark_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "quote_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "realized_pnl": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "realized_pnl_excl_fees": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "trade_amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_id": {
/// "type": "string"
/// },
/// "trade_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "tx_hash": {
/// "type": "string"
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SettledTrade {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
pub direction: Direction,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub expected_rebate: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub index_price: ::bigdecimal::BigDecimal,
pub instrument_name: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub mark_price: ::bigdecimal::BigDecimal,
///Optional UUID v4 string
pub quote_id: ::std::option::Option<::uuid::Uuid>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl_excl_fees: ::bigdecimal::BigDecimal,
///Optional UUID v4 string
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: i64,
pub timestamp: i64,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_amount: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_fee: ::bigdecimal::BigDecimal,
pub trade_id: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_price: ::bigdecimal::BigDecimal,
pub tx_hash: ::std::string::String,
pub wallet: ::std::string::String,
}
impl SettledTrade {
pub fn builder() -> builder::SettledTrade {
Default::default()
}
}
///An Action bundled with its ECDSA signature (65 bytes: r||s||v).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An Action bundled with its ECDSA signature (65 bytes: r||s||v).",
/// "type": "object",
/// "required": [
/// "action",
/// "signature"
/// ],
/// "properties": {
/// "action": {
/// "description": "The signed action envelope.",
/// "$ref": "#/definitions/Action"
/// },
/// "signature": {
/// "description": "65-byte ECDSA signature (r||s||v).",
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint8",
/// "minimum": 0.0
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SignedAction {
///The signed action envelope.
pub action: Action,
///65-byte ECDSA signature (r||s||v).
pub signature: ::std::vec::Vec<u8>,
}
impl SignedAction {
pub fn builder() -> builder::SignedAction {
Default::default()
}
}
///Action info that needs to be signed by quoter or RFQ executor for a transfer. The quoter signs the legs hash + max fee; the executor signs the same legs hash + their own max fee.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Action info that needs to be signed by quoter or RFQ executor for a transfer. The quoter signs the legs hash + max fee; the executor signs the same legs hash + their own max fee.",
/// "type": "object",
/// "required": [
/// "direction",
/// "legs",
/// "max_fee",
/// "nonce",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "subaccount_id"
/// ],
/// "properties": {
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "legs": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PricedLegParamsAndResponse"
/// }
/// },
/// "max_fee": {
/// "description": "Maximum fee the signer authorises, in USD, as a decimal string (e.g. `\"1.5\"`) or a JSON number.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nonce": {
/// "type": "string"
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "signer": {
/// "$ref": "#/definitions/Address"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SignedTransferQuoteRequest {
pub direction: Direction,
pub legs: ::std::vec::Vec<PricedLegParamsAndResponse>,
///Maximum fee the signer authorises, in USD, as a decimal string (e.g. `"1.5"`) or a JSON number.
pub max_fee: ::bigdecimal::BigDecimal,
pub nonce: ::std::string::String,
pub signature: ::std::string::String,
pub signature_expiry_sec: i64,
pub signer: Address,
pub subaccount_id: i64,
}
impl SignedTransferQuoteRequest {
pub fn builder() -> builder::SignedTransferQuoteRequest {
Default::default()
}
}
///A spot asset and its per-universe risk: collateral discounts, lending, OI.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A spot asset and its per-universe risk: collateral discounts, lending, OI.",
/// "type": "object",
/// "required": [
/// "address",
/// "erc20",
/// "min_deposit_usd",
/// "name",
/// "universes"
/// ],
/// "properties": {
/// "address": {
/// "description": "EIP-55 checksummed protocol asset address.",
/// "type": "string"
/// },
/// "erc20": {
/// "$ref": "#/definitions/Erc20Details"
/// },
/// "min_deposit_usd": {
/// "type": "string"
/// },
/// "name": {
/// "description": "Registered asset name (e.g. \"USDC\", \"USDC-NL\").",
/// "type": "string"
/// },
/// "universes": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/SpotUniverse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotAssetEntry {
///EIP-55 checksummed protocol asset address.
pub address: ::std::string::String,
pub erc20: Erc20Details,
pub min_deposit_usd: ::std::string::String,
///Registered asset name (e.g. "USDC", "USDC-NL").
pub name: ::std::string::String,
pub universes: ::std::vec::Vec<SpotUniverse>,
}
impl SpotAssetEntry {
pub fn builder() -> builder::SpotAssetEntry {
Default::default()
}
}
///`SpotFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "price",
/// "signatures",
/// "timestamp"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "feed_source_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "price": {
/// "type": "string"
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub feed_source_type: ::std::option::Option<::std::string::String>,
pub price: ::std::string::String,
pub signatures: OracleSignatureDataResponse,
pub timestamp: u64,
}
impl SpotFeedDataResponse {
pub fn builder() -> builder::SpotFeedDataResponse {
Default::default()
}
}
///`SpotFeedEntry`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "confidence_prev_daily",
/// "price",
/// "price_prev_daily",
/// "timestamp_prev_daily"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "confidence_prev_daily": {
/// "type": "string"
/// },
/// "price": {
/// "type": "string"
/// },
/// "price_prev_daily": {
/// "type": "string"
/// },
/// "timestamp_prev_daily": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotFeedEntry {
pub confidence: ::std::string::String,
pub confidence_prev_daily: ::std::string::String,
pub price: ::std::string::String,
pub price_prev_daily: ::std::string::String,
pub timestamp_prev_daily: i64,
}
impl SpotFeedEntry {
pub fn builder() -> builder::SpotFeedEntry {
Default::default()
}
}
///`SpotFeedNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/SpotFeedPayload"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SpotFeedNotification(pub SpotFeedPayload);
impl ::std::ops::Deref for SpotFeedNotification {
type Target = SpotFeedPayload;
fn deref(&self) -> &SpotFeedPayload {
&self.0
}
}
impl ::std::convert::From<SpotFeedNotification> for SpotFeedPayload {
fn from(value: SpotFeedNotification) -> Self {
value.0
}
}
impl ::std::convert::From<SpotFeedPayload> for SpotFeedNotification {
fn from(value: SpotFeedPayload) -> Self {
Self(value)
}
}
///Payload for `spot_feed.{currency}` (and `spot_feed.ALL`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for `spot_feed.{currency}` (and `spot_feed.ALL`).",
/// "type": "object",
/// "required": [
/// "feeds",
/// "timestamp"
/// ],
/// "properties": {
/// "feeds": {
/// "type": "object",
/// "properties": {
/// "{key}": {
/// "$ref": "#/definitions/SpotFeedEntry"
/// }
/// },
/// "additionalProperties": {
/// "$ref": "#/definitions/SpotFeedEntry"
/// }
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotFeedPayload {
pub feeds: SpotFeedPayloadFeeds,
pub timestamp: i64,
}
impl SpotFeedPayload {
pub fn builder() -> builder::SpotFeedPayload {
Default::default()
}
}
///`SpotFeedPayloadFeeds`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "{key}": {
/// "$ref": "#/definitions/SpotFeedEntry"
/// }
/// },
/// "additionalProperties": {
/// "$ref": "#/definitions/SpotFeedEntry"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotFeedPayloadFeeds {
#[serde(
rename = "{key}",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub key: ::std::option::Option<SpotFeedEntry>,
#[serde(flatten)]
pub extra: ::std::collections::HashMap<::std::string::String, SpotFeedEntry>,
}
impl SpotFeedPayloadFeeds {
pub fn builder() -> builder::SpotFeedPayloadFeeds {
Default::default()
}
}
///`SpotPublicDetails`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "borrow_index",
/// "decimals",
/// "supply_index",
/// "underlying_erc20_address"
/// ],
/// "properties": {
/// "borrow_index": {
/// "type": "string"
/// },
/// "decimals": {
/// "type": "integer",
/// "format": "uint8",
/// "minimum": 0.0
/// },
/// "supply_index": {
/// "type": "string"
/// },
/// "underlying_erc20_address": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotPublicDetails {
pub borrow_index: ::std::string::String,
pub decimals: u8,
pub supply_index: ::std::string::String,
pub underlying_erc20_address: ::std::string::String,
}
impl SpotPublicDetails {
pub fn builder() -> builder::SpotPublicDetails {
Default::default()
}
}
///Risk details for a single `(spot_asset, universe)` pair.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Risk details for a single `(spot_asset, universe)` pair.",
/// "type": "object",
/// "required": [
/// "oi",
/// "pm2_im_discount",
/// "pm2_mm_discount",
/// "risk_universe_id",
/// "srm_im_discount",
/// "srm_mm_discount"
/// ],
/// "properties": {
/// "lending": {
/// "description": "Lending stats; null if the asset has no pool in this universe.",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/LendingDetails"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "oi": {
/// "description": "Spot supply OI cap + current supply (for a lending asset, the current supply is the pool's total supplied collateral).",
/// "$ref": "#/definitions/OpenInterestStats"
/// },
/// "pm2_im_discount": {
/// "description": "PMRM2 collateral haircut (\"0\" if not collateralized).",
/// "type": "string"
/// },
/// "pm2_mm_discount": {
/// "type": "string"
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "srm_im_discount": {
/// "description": "SRM collateral discount (cash asset \"1\"; non-collateral \"0\").",
/// "type": "string"
/// },
/// "srm_mm_discount": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpotUniverse {
///Lending stats; null if the asset has no pool in this universe.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lending: ::std::option::Option<LendingDetails>,
///Spot supply OI cap + current supply (for a lending asset, the current supply is the pool's total supplied collateral).
pub oi: OpenInterestStats,
///PMRM2 collateral haircut ("0" if not collateralized).
pub pm2_im_discount: ::std::string::String,
pub pm2_mm_discount: ::std::string::String,
pub risk_universe_id: u32,
///SRM collateral discount (cash asset "1"; non-collateral "0").
pub srm_im_discount: ::std::string::String,
pub srm_mm_discount: ::std::string::String,
}
impl SpotUniverse {
pub fn builder() -> builder::SpotUniverse {
Default::default()
}
}
///`Subaccount`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "collaterals",
/// "collaterals_initial_margin",
/// "collaterals_maintenance_margin",
/// "collaterals_value",
/// "currency",
/// "failed_to_fetch",
/// "initial_margin",
/// "is_under_liquidation",
/// "label",
/// "maintenance_margin",
/// "manager_id",
/// "margin_type",
/// "open_orders",
/// "open_orders_margin",
/// "positions",
/// "positions_initial_margin",
/// "positions_maintenance_margin",
/// "positions_value",
/// "projected_margin_change",
/// "risk_universe_id",
/// "subaccount_id",
/// "subaccount_value",
/// "vault_deposit_holds"
/// ],
/// "properties": {
/// "collaterals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Collateral"
/// }
/// },
/// "collaterals_initial_margin": {
/// "type": "string"
/// },
/// "collaterals_maintenance_margin": {
/// "type": "string"
/// },
/// "collaterals_value": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "failed_to_fetch": {
/// "description": "`true` if this subaccount's portfolio could not be loaded; such subaccounts are returned as placeholders by `get_all_portfolios`.",
/// "type": "boolean"
/// },
/// "initial_margin": {
/// "type": "string"
/// },
/// "is_under_liquidation": {
/// "type": "boolean"
/// },
/// "label": {
/// "type": "string"
/// },
/// "maintenance_margin": {
/// "type": "string"
/// },
/// "manager_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "margin_type": {
/// "type": "string"
/// },
/// "mm_credits": {
/// "description": "MM credit from universe loss-socialization events: the socialized USDC debit lands on cash in full, and `debit × (1 − write_down)` is added back to maintenance margin while the 15-minute write-down runs. Events this subaccount has not yet realized contribute their expected credit, with the current subaccount value standing in for the MtM at realization. Zero while under auction — the credit is cleared when liquidation starts.",
/// "type": "string"
/// },
/// "open_orders": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Order"
/// }
/// },
/// "open_orders_margin": {
/// "type": "string"
/// },
/// "positions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Position"
/// }
/// },
/// "positions_initial_margin": {
/// "type": "string"
/// },
/// "positions_maintenance_margin": {
/// "type": "string"
/// },
/// "positions_value": {
/// "type": "string"
/// },
/// "projected_margin_change": {
/// "type": "string"
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "subaccount_value": {
/// "type": "string"
/// },
/// "vault_deposit_holds": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultDepositHold"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Subaccount {
pub collaterals: ::std::vec::Vec<Collateral>,
pub collaterals_initial_margin: ::std::string::String,
pub collaterals_maintenance_margin: ::std::string::String,
pub collaterals_value: ::std::string::String,
pub currency: ::std::vec::Vec<::std::string::String>,
///`true` if this subaccount's portfolio could not be loaded; such subaccounts are returned as placeholders by `get_all_portfolios`.
pub failed_to_fetch: bool,
pub initial_margin: ::std::string::String,
pub is_under_liquidation: bool,
pub label: ::std::string::String,
pub maintenance_margin: ::std::string::String,
pub manager_id: u32,
pub margin_type: ::std::string::String,
///MM credit from universe loss-socialization events: the socialized USDC debit lands on cash in full, and `debit × (1 − write_down)` is added back to maintenance margin while the 15-minute write-down runs. Events this subaccount has not yet realized contribute their expected credit, with the current subaccount value standing in for the MtM at realization. Zero while under auction — the credit is cleared when liquidation starts.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mm_credits: ::std::option::Option<::std::string::String>,
pub open_orders: ::std::vec::Vec<Order>,
pub open_orders_margin: ::std::string::String,
pub positions: ::std::vec::Vec<Position>,
pub positions_initial_margin: ::std::string::String,
pub positions_maintenance_margin: ::std::string::String,
pub positions_value: ::std::string::String,
pub projected_margin_change: ::std::string::String,
pub risk_universe_id: u32,
pub subaccount_id: u64,
pub subaccount_value: ::std::string::String,
pub vault_deposit_holds: ::std::vec::Vec<VaultDepositHold>,
}
impl Subaccount {
pub fn builder() -> builder::Subaccount {
Default::default()
}
}
///`SubaccountBalancesNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/BalanceUpdate"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountBalancesNotification(pub BalanceUpdate);
impl ::std::ops::Deref for SubaccountBalancesNotification {
type Target = BalanceUpdate;
fn deref(&self) -> &BalanceUpdate {
&self.0
}
}
impl ::std::convert::From<SubaccountBalancesNotification> for BalanceUpdate {
fn from(value: SubaccountBalancesNotification) -> Self {
value.0
}
}
impl ::std::convert::From<BalanceUpdate> for SubaccountBalancesNotification {
fn from(value: BalanceUpdate) -> Self {
Self(value)
}
}
///`SubaccountBestQuotesNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/BestQuoteChannelResult"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountBestQuotesNotification(pub BestQuoteChannelResult);
impl ::std::ops::Deref for SubaccountBestQuotesNotification {
type Target = BestQuoteChannelResult;
fn deref(&self) -> &BestQuoteChannelResult {
&self.0
}
}
impl ::std::convert::From<SubaccountBestQuotesNotification> for BestQuoteChannelResult {
fn from(value: SubaccountBestQuotesNotification) -> Self {
value.0
}
}
impl ::std::convert::From<BestQuoteChannelResult> for SubaccountBestQuotesNotification {
fn from(value: BestQuoteChannelResult) -> Self {
Self(value)
}
}
///`SubaccountOrdersNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/Order"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountOrdersNotification(pub Order);
impl ::std::ops::Deref for SubaccountOrdersNotification {
type Target = Order;
fn deref(&self) -> &Order {
&self.0
}
}
impl ::std::convert::From<SubaccountOrdersNotification> for Order {
fn from(value: SubaccountOrdersNotification) -> Self {
value.0
}
}
impl ::std::convert::From<Order> for SubaccountOrdersNotification {
fn from(value: Order) -> Self {
Self(value)
}
}
///`SubaccountQuotesNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/QuotePublishResult"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountQuotesNotification(pub QuotePublishResult);
impl ::std::ops::Deref for SubaccountQuotesNotification {
type Target = QuotePublishResult;
fn deref(&self) -> &QuotePublishResult {
&self.0
}
}
impl ::std::convert::From<SubaccountQuotesNotification> for QuotePublishResult {
fn from(value: SubaccountQuotesNotification) -> Self {
value.0
}
}
impl ::std::convert::From<QuotePublishResult> for SubaccountQuotesNotification {
fn from(value: QuotePublishResult) -> Self {
Self(value)
}
}
///`SubaccountTradesBatchStatusNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/Trade"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountTradesBatchStatusNotification(pub Trade);
impl ::std::ops::Deref for SubaccountTradesBatchStatusNotification {
type Target = Trade;
fn deref(&self) -> &Trade {
&self.0
}
}
impl ::std::convert::From<SubaccountTradesBatchStatusNotification> for Trade {
fn from(value: SubaccountTradesBatchStatusNotification) -> Self {
value.0
}
}
impl ::std::convert::From<Trade> for SubaccountTradesBatchStatusNotification {
fn from(value: Trade) -> Self {
Self(value)
}
}
///`SubaccountTradesNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/Trade"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubaccountTradesNotification(pub Trade);
impl ::std::ops::Deref for SubaccountTradesNotification {
type Target = Trade;
fn deref(&self) -> &Trade {
&self.0
}
}
impl ::std::convert::From<SubaccountTradesNotification> for Trade {
fn from(value: SubaccountTradesNotification) -> Self {
value.0
}
}
impl ::std::convert::From<Trade> for SubaccountTradesNotification {
fn from(value: Trade) -> Self {
Self(value)
}
}
///Params for `subscribe`. `channels` is the required list of channel names to subscribe to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Params for `subscribe`. `channels` is the required list of channel names to subscribe to.",
/// "type": "object",
/// "required": [
/// "channels"
/// ],
/// "properties": {
/// "channels": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscribeParams {
pub channels: ::std::vec::Vec<::std::string::String>,
}
impl SubscribeParams {
pub fn builder() -> builder::SubscribeParams {
Default::default()
}
}
///`SubscribeRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "headers": {
/// "description": "Non-standard; used by `auth/login`.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": true
/// },
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// },
/// "method": {
/// "type": "string",
/// "const": "subscribe"
/// },
/// "params": {
/// "$ref": "#/definitions/SubscribeParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscribeRequest {
///Non-standard; used by `auth/login`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub headers: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
pub id: JsonRpcId,
pub method: ::std::string::String,
pub params: SubscribeParams,
}
impl SubscribeRequest {
pub fn builder() -> builder::SubscribeRequest {
Default::default()
}
}
///`SubscribeResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "anyOf": [
/// {
/// "title": "Success",
/// "type": "object",
/// "required": [
/// "result"
/// ],
/// "properties": {
/// "result": {
/// "$ref": "#/definitions/SubscribeResult"
/// }
/// }
/// },
/// {
/// "title": "Error",
/// "type": "object",
/// "required": [
/// "error"
/// ],
/// "properties": {
/// "error": {
/// "$ref": "#/definitions/RPCError"
/// }
/// }
/// }
/// ],
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SubscribeResponse {
Variant0 { id: JsonRpcId, result: SubscribeResult },
Variant1 { error: RpcError, id: JsonRpcId },
}
///Result for `subscribe`. `status` maps each requested channel to `"ok"` or an error string; `current_subscriptions` is the full set of channels the connection is subscribed to after the operation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Result for `subscribe`. `status` maps each requested channel to `\"ok\"` or an error string; `current_subscriptions` is the full set of channels the connection is subscribed to after the operation.",
/// "type": "object",
/// "required": [
/// "current_subscriptions",
/// "status"
/// ],
/// "properties": {
/// "current_subscriptions": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "uniqueItems": true
/// },
/// "status": {
/// "type": "object",
/// "additionalProperties": true
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscribeResult {
pub current_subscriptions: Vec<::std::string::String>,
pub status: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
}
impl SubscribeResult {
pub fn builder() -> builder::SubscribeResult {
Default::default()
}
}
///`TickerSlimNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/TickerSlimPayload"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TickerSlimNotification(pub TickerSlimPayload);
impl ::std::ops::Deref for TickerSlimNotification {
type Target = TickerSlimPayload;
fn deref(&self) -> &TickerSlimPayload {
&self.0
}
}
impl ::std::convert::From<TickerSlimNotification> for TickerSlimPayload {
fn from(value: TickerSlimNotification) -> Self {
value.0
}
}
impl ::std::convert::From<TickerSlimPayload> for TickerSlimNotification {
fn from(value: TickerSlimPayload) -> Self {
Self(value)
}
}
///Payload for `ticker_slim.{instrument}.{interval}`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for `ticker_slim.{instrument}.{interval}`.",
/// "type": "object",
/// "required": [
/// "instrument_ticker",
/// "timestamp"
/// ],
/// "properties": {
/// "instrument_ticker": {
/// "$ref": "#/definitions/TickerSlimSnapshot"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TickerSlimPayload {
pub instrument_ticker: crate::models::ticker_slim_schema::TickerSlimSchema,
pub timestamp: i64,
}
impl TickerSlimPayload {
pub fn builder() -> builder::TickerSlimPayload {
Default::default()
}
}
///`TimeInForce`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "gtc",
/// "post_only",
/// "fok",
/// "ioc"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum TimeInForce {
#[serde(rename = "gtc")]
Gtc,
#[serde(rename = "post_only")]
PostOnly,
#[serde(rename = "fok")]
Fok,
#[serde(rename = "ioc")]
Ioc,
}
impl ::std::fmt::Display for TimeInForce {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Gtc => f.write_str("gtc"),
Self::PostOnly => f.write_str("post_only"),
Self::Fok => f.write_str("fok"),
Self::Ioc => f.write_str("ioc"),
}
}
}
impl ::std::str::FromStr for TimeInForce {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"gtc" => Ok(Self::Gtc),
"post_only" => Ok(Self::PostOnly),
"fok" => Ok(Self::Fok),
"ioc" => Ok(Self::Ioc),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TimeInForce {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TimeInForce {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TimeInForce {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Info that the user expects to get delivered when requesting trade info.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Info that the user expects to get delivered when requesting trade info.",
/// "type": "object",
/// "required": [
/// "direction",
/// "expected_rebate",
/// "extra_fee",
/// "index_price",
/// "instrument_name",
/// "is_transfer",
/// "liquidity_role",
/// "mark_price",
/// "op_uuid",
/// "order_id",
/// "quote_id",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "rfq_id",
/// "subaccount_id",
/// "timestamp",
/// "trade_amount",
/// "trade_fee",
/// "trade_id",
/// "trade_price"
/// ],
/// "properties": {
/// "batch_status": {
/// "description": "Settlement batch status; `null` if processed by sequencer.",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "expected_rebate": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "extra_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "index_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "default": "",
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "mark_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "op_uuid": {
/// "type": "string"
/// },
/// "order_id": {
/// "type": "string"
/// },
/// "quote_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "realized_pnl": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "realized_pnl_excl_fees": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "trade_amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_id": {
/// "type": "string"
/// },
/// "trade_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Trade {
///Settlement batch status; `null` if processed by sequencer.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
pub direction: Direction,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub expected_rebate: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub index_price: ::bigdecimal::BigDecimal,
pub instrument_name: ::std::string::String,
pub is_transfer: bool,
#[serde(default)]
pub label: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub mark_price: ::bigdecimal::BigDecimal,
pub op_uuid: ::std::string::String,
pub order_id: ::std::string::String,
///Optional UUID v4 string
pub quote_id: ::std::option::Option<::uuid::Uuid>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl_excl_fees: ::bigdecimal::BigDecimal,
///Optional UUID v4 string
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: i64,
pub timestamp: i64,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_amount: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_fee: ::bigdecimal::BigDecimal,
pub trade_id: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_price: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl Trade {
pub fn builder() -> builder::Trade {
Default::default()
}
}
///A trade as returned by `private/get_trade_history`. Mirrors a private trades subscription event, except `batch_status` is the settlement status (`null` until the batch settles).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A trade as returned by `private/get_trade_history`. Mirrors a private trades subscription event, except `batch_status` is the settlement status (`null` until the batch settles).",
/// "type": "object",
/// "required": [
/// "direction",
/// "expected_rebate",
/// "extra_fee",
/// "index_price",
/// "instrument_name",
/// "is_transfer",
/// "label",
/// "liquidity_role",
/// "mark_price",
/// "op_uuid",
/// "order_id",
/// "quote_id",
/// "realized_pnl",
/// "realized_pnl_excl_fees",
/// "rfq_id",
/// "subaccount_id",
/// "timestamp",
/// "trade_amount",
/// "trade_fee",
/// "trade_id",
/// "trade_price"
/// ],
/// "properties": {
/// "batch_status": {
/// "anyOf": [
/// {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "direction": {
/// "$ref": "#/definitions/Direction"
/// },
/// "expected_rebate": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "extra_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "index_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "instrument_name": {
/// "type": "string"
/// },
/// "is_transfer": {
/// "type": "boolean"
/// },
/// "label": {
/// "type": "string"
/// },
/// "liquidity_role": {
/// "$ref": "#/definitions/LiquidityRole"
/// },
/// "mark_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "op_uuid": {
/// "type": "string"
/// },
/// "order_id": {
/// "type": "string"
/// },
/// "quote_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "realized_pnl": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "realized_pnl_excl_fees": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "rfq_id": {
/// "description": "Optional UUID v4 string",
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "uuid"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "trade_amount": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_fee": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "trade_id": {
/// "type": "string"
/// },
/// "trade_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TradeHistoryResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub batch_status: ::std::option::Option<BatchStatus>,
pub direction: Direction,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub expected_rebate: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub extra_fee: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub index_price: ::bigdecimal::BigDecimal,
pub instrument_name: ::std::string::String,
pub is_transfer: bool,
pub label: ::std::string::String,
pub liquidity_role: LiquidityRole,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub mark_price: ::bigdecimal::BigDecimal,
pub op_uuid: ::std::string::String,
pub order_id: ::std::string::String,
///Optional UUID v4 string
pub quote_id: ::std::option::Option<::uuid::Uuid>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub realized_pnl_excl_fees: ::bigdecimal::BigDecimal,
///Optional UUID v4 string
pub rfq_id: ::std::option::Option<::uuid::Uuid>,
pub subaccount_id: i64,
pub timestamp: i64,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_amount: ::bigdecimal::BigDecimal,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_fee: ::bigdecimal::BigDecimal,
pub trade_id: ::std::string::String,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub trade_price: ::bigdecimal::BigDecimal,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl TradeHistoryResponse {
pub fn builder() -> builder::TradeHistoryResponse {
Default::default()
}
}
///`TradesByInstrumentNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/PublicTrade"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TradesByInstrumentNotification(pub PublicTrade);
impl ::std::ops::Deref for TradesByInstrumentNotification {
type Target = PublicTrade;
fn deref(&self) -> &PublicTrade {
&self.0
}
}
impl ::std::convert::From<TradesByInstrumentNotification> for PublicTrade {
fn from(value: TradesByInstrumentNotification) -> Self {
value.0
}
}
impl ::std::convert::From<PublicTrade> for TradesByInstrumentNotification {
fn from(value: PublicTrade) -> Self {
Self(value)
}
}
///`TradesByInstrumentTypeCurrencyBatchStatusNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/SettledTrade"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TradesByInstrumentTypeCurrencyBatchStatusNotification(pub SettledTrade);
impl ::std::ops::Deref for TradesByInstrumentTypeCurrencyBatchStatusNotification {
type Target = SettledTrade;
fn deref(&self) -> &SettledTrade {
&self.0
}
}
impl ::std::convert::From<TradesByInstrumentTypeCurrencyBatchStatusNotification>
for SettledTrade {
fn from(value: TradesByInstrumentTypeCurrencyBatchStatusNotification) -> Self {
value.0
}
}
impl ::std::convert::From<SettledTrade>
for TradesByInstrumentTypeCurrencyBatchStatusNotification {
fn from(value: SettledTrade) -> Self {
Self(value)
}
}
///`TradesByInstrumentTypeCurrencyNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/PublicTrade"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TradesByInstrumentTypeCurrencyNotification(pub PublicTrade);
impl ::std::ops::Deref for TradesByInstrumentTypeCurrencyNotification {
type Target = PublicTrade;
fn deref(&self) -> &PublicTrade {
&self.0
}
}
impl ::std::convert::From<TradesByInstrumentTypeCurrencyNotification> for PublicTrade {
fn from(value: TradesByInstrumentTypeCurrencyNotification) -> Self {
value.0
}
}
impl ::std::convert::From<PublicTrade> for TradesByInstrumentTypeCurrencyNotification {
fn from(value: PublicTrade) -> Self {
Self(value)
}
}
///Single trades OHLCV candle in `public/get_tradingview_chart_data`. `timestamp` and `timestamp_bucket` are the bucket start in UTC seconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Single trades OHLCV candle in `public/get_tradingview_chart_data`. `timestamp` and `timestamp_bucket` are the bucket start in UTC seconds.",
/// "type": "object",
/// "required": [
/// "close_price",
/// "high_price",
/// "low_price",
/// "open_price",
/// "timestamp",
/// "timestamp_bucket",
/// "volume_contracts",
/// "volume_usd"
/// ],
/// "properties": {
/// "close_price": {
/// "type": "string"
/// },
/// "high_price": {
/// "type": "string"
/// },
/// "low_price": {
/// "type": "string"
/// },
/// "open_price": {
/// "type": "string"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "timestamp_bucket": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "volume_contracts": {
/// "type": "string"
/// },
/// "volume_usd": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TradingviewCandle {
pub close_price: ::std::string::String,
pub high_price: ::std::string::String,
pub low_price: ::std::string::String,
pub open_price: ::std::string::String,
pub timestamp: i64,
pub timestamp_bucket: i64,
pub volume_contracts: ::std::string::String,
pub volume_usd: ::std::string::String,
}
impl TradingviewCandle {
pub fn builder() -> builder::TradingviewCandle {
Default::default()
}
}
///`amount` and `fee` are decimal strings (e.g. `"1.1"`). `is_outgoing` marks the caller's side; on the sender's row `amount` is the gross debited and `fee` the in-kind fee, on the receiver's row `amount` is the net credited and `fee` is 0. `operation_id`/`batch_uuid` are stable uuids.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`amount` and `fee` are decimal strings (e.g. `\"1.1\"`). `is_outgoing` marks the caller's side; on the sender's row `amount` is the gross debited and `fee` the in-kind fee, on the receiver's row `amount` is the net credited and `fee` is 0. `operation_id`/`batch_uuid` are stable uuids.",
/// "type": "object",
/// "required": [
/// "amount",
/// "asset",
/// "batch_status",
/// "batch_uuid",
/// "fee",
/// "from_subaccount_id",
/// "from_wallet",
/// "is_outgoing",
/// "operation_id",
/// "timestamp",
/// "to_subaccount_id",
/// "to_wallet"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "asset": {
/// "type": "string"
/// },
/// "batch_status": {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// "batch_uuid": {
/// "type": "string"
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "from_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "from_wallet": {
/// "type": "string"
/// },
/// "is_outgoing": {
/// "type": "boolean"
/// },
/// "operation_id": {
/// "type": "string"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "to_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "to_wallet": {
/// "type": "string"
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferEntry {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
pub asset: ::std::string::String,
pub batch_status: BatchStatus,
pub batch_uuid: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
pub from_subaccount_id: u64,
pub from_wallet: ::std::string::String,
pub is_outgoing: bool,
pub operation_id: ::std::string::String,
pub timestamp: u64,
pub to_subaccount_id: u64,
pub to_wallet: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
}
impl TransferEntry {
pub fn builder() -> builder::TransferEntry {
Default::default()
}
}
///`TransferHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "transfers"
/// ],
/// "properties": {
/// "transfers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/TransferEntry"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferHistoryResult {
pub transfers: ::std::vec::Vec<TransferEntry>,
}
impl TransferHistoryResult {
pub fn builder() -> builder::TransferHistoryResult {
Default::default()
}
}
///Params for `private/transfer_positions`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Params for `private/transfer_positions`.",
/// "type": "object",
/// "required": [
/// "maker_params",
/// "taker_params",
/// "wallet"
/// ],
/// "properties": {
/// "maker_params": {
/// "$ref": "#/definitions/SignedTransferQuoteRequest"
/// },
/// "taker_params": {
/// "$ref": "#/definitions/SignedTransferQuoteRequest"
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferPositionsRequest {
pub maker_params: SignedTransferQuoteRequest,
pub taker_params: SignedTransferQuoteRequest,
pub wallet: Address,
}
impl TransferPositionsRequest {
pub fn builder() -> builder::TransferPositionsRequest {
Default::default()
}
}
///Result for `private/transfer_positions`. Carries the synthesized maker and taker quote payloads so clients see a response shape parallel to `private/execute_quote`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Result for `private/transfer_positions`. Carries the synthesized maker and taker quote payloads so clients see a response shape parallel to `private/execute_quote`.",
/// "type": "object",
/// "required": [
/// "maker_quote",
/// "taker_quote"
/// ],
/// "properties": {
/// "maker_quote": {
/// "$ref": "#/definitions/Quote"
/// },
/// "taker_quote": {
/// "$ref": "#/definitions/Quote"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferPositionsResponse {
pub maker_quote: Quote,
pub taker_quote: Quote,
}
impl TransferPositionsResponse {
pub fn builder() -> builder::TransferPositionsResponse {
Default::default()
}
}
///`TriggerPriceType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "mark",
/// "index"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum TriggerPriceType {
#[serde(rename = "mark")]
Mark,
#[serde(rename = "index")]
Index,
}
impl ::std::fmt::Display for TriggerPriceType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Mark => f.write_str("mark"),
Self::Index => f.write_str("index"),
}
}
}
impl ::std::str::FromStr for TriggerPriceType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"mark" => Ok(Self::Mark),
"index" => Ok(Self::Index),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TriggerPriceType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TriggerPriceType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TriggerPriceType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`TriggerType`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "stoploss",
/// "takeprofit"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd
)]
pub enum TriggerType {
#[serde(rename = "stoploss")]
Stoploss,
#[serde(rename = "takeprofit")]
Takeprofit,
}
impl ::std::fmt::Display for TriggerType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Stoploss => f.write_str("stoploss"),
Self::Takeprofit => f.write_str("takeprofit"),
}
}
}
impl ::std::str::FromStr for TriggerType {
type Err = self::error::ConversionError;
fn from_str(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"stoploss" => Ok(Self::Stoploss),
"takeprofit" => Ok(Self::Takeprofit),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TriggerType {
type Error = self::error::ConversionError;
fn try_from(
value: &str,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TriggerType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TriggerType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///The managers risk-pricing a currency within one universe.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The managers risk-pricing a currency within one universe.",
/// "type": "object",
/// "required": [
/// "risk_universe_id"
/// ],
/// "properties": {
/// "pm": {
/// "description": "PMRM2 manager id risking this currency in the universe.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "risk_universe_id": {
/// "type": "integer",
/// "format": "uint32",
/// "minimum": 0.0
/// },
/// "risk_universe_name": {
/// "description": "Display name of the universe (uppercase, e.g. \"PRIME\"); absent until set by the exchange.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "sm": {
/// "description": "SRM manager id risking this currency in the universe.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "uint32",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UniverseManagers {
///PMRM2 manager id risking this currency in the universe.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pm: ::std::option::Option<u32>,
pub risk_universe_id: u32,
///Display name of the universe (uppercase, e.g. "PRIME"); absent until set by the exchange.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub risk_universe_name: ::std::option::Option<::std::string::String>,
///SRM manager id risking this currency in the universe.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sm: ::std::option::Option<u32>,
}
impl UniverseManagers {
pub fn builder() -> builder::UniverseManagers {
Default::default()
}
}
/**Params for `unsubscribe`. `channels` is optional.
When omitted (or null) the connection unsubscribes from all channels.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Params for `unsubscribe`. `channels` is optional.\n\nWhen omitted (or null) the connection unsubscribes from all channels.",
/// "type": "object",
/// "properties": {
/// "channels": {
/// "default": null,
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsubscribeParams {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub channels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl ::std::default::Default for UnsubscribeParams {
fn default() -> Self {
Self {
channels: Default::default(),
}
}
}
impl UnsubscribeParams {
pub fn builder() -> builder::UnsubscribeParams {
Default::default()
}
}
///`UnsubscribeRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "method",
/// "params"
/// ],
/// "properties": {
/// "headers": {
/// "description": "Non-standard; used by `auth/login`.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": true
/// },
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// },
/// "method": {
/// "type": "string",
/// "const": "unsubscribe"
/// },
/// "params": {
/// "$ref": "#/definitions/UnsubscribeParams"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsubscribeRequest {
///Non-standard; used by `auth/login`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub headers: ::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
pub id: JsonRpcId,
pub method: ::std::string::String,
pub params: UnsubscribeParams,
}
impl UnsubscribeRequest {
pub fn builder() -> builder::UnsubscribeRequest {
Default::default()
}
}
///`UnsubscribeResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "anyOf": [
/// {
/// "title": "Success",
/// "type": "object",
/// "required": [
/// "result"
/// ],
/// "properties": {
/// "result": {
/// "$ref": "#/definitions/UnsubscribeResult"
/// }
/// }
/// },
/// {
/// "title": "Error",
/// "type": "object",
/// "required": [
/// "error"
/// ],
/// "properties": {
/// "error": {
/// "$ref": "#/definitions/RPCError"
/// }
/// }
/// }
/// ],
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/definitions/JsonRpcId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum UnsubscribeResponse {
Variant0 { id: JsonRpcId, result: UnsubscribeResult },
Variant1 { error: RpcError, id: JsonRpcId },
}
///Result for `unsubscribe`. `status` maps each requested channel to `"ok"` or an error string; `remaining_subscriptions` is the set of channels the connection is still subscribed to after the operation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Result for `unsubscribe`. `status` maps each requested channel to `\"ok\"` or an error string; `remaining_subscriptions` is the set of channels the connection is still subscribed to after the operation.",
/// "type": "object",
/// "required": [
/// "remaining_subscriptions",
/// "status"
/// ],
/// "properties": {
/// "remaining_subscriptions": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// },
/// "uniqueItems": true
/// },
/// "status": {
/// "type": "object",
/// "additionalProperties": true
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UnsubscribeResult {
pub remaining_subscriptions: Vec<::std::string::String>,
pub status: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
}
impl UnsubscribeResult {
pub fn builder() -> builder::UnsubscribeResult {
Default::default()
}
}
///`UpdateVaultInfoRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "subaccount_id"
/// ],
/// "properties": {
/// "description": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "mtm_cap": {
/// "description": "Advisory mark-to-market cap in USD, as a decimal string (e.g. `\"1000\"`).",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Advisory mark-to-market cap in USD, as a decimal string (e.g. `\"1000\"`).",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "name": {
/// "default": null,
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subaccount_id": {
/// "description": "The vault's subaccount ID; the caller must be the vault's curator.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "whitelist_only": {
/// "default": null,
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateVaultInfoRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///Advisory mark-to-market cap in USD, as a decimal string (e.g. `"1000"`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mtm_cap: ::std::option::Option<::bigdecimal::BigDecimal>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///The vault's subaccount ID; the caller must be the vault's curator.
pub subaccount_id: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub whitelist_only: ::std::option::Option<bool>,
}
impl UpdateVaultInfoRequest {
pub fn builder() -> builder::UpdateVaultInfoRequest {
Default::default()
}
}
///`UpdateWhitelistedRecipientsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "add",
/// "nonce",
/// "remove",
/// "signature",
/// "signature_expiry_sec",
/// "signer",
/// "wallet"
/// ],
/// "properties": {
/// "add": {
/// "description": "Recipient wallet addresses to add to the whitelist.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "nonce": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "remove": {
/// "description": "Recipient wallet addresses to remove from the whitelist.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "signature": {
/// "type": "string"
/// },
/// "signature_expiry_sec": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signer": {
/// "type": "string"
/// },
/// "wallet": {
/// "description": "Wallet whose whitelist is being updated; becomes the action owner.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateWhitelistedRecipientsRequest {
///Recipient wallet addresses to add to the whitelist.
pub add: ::std::vec::Vec<::std::string::String>,
pub nonce: u64,
///Recipient wallet addresses to remove from the whitelist.
pub remove: ::std::vec::Vec<::std::string::String>,
pub signature: ::std::string::String,
pub signature_expiry_sec: u64,
pub signer: ::std::string::String,
///Wallet whose whitelist is being updated; becomes the action owner.
pub wallet: ::std::string::String,
}
impl UpdateWhitelistedRecipientsRequest {
pub fn builder() -> builder::UpdateWhitelistedRecipientsRequest {
Default::default()
}
}
///`UpdateWhitelistedRecipientsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id",
/// "whitelisted_recipients"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "whitelisted_recipients": {
/// "description": "The account's whitelisted recipients after the update was applied.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateWhitelistedRecipientsResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
///The account's whitelisted recipients after the update was applied.
pub whitelisted_recipients: ::std::vec::Vec<::std::string::String>,
}
impl UpdateWhitelistedRecipientsResponse {
pub fn builder() -> builder::UpdateWhitelistedRecipientsResponse {
Default::default()
}
}
///`Vault`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "curator",
/// "curator_shares",
/// "description",
/// "name",
/// "protocol",
/// "whitelist_only"
/// ],
/// "properties": {
/// "benchmark_price": {
/// "description": "USD spot price of the HWM benchmark asset (`1.0` for feed-less USD vaults). null when a configured benchmark has no resolvable price.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "USD spot price of the HWM benchmark asset (`1.0` for feed-less USD vaults). null when a configured benchmark has no resolvable price.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "curator": {
/// "description": "The vault's curator — the owner wallet of the vault subaccount.",
/// "$ref": "#/definitions/Address"
/// },
/// "curator_shares": {
/// "description": "Shares held by the curator (the vault subaccount's owner) — their skin-in-the-game. Same units as `protocol.total_shares`.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "description": {
/// "type": "string"
/// },
/// "mtm_cap": {
/// "description": "Optional non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Optional non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "nav_benchmark": {
/// "description": "Live NAV expressed in the HWM benchmark asset's units. null when the vault couldn't be priced or its configured benchmark has no spot price.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Live NAV expressed in the HWM benchmark asset's units. null when the vault couldn't be priced or its configured benchmark has no spot price.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "nav_usd": {
/// "description": "Live mark-to-market NAV (USD) — signed, so an insolvent vault surfaces as a negative value. null only when the vault couldn't be priced (e.g. missing data). Divide by `protocol.total_shares` for the pre-fee share price.",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Live mark-to-market NAV (USD) — signed, so an insolvent vault surfaces as a negative value. null only when the vault couldn't be priced (e.g. missing data). Divide by `protocol.total_shares` for the pre-fee share price.",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "protocol": {
/// "$ref": "#/definitions/ProtocolVault"
/// },
/// "simulated_share_price_usd": {
/// "description": "Live share price (USD/share) as if curator fees were settled now — the price a depositor/withdrawer faces. null when unpriceable or the vault is insolvent (a fee settlement on negative NAV is meaningless).",
/// "default": null,
/// "anyOf": [
/// {
/// "description": "Live share price (USD/share) as if curator fees were settled now — the price a depositor/withdrawer faces. null when unpriceable or the vault is insolvent (a fee settlement on negative NAV is meaningless).",
/// "default": null,
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "whitelist_only": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Vault {
///USD spot price of the HWM benchmark asset (`1.0` for feed-less USD vaults). null when a configured benchmark has no resolvable price.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub benchmark_price: ::std::option::Option<::bigdecimal::BigDecimal>,
///The vault's curator — the owner wallet of the vault subaccount.
pub curator: Address,
///Shares held by the curator (the vault subaccount's owner) — their skin-in-the-game. Same units as `protocol.total_shares`.
pub curator_shares: ::bigdecimal::BigDecimal,
pub description: ::std::string::String,
///Optional non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mtm_cap: ::std::option::Option<::bigdecimal::BigDecimal>,
pub name: ::std::string::String,
///Live NAV expressed in the HWM benchmark asset's units. null when the vault couldn't be priced or its configured benchmark has no spot price.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nav_benchmark: ::std::option::Option<::bigdecimal::BigDecimal>,
///Live mark-to-market NAV (USD) — signed, so an insolvent vault surfaces as a negative value. null only when the vault couldn't be priced (e.g. missing data). Divide by `protocol.total_shares` for the pre-fee share price.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub nav_usd: ::std::option::Option<::bigdecimal::BigDecimal>,
pub protocol: ProtocolVault,
///Live share price (USD/share) as if curator fees were settled now — the price a depositor/withdrawer faces. null when unpriceable or the vault is insolvent (a fee settlement on negative NAV is meaningless).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub simulated_share_price_usd: ::std::option::Option<::bigdecimal::BigDecimal>,
pub whitelist_only: bool,
}
impl Vault {
pub fn builder() -> builder::Vault {
Default::default()
}
}
///A vault action as surfaced to the requesting user. Monetary fields (amounts, prices, share price) are decimal strings.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A vault action as surfaced to the requesting user. Monetary fields (amounts, prices, share price) are decimal strings.",
/// "type": "object",
/// "required": [
/// "after_shares",
/// "amount",
/// "before_shares",
/// "creation_timestamp_ms",
/// "entry_price",
/// "error_reason",
/// "event_ts",
/// "event_type",
/// "exit_price",
/// "operation_id",
/// "operation_uuid",
/// "share_price",
/// "shares_delta",
/// "shares_requested",
/// "status",
/// "user_action_hash",
/// "vault_nonce",
/// "vault_subaccount_id",
/// "wallet"
/// ],
/// "properties": {
/// "after_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "before_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "creation_timestamp_ms": {
/// "description": "Timestamp the request was created (ms).",
/// "type": "integer",
/// "format": "int64"
/// },
/// "entry_price": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "error_reason": {
/// "type": "string"
/// },
/// "event_ts": {
/// "description": "Timestamp of this event (ms).",
/// "type": "integer",
/// "format": "int64"
/// },
/// "event_type": {
/// "description": "\"vault_deposit\" | \"vault_withdraw\" | \"vault_force_withdraw\" | \"vault_cancel\".",
/// "type": "string"
/// },
/// "exit_price": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "operation_uuid": {
/// "type": "string"
/// },
/// "share_price": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "shares_delta": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "shares_requested": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "status": {
/// "description": "While the action is in the queue, can be one of the following: \"enqueued\" | \"sequencer_applied\" | \"user_cancel\" | \"curator_reject\" | \"protocol_reject\" | \"expired\".\n\nOnce action is applied in the protocol, the status takes on `BatchStatus` values: \"Batching\" | \"Executing\" | \"Proving\" | \"Settling\" | \"Settled\" or an error.",
/// "type": "string"
/// },
/// "user_action_hash": {
/// "type": "string"
/// },
/// "vault_nonce": {
/// "type": "string"
/// },
/// "vault_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultActionResponse {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub after_shares: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub before_shares: ::bigdecimal::BigDecimal,
///Timestamp the request was created (ms).
pub creation_timestamp_ms: i64,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub entry_price: ::bigdecimal::BigDecimal,
pub error_reason: ::std::string::String,
///Timestamp of this event (ms).
pub event_ts: i64,
///"vault_deposit" | "vault_withdraw" | "vault_force_withdraw" | "vault_cancel".
pub event_type: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub exit_price: ::bigdecimal::BigDecimal,
pub operation_id: u64,
pub operation_uuid: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub share_price: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub shares_delta: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub shares_requested: ::bigdecimal::BigDecimal,
/**While the action is in the queue, can be one of the following: "enqueued" | "sequencer_applied" | "user_cancel" | "curator_reject" | "protocol_reject" | "expired".
Once action is applied in the protocol, the status takes on `BatchStatus` values: "Batching" | "Executing" | "Proving" | "Settling" | "Settled" or an error.*/
pub status: ::std::string::String,
pub user_action_hash: ::std::string::String,
pub vault_nonce: ::std::string::String,
pub vault_subaccount_id: u64,
pub wallet: ::std::string::String,
}
impl VaultActionResponse {
pub fn builder() -> builder::VaultActionResponse {
Default::default()
}
}
///Returned by `cancel_all_vault_requests`: identifiers to track the on-chain `VaultCancel` operation plus the ids of the wallet's pending requests that were cancelled.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `cancel_all_vault_requests`: identifiers to track the on-chain `VaultCancel` operation plus the ids of the wallet's pending requests that were cancelled.",
/// "type": "object",
/// "required": [
/// "cancelled_request_ids",
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "cancelled_request_ids": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultRequestId"
/// }
/// },
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultCancelResponse {
pub cancelled_request_ids: ::std::vec::Vec<VaultRequestId>,
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl VaultCancelResponse {
pub fn builder() -> builder::VaultCancelResponse {
Default::default()
}
}
/**Configuration for a vault subaccount's deposit/withdrawal controls.
Every field is immutable after vault creation. Mutable, informational settings (descriptions, an advisory TVL cap) live in off-chain vault state, not here.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Configuration for a vault subaccount's deposit/withdrawal controls.\n\nEvery field is immutable after vault creation. Mutable, informational settings (descriptions, an advisory TVL cap) live in off-chain vault state, not here.",
/// "type": "object",
/// "required": [
/// "cooldown_sec",
/// "deposit_spot_asset",
/// "management_fee_bps",
/// "max_slippage_bps",
/// "performance_fee_bps"
/// ],
/// "properties": {
/// "benchmark_asset": {
/// "description": "Spot asset the high-water mark is denominated in. null is the feed-less default: the HWM is a constant USD unit (reads no feed, so a deposit-asset depeg cannot manufacture a performance fee). An address denominates the HWM in that spot asset's units — performance fees then accrue only on outperformance measured in the benchmark (e.g. an ETH vault charging fees on ETH-outperformance, not on an ETH-price rally).",
/// "anyOf": [
/// {
/// "$ref": "#/definitions/Address"
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "cooldown_sec": {
/// "description": "Min seconds between a holder's last deposit and their withdrawal.",
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "deposit_spot_asset": {
/// "$ref": "#/definitions/Address"
/// },
/// "management_fee_bps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "max_slippage_bps": {
/// "description": "Max deviation of the curator's quoted share price from the mtm-derived price, both sides. Bounded at creation by the protocol-wide maximum slippage limit.",
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// },
/// "performance_fee_bps": {
/// "type": "integer",
/// "format": "uint16",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultConfig {
///Spot asset the high-water mark is denominated in. null is the feed-less default: the HWM is a constant USD unit (reads no feed, so a deposit-asset depeg cannot manufacture a performance fee). An address denominates the HWM in that spot asset's units — performance fees then accrue only on outperformance measured in the benchmark (e.g. an ETH vault charging fees on ETH-outperformance, not on an ETH-price rally).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub benchmark_asset: ::std::option::Option<Address>,
///Min seconds between a holder's last deposit and their withdrawal.
pub cooldown_sec: u64,
pub deposit_spot_asset: Address,
pub management_fee_bps: u16,
///Max deviation of the curator's quoted share price from the mtm-derived price, both sides. Bounded at creation by the protocol-wide maximum slippage limit.
pub max_slippage_bps: u16,
pub performance_fee_bps: u16,
}
impl VaultConfig {
pub fn builder() -> builder::VaultConfig {
Default::default()
}
}
///Returned by `create_vault`: identifiers to track the on-chain `CreateVault` operation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `create_vault`: identifiers to track the on-chain `CreateVault` operation.",
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultCreateResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl VaultCreateResponse {
pub fn builder() -> builder::VaultCreateResponse {
Default::default()
}
}
///`VaultDepositHold`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "amount",
/// "asset_name",
/// "currency",
/// "vault_id"
/// ],
/// "properties": {
/// "amount": {
/// "type": "string"
/// },
/// "asset_name": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "vault_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultDepositHold {
pub amount: ::std::string::String,
pub asset_name: ::std::string::String,
pub currency: ::std::string::String,
pub vault_id: u64,
}
impl VaultDepositHold {
pub fn builder() -> builder::VaultDepositHold {
Default::default()
}
}
///Returned by `force_burn`: identifiers to track the on-chain `ForceBurn` operation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `force_burn`: identifiers to track the on-chain `ForceBurn` operation.",
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultForceBurnResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl VaultForceBurnResponse {
pub fn builder() -> builder::VaultForceBurnResponse {
Default::default()
}
}
///Returned by `get_curated_vaults` / `get_shareholder_vaults`: the vault subaccount ids the caller curates / holds shares in.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `get_curated_vaults` / `get_shareholder_vaults`: the vault subaccount ids the caller curates / holds shares in.",
/// "type": "object",
/// "required": [
/// "subaccount_ids"
/// ],
/// "properties": {
/// "subaccount_ids": {
/// "type": "array",
/// "items": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultIdsResponse {
pub subaccount_ids: ::std::vec::Vec<u64>,
}
impl VaultIdsResponse {
pub fn builder() -> builder::VaultIdsResponse {
Default::default()
}
}
///`VaultPerformanceHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "points",
/// "resolution",
/// "subaccount_id"
/// ],
/// "properties": {
/// "points": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultPerformancePointResponse"
/// }
/// },
/// "resolution": {
/// "$ref": "#/definitions/PerformanceResolution"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultPerformanceHistoryResult {
pub points: ::std::vec::Vec<VaultPerformancePointResponse>,
pub resolution: PerformanceResolution,
pub subaccount_id: u64,
}
impl VaultPerformanceHistoryResult {
pub fn builder() -> builder::VaultPerformanceHistoryResult {
Default::default()
}
}
///One point in a vault's performance series. `ts` is the bucket time (epoch millis); each monetary value is the bucket's last sample as a decimal string. Live prices are nullable (a vault that couldn't be priced).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One point in a vault's performance series. `ts` is the bucket time (epoch millis); each monetary value is the bucket's last sample as a decimal string. Live prices are nullable (a vault that couldn't be priced).",
/// "type": "object",
/// "required": [
/// "benchmark_price",
/// "curator_shares",
/// "global_hwm",
/// "nav",
/// "nav_benchmark",
/// "share_price",
/// "total_shares",
/// "ts"
/// ],
/// "properties": {
/// "benchmark_price": {
/// "description": "Optional non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "curator_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "global_hwm": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "nav": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "nav_benchmark": {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "anyOf": [
/// {
/// "description": "Optional decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits, or null; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// {
/// "type": "null"
/// }
/// ]
/// },
/// "share_price": {
/// "description": "Decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "total_shares": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "ts": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultPerformancePointResponse {
///Optional non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub benchmark_price: ::std::option::Option<::bigdecimal::BigDecimal>,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub curator_shares: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub global_hwm: ::bigdecimal::BigDecimal,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub nav: ::std::option::Option<::bigdecimal::BigDecimal>,
///Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
pub nav_benchmark: ::std::option::Option<::bigdecimal::BigDecimal>,
///Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub share_price: ::bigdecimal::BigDecimal,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub total_shares: ::bigdecimal::BigDecimal,
pub ts: i64,
}
impl VaultPerformancePointResponse {
pub fn builder() -> builder::VaultPerformancePointResponse {
Default::default()
}
}
///Returned by `request_vault_deposit` / `request_vault_withdraw`: the id the queued request was assigned (the user's handle for polling / cancelling).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `request_vault_deposit` / `request_vault_withdraw`: the id the queued request was assigned (the user's handle for polling / cancelling).",
/// "type": "object",
/// "required": [
/// "request_id"
/// ],
/// "properties": {
/// "request_id": {
/// "$ref": "#/definitions/VaultRequestId"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultRequestAckResponse {
pub request_id: VaultRequestId,
}
impl VaultRequestAckResponse {
pub fn builder() -> builder::VaultRequestAckResponse {
Default::default()
}
}
/**Composite vault request id: `(vault_subaccount_id, wallet, vault_nonce)`
Useful as a stable dedup key across off-chain and on-chain vault events.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Composite vault request id: `(vault_subaccount_id, wallet, vault_nonce)`\n\nUseful as a stable dedup key across off-chain and on-chain vault events.",
/// "type": "object",
/// "required": [
/// "vault_nonce",
/// "vault_subaccount_id",
/// "wallet"
/// ],
/// "properties": {
/// "vault_nonce": {
/// "type": "string"
/// },
/// "vault_subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultRequestId {
pub vault_nonce: ::std::string::String,
pub vault_subaccount_id: u64,
pub wallet: Address,
}
impl VaultRequestId {
pub fn builder() -> builder::VaultRequestId {
Default::default()
}
}
///One queued deposit/withdraw request as surfaced to the curator.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One queued deposit/withdraw request as surfaced to the curator.",
/// "type": "object",
/// "required": [
/// "creation_timestamp_ms",
/// "id",
/// "signed_action",
/// "subaccount_id",
/// "user_action_hash",
/// "wallet"
/// ],
/// "properties": {
/// "creation_timestamp_ms": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "id": {
/// "$ref": "#/definitions/VaultRequestId"
/// },
/// "signed_action": {
/// "description": "The user's signed deposit/withdraw envelope; the curator pairs their `MintShares`/`BurnShares` approval against it.",
/// "$ref": "#/definitions/SignedAction"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "user_action_hash": {
/// "description": "0x-prefixed hex of the 32-byte user-action hash the curator commits to.",
/// "type": "string"
/// },
/// "wallet": {
/// "$ref": "#/definitions/Address"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultRequestResponse {
pub creation_timestamp_ms: u64,
pub id: VaultRequestId,
///The user's signed deposit/withdraw envelope; the curator pairs their `MintShares`/`BurnShares` approval against it.
pub signed_action: SignedAction,
pub subaccount_id: u64,
///0x-prefixed hex of the 32-byte user-action hash the curator commits to.
pub user_action_hash: ::std::string::String,
pub wallet: Address,
}
impl VaultRequestResponse {
pub fn builder() -> builder::VaultRequestResponse {
Default::default()
}
}
///Returned by `mint_vault_shares` / `burn_vault_shares`: identifiers to track the on-chain `MintShares` / `BurnShares` settlement.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `mint_vault_shares` / `burn_vault_shares`: identifiers to track the on-chain `MintShares` / `BurnShares` settlement.",
/// "type": "object",
/// "required": [
/// "op_uuid",
/// "operation_id"
/// ],
/// "properties": {
/// "op_uuid": {
/// "type": "string"
/// },
/// "operation_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultSettleResponse {
pub op_uuid: ::std::string::String,
pub operation_id: u64,
}
impl VaultSettleResponse {
pub fn builder() -> builder::VaultSettleResponse {
Default::default()
}
}
///One row of `get_vault_shares`: the caller's share balance in a vault plus the full enriched vault row (same shape as `public/get_vault`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One row of `get_vault_shares`: the caller's share balance in a vault plus the full enriched vault row (same shape as `public/get_vault`).",
/// "type": "object",
/// "required": [
/// "shares",
/// "vault"
/// ],
/// "properties": {
/// "shares": {
/// "description": "Shares the caller holds. Same units as `vault.protocol.total_shares`.",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "vault": {
/// "$ref": "#/definitions/Vault"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultShareEntryResponse {
///Shares the caller holds. Same units as `vault.protocol.total_shares`.
pub shares: ::bigdecimal::BigDecimal,
pub vault: Vault,
}
impl VaultShareEntryResponse {
pub fn builder() -> builder::VaultShareEntryResponse {
Default::default()
}
}
///Returned by `get_vault_shares`: one entry per vault the wallet holds shares in.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `get_vault_shares`: one entry per vault the wallet holds shares in.",
/// "type": "object",
/// "required": [
/// "vaults"
/// ],
/// "properties": {
/// "vaults": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/VaultShareEntryResponse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultSharesResponse {
pub vaults: ::std::vec::Vec<VaultShareEntryResponse>,
}
impl VaultSharesResponse {
pub fn builder() -> builder::VaultSharesResponse {
Default::default()
}
}
///Returned by `public/get_vaults`: one page of vaults plus pagination info. Each row carries its subaccount id under `protocol.subaccount_id`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Returned by `public/get_vaults`: one page of vaults plus pagination info. Each row carries its subaccount id under `protocol.subaccount_id`.",
/// "type": "object",
/// "required": [
/// "pagination",
/// "vaults"
/// ],
/// "properties": {
/// "pagination": {
/// "$ref": "#/definitions/Pagination"
/// },
/// "vaults": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Vault"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VaultsResponse {
pub pagination: Pagination,
pub vaults: ::std::vec::Vec<Vault>,
}
impl VaultsResponse {
pub fn builder() -> builder::VaultsResponse {
Default::default()
}
}
///`VolFeedDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confidence",
/// "currency",
/// "deadline",
/// "expiry",
/// "signatures",
/// "timestamp",
/// "vol_data"
/// ],
/// "properties": {
/// "confidence": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "deadline": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "expiry": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "signatures": {
/// "$ref": "#/definitions/OracleSignatureDataResponse"
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "vol_data": {
/// "$ref": "#/definitions/VolSVIParamDataResponse"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VolFeedDataResponse {
pub confidence: ::std::string::String,
pub currency: ::std::string::String,
pub deadline: u64,
pub expiry: u64,
pub signatures: OracleSignatureDataResponse,
pub timestamp: u64,
pub vol_data: VolSviParamDataResponse,
}
impl VolFeedDataResponse {
pub fn builder() -> builder::VolFeedDataResponse {
Default::default()
}
}
///`VolSviParamDataResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "SVI_a",
/// "SVI_b",
/// "SVI_fwd",
/// "SVI_m",
/// "SVI_refTau",
/// "SVI_rho",
/// "SVI_sigma"
/// ],
/// "properties": {
/// "SVI_a": {
/// "type": "string"
/// },
/// "SVI_b": {
/// "type": "string"
/// },
/// "SVI_fwd": {
/// "type": "string"
/// },
/// "SVI_m": {
/// "type": "string"
/// },
/// "SVI_refTau": {
/// "type": "string"
/// },
/// "SVI_rho": {
/// "type": "string"
/// },
/// "SVI_sigma": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VolSviParamDataResponse {
#[serde(rename = "SVI_a")]
pub svi_a: ::std::string::String,
#[serde(rename = "SVI_b")]
pub svi_b: ::std::string::String,
#[serde(rename = "SVI_fwd")]
pub svi_fwd: ::std::string::String,
#[serde(rename = "SVI_m")]
pub svi_m: ::std::string::String,
#[serde(rename = "SVI_refTau")]
pub svi_ref_tau: ::std::string::String,
#[serde(rename = "SVI_rho")]
pub svi_rho: ::std::string::String,
#[serde(rename = "SVI_sigma")]
pub svi_sigma: ::std::string::String,
}
impl VolSviParamDataResponse {
pub fn builder() -> builder::VolSviParamDataResponse {
Default::default()
}
}
///`WalletRfqsNotification`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$ref": "#/definitions/PublicRfq"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct WalletRfqsNotification(pub PublicRfq);
impl ::std::ops::Deref for WalletRfqsNotification {
type Target = PublicRfq;
fn deref(&self) -> &PublicRfq {
&self.0
}
}
impl ::std::convert::From<WalletRfqsNotification> for PublicRfq {
fn from(value: WalletRfqsNotification) -> Self {
value.0
}
}
impl ::std::convert::From<PublicRfq> for WalletRfqsNotification {
fn from(value: PublicRfq) -> Self {
Self(value)
}
}
///`amount` and `fee` are decimal strings (e.g. `"1.1"`); the net sent to the recipient is `amount - fee`. `wallet` is the account owner; `recipient` is the L1 destination. `asset` is the protocol asset (the native-ETH sentinel for ETH); `erc20_address` is the on-chain ERC20 the funds settle against (WETH for native ETH). `operation_id`/`batch_uuid` are the stable uuids.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "`amount` and `fee` are decimal strings (e.g. `\"1.1\"`); the net sent to the recipient is `amount - fee`. `wallet` is the account owner; `recipient` is the L1 destination. `asset` is the protocol asset (the native-ETH sentinel for ETH); `erc20_address` is the on-chain ERC20 the funds settle against (WETH for native ETH). `operation_id`/`batch_uuid` are the stable uuids.",
/// "type": "object",
/// "required": [
/// "amount",
/// "asset",
/// "batch_status",
/// "batch_uuid",
/// "erc20_address",
/// "fee",
/// "operation_id",
/// "recipient",
/// "subaccount_id",
/// "timestamp",
/// "wallet"
/// ],
/// "properties": {
/// "amount": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "asset": {
/// "type": "string"
/// },
/// "batch_status": {
/// "$ref": "#/definitions/BatchStatus"
/// },
/// "batch_uuid": {
/// "type": "string"
/// },
/// "erc20_address": {
/// "type": "string"
/// },
/// "fee": {
/// "description": "Non-negative decimal string of the human value (e.g. `\"1.5\"`), up to 12 fractional digits; a string or JSON number is accepted",
/// "type": "string",
/// "format": "decimal",
/// "x-rust-type": {
/// "crate": "bigdecimal",
/// "path": "bigdecimal::BigDecimal",
/// "version": ">=0.4.0, <0.5.0"
/// }
/// },
/// "operation_id": {
/// "type": "string"
/// },
/// "recipient": {
/// "type": "string"
/// },
/// "subaccount_id": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "timestamp": {
/// "type": "integer",
/// "format": "uint64",
/// "minimum": 0.0
/// },
/// "tx_hash": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "wallet": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WithdrawalEntry {
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub amount: ::bigdecimal::BigDecimal,
pub asset: ::std::string::String,
pub batch_status: BatchStatus,
pub batch_uuid: ::std::string::String,
pub erc20_address: ::std::string::String,
///Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
pub fee: ::bigdecimal::BigDecimal,
pub operation_id: ::std::string::String,
pub recipient: ::std::string::String,
pub subaccount_id: u64,
pub timestamp: u64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tx_hash: ::std::option::Option<::std::string::String>,
pub wallet: ::std::string::String,
}
impl WithdrawalEntry {
pub fn builder() -> builder::WithdrawalEntry {
Default::default()
}
}
///`WithdrawalHistoryResult`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "withdrawals"
/// ],
/// "properties": {
/// "withdrawals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/WithdrawalEntry"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WithdrawalHistoryResult {
pub withdrawals: ::std::vec::Vec<WithdrawalEntry>,
}
impl WithdrawalHistoryResult {
pub fn builder() -> builder::WithdrawalHistoryResult {
Default::default()
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct AccountFeeInfo {
base_fee_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
option_maker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
option_taker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
perp_maker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
perp_taker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rfq_maker_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
rfq_taker_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
spot_maker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
spot_taker_fee: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AccountFeeInfo {
fn default() -> Self {
Self {
base_fee_discount: Err(
"no value supplied for base_fee_discount".to_string(),
),
option_maker_fee: Ok(Default::default()),
option_taker_fee: Ok(Default::default()),
perp_maker_fee: Ok(Default::default()),
perp_taker_fee: Ok(Default::default()),
rfq_maker_discount: Err(
"no value supplied for rfq_maker_discount".to_string(),
),
rfq_taker_discount: Err(
"no value supplied for rfq_taker_discount".to_string(),
),
spot_maker_fee: Ok(Default::default()),
spot_taker_fee: Ok(Default::default()),
}
}
}
impl AccountFeeInfo {
pub fn base_fee_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.base_fee_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for base_fee_discount: {e}")
});
self
}
pub fn option_maker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.option_maker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for option_maker_fee: {e}")
});
self
}
pub fn option_taker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.option_taker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for option_taker_fee: {e}")
});
self
}
pub fn perp_maker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.perp_maker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for perp_maker_fee: {e}")
});
self
}
pub fn perp_taker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.perp_taker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for perp_taker_fee: {e}")
});
self
}
pub fn rfq_maker_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.rfq_maker_discount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for rfq_maker_discount: {e}"
)
});
self
}
pub fn rfq_taker_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.rfq_taker_discount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for rfq_taker_discount: {e}"
)
});
self
}
pub fn spot_maker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.spot_maker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_maker_fee: {e}")
});
self
}
pub fn spot_taker_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.spot_taker_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_taker_fee: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AccountFeeInfo> for super::AccountFeeInfo {
type Error = super::error::ConversionError;
fn try_from(
value: AccountFeeInfo,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
base_fee_discount: value.base_fee_discount?,
option_maker_fee: value.option_maker_fee?,
option_taker_fee: value.option_taker_fee?,
perp_maker_fee: value.perp_maker_fee?,
perp_taker_fee: value.perp_taker_fee?,
rfq_maker_discount: value.rfq_maker_discount?,
rfq_taker_discount: value.rfq_taker_discount?,
spot_maker_fee: value.spot_maker_fee?,
spot_taker_fee: value.spot_taker_fee?,
})
}
}
impl ::std::convert::From<super::AccountFeeInfo> for AccountFeeInfo {
fn from(value: super::AccountFeeInfo) -> Self {
Self {
base_fee_discount: Ok(value.base_fee_discount),
option_maker_fee: Ok(value.option_maker_fee),
option_taker_fee: Ok(value.option_taker_fee),
perp_maker_fee: Ok(value.perp_maker_fee),
perp_taker_fee: Ok(value.perp_taker_fee),
rfq_maker_discount: Ok(value.rfq_maker_discount),
rfq_taker_discount: Ok(value.rfq_taker_discount),
spot_maker_fee: Ok(value.spot_maker_fee),
spot_taker_fee: Ok(value.spot_taker_fee),
}
}
}
#[derive(Clone, Debug)]
pub struct Action {
data: ::std::result::Result<::std::vec::Vec<u8>, ::std::string::String>,
expiry: ::std::result::Result<u64, ::std::string::String>,
module: ::std::result::Result<super::Address, ::std::string::String>,
nonce: ::std::result::Result<u64, ::std::string::String>,
owner: ::std::result::Result<super::Address, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for Action {
fn default() -> Self {
Self {
data: Err("no value supplied for data".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
module: Err("no value supplied for module".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
owner: Err("no value supplied for owner".to_string()),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl Action {
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u8>>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn module<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.module = value
.try_into()
.map_err(|e| format!("error converting supplied value for module: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn owner<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.owner = value
.try_into()
.map_err(|e| format!("error converting supplied value for owner: {e}"));
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Action> for super::Action {
type Error = super::error::ConversionError;
fn try_from(
value: Action,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
data: value.data?,
expiry: value.expiry?,
module: value.module?,
nonce: value.nonce?,
owner: value.owner?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::Action> for Action {
fn from(value: super::Action) -> Self {
Self {
data: Ok(value.data),
expiry: Ok(value.expiry),
module: Ok(value.module),
nonce: Ok(value.nonce),
owner: Ok(value.owner),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct AggregatedOrdersResult {
orders: ::std::result::Result<
::std::vec::Vec<super::Order>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for AggregatedOrdersResult {
fn default() -> Self {
Self {
orders: Err("no value supplied for orders".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl AggregatedOrdersResult {
pub fn orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Order>>,
T::Error: ::std::fmt::Display,
{
self.orders = value
.try_into()
.map_err(|e| format!("error converting supplied value for orders: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AggregatedOrdersResult>
for super::AggregatedOrdersResult {
type Error = super::error::ConversionError;
fn try_from(
value: AggregatedOrdersResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
orders: value.orders?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::AggregatedOrdersResult> for AggregatedOrdersResult {
fn from(value: super::AggregatedOrdersResult) -> Self {
Self {
orders: Ok(value.orders),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct AggregatedTriggerOrdersResult {
orders: ::std::result::Result<
::std::vec::Vec<super::Order>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for AggregatedTriggerOrdersResult {
fn default() -> Self {
Self {
orders: Err("no value supplied for orders".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl AggregatedTriggerOrdersResult {
pub fn orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Order>>,
T::Error: ::std::fmt::Display,
{
self.orders = value
.try_into()
.map_err(|e| format!("error converting supplied value for orders: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AggregatedTriggerOrdersResult>
for super::AggregatedTriggerOrdersResult {
type Error = super::error::ConversionError;
fn try_from(
value: AggregatedTriggerOrdersResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
orders: value.orders?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::AggregatedTriggerOrdersResult>
for AggregatedTriggerOrdersResult {
fn from(value: super::AggregatedTriggerOrdersResult) -> Self {
Self {
orders: Ok(value.orders),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct Asset {
address: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_id: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_type: ::std::result::Result<super::AssetType, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
erc20_details: ::std::result::Result<
::std::option::Option<super::SpotPublicDetails>,
::std::string::String,
>,
is_collateral: ::std::result::Result<bool, ::std::string::String>,
is_position: ::std::result::Result<bool, ::std::string::String>,
option_details: ::std::result::Result<
::std::option::Option<super::OptionDetails>,
::std::string::String,
>,
perp_details: ::std::result::Result<
::std::option::Option<super::PerpDetails>,
::std::string::String,
>,
sub_id: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Asset {
fn default() -> Self {
Self {
address: Err("no value supplied for address".to_string()),
asset_id: Err("no value supplied for asset_id".to_string()),
asset_name: Err("no value supplied for asset_name".to_string()),
asset_type: Err("no value supplied for asset_type".to_string()),
currency: Err("no value supplied for currency".to_string()),
erc20_details: Ok(Default::default()),
is_collateral: Err("no value supplied for is_collateral".to_string()),
is_position: Err("no value supplied for is_position".to_string()),
option_details: Ok(Default::default()),
perp_details: Ok(Default::default()),
sub_id: Err("no value supplied for sub_id".to_string()),
}
}
}
impl Asset {
pub fn address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address: {e}")
});
self
}
pub fn asset_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_id: {e}")
});
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn asset_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.asset_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_type: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn erc20_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::SpotPublicDetails>>,
T::Error: ::std::fmt::Display,
{
self.erc20_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for erc20_details: {e}")
});
self
}
pub fn is_collateral<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_collateral = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_collateral: {e}")
});
self
}
pub fn is_position<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_position = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_position: {e}")
});
self
}
pub fn option_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::OptionDetails>>,
T::Error: ::std::fmt::Display,
{
self.option_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for option_details: {e}")
});
self
}
pub fn perp_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::PerpDetails>>,
T::Error: ::std::fmt::Display,
{
self.perp_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for perp_details: {e}")
});
self
}
pub fn sub_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.sub_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for sub_id: {e}"));
self
}
}
impl ::std::convert::TryFrom<Asset> for super::Asset {
type Error = super::error::ConversionError;
fn try_from(
value: Asset,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
address: value.address?,
asset_id: value.asset_id?,
asset_name: value.asset_name?,
asset_type: value.asset_type?,
currency: value.currency?,
erc20_details: value.erc20_details?,
is_collateral: value.is_collateral?,
is_position: value.is_position?,
option_details: value.option_details?,
perp_details: value.perp_details?,
sub_id: value.sub_id?,
})
}
}
impl ::std::convert::From<super::Asset> for Asset {
fn from(value: super::Asset) -> Self {
Self {
address: Ok(value.address),
asset_id: Ok(value.asset_id),
asset_name: Ok(value.asset_name),
asset_type: Ok(value.asset_type),
currency: Ok(value.currency),
erc20_details: Ok(value.erc20_details),
is_collateral: Ok(value.is_collateral),
is_position: Ok(value.is_position),
option_details: Ok(value.option_details),
perp_details: Ok(value.perp_details),
sub_id: Ok(value.sub_id),
}
}
}
#[derive(Clone, Debug)]
pub struct AssetEntry {
address: ::std::result::Result<::std::string::String, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
universes: ::std::result::Result<
::std::vec::Vec<super::AssetUniverse>,
::std::string::String,
>,
}
impl ::std::default::Default for AssetEntry {
fn default() -> Self {
Self {
address: Err("no value supplied for address".to_string()),
name: Err("no value supplied for name".to_string()),
universes: Err("no value supplied for universes".to_string()),
}
}
}
impl AssetEntry {
pub fn address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn universes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AssetUniverse>>,
T::Error: ::std::fmt::Display,
{
self.universes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for universes: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AssetEntry> for super::AssetEntry {
type Error = super::error::ConversionError;
fn try_from(
value: AssetEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
address: value.address?,
name: value.name?,
universes: value.universes?,
})
}
}
impl ::std::convert::From<super::AssetEntry> for AssetEntry {
fn from(value: super::AssetEntry) -> Self {
Self {
address: Ok(value.address),
name: Ok(value.name),
universes: Ok(value.universes),
}
}
}
#[derive(Clone, Debug)]
pub struct AssetUniverse {
oi: ::std::result::Result<super::OpenInterestStats, ::std::string::String>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
risk_universe_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AssetUniverse {
fn default() -> Self {
Self {
oi: Err("no value supplied for oi".to_string()),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
risk_universe_name: Ok(Default::default()),
}
}
}
impl AssetUniverse {
pub fn oi<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OpenInterestStats>,
T::Error: ::std::fmt::Display,
{
self.oi = value
.try_into()
.map_err(|e| format!("error converting supplied value for oi: {e}"));
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn risk_universe_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_name = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for risk_universe_name: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<AssetUniverse> for super::AssetUniverse {
type Error = super::error::ConversionError;
fn try_from(
value: AssetUniverse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
oi: value.oi?,
risk_universe_id: value.risk_universe_id?,
risk_universe_name: value.risk_universe_name?,
})
}
}
impl ::std::convert::From<super::AssetUniverse> for AssetUniverse {
fn from(value: super::AssetUniverse) -> Self {
Self {
oi: Ok(value.oi),
risk_universe_id: Ok(value.risk_universe_id),
risk_universe_name: Ok(value.risk_universe_name),
}
}
}
#[derive(Clone, Debug)]
pub struct AuctionBidEvent {
amounts_liquidated: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
cash_received: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
discount_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
percent_liquidated: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
positions_realized_pnl: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
positions_realized_pnl_excl_fees: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
tx_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for AuctionBidEvent {
fn default() -> Self {
Self {
amounts_liquidated: Err(
"no value supplied for amounts_liquidated".to_string(),
),
cash_received: Err("no value supplied for cash_received".to_string()),
discount_pnl: Err("no value supplied for discount_pnl".to_string()),
percent_liquidated: Err(
"no value supplied for percent_liquidated".to_string(),
),
positions_realized_pnl: Err(
"no value supplied for positions_realized_pnl".to_string(),
),
positions_realized_pnl_excl_fees: Err(
"no value supplied for positions_realized_pnl_excl_fees".to_string(),
),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
timestamp: Err("no value supplied for timestamp".to_string()),
tx_hash: Err("no value supplied for tx_hash".to_string()),
}
}
}
impl AuctionBidEvent {
pub fn amounts_liquidated<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.amounts_liquidated = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for amounts_liquidated: {e}"
)
});
self
}
pub fn cash_received<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.cash_received = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cash_received: {e}")
});
self
}
pub fn discount_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.discount_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for discount_pnl: {e}")
});
self
}
pub fn percent_liquidated<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.percent_liquidated = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for percent_liquidated: {e}"
)
});
self
}
pub fn positions_realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.positions_realized_pnl = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for positions_realized_pnl: {e}"
)
});
self
}
pub fn positions_realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.positions_realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for positions_realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuctionBidEvent> for super::AuctionBidEvent {
type Error = super::error::ConversionError;
fn try_from(
value: AuctionBidEvent,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amounts_liquidated: value.amounts_liquidated?,
cash_received: value.cash_received?,
discount_pnl: value.discount_pnl?,
percent_liquidated: value.percent_liquidated?,
positions_realized_pnl: value.positions_realized_pnl?,
positions_realized_pnl_excl_fees: value
.positions_realized_pnl_excl_fees?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
timestamp: value.timestamp?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::AuctionBidEvent> for AuctionBidEvent {
fn from(value: super::AuctionBidEvent) -> Self {
Self {
amounts_liquidated: Ok(value.amounts_liquidated),
cash_received: Ok(value.cash_received),
discount_pnl: Ok(value.discount_pnl),
percent_liquidated: Ok(value.percent_liquidated),
positions_realized_pnl: Ok(value.positions_realized_pnl),
positions_realized_pnl_excl_fees: Ok(
value.positions_realized_pnl_excl_fees,
),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
timestamp: Ok(value.timestamp),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct AuctionDetails {
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
estimated_bid_price: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_discount_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_mtm: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_percent_bid: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
last_seen_trade_id: ::std::result::Result<i64, ::std::string::String>,
margin_type: ::std::result::Result<::std::string::String, ::std::string::String>,
min_cash_transfer: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
min_price_limit: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_balances: ::std::result::Result<
super::AuctionDetailsSubaccountBalances,
::std::string::String,
>,
}
impl ::std::default::Default for AuctionDetails {
fn default() -> Self {
Self {
currency: Ok(Default::default()),
estimated_bid_price: Err(
"no value supplied for estimated_bid_price".to_string(),
),
estimated_discount_pnl: Err(
"no value supplied for estimated_discount_pnl".to_string(),
),
estimated_mtm: Err("no value supplied for estimated_mtm".to_string()),
estimated_percent_bid: Err(
"no value supplied for estimated_percent_bid".to_string(),
),
last_seen_trade_id: Err(
"no value supplied for last_seen_trade_id".to_string(),
),
margin_type: Err("no value supplied for margin_type".to_string()),
min_cash_transfer: Err(
"no value supplied for min_cash_transfer".to_string(),
),
min_price_limit: Err(
"no value supplied for min_price_limit".to_string(),
),
subaccount_balances: Err(
"no value supplied for subaccount_balances".to_string(),
),
}
}
}
impl AuctionDetails {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn estimated_bid_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_bid_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_bid_price: {e}"
)
});
self
}
pub fn estimated_discount_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_discount_pnl = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_discount_pnl: {e}"
)
});
self
}
pub fn estimated_mtm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_mtm = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for estimated_mtm: {e}")
});
self
}
pub fn estimated_percent_bid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_percent_bid = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_percent_bid: {e}"
)
});
self
}
pub fn last_seen_trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_seen_trade_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_seen_trade_id: {e}"
)
});
self
}
pub fn margin_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.margin_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for margin_type: {e}")
});
self
}
pub fn min_cash_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.min_cash_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_cash_transfer: {e}")
});
self
}
pub fn min_price_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.min_price_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_price_limit: {e}")
});
self
}
pub fn subaccount_balances<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AuctionDetailsSubaccountBalances>,
T::Error: ::std::fmt::Display,
{
self.subaccount_balances = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for subaccount_balances: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<AuctionDetails> for super::AuctionDetails {
type Error = super::error::ConversionError;
fn try_from(
value: AuctionDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
estimated_bid_price: value.estimated_bid_price?,
estimated_discount_pnl: value.estimated_discount_pnl?,
estimated_mtm: value.estimated_mtm?,
estimated_percent_bid: value.estimated_percent_bid?,
last_seen_trade_id: value.last_seen_trade_id?,
margin_type: value.margin_type?,
min_cash_transfer: value.min_cash_transfer?,
min_price_limit: value.min_price_limit?,
subaccount_balances: value.subaccount_balances?,
})
}
}
impl ::std::convert::From<super::AuctionDetails> for AuctionDetails {
fn from(value: super::AuctionDetails) -> Self {
Self {
currency: Ok(value.currency),
estimated_bid_price: Ok(value.estimated_bid_price),
estimated_discount_pnl: Ok(value.estimated_discount_pnl),
estimated_mtm: Ok(value.estimated_mtm),
estimated_percent_bid: Ok(value.estimated_percent_bid),
last_seen_trade_id: Ok(value.last_seen_trade_id),
margin_type: Ok(value.margin_type),
min_cash_transfer: Ok(value.min_cash_transfer),
min_price_limit: Ok(value.min_price_limit),
subaccount_balances: Ok(value.subaccount_balances),
}
}
}
#[derive(Clone, Debug)]
pub struct AuctionDetailsSubaccountBalances {
key: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
extra: ::std::result::Result<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for AuctionDetailsSubaccountBalances {
fn default() -> Self {
Self {
key: Ok(Default::default()),
extra: Err("no value supplied for extra".to_string()),
}
}
}
impl AuctionDetailsSubaccountBalances {
pub fn key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.key = value
.try_into()
.map_err(|e| format!("error converting supplied value for key: {e}"));
self
}
pub fn extra<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
T::Error: ::std::fmt::Display,
{
self.extra = value
.try_into()
.map_err(|e| format!("error converting supplied value for extra: {e}"));
self
}
}
impl ::std::convert::TryFrom<AuctionDetailsSubaccountBalances>
for super::AuctionDetailsSubaccountBalances {
type Error = super::error::ConversionError;
fn try_from(
value: AuctionDetailsSubaccountBalances,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
key: value.key?,
extra: value.extra?,
})
}
}
impl ::std::convert::From<super::AuctionDetailsSubaccountBalances>
for AuctionDetailsSubaccountBalances {
fn from(value: super::AuctionDetailsSubaccountBalances) -> Self {
Self {
key: Ok(value.key),
extra: Ok(value.extra),
}
}
}
#[derive(Clone, Debug)]
pub struct AuctionHistory {
auction_id: ::std::result::Result<::std::string::String, ::std::string::String>,
auction_type: ::std::result::Result<super::AuctionType, ::std::string::String>,
bids: ::std::result::Result<
::std::vec::Vec<super::AuctionBidEvent>,
::std::string::String,
>,
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
fee: ::std::result::Result<::std::string::String, ::std::string::String>,
start_timestamp: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
tx_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for AuctionHistory {
fn default() -> Self {
Self {
auction_id: Err("no value supplied for auction_id".to_string()),
auction_type: Err("no value supplied for auction_type".to_string()),
bids: Err("no value supplied for bids".to_string()),
end_timestamp: Ok(Default::default()),
fee: Err("no value supplied for fee".to_string()),
start_timestamp: Err(
"no value supplied for start_timestamp".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
tx_hash: Err("no value supplied for tx_hash".to_string()),
}
}
}
impl AuctionHistory {
pub fn auction_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.auction_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auction_id: {e}")
});
self
}
pub fn auction_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AuctionType>,
T::Error: ::std::fmt::Display,
{
self.auction_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auction_type: {e}")
});
self
}
pub fn bids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AuctionBidEvent>>,
T::Error: ::std::fmt::Display,
{
self.bids = value
.try_into()
.map_err(|e| format!("error converting supplied value for bids: {e}"));
self
}
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuctionHistory> for super::AuctionHistory {
type Error = super::error::ConversionError;
fn try_from(
value: AuctionHistory,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
auction_id: value.auction_id?,
auction_type: value.auction_type?,
bids: value.bids?,
end_timestamp: value.end_timestamp?,
fee: value.fee?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::AuctionHistory> for AuctionHistory {
fn from(value: super::AuctionHistory) -> Self {
Self {
auction_id: Ok(value.auction_id),
auction_type: Ok(value.auction_type),
bids: Ok(value.bids),
end_timestamp: Ok(value.end_timestamp),
fee: Ok(value.fee),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct AuctionResult {
details: ::std::result::Result<
::std::option::Option<super::AuctionDetails>,
::std::string::String,
>,
state: ::std::result::Result<super::AuctionStateType, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for AuctionResult {
fn default() -> Self {
Self {
details: Ok(Default::default()),
state: Err("no value supplied for state".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl AuctionResult {
pub fn details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AuctionDetails>>,
T::Error: ::std::fmt::Display,
{
self.details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for details: {e}")
});
self
}
pub fn state<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AuctionStateType>,
T::Error: ::std::fmt::Display,
{
self.state = value
.try_into()
.map_err(|e| format!("error converting supplied value for state: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<AuctionResult> for super::AuctionResult {
type Error = super::error::ConversionError;
fn try_from(
value: AuctionResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
details: value.details?,
state: value.state?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::AuctionResult> for AuctionResult {
fn from(value: super::AuctionResult) -> Self {
Self {
details: Ok(value.details),
state: Ok(value.state),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct BalanceUpdate {
name: ::std::result::Result<::std::string::String, ::std::string::String>,
new_balance: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
previous_balance: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
update_type: ::std::result::Result<
super::BalanceUpdateType,
::std::string::String,
>,
}
impl ::std::default::Default for BalanceUpdate {
fn default() -> Self {
Self {
name: Err("no value supplied for name".to_string()),
new_balance: Err("no value supplied for new_balance".to_string()),
previous_balance: Err(
"no value supplied for previous_balance".to_string(),
),
update_type: Err("no value supplied for update_type".to_string()),
}
}
}
impl BalanceUpdate {
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn new_balance<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.new_balance = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for new_balance: {e}")
});
self
}
pub fn previous_balance<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.previous_balance = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for previous_balance: {e}")
});
self
}
pub fn update_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BalanceUpdateType>,
T::Error: ::std::fmt::Display,
{
self.update_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for update_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<BalanceUpdate> for super::BalanceUpdate {
type Error = super::error::ConversionError;
fn try_from(
value: BalanceUpdate,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
name: value.name?,
new_balance: value.new_balance?,
previous_balance: value.previous_balance?,
update_type: value.update_type?,
})
}
}
impl ::std::convert::From<super::BalanceUpdate> for BalanceUpdate {
fn from(value: super::BalanceUpdate) -> Self {
Self {
name: Ok(value.name),
new_balance: Ok(value.new_balance),
previous_balance: Ok(value.previous_balance),
update_type: Ok(value.update_type),
}
}
}
#[derive(Clone, Debug)]
pub struct BestQuoteChannelResult {
error: ::std::result::Result<
::std::option::Option<super::RpcError>,
::std::string::String,
>,
result: ::std::result::Result<
::std::option::Option<super::RfqGetBestQuoteResponse>,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
}
impl ::std::default::Default for BestQuoteChannelResult {
fn default() -> Self {
Self {
error: Ok(Default::default()),
result: Ok(Default::default()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
}
}
}
impl BestQuoteChannelResult {
pub fn error<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RpcError>>,
T::Error: ::std::fmt::Display,
{
self.error = value
.try_into()
.map_err(|e| format!("error converting supplied value for error: {e}"));
self
}
pub fn result<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::RfqGetBestQuoteResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.result = value
.try_into()
.map_err(|e| format!("error converting supplied value for result: {e}"));
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
}
impl ::std::convert::TryFrom<BestQuoteChannelResult>
for super::BestQuoteChannelResult {
type Error = super::error::ConversionError;
fn try_from(
value: BestQuoteChannelResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
error: value.error?,
result: value.result?,
rfq_id: value.rfq_id?,
})
}
}
impl ::std::convert::From<super::BestQuoteChannelResult> for BestQuoteChannelResult {
fn from(value: super::BestQuoteChannelResult) -> Self {
Self {
error: Ok(value.error),
result: Ok(value.result),
rfq_id: Ok(value.rfq_id),
}
}
}
#[derive(Clone, Debug)]
pub struct BurnSharesRequest {
nonce: ::std::result::Result<u64, ::std::string::String>,
request_id: ::std::result::Result<super::VaultRequestId, ::std::string::String>,
share_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
withdraw_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for BurnSharesRequest {
fn default() -> Self {
Self {
nonce: Err("no value supplied for nonce".to_string()),
request_id: Err("no value supplied for request_id".to_string()),
share_price: Err("no value supplied for share_price".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
withdraw_hash: Err("no value supplied for withdraw_hash".to_string()),
}
}
}
impl BurnSharesRequest {
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn request_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultRequestId>,
T::Error: ::std::fmt::Display,
{
self.request_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for request_id: {e}")
});
self
}
pub fn share_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.share_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for share_price: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn withdraw_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.withdraw_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for withdraw_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<BurnSharesRequest> for super::BurnSharesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: BurnSharesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
nonce: value.nonce?,
request_id: value.request_id?,
share_price: value.share_price?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
withdraw_hash: value.withdraw_hash?,
})
}
}
impl ::std::convert::From<super::BurnSharesRequest> for BurnSharesRequest {
fn from(value: super::BurnSharesRequest) -> Self {
Self {
nonce: Ok(value.nonce),
request_id: Ok(value.request_id),
share_price: Ok(value.share_price),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
withdraw_hash: Ok(value.withdraw_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelAlgoOrderRequest {
order_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelAlgoOrderRequest {
fn default() -> Self {
Self {
order_id: Err("no value supplied for order_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelAlgoOrderRequest {
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelAlgoOrderRequest>
for super::CancelAlgoOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelAlgoOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
order_id: value.order_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelAlgoOrderRequest> for CancelAlgoOrderRequest {
fn from(value: super::CancelAlgoOrderRequest) -> Self {
Self {
order_id: Ok(value.order_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelAllAlgoOrdersRequest {
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelAllAlgoOrdersRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelAllAlgoOrdersRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelAllAlgoOrdersRequest>
for super::CancelAllAlgoOrdersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelAllAlgoOrdersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelAllAlgoOrdersRequest>
for CancelAllAlgoOrdersRequest {
fn from(value: super::CancelAllAlgoOrdersRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelAllRequest {
cancel_algo_orders: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
cancel_trigger_orders: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelAllRequest {
fn default() -> Self {
Self {
cancel_algo_orders: Ok(Default::default()),
cancel_trigger_orders: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelAllRequest {
pub fn cancel_algo_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.cancel_algo_orders = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cancel_algo_orders: {e}"
)
});
self
}
pub fn cancel_trigger_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.cancel_trigger_orders = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cancel_trigger_orders: {e}"
)
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelAllRequest> for super::CancelAllRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelAllRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancel_algo_orders: value.cancel_algo_orders?,
cancel_trigger_orders: value.cancel_trigger_orders?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelAllRequest> for CancelAllRequest {
fn from(value: super::CancelAllRequest) -> Self {
Self {
cancel_algo_orders: Ok(value.cancel_algo_orders),
cancel_trigger_orders: Ok(value.cancel_trigger_orders),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelAllTriggerOrdersRequest {
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelAllTriggerOrdersRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelAllTriggerOrdersRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelAllTriggerOrdersRequest>
for super::CancelAllTriggerOrdersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelAllTriggerOrdersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelAllTriggerOrdersRequest>
for CancelAllTriggerOrdersRequest {
fn from(value: super::CancelAllTriggerOrdersRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelBatchQuotesRequest {
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
nonce: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CancelBatchQuotesRequest {
fn default() -> Self {
Self {
label: Ok(Default::default()),
nonce: Ok(Default::default()),
quote_id: Ok(Default::default()),
rfq_id: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelBatchQuotesRequest {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelBatchQuotesRequest>
for super::CancelBatchQuotesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelBatchQuotesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelBatchQuotesRequest>
for CancelBatchQuotesRequest {
fn from(value: super::CancelBatchQuotesRequest) -> Self {
Self {
label: Ok(value.label),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelBatchResult {
cancelled_ids: ::std::result::Result<
::std::vec::Vec<::uuid::Uuid>,
::std::string::String,
>,
}
impl ::std::default::Default for CancelBatchResult {
fn default() -> Self {
Self {
cancelled_ids: Err("no value supplied for cancelled_ids".to_string()),
}
}
}
impl CancelBatchResult {
pub fn cancelled_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.cancelled_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelBatchResult> for super::CancelBatchResult {
type Error = super::error::ConversionError;
fn try_from(
value: CancelBatchResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_ids: value.cancelled_ids?,
})
}
}
impl ::std::convert::From<super::CancelBatchResult> for CancelBatchResult {
fn from(value: super::CancelBatchResult) -> Self {
Self {
cancelled_ids: Ok(value.cancelled_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelBatchRfqsRequest {
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
nonce: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CancelBatchRfqsRequest {
fn default() -> Self {
Self {
label: Ok(Default::default()),
nonce: Ok(Default::default()),
rfq_id: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelBatchRfqsRequest {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelBatchRfqsRequest>
for super::CancelBatchRfqsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelBatchRfqsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
nonce: value.nonce?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelBatchRfqsRequest> for CancelBatchRfqsRequest {
fn from(value: super::CancelBatchRfqsRequest) -> Self {
Self {
label: Ok(value.label),
nonce: Ok(value.nonce),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelBatchRfqsResponse {
cancelled_ids: ::std::result::Result<
::std::vec::Vec<::uuid::Uuid>,
::std::string::String,
>,
}
impl ::std::default::Default for CancelBatchRfqsResponse {
fn default() -> Self {
Self {
cancelled_ids: Err("no value supplied for cancelled_ids".to_string()),
}
}
}
impl CancelBatchRfqsResponse {
pub fn cancelled_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.cancelled_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelBatchRfqsResponse>
for super::CancelBatchRfqsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CancelBatchRfqsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_ids: value.cancelled_ids?,
})
}
}
impl ::std::convert::From<super::CancelBatchRfqsResponse>
for CancelBatchRfqsResponse {
fn from(value: super::CancelBatchRfqsResponse) -> Self {
Self {
cancelled_ids: Ok(value.cancelled_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByInstrumentRequest {
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByInstrumentRequest {
fn default() -> Self {
Self {
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelByInstrumentRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByInstrumentRequest>
for super::CancelByInstrumentRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByInstrumentRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelByInstrumentRequest>
for CancelByInstrumentRequest {
fn from(value: super::CancelByInstrumentRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByInstrumentResponse {
cancelled_orders: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByInstrumentResponse {
fn default() -> Self {
Self {
cancelled_orders: Err(
"no value supplied for cancelled_orders".to_string(),
),
}
}
}
impl CancelByInstrumentResponse {
pub fn cancelled_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.cancelled_orders = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_orders: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByInstrumentResponse>
for super::CancelByInstrumentResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByInstrumentResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_orders: value.cancelled_orders?,
})
}
}
impl ::std::convert::From<super::CancelByInstrumentResponse>
for CancelByInstrumentResponse {
fn from(value: super::CancelByInstrumentResponse) -> Self {
Self {
cancelled_orders: Ok(value.cancelled_orders),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByLabelRequest {
instrument_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByLabelRequest {
fn default() -> Self {
Self {
instrument_name: Ok(Default::default()),
label: Err("no value supplied for label".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelByLabelRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByLabelRequest> for super::CancelByLabelRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByLabelRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
label: value.label?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelByLabelRequest> for CancelByLabelRequest {
fn from(value: super::CancelByLabelRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
label: Ok(value.label),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByLabelResponse {
cancelled_orders: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByLabelResponse {
fn default() -> Self {
Self {
cancelled_orders: Err(
"no value supplied for cancelled_orders".to_string(),
),
}
}
}
impl CancelByLabelResponse {
pub fn cancelled_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.cancelled_orders = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_orders: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByLabelResponse>
for super::CancelByLabelResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByLabelResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_orders: value.cancelled_orders?,
})
}
}
impl ::std::convert::From<super::CancelByLabelResponse> for CancelByLabelResponse {
fn from(value: super::CancelByLabelResponse) -> Self {
Self {
cancelled_orders: Ok(value.cancelled_orders),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByNonceRequest {
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
nonce: ::std::result::Result<i64, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByNonceRequest {
fn default() -> Self {
Self {
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
nonce: Err("no value supplied for nonce".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelByNonceRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByNonceRequest> for super::CancelByNonceRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByNonceRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
nonce: value.nonce?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelByNonceRequest> for CancelByNonceRequest {
fn from(value: super::CancelByNonceRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
nonce: Ok(value.nonce),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelByNonceResponse {
cancelled_orders: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelByNonceResponse {
fn default() -> Self {
Self {
cancelled_orders: Err(
"no value supplied for cancelled_orders".to_string(),
),
}
}
}
impl CancelByNonceResponse {
pub fn cancelled_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.cancelled_orders = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_orders: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelByNonceResponse>
for super::CancelByNonceResponse {
type Error = super::error::ConversionError;
fn try_from(
value: CancelByNonceResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_orders: value.cancelled_orders?,
})
}
}
impl ::std::convert::From<super::CancelByNonceResponse> for CancelByNonceResponse {
fn from(value: super::CancelByNonceResponse) -> Self {
Self {
cancelled_orders: Ok(value.cancelled_orders),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelOrderRequest {
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
order_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelOrderRequest {
fn default() -> Self {
Self {
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
order_id: Err("no value supplied for order_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelOrderRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelOrderRequest> for super::CancelOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
order_id: value.order_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelOrderRequest> for CancelOrderRequest {
fn from(value: super::CancelOrderRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
order_id: Ok(value.order_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelQuoteRequest {
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
nonce: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CancelQuoteRequest {
fn default() -> Self {
Self {
label: Ok(Default::default()),
nonce: Ok(Default::default()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_id: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelQuoteRequest {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelQuoteRequest> for super::CancelQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelQuoteRequest> for CancelQuoteRequest {
fn from(value: super::CancelQuoteRequest) -> Self {
Self {
label: Ok(value.label),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelRfqRequest {
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CancelRfqRequest {
fn default() -> Self {
Self {
rfq_id: Err("no value supplied for rfq_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelRfqRequest {
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelRfqRequest> for super::CancelRfqRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelRfqRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelRfqRequest> for CancelRfqRequest {
fn from(value: super::CancelRfqRequest) -> Self {
Self {
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelTriggerOrderRequest {
order_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for CancelTriggerOrderRequest {
fn default() -> Self {
Self {
order_id: Err("no value supplied for order_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CancelTriggerOrderRequest {
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CancelTriggerOrderRequest>
for super::CancelTriggerOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelTriggerOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
order_id: value.order_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelTriggerOrderRequest>
for CancelTriggerOrderRequest {
fn from(value: super::CancelTriggerOrderRequest) -> Self {
Self {
order_id: Ok(value.order_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct CancelVaultRequestRequest {
nonce: ::std::result::Result<u64, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
vault_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CancelVaultRequestRequest {
fn default() -> Self {
Self {
nonce: Err("no value supplied for nonce".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
vault_subaccount_id: Err(
"no value supplied for vault_subaccount_id".to_string(),
),
}
}
}
impl CancelVaultRequestRequest {
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn vault_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_subaccount_id: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<CancelVaultRequestRequest>
for super::CancelVaultRequestRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CancelVaultRequestRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
nonce: value.nonce?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
vault_subaccount_id: value.vault_subaccount_id?,
})
}
}
impl ::std::convert::From<super::CancelVaultRequestRequest>
for CancelVaultRequestRequest {
fn from(value: super::CancelVaultRequestRequest) -> Self {
Self {
nonce: Ok(value.nonce),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
vault_subaccount_id: Ok(value.vault_subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ChangeSubaccountLabelRequest {
label: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ChangeSubaccountLabelRequest {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl ChangeSubaccountLabelRequest {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ChangeSubaccountLabelRequest>
for super::ChangeSubaccountLabelRequest {
type Error = super::error::ConversionError;
fn try_from(
value: ChangeSubaccountLabelRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::ChangeSubaccountLabelRequest>
for ChangeSubaccountLabelRequest {
fn from(value: super::ChangeSubaccountLabelRequest) -> Self {
Self {
label: Ok(value.label),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct Collateral {
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
amount_step: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_type: ::std::result::Result<::std::string::String, ::std::string::String>,
average_price: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
average_price_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
cumulative_interest: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
delta: ::std::result::Result<::std::string::String, ::std::string::String>,
delta_currency: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mark_price: ::std::result::Result<::std::string::String, ::std::string::String>,
mark_value: ::std::result::Result<::std::string::String, ::std::string::String>,
open_orders_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
pending_interest: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_fees: ::std::result::Result<::std::string::String, ::std::string::String>,
unrealized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
unrealized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for Collateral {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
amount_step: Err("no value supplied for amount_step".to_string()),
asset_name: Err("no value supplied for asset_name".to_string()),
asset_type: Err("no value supplied for asset_type".to_string()),
average_price: Err("no value supplied for average_price".to_string()),
average_price_excl_fees: Err(
"no value supplied for average_price_excl_fees".to_string(),
),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
cumulative_interest: Err(
"no value supplied for cumulative_interest".to_string(),
),
currency: Err("no value supplied for currency".to_string()),
delta: Err("no value supplied for delta".to_string()),
delta_currency: Err("no value supplied for delta_currency".to_string()),
initial_margin: Err("no value supplied for initial_margin".to_string()),
maintenance_margin: Err(
"no value supplied for maintenance_margin".to_string(),
),
mark_price: Err("no value supplied for mark_price".to_string()),
mark_value: Err("no value supplied for mark_value".to_string()),
open_orders_margin: Err(
"no value supplied for open_orders_margin".to_string(),
),
pending_interest: Err(
"no value supplied for pending_interest".to_string(),
),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
total_fees: Err("no value supplied for total_fees".to_string()),
unrealized_pnl: Err("no value supplied for unrealized_pnl".to_string()),
unrealized_pnl_excl_fees: Err(
"no value supplied for unrealized_pnl_excl_fees".to_string(),
),
}
}
}
impl Collateral {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn amount_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for amount_step: {e}")
});
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn asset_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_type: {e}")
});
self
}
pub fn average_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.average_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for average_price: {e}")
});
self
}
pub fn average_price_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.average_price_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for average_price_excl_fees: {e}"
)
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn cumulative_interest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.cumulative_interest = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cumulative_interest: {e}"
)
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn delta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.delta = value
.try_into()
.map_err(|e| format!("error converting supplied value for delta: {e}"));
self
}
pub fn delta_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.delta_currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for delta_currency: {e}")
});
self
}
pub fn initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.initial_margin = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for initial_margin: {e}")
});
self
}
pub fn maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for maintenance_margin: {e}"
)
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn mark_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mark_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_value: {e}")
});
self
}
pub fn open_orders_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open_orders_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for open_orders_margin: {e}"
)
});
self
}
pub fn pending_interest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pending_interest = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pending_interest: {e}")
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn total_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_fees = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_fees: {e}")
});
self
}
pub fn unrealized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.unrealized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for unrealized_pnl: {e}")
});
self
}
pub fn unrealized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.unrealized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for unrealized_pnl_excl_fees: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<Collateral> for super::Collateral {
type Error = super::error::ConversionError;
fn try_from(
value: Collateral,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
amount_step: value.amount_step?,
asset_name: value.asset_name?,
asset_type: value.asset_type?,
average_price: value.average_price?,
average_price_excl_fees: value.average_price_excl_fees?,
creation_timestamp: value.creation_timestamp?,
cumulative_interest: value.cumulative_interest?,
currency: value.currency?,
delta: value.delta?,
delta_currency: value.delta_currency?,
initial_margin: value.initial_margin?,
maintenance_margin: value.maintenance_margin?,
mark_price: value.mark_price?,
mark_value: value.mark_value?,
open_orders_margin: value.open_orders_margin?,
pending_interest: value.pending_interest?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
total_fees: value.total_fees?,
unrealized_pnl: value.unrealized_pnl?,
unrealized_pnl_excl_fees: value.unrealized_pnl_excl_fees?,
})
}
}
impl ::std::convert::From<super::Collateral> for Collateral {
fn from(value: super::Collateral) -> Self {
Self {
amount: Ok(value.amount),
amount_step: Ok(value.amount_step),
asset_name: Ok(value.asset_name),
asset_type: Ok(value.asset_type),
average_price: Ok(value.average_price),
average_price_excl_fees: Ok(value.average_price_excl_fees),
creation_timestamp: Ok(value.creation_timestamp),
cumulative_interest: Ok(value.cumulative_interest),
currency: Ok(value.currency),
delta: Ok(value.delta),
delta_currency: Ok(value.delta_currency),
initial_margin: Ok(value.initial_margin),
maintenance_margin: Ok(value.maintenance_margin),
mark_price: Ok(value.mark_price),
mark_value: Ok(value.mark_value),
open_orders_margin: Ok(value.open_orders_margin),
pending_interest: Ok(value.pending_interest),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
total_fees: Ok(value.total_fees),
unrealized_pnl: Ok(value.unrealized_pnl),
unrealized_pnl_excl_fees: Ok(value.unrealized_pnl_excl_fees),
}
}
}
#[derive(Clone, Debug)]
pub struct CreateOrderRequest {
algo_duration_sec: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_num_slices: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_type: ::std::result::Result<
::std::option::Option<super::AlgoType>,
::std::string::String,
>,
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
client: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_atomic_signing: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
limit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
order_type: ::std::result::Result<super::OrderType, ::std::string::String>,
reduce_only: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
reject_post_only: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
reject_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
time_in_force: ::std::result::Result<super::TimeInForce, ::std::string::String>,
trigger_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
trigger_price_type: ::std::result::Result<
::std::option::Option<super::TriggerPriceType>,
::std::string::String,
>,
trigger_type: ::std::result::Result<
::std::option::Option<super::TriggerType>,
::std::string::String,
>,
}
impl ::std::default::Default for CreateOrderRequest {
fn default() -> Self {
Self {
algo_duration_sec: Ok(Default::default()),
algo_num_slices: Ok(Default::default()),
algo_type: Ok(Default::default()),
amount: Err("no value supplied for amount".to_string()),
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Ok(Default::default()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_atomic_signing: Ok(Default::default()),
label: Ok(Default::default()),
limit_price: Err("no value supplied for limit_price".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
order_type: Ok(super::defaults::create_order_request_order_type()),
reduce_only: Ok(Default::default()),
referral_code: Ok(Default::default()),
reject_post_only: Ok(Default::default()),
reject_timestamp: Ok(Default::default()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
time_in_force: Ok(super::defaults::create_order_request_time_in_force()),
trigger_price: Ok(Default::default()),
trigger_price_type: Ok(Default::default()),
trigger_type: Ok(Default::default()),
}
}
}
impl CreateOrderRequest {
pub fn algo_duration_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_duration_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_duration_sec: {e}")
});
self
}
pub fn algo_num_slices<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_num_slices = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_num_slices: {e}")
});
self
}
pub fn algo_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AlgoType>>,
T::Error: ::std::fmt::Display,
{
self.algo_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_type: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_atomic_signing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.is_atomic_signing = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_atomic_signing: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.limit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for limit_price: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn order_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderType>,
T::Error: ::std::fmt::Display,
{
self.order_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_type: {e}")
});
self
}
pub fn reduce_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.reduce_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reduce_only: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn reject_post_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.reject_post_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_post_only: {e}")
});
self
}
pub fn reject_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.reject_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_timestamp: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn time_in_force<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TimeInForce>,
T::Error: ::std::fmt::Display,
{
self.time_in_force = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for time_in_force: {e}")
});
self
}
pub fn trigger_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_price: {e}")
});
self
}
pub fn trigger_price_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerPriceType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price_type = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for trigger_price_type: {e}"
)
});
self
}
pub fn trigger_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CreateOrderRequest> for super::CreateOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CreateOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
algo_duration_sec: value.algo_duration_sec?,
algo_num_slices: value.algo_num_slices?,
algo_type: value.algo_type?,
amount: value.amount?,
client: value.client?,
direction: value.direction?,
extra_fee: value.extra_fee?,
instrument_name: value.instrument_name?,
is_atomic_signing: value.is_atomic_signing?,
label: value.label?,
limit_price: value.limit_price?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
order_type: value.order_type?,
reduce_only: value.reduce_only?,
referral_code: value.referral_code?,
reject_post_only: value.reject_post_only?,
reject_timestamp: value.reject_timestamp?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
time_in_force: value.time_in_force?,
trigger_price: value.trigger_price?,
trigger_price_type: value.trigger_price_type?,
trigger_type: value.trigger_type?,
})
}
}
impl ::std::convert::From<super::CreateOrderRequest> for CreateOrderRequest {
fn from(value: super::CreateOrderRequest) -> Self {
Self {
algo_duration_sec: Ok(value.algo_duration_sec),
algo_num_slices: Ok(value.algo_num_slices),
algo_type: Ok(value.algo_type),
amount: Ok(value.amount),
client: Ok(value.client),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
instrument_name: Ok(value.instrument_name),
is_atomic_signing: Ok(value.is_atomic_signing),
label: Ok(value.label),
limit_price: Ok(value.limit_price),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
order_type: Ok(value.order_type),
reduce_only: Ok(value.reduce_only),
referral_code: Ok(value.referral_code),
reject_post_only: Ok(value.reject_post_only),
reject_timestamp: Ok(value.reject_timestamp),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
time_in_force: Ok(value.time_in_force),
trigger_price: Ok(value.trigger_price),
trigger_price_type: Ok(value.trigger_price_type),
trigger_type: Ok(value.trigger_type),
}
}
}
#[derive(Clone, Debug)]
pub struct CreateVaultRequest {
benchmark_asset: ::std::result::Result<
::std::option::Option<super::Address>,
::std::string::String,
>,
cooldown_sec: ::std::result::Result<u64, ::std::string::String>,
deposit_spot_asset: ::std::result::Result<super::Address, ::std::string::String>,
initial_deposit: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
initial_share_price_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
management_fee_bps: ::std::result::Result<u64, ::std::string::String>,
manager_id: ::std::result::Result<u64, ::std::string::String>,
max_fee_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
max_slippage_bps: ::std::result::Result<u64, ::std::string::String>,
nonce: ::std::result::Result<u64, ::std::string::String>,
performance_fee_bps: ::std::result::Result<u64, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for CreateVaultRequest {
fn default() -> Self {
Self {
benchmark_asset: Ok(Default::default()),
cooldown_sec: Err("no value supplied for cooldown_sec".to_string()),
deposit_spot_asset: Err(
"no value supplied for deposit_spot_asset".to_string(),
),
initial_deposit: Err(
"no value supplied for initial_deposit".to_string(),
),
initial_share_price_usd: Err(
"no value supplied for initial_share_price_usd".to_string(),
),
management_fee_bps: Err(
"no value supplied for management_fee_bps".to_string(),
),
manager_id: Err("no value supplied for manager_id".to_string()),
max_fee_usd: Err("no value supplied for max_fee_usd".to_string()),
max_slippage_bps: Err(
"no value supplied for max_slippage_bps".to_string(),
),
nonce: Err("no value supplied for nonce".to_string()),
performance_fee_bps: Err(
"no value supplied for performance_fee_bps".to_string(),
),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl CreateVaultRequest {
pub fn benchmark_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Address>>,
T::Error: ::std::fmt::Display,
{
self.benchmark_asset = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for benchmark_asset: {e}")
});
self
}
pub fn cooldown_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.cooldown_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cooldown_sec: {e}")
});
self
}
pub fn deposit_spot_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.deposit_spot_asset = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for deposit_spot_asset: {e}"
)
});
self
}
pub fn initial_deposit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.initial_deposit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for initial_deposit: {e}")
});
self
}
pub fn initial_share_price_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.initial_share_price_usd = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for initial_share_price_usd: {e}"
)
});
self
}
pub fn management_fee_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.management_fee_bps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for management_fee_bps: {e}"
)
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn max_fee_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee_usd: {e}")
});
self
}
pub fn max_slippage_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.max_slippage_bps = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_slippage_bps: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn performance_fee_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.performance_fee_bps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for performance_fee_bps: {e}"
)
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<CreateVaultRequest> for super::CreateVaultRequest {
type Error = super::error::ConversionError;
fn try_from(
value: CreateVaultRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
benchmark_asset: value.benchmark_asset?,
cooldown_sec: value.cooldown_sec?,
deposit_spot_asset: value.deposit_spot_asset?,
initial_deposit: value.initial_deposit?,
initial_share_price_usd: value.initial_share_price_usd?,
management_fee_bps: value.management_fee_bps?,
manager_id: value.manager_id?,
max_fee_usd: value.max_fee_usd?,
max_slippage_bps: value.max_slippage_bps?,
nonce: value.nonce?,
performance_fee_bps: value.performance_fee_bps?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::CreateVaultRequest> for CreateVaultRequest {
fn from(value: super::CreateVaultRequest) -> Self {
Self {
benchmark_asset: Ok(value.benchmark_asset),
cooldown_sec: Ok(value.cooldown_sec),
deposit_spot_asset: Ok(value.deposit_spot_asset),
initial_deposit: Ok(value.initial_deposit),
initial_share_price_usd: Ok(value.initial_share_price_usd),
management_fee_bps: Ok(value.management_fee_bps),
manager_id: Ok(value.manager_id),
max_fee_usd: Ok(value.max_fee_usd),
max_slippage_bps: Ok(value.max_slippage_bps),
nonce: Ok(value.nonce),
performance_fee_bps: Ok(value.performance_fee_bps),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct Currency {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
managers: ::std::result::Result<
::std::vec::Vec<super::UniverseManagers>,
::std::string::String,
>,
market_type: ::std::result::Result<super::MarketType, ::std::string::String>,
option: ::std::result::Result<
::std::option::Option<super::AssetEntry>,
::std::string::String,
>,
perp: ::std::result::Result<
::std::option::Option<super::AssetEntry>,
::std::string::String,
>,
spot: ::std::result::Result<
::std::vec::Vec<super::SpotAssetEntry>,
::std::string::String,
>,
spot_price: ::std::result::Result<::std::string::String, ::std::string::String>,
spot_price_24h: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Currency {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
managers: Err("no value supplied for managers".to_string()),
market_type: Err("no value supplied for market_type".to_string()),
option: Ok(Default::default()),
perp: Ok(Default::default()),
spot: Err("no value supplied for spot".to_string()),
spot_price: Err("no value supplied for spot_price".to_string()),
spot_price_24h: Ok(Default::default()),
}
}
}
impl Currency {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn managers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::UniverseManagers>>,
T::Error: ::std::fmt::Display,
{
self.managers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for managers: {e}")
});
self
}
pub fn market_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::MarketType>,
T::Error: ::std::fmt::Display,
{
self.market_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for market_type: {e}")
});
self
}
pub fn option<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AssetEntry>>,
T::Error: ::std::fmt::Display,
{
self.option = value
.try_into()
.map_err(|e| format!("error converting supplied value for option: {e}"));
self
}
pub fn perp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AssetEntry>>,
T::Error: ::std::fmt::Display,
{
self.perp = value
.try_into()
.map_err(|e| format!("error converting supplied value for perp: {e}"));
self
}
pub fn spot<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::SpotAssetEntry>>,
T::Error: ::std::fmt::Display,
{
self.spot = value
.try_into()
.map_err(|e| format!("error converting supplied value for spot: {e}"));
self
}
pub fn spot_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.spot_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_price: {e}")
});
self
}
pub fn spot_price_24h<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.spot_price_24h = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_price_24h: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Currency> for super::Currency {
type Error = super::error::ConversionError;
fn try_from(
value: Currency,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
managers: value.managers?,
market_type: value.market_type?,
option: value.option?,
perp: value.perp?,
spot: value.spot?,
spot_price: value.spot_price?,
spot_price_24h: value.spot_price_24h?,
})
}
}
impl ::std::convert::From<super::Currency> for Currency {
fn from(value: super::Currency) -> Self {
Self {
currency: Ok(value.currency),
managers: Ok(value.managers),
market_type: Ok(value.market_type),
option: Ok(value.option),
perp: Ok(value.perp),
spot: Ok(value.spot),
spot_price: Ok(value.spot_price),
spot_price_24h: Ok(value.spot_price_24h),
}
}
}
#[derive(Clone, Debug)]
pub struct DailyTradingStatistics {
c: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
h: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
l: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
n: ::std::result::Result<u64, ::std::string::String>,
oi: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
p: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
pr: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
v: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
}
impl ::std::default::Default for DailyTradingStatistics {
fn default() -> Self {
Self {
c: Err("no value supplied for c".to_string()),
h: Err("no value supplied for h".to_string()),
l: Err("no value supplied for l".to_string()),
n: Err("no value supplied for n".to_string()),
oi: Err("no value supplied for oi".to_string()),
p: Err("no value supplied for p".to_string()),
pr: Err("no value supplied for pr".to_string()),
v: Err("no value supplied for v".to_string()),
}
}
}
impl DailyTradingStatistics {
pub fn c<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.c = value
.try_into()
.map_err(|e| format!("error converting supplied value for c: {e}"));
self
}
pub fn h<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.h = value
.try_into()
.map_err(|e| format!("error converting supplied value for h: {e}"));
self
}
pub fn l<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.l = value
.try_into()
.map_err(|e| format!("error converting supplied value for l: {e}"));
self
}
pub fn n<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.n = value
.try_into()
.map_err(|e| format!("error converting supplied value for n: {e}"));
self
}
pub fn oi<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.oi = value
.try_into()
.map_err(|e| format!("error converting supplied value for oi: {e}"));
self
}
pub fn p<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.p = value
.try_into()
.map_err(|e| format!("error converting supplied value for p: {e}"));
self
}
pub fn pr<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.pr = value
.try_into()
.map_err(|e| format!("error converting supplied value for pr: {e}"));
self
}
pub fn v<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.v = value
.try_into()
.map_err(|e| format!("error converting supplied value for v: {e}"));
self
}
}
impl ::std::convert::TryFrom<DailyTradingStatistics>
for super::DailyTradingStatistics {
type Error = super::error::ConversionError;
fn try_from(
value: DailyTradingStatistics,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
c: value.c?,
h: value.h?,
l: value.l?,
n: value.n?,
oi: value.oi?,
p: value.p?,
pr: value.pr?,
v: value.v?,
})
}
}
impl ::std::convert::From<super::DailyTradingStatistics> for DailyTradingStatistics {
fn from(value: super::DailyTradingStatistics) -> Self {
Self {
c: Ok(value.c),
h: Ok(value.h),
l: Ok(value.l),
n: Ok(value.n),
oi: Ok(value.oi),
p: Ok(value.p),
pr: Ok(value.pr),
v: Ok(value.v),
}
}
}
#[derive(Clone, Debug)]
pub struct DepositEntry {
action_id: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
asset: ::std::result::Result<::std::string::String, ::std::string::String>,
batch_status: ::std::result::Result<super::BatchStatus, ::std::string::String>,
batch_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
new_subaccount: ::std::result::Result<bool, ::std::string::String>,
operation_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for DepositEntry {
fn default() -> Self {
Self {
action_id: Ok(Default::default()),
amount: Err("no value supplied for amount".to_string()),
asset: Err("no value supplied for asset".to_string()),
batch_status: Err("no value supplied for batch_status".to_string()),
batch_uuid: Err("no value supplied for batch_uuid".to_string()),
fee: Err("no value supplied for fee".to_string()),
new_subaccount: Err("no value supplied for new_subaccount".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
tx_hash: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl DepositEntry {
pub fn action_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.action_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_id: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset = value
.try_into()
.map_err(|e| format!("error converting supplied value for asset: {e}"));
self
}
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BatchStatus>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn batch_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.batch_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_uuid: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn new_subaccount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.new_subaccount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for new_subaccount: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<DepositEntry> for super::DepositEntry {
type Error = super::error::ConversionError;
fn try_from(
value: DepositEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_id: value.action_id?,
amount: value.amount?,
asset: value.asset?,
batch_status: value.batch_status?,
batch_uuid: value.batch_uuid?,
fee: value.fee?,
new_subaccount: value.new_subaccount?,
operation_id: value.operation_id?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
tx_hash: value.tx_hash?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::DepositEntry> for DepositEntry {
fn from(value: super::DepositEntry) -> Self {
Self {
action_id: Ok(value.action_id),
amount: Ok(value.amount),
asset: Ok(value.asset),
batch_status: Ok(value.batch_status),
batch_uuid: Ok(value.batch_uuid),
fee: Ok(value.fee),
new_subaccount: Ok(value.new_subaccount),
operation_id: Ok(value.operation_id),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
tx_hash: Ok(value.tx_hash),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct DepositHistoryResult {
deposits: ::std::result::Result<
::std::vec::Vec<super::DepositEntry>,
::std::string::String,
>,
}
impl ::std::default::Default for DepositHistoryResult {
fn default() -> Self {
Self {
deposits: Err("no value supplied for deposits".to_string()),
}
}
}
impl DepositHistoryResult {
pub fn deposits<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::DepositEntry>>,
T::Error: ::std::fmt::Display,
{
self.deposits = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposits: {e}")
});
self
}
}
impl ::std::convert::TryFrom<DepositHistoryResult> for super::DepositHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: DepositHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { deposits: value.deposits? })
}
}
impl ::std::convert::From<super::DepositHistoryResult> for DepositHistoryResult {
fn from(value: super::DepositHistoryResult) -> Self {
Self {
deposits: Ok(value.deposits),
}
}
}
#[derive(Clone, Debug)]
pub struct EditSessionKeyRequest {
ip_whitelist: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
offchain_scopes: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
public_session_key: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for EditSessionKeyRequest {
fn default() -> Self {
Self {
ip_whitelist: Ok(Default::default()),
label: Ok(Default::default()),
offchain_scopes: Ok(Default::default()),
public_session_key: Err(
"no value supplied for public_session_key".to_string(),
),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl EditSessionKeyRequest {
pub fn ip_whitelist<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.ip_whitelist = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ip_whitelist: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn offchain_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.offchain_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for offchain_scopes: {e}")
});
self
}
pub fn public_session_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.public_session_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_key: {e}"
)
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<EditSessionKeyRequest>
for super::EditSessionKeyRequest {
type Error = super::error::ConversionError;
fn try_from(
value: EditSessionKeyRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ip_whitelist: value.ip_whitelist?,
label: value.label?,
offchain_scopes: value.offchain_scopes?,
public_session_key: value.public_session_key?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::EditSessionKeyRequest> for EditSessionKeyRequest {
fn from(value: super::EditSessionKeyRequest) -> Self {
Self {
ip_whitelist: Ok(value.ip_whitelist),
label: Ok(value.label),
offchain_scopes: Ok(value.offchain_scopes),
public_session_key: Ok(value.public_session_key),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct Erc20Details {
decimals: ::std::result::Result<u8, ::std::string::String>,
underlying_erc20: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Erc20Details {
fn default() -> Self {
Self {
decimals: Err("no value supplied for decimals".to_string()),
underlying_erc20: Ok(Default::default()),
}
}
}
impl Erc20Details {
pub fn decimals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u8>,
T::Error: ::std::fmt::Display,
{
self.decimals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for decimals: {e}")
});
self
}
pub fn underlying_erc20<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.underlying_erc20 = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for underlying_erc20: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Erc20Details> for super::Erc20Details {
type Error = super::error::ConversionError;
fn try_from(
value: Erc20Details,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
decimals: value.decimals?,
underlying_erc20: value.underlying_erc20?,
})
}
}
impl ::std::convert::From<super::Erc20Details> for Erc20Details {
fn from(value: super::Erc20Details) -> Self {
Self {
decimals: Ok(value.decimals),
underlying_erc20: Ok(value.underlying_erc20),
}
}
}
#[derive(Clone, Debug)]
pub struct ExecuteQuoteRequest {
client: ::std::result::Result<::std::string::String, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
enable_taker_protection: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ExecuteQuoteRequest {
fn default() -> Self {
Self {
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
enable_taker_protection: Ok(Default::default()),
label: Ok(Default::default()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
referral_code: Ok(Default::default()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl ExecuteQuoteRequest {
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn enable_taker_protection<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.enable_taker_protection = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for enable_taker_protection: {e}"
)
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ExecuteQuoteRequest> for super::ExecuteQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: ExecuteQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
client: value.client?,
direction: value.direction?,
enable_taker_protection: value.enable_taker_protection?,
label: value.label?,
legs: value.legs?,
max_fee: value.max_fee?,
nonce: value.nonce?,
quote_id: value.quote_id?,
referral_code: value.referral_code?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::ExecuteQuoteRequest> for ExecuteQuoteRequest {
fn from(value: super::ExecuteQuoteRequest) -> Self {
Self {
client: Ok(value.client),
direction: Ok(value.direction),
enable_taker_protection: Ok(value.enable_taker_protection),
label: Ok(value.label),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
referral_code: Ok(value.referral_code),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ExpirySettlementPrice {
expiry_date: ::std::result::Result<::std::string::String, ::std::string::String>,
price: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
utc_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ExpirySettlementPrice {
fn default() -> Self {
Self {
expiry_date: Err("no value supplied for expiry_date".to_string()),
price: Ok(Default::default()),
utc_expiry_sec: Err("no value supplied for utc_expiry_sec".to_string()),
}
}
}
impl ExpirySettlementPrice {
pub fn expiry_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.expiry_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiry_date: {e}")
});
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
pub fn utc_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.utc_expiry_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for utc_expiry_sec: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ExpirySettlementPrice>
for super::ExpirySettlementPrice {
type Error = super::error::ConversionError;
fn try_from(
value: ExpirySettlementPrice,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
expiry_date: value.expiry_date?,
price: value.price?,
utc_expiry_sec: value.utc_expiry_sec?,
})
}
}
impl ::std::convert::From<super::ExpirySettlementPrice> for ExpirySettlementPrice {
fn from(value: super::ExpirySettlementPrice) -> Self {
Self {
expiry_date: Ok(value.expiry_date),
price: Ok(value.price),
utc_expiry_sec: Ok(value.utc_expiry_sec),
}
}
}
#[derive(Clone, Debug)]
pub struct ForceBurnRequest {
holder: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ForceBurnRequest {
fn default() -> Self {
Self {
holder: Err("no value supplied for holder".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl ForceBurnRequest {
pub fn holder<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.holder = value
.try_into()
.map_err(|e| format!("error converting supplied value for holder: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ForceBurnRequest> for super::ForceBurnRequest {
type Error = super::error::ConversionError;
fn try_from(
value: ForceBurnRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
holder: value.holder?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::ForceBurnRequest> for ForceBurnRequest {
fn from(value: super::ForceBurnRequest) -> Self {
Self {
holder: Ok(value.holder),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ForwardFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
expiry: ::std::result::Result<u64, ::std::string::String>,
fwd_diff: ::std::result::Result<::std::string::String, ::std::string::String>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
spot_aggregate_latest: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
spot_aggregate_start: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ForwardFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
fwd_diff: Err("no value supplied for fwd_diff".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
spot_aggregate_latest: Err(
"no value supplied for spot_aggregate_latest".to_string(),
),
spot_aggregate_start: Err(
"no value supplied for spot_aggregate_start".to_string(),
),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl ForwardFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn fwd_diff<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.fwd_diff = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fwd_diff: {e}")
});
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn spot_aggregate_latest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.spot_aggregate_latest = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for spot_aggregate_latest: {e}"
)
});
self
}
pub fn spot_aggregate_start<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.spot_aggregate_start = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for spot_aggregate_start: {e}"
)
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ForwardFeedDataResponse>
for super::ForwardFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: ForwardFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
expiry: value.expiry?,
fwd_diff: value.fwd_diff?,
signatures: value.signatures?,
spot_aggregate_latest: value.spot_aggregate_latest?,
spot_aggregate_start: value.spot_aggregate_start?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::ForwardFeedDataResponse>
for ForwardFeedDataResponse {
fn from(value: super::ForwardFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
expiry: Ok(value.expiry),
fwd_diff: Ok(value.fwd_diff),
signatures: Ok(value.signatures),
spot_aggregate_latest: Ok(value.spot_aggregate_latest),
spot_aggregate_start: Ok(value.spot_aggregate_start),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct FundingFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
funding_rate: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for FundingFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
funding_rate: Err("no value supplied for funding_rate".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl FundingFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn funding_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.funding_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for funding_rate: {e}")
});
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<FundingFeedDataResponse>
for super::FundingFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: FundingFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
funding_rate: value.funding_rate?,
signatures: value.signatures?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::FundingFeedDataResponse>
for FundingFeedDataResponse {
fn from(value: super::FundingFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
funding_rate: Ok(value.funding_rate),
signatures: Ok(value.signatures),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct FundingRateCandle {
close: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
funding_rate: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
high: ::std::result::Result<::std::string::String, ::std::string::String>,
low: ::std::result::Result<::std::string::String, ::std::string::String>,
open: ::std::result::Result<::std::string::String, ::std::string::String>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for FundingRateCandle {
fn default() -> Self {
Self {
close: Err("no value supplied for close".to_string()),
currency: Err("no value supplied for currency".to_string()),
funding_rate: Err("no value supplied for funding_rate".to_string()),
high: Err("no value supplied for high".to_string()),
low: Err("no value supplied for low".to_string()),
open: Err("no value supplied for open".to_string()),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl FundingRateCandle {
pub fn close<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.close = value
.try_into()
.map_err(|e| format!("error converting supplied value for close: {e}"));
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn funding_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.funding_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for funding_rate: {e}")
});
self
}
pub fn high<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.high = value
.try_into()
.map_err(|e| format!("error converting supplied value for high: {e}"));
self
}
pub fn low<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.low = value
.try_into()
.map_err(|e| format!("error converting supplied value for low: {e}"));
self
}
pub fn open<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open = value
.try_into()
.map_err(|e| format!("error converting supplied value for open: {e}"));
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<FundingRateCandle> for super::FundingRateCandle {
type Error = super::error::ConversionError;
fn try_from(
value: FundingRateCandle,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
close: value.close?,
currency: value.currency?,
funding_rate: value.funding_rate?,
high: value.high?,
low: value.low?,
open: value.open?,
risk_universe_id: value.risk_universe_id?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::FundingRateCandle> for FundingRateCandle {
fn from(value: super::FundingRateCandle) -> Self {
Self {
close: Ok(value.close),
currency: Ok(value.currency),
funding_rate: Ok(value.funding_rate),
high: Ok(value.high),
low: Ok(value.low),
open: Ok(value.open),
risk_universe_id: Ok(value.risk_universe_id),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct FundingRateHistoryResult {
funding_rate_history: ::std::result::Result<
::std::vec::Vec<super::FundingRateCandle>,
::std::string::String,
>,
}
impl ::std::default::Default for FundingRateHistoryResult {
fn default() -> Self {
Self {
funding_rate_history: Err(
"no value supplied for funding_rate_history".to_string(),
),
}
}
}
impl FundingRateHistoryResult {
pub fn funding_rate_history<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::FundingRateCandle>>,
T::Error: ::std::fmt::Display,
{
self.funding_rate_history = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for funding_rate_history: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<FundingRateHistoryResult>
for super::FundingRateHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: FundingRateHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
funding_rate_history: value.funding_rate_history?,
})
}
}
impl ::std::convert::From<super::FundingRateHistoryResult>
for FundingRateHistoryResult {
fn from(value: super::FundingRateHistoryResult) -> Self {
Self {
funding_rate_history: Ok(value.funding_rate_history),
}
}
}
#[derive(Clone, Debug)]
pub struct GetAccountRequest {
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for GetAccountRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetAccountRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetAccountRequest> for super::GetAccountRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetAccountRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetAccountRequest> for GetAccountRequest {
fn from(value: super::GetAccountRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetAlgoOrdersRequest {
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetAlgoOrdersRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetAlgoOrdersRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetAlgoOrdersRequest> for super::GetAlgoOrdersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetAlgoOrdersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetAlgoOrdersRequest> for GetAlgoOrdersRequest {
fn from(value: super::GetAlgoOrdersRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetAllInstrumentsRequest {
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
expired: ::std::result::Result<bool, ::std::string::String>,
instrument_type: ::std::result::Result<super::AssetType, ::std::string::String>,
page: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
risk_universe_id: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
}
impl ::std::default::Default for GetAllInstrumentsRequest {
fn default() -> Self {
Self {
currency: Ok(Default::default()),
expired: Err("no value supplied for expired".to_string()),
instrument_type: Err(
"no value supplied for instrument_type".to_string(),
),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
risk_universe_id: Ok(Default::default()),
}
}
}
impl GetAllInstrumentsRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn expired<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.expired = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expired: {e}")
});
self
}
pub fn instrument_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.instrument_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_type: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetAllInstrumentsRequest>
for super::GetAllInstrumentsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetAllInstrumentsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
expired: value.expired?,
instrument_type: value.instrument_type?,
page: value.page?,
page_size: value.page_size?,
risk_universe_id: value.risk_universe_id?,
})
}
}
impl ::std::convert::From<super::GetAllInstrumentsRequest>
for GetAllInstrumentsRequest {
fn from(value: super::GetAllInstrumentsRequest) -> Self {
Self {
currency: Ok(value.currency),
expired: Ok(value.expired),
instrument_type: Ok(value.instrument_type),
page: Ok(value.page),
page_size: Ok(value.page_size),
risk_universe_id: Ok(value.risk_universe_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetAllInstrumentsResponse {
instruments: ::std::result::Result<
::std::vec::Vec<super::Instrument>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
}
impl ::std::default::Default for GetAllInstrumentsResponse {
fn default() -> Self {
Self {
instruments: Err("no value supplied for instruments".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
}
}
}
impl GetAllInstrumentsResponse {
pub fn instruments<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Instrument>>,
T::Error: ::std::fmt::Display,
{
self.instruments = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instruments: {e}")
});
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetAllInstrumentsResponse>
for super::GetAllInstrumentsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetAllInstrumentsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instruments: value.instruments?,
pagination: value.pagination?,
})
}
}
impl ::std::convert::From<super::GetAllInstrumentsResponse>
for GetAllInstrumentsResponse {
fn from(value: super::GetAllInstrumentsResponse) -> Self {
Self {
instruments: Ok(value.instruments),
pagination: Ok(value.pagination),
}
}
}
#[derive(Clone, Debug)]
pub struct GetAllPortfoliosRequest {
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for GetAllPortfoliosRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetAllPortfoliosRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetAllPortfoliosRequest>
for super::GetAllPortfoliosRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetAllPortfoliosRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetAllPortfoliosRequest>
for GetAllPortfoliosRequest {
fn from(value: super::GetAllPortfoliosRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetAssetsRequest {
asset_type: ::std::result::Result<super::AssetType, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
expired: ::std::result::Result<bool, ::std::string::String>,
}
impl ::std::default::Default for GetAssetsRequest {
fn default() -> Self {
Self {
asset_type: Err("no value supplied for asset_type".to_string()),
currency: Err("no value supplied for currency".to_string()),
expired: Err("no value supplied for expired".to_string()),
}
}
}
impl GetAssetsRequest {
pub fn asset_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.asset_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_type: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn expired<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.expired = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expired: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetAssetsRequest> for super::GetAssetsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetAssetsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
asset_type: value.asset_type?,
currency: value.currency?,
expired: value.expired?,
})
}
}
impl ::std::convert::From<super::GetAssetsRequest> for GetAssetsRequest {
fn from(value: super::GetAssetsRequest) -> Self {
Self {
asset_type: Ok(value.asset_type),
currency: Ok(value.currency),
expired: Ok(value.expired),
}
}
}
#[derive(Clone, Debug)]
pub struct GetCollateralsRequest {
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetCollateralsRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetCollateralsRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetCollateralsRequest>
for super::GetCollateralsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetCollateralsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetCollateralsRequest> for GetCollateralsRequest {
fn from(value: super::GetCollateralsRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetCuratedVaultsRequest {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetCuratedVaultsRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetCuratedVaultsRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetCuratedVaultsRequest>
for super::GetCuratedVaultsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetCuratedVaultsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetCuratedVaultsRequest>
for GetCuratedVaultsRequest {
fn from(value: super::GetCuratedVaultsRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetCurrencyRequest {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetCurrencyRequest {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
}
}
}
impl GetCurrencyRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetCurrencyRequest> for super::GetCurrencyRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetCurrencyRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { currency: value.currency? })
}
}
impl ::std::convert::From<super::GetCurrencyRequest> for GetCurrencyRequest {
fn from(value: super::GetCurrencyRequest) -> Self {
Self {
currency: Ok(value.currency),
}
}
}
#[derive(Clone, Debug)]
pub struct GetDepositHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetDepositHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetDepositHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetDepositHistoryRequest>
for super::GetDepositHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetDepositHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetDepositHistoryRequest>
for GetDepositHistoryRequest {
fn from(value: super::GetDepositHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetErc20TransferHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetErc20TransferHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetErc20TransferHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetErc20TransferHistoryRequest>
for super::GetErc20TransferHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetErc20TransferHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetErc20TransferHistoryRequest>
for GetErc20TransferHistoryRequest {
fn from(value: super::GetErc20TransferHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetFundingHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetFundingHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
instrument_name: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetFundingHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetFundingHistoryRequest>
for super::GetFundingHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetFundingHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
instrument_name: value.instrument_name?,
page: value.page?,
page_size: value.page_size?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetFundingHistoryRequest>
for GetFundingHistoryRequest {
fn from(value: super::GetFundingHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
instrument_name: Ok(value.instrument_name),
page: Ok(value.page),
page_size: Ok(value.page_size),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetFundingRateHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
period: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
start_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
}
impl ::std::default::Default for GetFundingRateHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
period: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
}
}
}
impl GetFundingRateHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn period<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.period = value
.try_into()
.map_err(|e| format!("error converting supplied value for period: {e}"));
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetFundingRateHistoryRequest>
for super::GetFundingRateHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetFundingRateHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
instrument_name: value.instrument_name?,
period: value.period?,
start_timestamp: value.start_timestamp?,
})
}
}
impl ::std::convert::From<super::GetFundingRateHistoryRequest>
for GetFundingRateHistoryRequest {
fn from(value: super::GetFundingRateHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
instrument_name: Ok(value.instrument_name),
period: Ok(value.period),
start_timestamp: Ok(value.start_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetIndexChartDataRequest {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
end_timestamp: ::std::result::Result<u64, ::std::string::String>,
period: ::std::result::Result<u64, ::std::string::String>,
start_timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetIndexChartDataRequest {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
end_timestamp: Err("no value supplied for end_timestamp".to_string()),
period: Err("no value supplied for period".to_string()),
start_timestamp: Err("no value supplied for start_timestamp".to_string()),
}
}
}
impl GetIndexChartDataRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn period<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.period = value
.try_into()
.map_err(|e| format!("error converting supplied value for period: {e}"));
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetIndexChartDataRequest>
for super::GetIndexChartDataRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetIndexChartDataRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
end_timestamp: value.end_timestamp?,
period: value.period?,
start_timestamp: value.start_timestamp?,
})
}
}
impl ::std::convert::From<super::GetIndexChartDataRequest>
for GetIndexChartDataRequest {
fn from(value: super::GetIndexChartDataRequest) -> Self {
Self {
currency: Ok(value.currency),
end_timestamp: Ok(value.end_timestamp),
period: Ok(value.period),
start_timestamp: Ok(value.start_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetInstrumentRequest {
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for GetInstrumentRequest {
fn default() -> Self {
Self {
instrument_name: Err("no value supplied for instrument_name".to_string()),
}
}
}
impl GetInstrumentRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetInstrumentRequest> for super::GetInstrumentRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetInstrumentRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
})
}
}
impl ::std::convert::From<super::GetInstrumentRequest> for GetInstrumentRequest {
fn from(value: super::GetInstrumentRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
}
}
}
#[derive(Clone, Debug)]
pub struct GetInterestHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetInterestHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetInterestHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetInterestHistoryRequest>
for super::GetInterestHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetInterestHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetInterestHistoryRequest>
for GetInterestHistoryRequest {
fn from(value: super::GetInterestHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetInterestRateHistoryRequest {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
end_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
period: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
risk_universe_id: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
}
impl ::std::default::Default for GetInterestRateHistoryRequest {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
end_timestamp: Ok(Default::default()),
period: Ok(Default::default()),
risk_universe_id: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
}
}
}
impl GetInterestRateHistoryRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn period<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.period = value
.try_into()
.map_err(|e| format!("error converting supplied value for period: {e}"));
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetInterestRateHistoryRequest>
for super::GetInterestRateHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetInterestRateHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
end_timestamp: value.end_timestamp?,
period: value.period?,
risk_universe_id: value.risk_universe_id?,
start_timestamp: value.start_timestamp?,
})
}
}
impl ::std::convert::From<super::GetInterestRateHistoryRequest>
for GetInterestRateHistoryRequest {
fn from(value: super::GetInterestRateHistoryRequest) -> Self {
Self {
currency: Ok(value.currency),
end_timestamp: Ok(value.end_timestamp),
period: Ok(value.period),
risk_universe_id: Ok(value.risk_universe_id),
start_timestamp: Ok(value.start_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLatestSignedFeedsRequest {
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
expiry: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
}
impl ::std::default::Default for GetLatestSignedFeedsRequest {
fn default() -> Self {
Self {
currency: Ok(Default::default()),
expiry: Ok(Default::default()),
}
}
}
impl GetLatestSignedFeedsRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetLatestSignedFeedsRequest>
for super::GetLatestSignedFeedsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetLatestSignedFeedsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
expiry: value.expiry?,
})
}
}
impl ::std::convert::From<super::GetLatestSignedFeedsRequest>
for GetLatestSignedFeedsRequest {
fn from(value: super::GetLatestSignedFeedsRequest) -> Self {
Self {
currency: Ok(value.currency),
expiry: Ok(value.expiry),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLatestSignedFeedsResponse {
funding_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
super::FundingFeedDataResponse,
>,
::std::string::String,
>,
fwd_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::ForwardFeedDataResponse,
>,
>,
::std::string::String,
>,
perp_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::PerpFeedDataResponse,
>,
>,
::std::string::String,
>,
rate_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::RateFeedDataResponse,
>,
>,
::std::string::String,
>,
spot_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
super::SpotFeedDataResponse,
>,
::std::string::String,
>,
vol_data: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::VolFeedDataResponse,
>,
>,
::std::string::String,
>,
}
impl ::std::default::Default for GetLatestSignedFeedsResponse {
fn default() -> Self {
Self {
funding_data: Err("no value supplied for funding_data".to_string()),
fwd_data: Err("no value supplied for fwd_data".to_string()),
perp_data: Err("no value supplied for perp_data".to_string()),
rate_data: Err("no value supplied for rate_data".to_string()),
spot_data: Err("no value supplied for spot_data".to_string()),
vol_data: Err("no value supplied for vol_data".to_string()),
}
}
}
impl GetLatestSignedFeedsResponse {
pub fn funding_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
super::FundingFeedDataResponse,
>,
>,
T::Error: ::std::fmt::Display,
{
self.funding_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for funding_data: {e}")
});
self
}
pub fn fwd_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::ForwardFeedDataResponse,
>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.fwd_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fwd_data: {e}")
});
self
}
pub fn perp_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::PerpFeedDataResponse,
>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.perp_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for perp_data: {e}")
});
self
}
pub fn rate_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::RateFeedDataResponse,
>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.rate_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for rate_data: {e}")
});
self
}
pub fn spot_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
super::SpotFeedDataResponse,
>,
>,
T::Error: ::std::fmt::Display,
{
self.spot_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_data: {e}")
});
self
}
pub fn vol_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::VolFeedDataResponse,
>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.vol_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vol_data: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetLatestSignedFeedsResponse>
for super::GetLatestSignedFeedsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetLatestSignedFeedsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
funding_data: value.funding_data?,
fwd_data: value.fwd_data?,
perp_data: value.perp_data?,
rate_data: value.rate_data?,
spot_data: value.spot_data?,
vol_data: value.vol_data?,
})
}
}
impl ::std::convert::From<super::GetLatestSignedFeedsResponse>
for GetLatestSignedFeedsResponse {
fn from(value: super::GetLatestSignedFeedsResponse) -> Self {
Self {
funding_data: Ok(value.funding_data),
fwd_data: Ok(value.fwd_data),
perp_data: Ok(value.perp_data),
rate_data: Ok(value.rate_data),
spot_data: Ok(value.spot_data),
vol_data: Ok(value.vol_data),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLiquidationHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
}
impl ::std::default::Default for GetLiquidationHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
}
}
}
impl GetLiquidationHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetLiquidationHistoryRequest>
for super::GetLiquidationHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetLiquidationHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
page: value.page?,
page_size: value.page_size?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetLiquidationHistoryRequest>
for GetLiquidationHistoryRequest {
fn from(value: super::GetLiquidationHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLiveBurnRequestsRequest {
limit: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetLiveBurnRequestsRequest {
fn default() -> Self {
Self {
limit: Err("no value supplied for limit".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetLiveBurnRequestsRequest {
pub fn limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.limit = value
.try_into()
.map_err(|e| format!("error converting supplied value for limit: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetLiveBurnRequestsRequest>
for super::GetLiveBurnRequestsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetLiveBurnRequestsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
limit: value.limit?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetLiveBurnRequestsRequest>
for GetLiveBurnRequestsRequest {
fn from(value: super::GetLiveBurnRequestsRequest) -> Self {
Self {
limit: Ok(value.limit),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLiveMintRequestsRequest {
limit: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetLiveMintRequestsRequest {
fn default() -> Self {
Self {
limit: Err("no value supplied for limit".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetLiveMintRequestsRequest {
pub fn limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.limit = value
.try_into()
.map_err(|e| format!("error converting supplied value for limit: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetLiveMintRequestsRequest>
for super::GetLiveMintRequestsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetLiveMintRequestsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
limit: value.limit?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetLiveMintRequestsRequest>
for GetLiveMintRequestsRequest {
fn from(value: super::GetLiveMintRequestsRequest) -> Self {
Self {
limit: Ok(value.limit),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetLiveVaultRequestsRequest {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetLiveVaultRequestsRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetLiveVaultRequestsRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetLiveVaultRequestsRequest>
for super::GetLiveVaultRequestsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetLiveVaultRequestsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetLiveVaultRequestsRequest>
for GetLiveVaultRequestsRequest {
fn from(value: super::GetLiveVaultRequestsRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetOnchainActionHistoryParams {
action_type: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
end_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetOnchainActionHistoryParams {
fn default() -> Self {
Self {
action_type: Ok(Default::default()),
end_timestamp: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetOnchainActionHistoryParams {
pub fn action_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.action_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_type: {e}")
});
self
}
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetOnchainActionHistoryParams>
for super::GetOnchainActionHistoryParams {
type Error = super::error::ConversionError;
fn try_from(
value: GetOnchainActionHistoryParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_type: value.action_type?,
end_timestamp: value.end_timestamp?,
page: value.page?,
page_size: value.page_size?,
start_timestamp: value.start_timestamp?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetOnchainActionHistoryParams>
for GetOnchainActionHistoryParams {
fn from(value: super::GetOnchainActionHistoryParams) -> Self {
Self {
action_type: Ok(value.action_type),
end_timestamp: Ok(value.end_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
start_timestamp: Ok(value.start_timestamp),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOnchainActionHistoryResponse {
actions: ::std::result::Result<
::std::vec::Vec<super::OnchainActionHistoryEntry>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
}
impl ::std::default::Default for GetOnchainActionHistoryResponse {
fn default() -> Self {
Self {
actions: Err("no value supplied for actions".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
}
}
}
impl GetOnchainActionHistoryResponse {
pub fn actions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::OnchainActionHistoryEntry>,
>,
T::Error: ::std::fmt::Display,
{
self.actions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for actions: {e}")
});
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetOnchainActionHistoryResponse>
for super::GetOnchainActionHistoryResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetOnchainActionHistoryResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
actions: value.actions?,
pagination: value.pagination?,
})
}
}
impl ::std::convert::From<super::GetOnchainActionHistoryResponse>
for GetOnchainActionHistoryResponse {
fn from(value: super::GetOnchainActionHistoryResponse) -> Self {
Self {
actions: Ok(value.actions),
pagination: Ok(value.pagination),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOpenOrdersRequest {
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetOpenOrdersRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetOpenOrdersRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetOpenOrdersRequest> for super::GetOpenOrdersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetOpenOrdersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetOpenOrdersRequest> for GetOpenOrdersRequest {
fn from(value: super::GetOpenOrdersRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOptionSettlementHistoryParams {
subaccount_id: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetOptionSettlementHistoryParams {
fn default() -> Self {
Self {
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetOptionSettlementHistoryParams {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetOptionSettlementHistoryParams>
for super::GetOptionSettlementHistoryParams {
type Error = super::error::ConversionError;
fn try_from(
value: GetOptionSettlementHistoryParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetOptionSettlementHistoryParams>
for GetOptionSettlementHistoryParams {
fn from(value: super::GetOptionSettlementHistoryParams) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOptionSettlementPricesRequest {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetOptionSettlementPricesRequest {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
}
}
}
impl GetOptionSettlementPricesRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetOptionSettlementPricesRequest>
for super::GetOptionSettlementPricesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetOptionSettlementPricesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { currency: value.currency? })
}
}
impl ::std::convert::From<super::GetOptionSettlementPricesRequest>
for GetOptionSettlementPricesRequest {
fn from(value: super::GetOptionSettlementPricesRequest) -> Self {
Self {
currency: Ok(value.currency),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOrderHistoryRequest {
from_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
to_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetOrderHistoryRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
to_timestamp: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetOrderHistoryRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetOrderHistoryRequest>
for super::GetOrderHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetOrderHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
page: value.page?,
page_size: value.page_size?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetOrderHistoryRequest> for GetOrderHistoryRequest {
fn from(value: super::GetOrderHistoryRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetOrderRequest {
order_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetOrderRequest {
fn default() -> Self {
Self {
order_id: Err("no value supplied for order_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetOrderRequest {
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetOrderRequest> for super::GetOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
order_id: value.order_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetOrderRequest> for GetOrderRequest {
fn from(value: super::GetOrderRequest) -> Self {
Self {
order_id: Ok(value.order_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetPendingDepositsParams {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetPendingDepositsParams {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetPendingDepositsParams {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetPendingDepositsParams>
for super::GetPendingDepositsParams {
type Error = super::error::ConversionError;
fn try_from(
value: GetPendingDepositsParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetPendingDepositsParams>
for GetPendingDepositsParams {
fn from(value: super::GetPendingDepositsParams) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetPendingDepositsResult {
pending_deposits: ::std::result::Result<
::std::vec::Vec<super::PendingDepositEntry>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetPendingDepositsResult {
fn default() -> Self {
Self {
pending_deposits: Err(
"no value supplied for pending_deposits".to_string(),
),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetPendingDepositsResult {
pub fn pending_deposits<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PendingDepositEntry>>,
T::Error: ::std::fmt::Display,
{
self.pending_deposits = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pending_deposits: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetPendingDepositsResult>
for super::GetPendingDepositsResult {
type Error = super::error::ConversionError;
fn try_from(
value: GetPendingDepositsResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pending_deposits: value.pending_deposits?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetPendingDepositsResult>
for GetPendingDepositsResult {
fn from(value: super::GetPendingDepositsResult) -> Self {
Self {
pending_deposits: Ok(value.pending_deposits),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetPositionsRequest {
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetPositionsRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetPositionsRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetPositionsRequest> for super::GetPositionsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetPositionsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetPositionsRequest> for GetPositionsRequest {
fn from(value: super::GetPositionsRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetPublicTradeHistoryRequest {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
from_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
instrument_type: ::std::result::Result<
::std::option::Option<super::AssetType>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
to_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
trade_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetPublicTradeHistoryRequest {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
currency: Ok(Default::default()),
from_timestamp: Ok(Default::default()),
instrument_name: Ok(Default::default()),
instrument_type: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
to_timestamp: Ok(Default::default()),
trade_id: Ok(Default::default()),
}
}
}
impl GetPublicTradeHistoryRequest {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn instrument_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AssetType>>,
T::Error: ::std::fmt::Display,
{
self.instrument_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_type: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
pub fn trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.trade_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetPublicTradeHistoryRequest>
for super::GetPublicTradeHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetPublicTradeHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
currency: value.currency?,
from_timestamp: value.from_timestamp?,
instrument_name: value.instrument_name?,
instrument_type: value.instrument_type?,
page: value.page?,
page_size: value.page_size?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
trade_id: value.trade_id?,
})
}
}
impl ::std::convert::From<super::GetPublicTradeHistoryRequest>
for GetPublicTradeHistoryRequest {
fn from(value: super::GetPublicTradeHistoryRequest) -> Self {
Self {
batch_status: Ok(value.batch_status),
currency: Ok(value.currency),
from_timestamp: Ok(value.from_timestamp),
instrument_name: Ok(value.instrument_name),
instrument_type: Ok(value.instrument_type),
page: Ok(value.page),
page_size: Ok(value.page_size),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
trade_id: Ok(value.trade_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetQuotesRequest {
from_timestamp: ::std::result::Result<i64, ::std::string::String>,
page: ::std::result::Result<u64, ::std::string::String>,
page_size: ::std::result::Result<u64, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
to_timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetQuotesRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
page: Ok(super::defaults::default_u64::<u64, 1>()),
page_size: Ok(super::defaults::default_u64::<u64, 20>()),
quote_id: Ok(Default::default()),
rfq_id: Ok(Default::default()),
status: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_timestamp: Ok(
super::defaults::default_u64::<i64, 9223372036854775807>(),
),
}
}
}
impl GetQuotesRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetQuotesRequest> for super::GetQuotesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetQuotesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
page: value.page?,
page_size: value.page_size?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
})
}
}
impl ::std::convert::From<super::GetQuotesRequest> for GetQuotesRequest {
fn from(value: super::GetQuotesRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetReferralPerformanceParams {
end_ms: ::std::result::Result<i64, ::std::string::String>,
referral_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
start_ms: ::std::result::Result<i64, ::std::string::String>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetReferralPerformanceParams {
fn default() -> Self {
Self {
end_ms: Err("no value supplied for end_ms".to_string()),
referral_code: Ok(Default::default()),
start_ms: Err("no value supplied for start_ms".to_string()),
wallet: Ok(Default::default()),
}
}
}
impl GetReferralPerformanceParams {
pub fn end_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.end_ms = value
.try_into()
.map_err(|e| format!("error converting supplied value for end_ms: {e}"));
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn start_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.start_ms = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_ms: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetReferralPerformanceParams>
for super::GetReferralPerformanceParams {
type Error = super::error::ConversionError;
fn try_from(
value: GetReferralPerformanceParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_ms: value.end_ms?,
referral_code: value.referral_code?,
start_ms: value.start_ms?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetReferralPerformanceParams>
for GetReferralPerformanceParams {
fn from(value: super::GetReferralPerformanceParams) -> Self {
Self {
end_ms: Ok(value.end_ms),
referral_code: Ok(value.referral_code),
start_ms: Ok(value.start_ms),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetReferralPerformanceResult {
fee_share_percentage: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
rewards: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::ReferralPerformanceByInstrumentType,
>,
>,
>,
::std::string::String,
>,
stdrv_balance: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_builder_fee_collected: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_fee_rewards: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_notional_volume: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_referred_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for GetReferralPerformanceResult {
fn default() -> Self {
Self {
fee_share_percentage: Err(
"no value supplied for fee_share_percentage".to_string(),
),
referral_code: Err("no value supplied for referral_code".to_string()),
rewards: Err("no value supplied for rewards".to_string()),
stdrv_balance: Err("no value supplied for stdrv_balance".to_string()),
total_builder_fee_collected: Err(
"no value supplied for total_builder_fee_collected".to_string(),
),
total_fee_rewards: Err(
"no value supplied for total_fee_rewards".to_string(),
),
total_notional_volume: Err(
"no value supplied for total_notional_volume".to_string(),
),
total_referred_fees: Err(
"no value supplied for total_referred_fees".to_string(),
),
}
}
}
impl GetReferralPerformanceResult {
pub fn fee_share_percentage<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.fee_share_percentage = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for fee_share_percentage: {e}"
)
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn rewards<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<
::std::string::String,
super::ReferralPerformanceByInstrumentType,
>,
>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.rewards = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for rewards: {e}")
});
self
}
pub fn stdrv_balance<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.stdrv_balance = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for stdrv_balance: {e}")
});
self
}
pub fn total_builder_fee_collected<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_builder_fee_collected = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for total_builder_fee_collected: {e}"
)
});
self
}
pub fn total_fee_rewards<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_fee_rewards = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_fee_rewards: {e}")
});
self
}
pub fn total_notional_volume<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_notional_volume = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for total_notional_volume: {e}"
)
});
self
}
pub fn total_referred_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_referred_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for total_referred_fees: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<GetReferralPerformanceResult>
for super::GetReferralPerformanceResult {
type Error = super::error::ConversionError;
fn try_from(
value: GetReferralPerformanceResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
fee_share_percentage: value.fee_share_percentage?,
referral_code: value.referral_code?,
rewards: value.rewards?,
stdrv_balance: value.stdrv_balance?,
total_builder_fee_collected: value.total_builder_fee_collected?,
total_fee_rewards: value.total_fee_rewards?,
total_notional_volume: value.total_notional_volume?,
total_referred_fees: value.total_referred_fees?,
})
}
}
impl ::std::convert::From<super::GetReferralPerformanceResult>
for GetReferralPerformanceResult {
fn from(value: super::GetReferralPerformanceResult) -> Self {
Self {
fee_share_percentage: Ok(value.fee_share_percentage),
referral_code: Ok(value.referral_code),
rewards: Ok(value.rewards),
stdrv_balance: Ok(value.stdrv_balance),
total_builder_fee_collected: Ok(value.total_builder_fee_collected),
total_fee_rewards: Ok(value.total_fee_rewards),
total_notional_volume: Ok(value.total_notional_volume),
total_referred_fees: Ok(value.total_referred_fees),
}
}
}
#[derive(Clone, Debug)]
pub struct GetRfqsRequest {
from_timestamp: ::std::result::Result<i64, ::std::string::String>,
page: ::std::result::Result<u64, ::std::string::String>,
page_size: ::std::result::Result<u64, ::std::string::String>,
rfq_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
to_timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetRfqsRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
page: Ok(super::defaults::default_u64::<u64, 1>()),
page_size: Ok(super::defaults::default_u64::<u64, 20>()),
rfq_id: Ok(Default::default()),
status: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_timestamp: Ok(
super::defaults::default_u64::<i64, 9223372036854775807>(),
),
}
}
}
impl GetRfqsRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetRfqsRequest> for super::GetRfqsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetRfqsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
page: value.page?,
page_size: value.page_size?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
})
}
}
impl ::std::convert::From<super::GetRfqsRequest> for GetRfqsRequest {
fn from(value: super::GetRfqsRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetShareholderVaultsRequest {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetShareholderVaultsRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetShareholderVaultsRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetShareholderVaultsRequest>
for super::GetShareholderVaultsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetShareholderVaultsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetShareholderVaultsRequest>
for GetShareholderVaultsRequest {
fn from(value: super::GetShareholderVaultsRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetSubaccountRequest {
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetSubaccountRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetSubaccountRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetSubaccountRequest> for super::GetSubaccountRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetSubaccountRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetSubaccountRequest> for GetSubaccountRequest {
fn from(value: super::GetSubaccountRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetSubaccountsRequest {
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for GetSubaccountsRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetSubaccountsRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetSubaccountsRequest>
for super::GetSubaccountsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetSubaccountsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetSubaccountsRequest> for GetSubaccountsRequest {
fn from(value: super::GetSubaccountsRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetTickerRequest {
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for GetTickerRequest {
fn default() -> Self {
Self {
instrument_name: Err("no value supplied for instrument_name".to_string()),
}
}
}
impl GetTickerRequest {
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTickerRequest> for super::GetTickerRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetTickerRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_name: value.instrument_name?,
})
}
}
impl ::std::convert::From<super::GetTickerRequest> for GetTickerRequest {
fn from(value: super::GetTickerRequest) -> Self {
Self {
instrument_name: Ok(value.instrument_name),
}
}
}
#[derive(Clone, Debug)]
pub struct GetTickersRequest {
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
expiry_date: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
instrument_type: ::std::result::Result<super::AssetType, ::std::string::String>,
}
impl ::std::default::Default for GetTickersRequest {
fn default() -> Self {
Self {
currency: Ok(Default::default()),
expiry_date: Ok(Default::default()),
instrument_type: Err("no value supplied for instrument_type".to_string()),
}
}
}
impl GetTickersRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn expiry_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.expiry_date = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiry_date: {e}")
});
self
}
pub fn instrument_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.instrument_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTickersRequest> for super::GetTickersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetTickersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
expiry_date: value.expiry_date?,
instrument_type: value.instrument_type?,
})
}
}
impl ::std::convert::From<super::GetTickersRequest> for GetTickersRequest {
fn from(value: super::GetTickersRequest) -> Self {
Self {
currency: Ok(value.currency),
expiry_date: Ok(value.expiry_date),
instrument_type: Ok(value.instrument_type),
}
}
}
#[derive(Clone, Debug)]
pub struct GetTickersResponse {
tickers: ::std::result::Result<
::std::collections::HashMap<
::std::string::String,
crate::models::ticker_slim_schema::TickerSlimSchema,
>,
::std::string::String,
>,
}
impl ::std::default::Default for GetTickersResponse {
fn default() -> Self {
Self {
tickers: Err("no value supplied for tickers".to_string()),
}
}
}
impl GetTickersResponse {
pub fn tickers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<
::std::string::String,
crate::models::ticker_slim_schema::TickerSlimSchema,
>,
>,
T::Error: ::std::fmt::Display,
{
self.tickers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tickers: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTickersResponse> for super::GetTickersResponse {
type Error = super::error::ConversionError;
fn try_from(
value: GetTickersResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { tickers: value.tickers? })
}
}
impl ::std::convert::From<super::GetTickersResponse> for GetTickersResponse {
fn from(value: super::GetTickersResponse) -> Self {
Self { tickers: Ok(value.tickers) }
}
}
#[derive(Clone, Debug)]
pub struct GetTradeHistoryRequest {
from_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
order_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
quote_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
to_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetTradeHistoryRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
instrument_name: Ok(Default::default()),
order_id: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
quote_id: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
to_timestamp: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetTradeHistoryRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetTradeHistoryRequest>
for super::GetTradeHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetTradeHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
instrument_name: value.instrument_name?,
order_id: value.order_id?,
page: value.page?,
page_size: value.page_size?,
quote_id: value.quote_id?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetTradeHistoryRequest> for GetTradeHistoryRequest {
fn from(value: super::GetTradeHistoryRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
instrument_name: Ok(value.instrument_name),
order_id: Ok(value.order_id),
page: Ok(value.page),
page_size: Ok(value.page_size),
quote_id: Ok(value.quote_id),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetTradingviewChartDataRequest {
end_timestamp: ::std::result::Result<u64, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
period: ::std::result::Result<u64, ::std::string::String>,
start_timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetTradingviewChartDataRequest {
fn default() -> Self {
Self {
end_timestamp: Err("no value supplied for end_timestamp".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
period: Err("no value supplied for period".to_string()),
start_timestamp: Err("no value supplied for start_timestamp".to_string()),
}
}
}
impl GetTradingviewChartDataRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn period<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.period = value
.try_into()
.map_err(|e| format!("error converting supplied value for period: {e}"));
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTradingviewChartDataRequest>
for super::GetTradingviewChartDataRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetTradingviewChartDataRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
instrument_name: value.instrument_name?,
period: value.period?,
start_timestamp: value.start_timestamp?,
})
}
}
impl ::std::convert::From<super::GetTradingviewChartDataRequest>
for GetTradingviewChartDataRequest {
fn from(value: super::GetTradingviewChartDataRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
instrument_name: Ok(value.instrument_name),
period: Ok(value.period),
start_timestamp: Ok(value.start_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct GetTransactionParams {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetTransactionParams {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
}
}
}
impl GetTransactionParams {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTransactionParams> for super::GetTransactionParams {
type Error = super::error::ConversionError;
fn try_from(
value: GetTransactionParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { op_uuid: value.op_uuid? })
}
}
impl ::std::convert::From<super::GetTransactionParams> for GetTransactionParams {
fn from(value: super::GetTransactionParams) -> Self {
Self { op_uuid: Ok(value.op_uuid) }
}
}
#[derive(Clone, Debug)]
pub struct GetTransactionResult {
data: ::std::result::Result<::std::string::String, ::std::string::String>,
error_log: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
transaction_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetTransactionResult {
fn default() -> Self {
Self {
data: Err("no value supplied for data".to_string()),
error_log: Ok(Default::default()),
status: Ok(Default::default()),
transaction_hash: Ok(Default::default()),
}
}
}
impl GetTransactionResult {
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn error_log<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.error_log = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for error_log: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn transaction_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.transaction_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for transaction_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTransactionResult> for super::GetTransactionResult {
type Error = super::error::ConversionError;
fn try_from(
value: GetTransactionResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
data: value.data?,
error_log: value.error_log?,
status: value.status?,
transaction_hash: value.transaction_hash?,
})
}
}
impl ::std::convert::From<super::GetTransactionResult> for GetTransactionResult {
fn from(value: super::GetTransactionResult) -> Self {
Self {
data: Ok(value.data),
error_log: Ok(value.error_log),
status: Ok(value.status),
transaction_hash: Ok(value.transaction_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct GetTriggerOrdersRequest {
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for GetTriggerOrdersRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetTriggerOrdersRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetTriggerOrdersRequest>
for super::GetTriggerOrdersRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetTriggerOrdersRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetTriggerOrdersRequest>
for GetTriggerOrdersRequest {
fn from(value: super::GetTriggerOrdersRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetVaultActionHistoryRequest {
event_type: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetVaultActionHistoryRequest {
fn default() -> Self {
Self {
event_type: Ok(Default::default()),
page: Ok(Default::default()),
page_size: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetVaultActionHistoryRequest {
pub fn event_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.event_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for event_type: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetVaultActionHistoryRequest>
for super::GetVaultActionHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultActionHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
event_type: value.event_type?,
page: value.page?,
page_size: value.page_size?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetVaultActionHistoryRequest>
for GetVaultActionHistoryRequest {
fn from(value: super::GetVaultActionHistoryRequest) -> Self {
Self {
event_type: Ok(value.event_type),
page: Ok(value.page),
page_size: Ok(value.page_size),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetVaultPerformanceHistoryRequest {
from: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
limit: ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
resolution: ::std::result::Result<
super::PerformanceResolution,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
to: ::std::result::Result<::std::option::Option<i64>, ::std::string::String>,
}
impl ::std::default::Default for GetVaultPerformanceHistoryRequest {
fn default() -> Self {
Self {
from: Ok(Default::default()),
limit: Ok(Default::default()),
resolution: Err("no value supplied for resolution".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to: Ok(Default::default()),
}
}
}
impl GetVaultPerformanceHistoryRequest {
pub fn from<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.from = value
.try_into()
.map_err(|e| format!("error converting supplied value for from: {e}"));
self
}
pub fn limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.limit = value
.try_into()
.map_err(|e| format!("error converting supplied value for limit: {e}"));
self
}
pub fn resolution<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PerformanceResolution>,
T::Error: ::std::fmt::Display,
{
self.resolution = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for resolution: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.to = value
.try_into()
.map_err(|e| format!("error converting supplied value for to: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetVaultPerformanceHistoryRequest>
for super::GetVaultPerformanceHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultPerformanceHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from: value.from?,
limit: value.limit?,
resolution: value.resolution?,
subaccount_id: value.subaccount_id?,
to: value.to?,
})
}
}
impl ::std::convert::From<super::GetVaultPerformanceHistoryRequest>
for GetVaultPerformanceHistoryRequest {
fn from(value: super::GetVaultPerformanceHistoryRequest) -> Self {
Self {
from: Ok(value.from),
limit: Ok(value.limit),
resolution: Ok(value.resolution),
subaccount_id: Ok(value.subaccount_id),
to: Ok(value.to),
}
}
}
#[derive(Clone, Debug)]
pub struct GetVaultRequest {
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for GetVaultRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl GetVaultRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetVaultRequest> for super::GetVaultRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::GetVaultRequest> for GetVaultRequest {
fn from(value: super::GetVaultRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct GetVaultRequestHistoryRequest {
page: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
page_size: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetVaultRequestHistoryRequest {
fn default() -> Self {
Self {
page: Ok(Default::default()),
page_size: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetVaultRequestHistoryRequest {
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetVaultRequestHistoryRequest>
for super::GetVaultRequestHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultRequestHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
page: value.page?,
page_size: value.page_size?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetVaultRequestHistoryRequest>
for GetVaultRequestHistoryRequest {
fn from(value: super::GetVaultRequestHistoryRequest) -> Self {
Self {
page: Ok(value.page),
page_size: Ok(value.page_size),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct GetVaultSharesRequest {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for GetVaultSharesRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl GetVaultSharesRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetVaultSharesRequest>
for super::GetVaultSharesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultSharesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::GetVaultSharesRequest> for GetVaultSharesRequest {
fn from(value: super::GetVaultSharesRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct GetVaultsRequest {
page: ::std::result::Result<u32, ::std::string::String>,
page_size: ::std::result::Result<u32, ::std::string::String>,
}
impl ::std::default::Default for GetVaultsRequest {
fn default() -> Self {
Self {
page: Ok(super::defaults::default_u64::<u32, 1>()),
page_size: Ok(super::defaults::default_u64::<u32, 100>()),
}
}
}
impl GetVaultsRequest {
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
}
impl ::std::convert::TryFrom<GetVaultsRequest> for super::GetVaultsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetVaultsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
page: value.page?,
page_size: value.page_size?,
})
}
}
impl ::std::convert::From<super::GetVaultsRequest> for GetVaultsRequest {
fn from(value: super::GetVaultsRequest) -> Self {
Self {
page: Ok(value.page),
page_size: Ok(value.page_size),
}
}
}
#[derive(Clone, Debug)]
pub struct GetWalletsFromSessionKeyRequest {
public_session_key: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
scope: ::std::result::Result<
::std::option::Option<super::OffchainKeyScope>,
::std::string::String,
>,
}
impl ::std::default::Default for GetWalletsFromSessionKeyRequest {
fn default() -> Self {
Self {
public_session_key: Err(
"no value supplied for public_session_key".to_string(),
),
scope: Ok(Default::default()),
}
}
}
impl GetWalletsFromSessionKeyRequest {
pub fn public_session_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.public_session_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_key: {e}"
)
});
self
}
pub fn scope<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::OffchainKeyScope>>,
T::Error: ::std::fmt::Display,
{
self.scope = value
.try_into()
.map_err(|e| format!("error converting supplied value for scope: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetWalletsFromSessionKeyRequest>
for super::GetWalletsFromSessionKeyRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetWalletsFromSessionKeyRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
public_session_key: value.public_session_key?,
scope: value.scope?,
})
}
}
impl ::std::convert::From<super::GetWalletsFromSessionKeyRequest>
for GetWalletsFromSessionKeyRequest {
fn from(value: super::GetWalletsFromSessionKeyRequest) -> Self {
Self {
public_session_key: Ok(value.public_session_key),
scope: Ok(value.scope),
}
}
}
#[derive(Clone, Debug)]
pub struct GetWithdrawalHistoryRequest {
end_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
start_timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for GetWithdrawalHistoryRequest {
fn default() -> Self {
Self {
end_timestamp: Ok(Default::default()),
start_timestamp: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl GetWithdrawalHistoryRequest {
pub fn end_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.end_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for end_timestamp: {e}")
});
self
}
pub fn start_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.start_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for start_timestamp: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<GetWithdrawalHistoryRequest>
for super::GetWithdrawalHistoryRequest {
type Error = super::error::ConversionError;
fn try_from(
value: GetWithdrawalHistoryRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_timestamp: value.end_timestamp?,
start_timestamp: value.start_timestamp?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::GetWithdrawalHistoryRequest>
for GetWithdrawalHistoryRequest {
fn from(value: super::GetWithdrawalHistoryRequest) -> Self {
Self {
end_timestamp: Ok(value.end_timestamp),
start_timestamp: Ok(value.start_timestamp),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct IndexCandle {
close_price: ::std::result::Result<::std::string::String, ::std::string::String>,
high_price: ::std::result::Result<::std::string::String, ::std::string::String>,
low_price: ::std::result::Result<::std::string::String, ::std::string::String>,
open_price: ::std::result::Result<::std::string::String, ::std::string::String>,
price: ::std::result::Result<::std::string::String, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
timestamp_bucket: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for IndexCandle {
fn default() -> Self {
Self {
close_price: Err("no value supplied for close_price".to_string()),
high_price: Err("no value supplied for high_price".to_string()),
low_price: Err("no value supplied for low_price".to_string()),
open_price: Err("no value supplied for open_price".to_string()),
price: Err("no value supplied for price".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
timestamp_bucket: Err(
"no value supplied for timestamp_bucket".to_string(),
),
}
}
}
impl IndexCandle {
pub fn close_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.close_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for close_price: {e}")
});
self
}
pub fn high_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.high_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for high_price: {e}")
});
self
}
pub fn low_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.low_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for low_price: {e}")
});
self
}
pub fn open_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for open_price: {e}")
});
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn timestamp_bucket<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp_bucket = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp_bucket: {e}")
});
self
}
}
impl ::std::convert::TryFrom<IndexCandle> for super::IndexCandle {
type Error = super::error::ConversionError;
fn try_from(
value: IndexCandle,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
close_price: value.close_price?,
high_price: value.high_price?,
low_price: value.low_price?,
open_price: value.open_price?,
price: value.price?,
timestamp: value.timestamp?,
timestamp_bucket: value.timestamp_bucket?,
})
}
}
impl ::std::convert::From<super::IndexCandle> for IndexCandle {
fn from(value: super::IndexCandle) -> Self {
Self {
close_price: Ok(value.close_price),
high_price: Ok(value.high_price),
low_price: Ok(value.low_price),
open_price: Ok(value.open_price),
price: Ok(value.price),
timestamp: Ok(value.timestamp),
timestamp_bucket: Ok(value.timestamp_bucket),
}
}
}
#[derive(Clone, Debug)]
pub struct Instrument {
amount_step: ::std::result::Result<::std::string::String, ::std::string::String>,
base_asset_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
base_asset_sub_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
base_currency: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
base_fee: ::std::result::Result<::std::string::String, ::std::string::String>,
erc20_details: ::std::result::Result<
::std::option::Option<super::SpotPublicDetails>,
::std::string::String,
>,
fifo_min_allocation: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
instrument_type: ::std::result::Result<super::AssetType, ::std::string::String>,
is_active: ::std::result::Result<bool, ::std::string::String>,
maker_fee_rate: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mark_price_fee_rate_cap: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
maximum_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
minimum_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
option_details: ::std::result::Result<
::std::option::Option<super::OptionDetails>,
::std::string::String,
>,
perp_details: ::std::result::Result<
::std::option::Option<super::PerpDetails>,
::std::string::String,
>,
pro_rata_amount_step: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
pro_rata_fraction: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
quote_currency: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
scheduled_activation: ::std::result::Result<i64, ::std::string::String>,
scheduled_deactivation: ::std::result::Result<i64, ::std::string::String>,
taker_fee_rate: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
tick_size: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
}
impl ::std::default::Default for Instrument {
fn default() -> Self {
Self {
amount_step: Err("no value supplied for amount_step".to_string()),
base_asset_address: Err(
"no value supplied for base_asset_address".to_string(),
),
base_asset_sub_id: Err(
"no value supplied for base_asset_sub_id".to_string(),
),
base_currency: Err("no value supplied for base_currency".to_string()),
base_fee: Err("no value supplied for base_fee".to_string()),
erc20_details: Ok(Default::default()),
fifo_min_allocation: Err(
"no value supplied for fifo_min_allocation".to_string(),
),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
instrument_type: Err(
"no value supplied for instrument_type".to_string(),
),
is_active: Err("no value supplied for is_active".to_string()),
maker_fee_rate: Err("no value supplied for maker_fee_rate".to_string()),
mark_price_fee_rate_cap: Ok(Default::default()),
maximum_amount: Err("no value supplied for maximum_amount".to_string()),
minimum_amount: Err("no value supplied for minimum_amount".to_string()),
option_details: Ok(Default::default()),
perp_details: Ok(Default::default()),
pro_rata_amount_step: Err(
"no value supplied for pro_rata_amount_step".to_string(),
),
pro_rata_fraction: Err(
"no value supplied for pro_rata_fraction".to_string(),
),
quote_currency: Err("no value supplied for quote_currency".to_string()),
scheduled_activation: Err(
"no value supplied for scheduled_activation".to_string(),
),
scheduled_deactivation: Err(
"no value supplied for scheduled_deactivation".to_string(),
),
taker_fee_rate: Err("no value supplied for taker_fee_rate".to_string()),
tick_size: Err("no value supplied for tick_size".to_string()),
}
}
}
impl Instrument {
pub fn amount_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for amount_step: {e}")
});
self
}
pub fn base_asset_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.base_asset_address = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for base_asset_address: {e}"
)
});
self
}
pub fn base_asset_sub_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.base_asset_sub_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for base_asset_sub_id: {e}")
});
self
}
pub fn base_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.base_currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for base_currency: {e}")
});
self
}
pub fn base_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.base_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for base_fee: {e}")
});
self
}
pub fn erc20_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::SpotPublicDetails>>,
T::Error: ::std::fmt::Display,
{
self.erc20_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for erc20_details: {e}")
});
self
}
pub fn fifo_min_allocation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.fifo_min_allocation = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for fifo_min_allocation: {e}"
)
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn instrument_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.instrument_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_type: {e}")
});
self
}
pub fn is_active<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_active = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_active: {e}")
});
self
}
pub fn maker_fee_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.maker_fee_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for maker_fee_rate: {e}")
});
self
}
pub fn mark_price_fee_rate_cap<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.mark_price_fee_rate_cap = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for mark_price_fee_rate_cap: {e}"
)
});
self
}
pub fn maximum_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.maximum_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for maximum_amount: {e}")
});
self
}
pub fn minimum_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.minimum_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for minimum_amount: {e}")
});
self
}
pub fn option_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::OptionDetails>>,
T::Error: ::std::fmt::Display,
{
self.option_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for option_details: {e}")
});
self
}
pub fn perp_details<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::PerpDetails>>,
T::Error: ::std::fmt::Display,
{
self.perp_details = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for perp_details: {e}")
});
self
}
pub fn pro_rata_amount_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pro_rata_amount_step = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for pro_rata_amount_step: {e}"
)
});
self
}
pub fn pro_rata_fraction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pro_rata_fraction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pro_rata_fraction: {e}")
});
self
}
pub fn quote_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.quote_currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_currency: {e}")
});
self
}
pub fn scheduled_activation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.scheduled_activation = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for scheduled_activation: {e}"
)
});
self
}
pub fn scheduled_deactivation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.scheduled_deactivation = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for scheduled_deactivation: {e}"
)
});
self
}
pub fn taker_fee_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.taker_fee_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for taker_fee_rate: {e}")
});
self
}
pub fn tick_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.tick_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tick_size: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Instrument> for super::Instrument {
type Error = super::error::ConversionError;
fn try_from(
value: Instrument,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount_step: value.amount_step?,
base_asset_address: value.base_asset_address?,
base_asset_sub_id: value.base_asset_sub_id?,
base_currency: value.base_currency?,
base_fee: value.base_fee?,
erc20_details: value.erc20_details?,
fifo_min_allocation: value.fifo_min_allocation?,
instrument_name: value.instrument_name?,
instrument_type: value.instrument_type?,
is_active: value.is_active?,
maker_fee_rate: value.maker_fee_rate?,
mark_price_fee_rate_cap: value.mark_price_fee_rate_cap?,
maximum_amount: value.maximum_amount?,
minimum_amount: value.minimum_amount?,
option_details: value.option_details?,
perp_details: value.perp_details?,
pro_rata_amount_step: value.pro_rata_amount_step?,
pro_rata_fraction: value.pro_rata_fraction?,
quote_currency: value.quote_currency?,
scheduled_activation: value.scheduled_activation?,
scheduled_deactivation: value.scheduled_deactivation?,
taker_fee_rate: value.taker_fee_rate?,
tick_size: value.tick_size?,
})
}
}
impl ::std::convert::From<super::Instrument> for Instrument {
fn from(value: super::Instrument) -> Self {
Self {
amount_step: Ok(value.amount_step),
base_asset_address: Ok(value.base_asset_address),
base_asset_sub_id: Ok(value.base_asset_sub_id),
base_currency: Ok(value.base_currency),
base_fee: Ok(value.base_fee),
erc20_details: Ok(value.erc20_details),
fifo_min_allocation: Ok(value.fifo_min_allocation),
instrument_name: Ok(value.instrument_name),
instrument_type: Ok(value.instrument_type),
is_active: Ok(value.is_active),
maker_fee_rate: Ok(value.maker_fee_rate),
mark_price_fee_rate_cap: Ok(value.mark_price_fee_rate_cap),
maximum_amount: Ok(value.maximum_amount),
minimum_amount: Ok(value.minimum_amount),
option_details: Ok(value.option_details),
perp_details: Ok(value.perp_details),
pro_rata_amount_step: Ok(value.pro_rata_amount_step),
pro_rata_fraction: Ok(value.pro_rata_fraction),
quote_currency: Ok(value.quote_currency),
scheduled_activation: Ok(value.scheduled_activation),
scheduled_deactivation: Ok(value.scheduled_deactivation),
taker_fee_rate: Ok(value.taker_fee_rate),
tick_size: Ok(value.tick_size),
}
}
}
#[derive(Clone, Debug)]
pub struct InterestHistoryResult {
events: ::std::result::Result<
::std::vec::Vec<super::InterestPayment>,
::std::string::String,
>,
}
impl ::std::default::Default for InterestHistoryResult {
fn default() -> Self {
Self {
events: Err("no value supplied for events".to_string()),
}
}
}
impl InterestHistoryResult {
pub fn events<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::InterestPayment>>,
T::Error: ::std::fmt::Display,
{
self.events = value
.try_into()
.map_err(|e| format!("error converting supplied value for events: {e}"));
self
}
}
impl ::std::convert::TryFrom<InterestHistoryResult>
for super::InterestHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: InterestHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { events: value.events? })
}
}
impl ::std::convert::From<super::InterestHistoryResult> for InterestHistoryResult {
fn from(value: super::InterestHistoryResult) -> Self {
Self { events: Ok(value.events) }
}
}
#[derive(Clone, Debug)]
pub struct InterestPayment {
interest: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for InterestPayment {
fn default() -> Self {
Self {
interest: Err("no value supplied for interest".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl InterestPayment {
pub fn interest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.interest = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for interest: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<InterestPayment> for super::InterestPayment {
type Error = super::error::ConversionError;
fn try_from(
value: InterestPayment,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
interest: value.interest?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::InterestPayment> for InterestPayment {
fn from(value: super::InterestPayment) -> Self {
Self {
interest: Ok(value.interest),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct InterestRateCandle {
borrow_apy: ::std::result::Result<super::Ohlc, ::std::string::String>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
supply_apy: ::std::result::Result<super::Ohlc, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
total_borrow: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_supply: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for InterestRateCandle {
fn default() -> Self {
Self {
borrow_apy: Err("no value supplied for borrow_apy".to_string()),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
supply_apy: Err("no value supplied for supply_apy".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
total_borrow: Err("no value supplied for total_borrow".to_string()),
total_supply: Err("no value supplied for total_supply".to_string()),
}
}
}
impl InterestRateCandle {
pub fn borrow_apy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Ohlc>,
T::Error: ::std::fmt::Display,
{
self.borrow_apy = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for borrow_apy: {e}")
});
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn supply_apy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Ohlc>,
T::Error: ::std::fmt::Display,
{
self.supply_apy = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for supply_apy: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn total_borrow<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_borrow = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_borrow: {e}")
});
self
}
pub fn total_supply<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_supply = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_supply: {e}")
});
self
}
}
impl ::std::convert::TryFrom<InterestRateCandle> for super::InterestRateCandle {
type Error = super::error::ConversionError;
fn try_from(
value: InterestRateCandle,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
borrow_apy: value.borrow_apy?,
risk_universe_id: value.risk_universe_id?,
supply_apy: value.supply_apy?,
timestamp: value.timestamp?,
total_borrow: value.total_borrow?,
total_supply: value.total_supply?,
})
}
}
impl ::std::convert::From<super::InterestRateCandle> for InterestRateCandle {
fn from(value: super::InterestRateCandle) -> Self {
Self {
borrow_apy: Ok(value.borrow_apy),
risk_universe_id: Ok(value.risk_universe_id),
supply_apy: Ok(value.supply_apy),
timestamp: Ok(value.timestamp),
total_borrow: Ok(value.total_borrow),
total_supply: Ok(value.total_supply),
}
}
}
#[derive(Clone, Debug)]
pub struct InterestRateHistoryResult {
interest_rate_history: ::std::result::Result<
::std::vec::Vec<super::InterestRateCandle>,
::std::string::String,
>,
}
impl ::std::default::Default for InterestRateHistoryResult {
fn default() -> Self {
Self {
interest_rate_history: Err(
"no value supplied for interest_rate_history".to_string(),
),
}
}
}
impl InterestRateHistoryResult {
pub fn interest_rate_history<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::InterestRateCandle>>,
T::Error: ::std::fmt::Display,
{
self.interest_rate_history = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for interest_rate_history: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<InterestRateHistoryResult>
for super::InterestRateHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: InterestRateHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
interest_rate_history: value.interest_rate_history?,
})
}
}
impl ::std::convert::From<super::InterestRateHistoryResult>
for InterestRateHistoryResult {
fn from(value: super::InterestRateHistoryResult) -> Self {
Self {
interest_rate_history: Ok(value.interest_rate_history),
}
}
}
#[derive(Clone, Debug)]
pub struct LegUnpricedParams {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for LegUnpricedParams {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
direction: Err("no value supplied for direction".to_string()),
instrument_name: Err("no value supplied for instrument_name".to_string()),
}
}
}
impl LegUnpricedParams {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
}
impl ::std::convert::TryFrom<LegUnpricedParams> for super::LegUnpricedParams {
type Error = super::error::ConversionError;
fn try_from(
value: LegUnpricedParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
direction: value.direction?,
instrument_name: value.instrument_name?,
})
}
}
impl ::std::convert::From<super::LegUnpricedParams> for LegUnpricedParams {
fn from(value: super::LegUnpricedParams) -> Self {
Self {
amount: Ok(value.amount),
direction: Ok(value.direction),
instrument_name: Ok(value.instrument_name),
}
}
}
#[derive(Clone, Debug)]
pub struct LendingDetails {
borrow_apy: ::std::result::Result<::std::string::String, ::std::string::String>,
supply_apy: ::std::result::Result<::std::string::String, ::std::string::String>,
total_borrow: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
total_borrow_cap: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for LendingDetails {
fn default() -> Self {
Self {
borrow_apy: Err("no value supplied for borrow_apy".to_string()),
supply_apy: Err("no value supplied for supply_apy".to_string()),
total_borrow: Err("no value supplied for total_borrow".to_string()),
total_borrow_cap: Err(
"no value supplied for total_borrow_cap".to_string(),
),
}
}
}
impl LendingDetails {
pub fn borrow_apy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.borrow_apy = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for borrow_apy: {e}")
});
self
}
pub fn supply_apy<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.supply_apy = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for supply_apy: {e}")
});
self
}
pub fn total_borrow<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_borrow = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_borrow: {e}")
});
self
}
pub fn total_borrow_cap<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_borrow_cap = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_borrow_cap: {e}")
});
self
}
}
impl ::std::convert::TryFrom<LendingDetails> for super::LendingDetails {
type Error = super::error::ConversionError;
fn try_from(
value: LendingDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
borrow_apy: value.borrow_apy?,
supply_apy: value.supply_apy?,
total_borrow: value.total_borrow?,
total_borrow_cap: value.total_borrow_cap?,
})
}
}
impl ::std::convert::From<super::LendingDetails> for LendingDetails {
fn from(value: super::LendingDetails) -> Self {
Self {
borrow_apy: Ok(value.borrow_apy),
supply_apy: Ok(value.supply_apy),
total_borrow: Ok(value.total_borrow),
total_borrow_cap: Ok(value.total_borrow_cap),
}
}
}
#[derive(Clone, Debug)]
pub struct LiquidationHistoryResult {
auctions: ::std::result::Result<
::std::vec::Vec<super::AuctionHistory>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
}
impl ::std::default::Default for LiquidationHistoryResult {
fn default() -> Self {
Self {
auctions: Err("no value supplied for auctions".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
}
}
}
impl LiquidationHistoryResult {
pub fn auctions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::AuctionHistory>>,
T::Error: ::std::fmt::Display,
{
self.auctions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for auctions: {e}")
});
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
}
impl ::std::convert::TryFrom<LiquidationHistoryResult>
for super::LiquidationHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: LiquidationHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
auctions: value.auctions?,
pagination: value.pagination?,
})
}
}
impl ::std::convert::From<super::LiquidationHistoryResult>
for LiquidationHistoryResult {
fn from(value: super::LiquidationHistoryResult) -> Self {
Self {
auctions: Ok(value.auctions),
pagination: Ok(value.pagination),
}
}
}
#[derive(Clone, Debug)]
pub struct LoginRequest {
signature: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
timestamp: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for LoginRequest {
fn default() -> Self {
Self {
signature: Ok(Default::default()),
timestamp: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl LoginRequest {
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<LoginRequest> for super::LoginRequest {
type Error = super::error::ConversionError;
fn try_from(
value: LoginRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
signature: value.signature?,
timestamp: value.timestamp?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::LoginRequest> for LoginRequest {
fn from(value: super::LoginRequest) -> Self {
Self {
signature: Ok(value.signature),
timestamp: Ok(value.timestamp),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct ManagerCollateral {
address: ::std::result::Result<::std::string::String, ::std::string::String>,
erc20: ::std::result::Result<super::Erc20Details, ::std::string::String>,
im_discount: ::std::result::Result<::std::string::String, ::std::string::String>,
min_deposit_usd: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mm_discount: ::std::result::Result<::std::string::String, ::std::string::String>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for ManagerCollateral {
fn default() -> Self {
Self {
address: Err("no value supplied for address".to_string()),
erc20: Err("no value supplied for erc20".to_string()),
im_discount: Err("no value supplied for im_discount".to_string()),
min_deposit_usd: Err(
"no value supplied for min_deposit_usd".to_string(),
),
mm_discount: Err("no value supplied for mm_discount".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl ManagerCollateral {
pub fn address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address: {e}")
});
self
}
pub fn erc20<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Erc20Details>,
T::Error: ::std::fmt::Display,
{
self.erc20 = value
.try_into()
.map_err(|e| format!("error converting supplied value for erc20: {e}"));
self
}
pub fn im_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.im_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for im_discount: {e}")
});
self
}
pub fn min_deposit_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.min_deposit_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_deposit_usd: {e}")
});
self
}
pub fn mm_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mm_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mm_discount: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
}
impl ::std::convert::TryFrom<ManagerCollateral> for super::ManagerCollateral {
type Error = super::error::ConversionError;
fn try_from(
value: ManagerCollateral,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
address: value.address?,
erc20: value.erc20?,
im_discount: value.im_discount?,
min_deposit_usd: value.min_deposit_usd?,
mm_discount: value.mm_discount?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::ManagerCollateral> for ManagerCollateral {
fn from(value: super::ManagerCollateral) -> Self {
Self {
address: Ok(value.address),
erc20: Ok(value.erc20),
im_discount: Ok(value.im_discount),
min_deposit_usd: Ok(value.min_deposit_usd),
mm_discount: Ok(value.mm_discount),
name: Ok(value.name),
}
}
}
#[derive(Clone, Debug)]
pub struct MarginWatchResult {
collaterals: ::std::result::Result<
::std::vec::Vec<::serde_json::Value>,
::std::string::String,
>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
margin_type: ::std::result::Result<::std::string::String, ::std::string::String>,
positions: ::std::result::Result<
::std::vec::Vec<::serde_json::Value>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
subaccount_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
valuation_timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for MarginWatchResult {
fn default() -> Self {
Self {
collaterals: Err("no value supplied for collaterals".to_string()),
currency: Err("no value supplied for currency".to_string()),
initial_margin: Err("no value supplied for initial_margin".to_string()),
maintenance_margin: Err(
"no value supplied for maintenance_margin".to_string(),
),
margin_type: Err("no value supplied for margin_type".to_string()),
positions: Err("no value supplied for positions".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
subaccount_value: Err(
"no value supplied for subaccount_value".to_string(),
),
valuation_timestamp: Err(
"no value supplied for valuation_timestamp".to_string(),
),
}
}
}
impl MarginWatchResult {
pub fn collaterals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::serde_json::Value>>,
T::Error: ::std::fmt::Display,
{
self.collaterals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for collaterals: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.initial_margin = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for initial_margin: {e}")
});
self
}
pub fn maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for maintenance_margin: {e}"
)
});
self
}
pub fn margin_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.margin_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for margin_type: {e}")
});
self
}
pub fn positions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::serde_json::Value>>,
T::Error: ::std::fmt::Display,
{
self.positions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for positions: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn subaccount_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.subaccount_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_value: {e}")
});
self
}
pub fn valuation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.valuation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for valuation_timestamp: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<MarginWatchResult> for super::MarginWatchResult {
type Error = super::error::ConversionError;
fn try_from(
value: MarginWatchResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
collaterals: value.collaterals?,
currency: value.currency?,
initial_margin: value.initial_margin?,
maintenance_margin: value.maintenance_margin?,
margin_type: value.margin_type?,
positions: value.positions?,
subaccount_id: value.subaccount_id?,
subaccount_value: value.subaccount_value?,
valuation_timestamp: value.valuation_timestamp?,
})
}
}
impl ::std::convert::From<super::MarginWatchResult> for MarginWatchResult {
fn from(value: super::MarginWatchResult) -> Self {
Self {
collaterals: Ok(value.collaterals),
currency: Ok(value.currency),
initial_margin: Ok(value.initial_margin),
maintenance_margin: Ok(value.maintenance_margin),
margin_type: Ok(value.margin_type),
positions: Ok(value.positions),
subaccount_id: Ok(value.subaccount_id),
subaccount_value: Ok(value.subaccount_value),
valuation_timestamp: Ok(value.valuation_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct MintSharesRequest {
deposit_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
nonce: ::std::result::Result<u64, ::std::string::String>,
request_id: ::std::result::Result<super::VaultRequestId, ::std::string::String>,
share_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for MintSharesRequest {
fn default() -> Self {
Self {
deposit_hash: Err("no value supplied for deposit_hash".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
request_id: Err("no value supplied for request_id".to_string()),
share_price: Err("no value supplied for share_price".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl MintSharesRequest {
pub fn deposit_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.deposit_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposit_hash: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn request_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultRequestId>,
T::Error: ::std::fmt::Display,
{
self.request_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for request_id: {e}")
});
self
}
pub fn share_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.share_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for share_price: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<MintSharesRequest> for super::MintSharesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: MintSharesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
deposit_hash: value.deposit_hash?,
nonce: value.nonce?,
request_id: value.request_id?,
share_price: value.share_price?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::MintSharesRequest> for MintSharesRequest {
fn from(value: super::MintSharesRequest) -> Self {
Self {
deposit_hash: Ok(value.deposit_hash),
nonce: Ok(value.nonce),
request_id: Ok(value.request_id),
share_price: Ok(value.share_price),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct MmpConfigResult {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
is_frozen: ::std::result::Result<bool, ::std::string::String>,
mmp_amount_limit: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mmp_delta_limit: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mmp_frozen_time: ::std::result::Result<u64, ::std::string::String>,
mmp_interval: ::std::result::Result<u64, ::std::string::String>,
mmp_unfreeze_time: ::std::result::Result<i64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for MmpConfigResult {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
is_frozen: Err("no value supplied for is_frozen".to_string()),
mmp_amount_limit: Err(
"no value supplied for mmp_amount_limit".to_string(),
),
mmp_delta_limit: Err(
"no value supplied for mmp_delta_limit".to_string(),
),
mmp_frozen_time: Err(
"no value supplied for mmp_frozen_time".to_string(),
),
mmp_interval: Err("no value supplied for mmp_interval".to_string()),
mmp_unfreeze_time: Err(
"no value supplied for mmp_unfreeze_time".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl MmpConfigResult {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn is_frozen<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_frozen = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_frozen: {e}")
});
self
}
pub fn mmp_amount_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mmp_amount_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_amount_limit: {e}")
});
self
}
pub fn mmp_delta_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mmp_delta_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_delta_limit: {e}")
});
self
}
pub fn mmp_frozen_time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_frozen_time = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_frozen_time: {e}")
});
self
}
pub fn mmp_interval<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_interval = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_interval: {e}")
});
self
}
pub fn mmp_unfreeze_time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.mmp_unfreeze_time = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_unfreeze_time: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<MmpConfigResult> for super::MmpConfigResult {
type Error = super::error::ConversionError;
fn try_from(
value: MmpConfigResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
is_frozen: value.is_frozen?,
mmp_amount_limit: value.mmp_amount_limit?,
mmp_delta_limit: value.mmp_delta_limit?,
mmp_frozen_time: value.mmp_frozen_time?,
mmp_interval: value.mmp_interval?,
mmp_unfreeze_time: value.mmp_unfreeze_time?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::MmpConfigResult> for MmpConfigResult {
fn from(value: super::MmpConfigResult) -> Self {
Self {
currency: Ok(value.currency),
is_frozen: Ok(value.is_frozen),
mmp_amount_limit: Ok(value.mmp_amount_limit),
mmp_delta_limit: Ok(value.mmp_delta_limit),
mmp_frozen_time: Ok(value.mmp_frozen_time),
mmp_interval: Ok(value.mmp_interval),
mmp_unfreeze_time: Ok(value.mmp_unfreeze_time),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct MmpScopeRequest {
currency: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for MmpScopeRequest {
fn default() -> Self {
Self {
currency: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl MmpScopeRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<MmpScopeRequest> for super::MmpScopeRequest {
type Error = super::error::ConversionError;
fn try_from(
value: MmpScopeRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::MmpScopeRequest> for MmpScopeRequest {
fn from(value: super::MmpScopeRequest) -> Self {
Self {
currency: Ok(value.currency),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct MultipleVaultRequestsResponse {
requests: ::std::result::Result<
::std::vec::Vec<super::VaultRequestResponse>,
::std::string::String,
>,
total: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for MultipleVaultRequestsResponse {
fn default() -> Self {
Self {
requests: Err("no value supplied for requests".to_string()),
total: Err("no value supplied for total".to_string()),
}
}
}
impl MultipleVaultRequestsResponse {
pub fn requests<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VaultRequestResponse>>,
T::Error: ::std::fmt::Display,
{
self.requests = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for requests: {e}")
});
self
}
pub fn total<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.total = value
.try_into()
.map_err(|e| format!("error converting supplied value for total: {e}"));
self
}
}
impl ::std::convert::TryFrom<MultipleVaultRequestsResponse>
for super::MultipleVaultRequestsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: MultipleVaultRequestsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
requests: value.requests?,
total: value.total?,
})
}
}
impl ::std::convert::From<super::MultipleVaultRequestsResponse>
for MultipleVaultRequestsResponse {
fn from(value: super::MultipleVaultRequestsResponse) -> Self {
Self {
requests: Ok(value.requests),
total: Ok(value.total),
}
}
}
#[derive(Clone, Debug)]
pub struct OffchainAckResponse {
status: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for OffchainAckResponse {
fn default() -> Self {
Self {
status: Err("no value supplied for status".to_string()),
}
}
}
impl OffchainAckResponse {
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
}
impl ::std::convert::TryFrom<OffchainAckResponse> for super::OffchainAckResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OffchainAckResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { status: value.status? })
}
}
impl ::std::convert::From<super::OffchainAckResponse> for OffchainAckResponse {
fn from(value: super::OffchainAckResponse) -> Self {
Self { status: Ok(value.status) }
}
}
#[derive(Clone, Debug)]
pub struct Ohlc {
close: ::std::result::Result<::std::string::String, ::std::string::String>,
high: ::std::result::Result<::std::string::String, ::std::string::String>,
low: ::std::result::Result<::std::string::String, ::std::string::String>,
open: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Ohlc {
fn default() -> Self {
Self {
close: Err("no value supplied for close".to_string()),
high: Err("no value supplied for high".to_string()),
low: Err("no value supplied for low".to_string()),
open: Err("no value supplied for open".to_string()),
}
}
}
impl Ohlc {
pub fn close<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.close = value
.try_into()
.map_err(|e| format!("error converting supplied value for close: {e}"));
self
}
pub fn high<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.high = value
.try_into()
.map_err(|e| format!("error converting supplied value for high: {e}"));
self
}
pub fn low<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.low = value
.try_into()
.map_err(|e| format!("error converting supplied value for low: {e}"));
self
}
pub fn open<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open = value
.try_into()
.map_err(|e| format!("error converting supplied value for open: {e}"));
self
}
}
impl ::std::convert::TryFrom<Ohlc> for super::Ohlc {
type Error = super::error::ConversionError;
fn try_from(
value: Ohlc,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
close: value.close?,
high: value.high?,
low: value.low?,
open: value.open?,
})
}
}
impl ::std::convert::From<super::Ohlc> for Ohlc {
fn from(value: super::Ohlc) -> Self {
Self {
close: Ok(value.close),
high: Ok(value.high),
low: Ok(value.low),
open: Ok(value.open),
}
}
}
#[derive(Clone, Debug)]
pub struct OnchainActionHistoryEntry {
acc: ::std::result::Result<::std::string::String, ::std::string::String>,
action_id: ::std::result::Result<u64, ::std::string::String>,
action_type: ::std::result::Result<u64, ::std::string::String>,
action_type_label: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
block_number: ::std::result::Result<u64, ::std::string::String>,
data: ::std::result::Result<::std::string::String, ::std::string::String>,
error_code: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
error_message: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
fallback_at: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
first_failed_at: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
l1_sender: ::std::result::Result<::std::string::String, ::std::string::String>,
last_failed_at: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
op_uuid: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
queue: ::std::result::Result<::std::string::String, ::std::string::String>,
status: ::std::result::Result<::std::string::String, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
updated_at: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for OnchainActionHistoryEntry {
fn default() -> Self {
Self {
acc: Err("no value supplied for acc".to_string()),
action_id: Err("no value supplied for action_id".to_string()),
action_type: Err("no value supplied for action_type".to_string()),
action_type_label: Err(
"no value supplied for action_type_label".to_string(),
),
block_number: Err("no value supplied for block_number".to_string()),
data: Err("no value supplied for data".to_string()),
error_code: Ok(Default::default()),
error_message: Ok(Default::default()),
fallback_at: Ok(Default::default()),
first_failed_at: Ok(Default::default()),
l1_sender: Err("no value supplied for l1_sender".to_string()),
last_failed_at: Ok(Default::default()),
op_uuid: Ok(Default::default()),
queue: Err("no value supplied for queue".to_string()),
status: Err("no value supplied for status".to_string()),
tx_hash: Ok(Default::default()),
updated_at: Err("no value supplied for updated_at".to_string()),
}
}
}
impl OnchainActionHistoryEntry {
pub fn acc<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.acc = value
.try_into()
.map_err(|e| format!("error converting supplied value for acc: {e}"));
self
}
pub fn action_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.action_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_id: {e}")
});
self
}
pub fn action_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.action_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_type: {e}")
});
self
}
pub fn action_type_label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_type_label = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_type_label: {e}")
});
self
}
pub fn block_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.block_number = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for block_number: {e}")
});
self
}
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn error_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.error_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for error_code: {e}")
});
self
}
pub fn error_message<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.error_message = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for error_message: {e}")
});
self
}
pub fn fallback_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.fallback_at = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fallback_at: {e}")
});
self
}
pub fn first_failed_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.first_failed_at = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for first_failed_at: {e}")
});
self
}
pub fn l1_sender<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.l1_sender = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for l1_sender: {e}")
});
self
}
pub fn last_failed_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.last_failed_at = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for last_failed_at: {e}")
});
self
}
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn queue<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.queue = value
.try_into()
.map_err(|e| format!("error converting supplied value for queue: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
pub fn updated_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.updated_at = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for updated_at: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OnchainActionHistoryEntry>
for super::OnchainActionHistoryEntry {
type Error = super::error::ConversionError;
fn try_from(
value: OnchainActionHistoryEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
acc: value.acc?,
action_id: value.action_id?,
action_type: value.action_type?,
action_type_label: value.action_type_label?,
block_number: value.block_number?,
data: value.data?,
error_code: value.error_code?,
error_message: value.error_message?,
fallback_at: value.fallback_at?,
first_failed_at: value.first_failed_at?,
l1_sender: value.l1_sender?,
last_failed_at: value.last_failed_at?,
op_uuid: value.op_uuid?,
queue: value.queue?,
status: value.status?,
tx_hash: value.tx_hash?,
updated_at: value.updated_at?,
})
}
}
impl ::std::convert::From<super::OnchainActionHistoryEntry>
for OnchainActionHistoryEntry {
fn from(value: super::OnchainActionHistoryEntry) -> Self {
Self {
acc: Ok(value.acc),
action_id: Ok(value.action_id),
action_type: Ok(value.action_type),
action_type_label: Ok(value.action_type_label),
block_number: Ok(value.block_number),
data: Ok(value.data),
error_code: Ok(value.error_code),
error_message: Ok(value.error_message),
fallback_at: Ok(value.fallback_at),
first_failed_at: Ok(value.first_failed_at),
l1_sender: Ok(value.l1_sender),
last_failed_at: Ok(value.last_failed_at),
op_uuid: Ok(value.op_uuid),
queue: Ok(value.queue),
status: Ok(value.status),
tx_hash: Ok(value.tx_hash),
updated_at: Ok(value.updated_at),
}
}
}
#[derive(Clone, Debug)]
pub struct OpenInterestStats {
current_open_interest: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
interest_cap: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for OpenInterestStats {
fn default() -> Self {
Self {
current_open_interest: Err(
"no value supplied for current_open_interest".to_string(),
),
interest_cap: Err("no value supplied for interest_cap".to_string()),
}
}
}
impl OpenInterestStats {
pub fn current_open_interest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.current_open_interest = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for current_open_interest: {e}"
)
});
self
}
pub fn interest_cap<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.interest_cap = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for interest_cap: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OpenInterestStats> for super::OpenInterestStats {
type Error = super::error::ConversionError;
fn try_from(
value: OpenInterestStats,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
current_open_interest: value.current_open_interest?,
interest_cap: value.interest_cap?,
})
}
}
impl ::std::convert::From<super::OpenInterestStats> for OpenInterestStats {
fn from(value: super::OpenInterestStats) -> Self {
Self {
current_open_interest: Ok(value.current_open_interest),
interest_cap: Ok(value.interest_cap),
}
}
}
#[derive(Clone, Debug)]
pub struct OptionDetails {
expiry: ::std::result::Result<u64, ::std::string::String>,
index: ::std::result::Result<::std::string::String, ::std::string::String>,
option_type: ::std::result::Result<::std::string::String, ::std::string::String>,
settlement_price: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
strike: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for OptionDetails {
fn default() -> Self {
Self {
expiry: Err("no value supplied for expiry".to_string()),
index: Err("no value supplied for index".to_string()),
option_type: Err("no value supplied for option_type".to_string()),
settlement_price: Ok(Default::default()),
strike: Err("no value supplied for strike".to_string()),
}
}
}
impl OptionDetails {
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn index<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.index = value
.try_into()
.map_err(|e| format!("error converting supplied value for index: {e}"));
self
}
pub fn option_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.option_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for option_type: {e}")
});
self
}
pub fn settlement_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.settlement_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for settlement_price: {e}")
});
self
}
pub fn strike<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.strike = value
.try_into()
.map_err(|e| format!("error converting supplied value for strike: {e}"));
self
}
}
impl ::std::convert::TryFrom<OptionDetails> for super::OptionDetails {
type Error = super::error::ConversionError;
fn try_from(
value: OptionDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
expiry: value.expiry?,
index: value.index?,
option_type: value.option_type?,
settlement_price: value.settlement_price?,
strike: value.strike?,
})
}
}
impl ::std::convert::From<super::OptionDetails> for OptionDetails {
fn from(value: super::OptionDetails) -> Self {
Self {
expiry: Ok(value.expiry),
index: Ok(value.index),
option_type: Ok(value.option_type),
settlement_price: Ok(value.settlement_price),
strike: Ok(value.strike),
}
}
}
#[derive(Clone, Debug)]
pub struct OptionPricing {
ai: ::std::result::Result<::std::string::String, ::std::string::String>,
bi: ::std::result::Result<::std::string::String, ::std::string::String>,
d: ::std::result::Result<::std::string::String, ::std::string::String>,
df: ::std::result::Result<::std::string::String, ::std::string::String>,
f: ::std::result::Result<::std::string::String, ::std::string::String>,
g: ::std::result::Result<::std::string::String, ::std::string::String>,
i: ::std::result::Result<::std::string::String, ::std::string::String>,
m: ::std::result::Result<::std::string::String, ::std::string::String>,
r: ::std::result::Result<::std::string::String, ::std::string::String>,
t: ::std::result::Result<::std::string::String, ::std::string::String>,
v: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for OptionPricing {
fn default() -> Self {
Self {
ai: Err("no value supplied for ai".to_string()),
bi: Err("no value supplied for bi".to_string()),
d: Err("no value supplied for d".to_string()),
df: Err("no value supplied for df".to_string()),
f: Err("no value supplied for f".to_string()),
g: Err("no value supplied for g".to_string()),
i: Err("no value supplied for i".to_string()),
m: Err("no value supplied for m".to_string()),
r: Err("no value supplied for r".to_string()),
t: Err("no value supplied for t".to_string()),
v: Err("no value supplied for v".to_string()),
}
}
}
impl OptionPricing {
pub fn ai<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.ai = value
.try_into()
.map_err(|e| format!("error converting supplied value for ai: {e}"));
self
}
pub fn bi<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.bi = value
.try_into()
.map_err(|e| format!("error converting supplied value for bi: {e}"));
self
}
pub fn d<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.d = value
.try_into()
.map_err(|e| format!("error converting supplied value for d: {e}"));
self
}
pub fn df<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.df = value
.try_into()
.map_err(|e| format!("error converting supplied value for df: {e}"));
self
}
pub fn f<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.f = value
.try_into()
.map_err(|e| format!("error converting supplied value for f: {e}"));
self
}
pub fn g<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.g = value
.try_into()
.map_err(|e| format!("error converting supplied value for g: {e}"));
self
}
pub fn i<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.i = value
.try_into()
.map_err(|e| format!("error converting supplied value for i: {e}"));
self
}
pub fn m<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.m = value
.try_into()
.map_err(|e| format!("error converting supplied value for m: {e}"));
self
}
pub fn r<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.r = value
.try_into()
.map_err(|e| format!("error converting supplied value for r: {e}"));
self
}
pub fn t<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.t = value
.try_into()
.map_err(|e| format!("error converting supplied value for t: {e}"));
self
}
pub fn v<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.v = value
.try_into()
.map_err(|e| format!("error converting supplied value for v: {e}"));
self
}
}
impl ::std::convert::TryFrom<OptionPricing> for super::OptionPricing {
type Error = super::error::ConversionError;
fn try_from(
value: OptionPricing,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ai: value.ai?,
bi: value.bi?,
d: value.d?,
df: value.df?,
f: value.f?,
g: value.g?,
i: value.i?,
m: value.m?,
r: value.r?,
t: value.t?,
v: value.v?,
})
}
}
impl ::std::convert::From<super::OptionPricing> for OptionPricing {
fn from(value: super::OptionPricing) -> Self {
Self {
ai: Ok(value.ai),
bi: Ok(value.bi),
d: Ok(value.d),
df: Ok(value.df),
f: Ok(value.f),
g: Ok(value.g),
i: Ok(value.i),
m: Ok(value.m),
r: Ok(value.r),
t: Ok(value.t),
v: Ok(value.v),
}
}
}
#[derive(Clone, Debug)]
pub struct OptionSettlementHistoryResponse {
settlements: ::std::result::Result<
::std::vec::Vec<super::OptionSettlementResponse>,
::std::string::String,
>,
}
impl ::std::default::Default for OptionSettlementHistoryResponse {
fn default() -> Self {
Self {
settlements: Err("no value supplied for settlements".to_string()),
}
}
}
impl OptionSettlementHistoryResponse {
pub fn settlements<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::OptionSettlementResponse>>,
T::Error: ::std::fmt::Display,
{
self.settlements = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for settlements: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OptionSettlementHistoryResponse>
for super::OptionSettlementHistoryResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OptionSettlementHistoryResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
settlements: value.settlements?,
})
}
}
impl ::std::convert::From<super::OptionSettlementHistoryResponse>
for OptionSettlementHistoryResponse {
fn from(value: super::OptionSettlementHistoryResponse) -> Self {
Self {
settlements: Ok(value.settlements),
}
}
}
#[derive(Clone, Debug)]
pub struct OptionSettlementPricesResult {
expiries: ::std::result::Result<
::std::vec::Vec<super::ExpirySettlementPrice>,
::std::string::String,
>,
}
impl ::std::default::Default for OptionSettlementPricesResult {
fn default() -> Self {
Self {
expiries: Err("no value supplied for expiries".to_string()),
}
}
}
impl OptionSettlementPricesResult {
pub fn expiries<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ExpirySettlementPrice>>,
T::Error: ::std::fmt::Display,
{
self.expiries = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiries: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OptionSettlementPricesResult>
for super::OptionSettlementPricesResult {
type Error = super::error::ConversionError;
fn try_from(
value: OptionSettlementPricesResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { expiries: value.expiries? })
}
}
impl ::std::convert::From<super::OptionSettlementPricesResult>
for OptionSettlementPricesResult {
fn from(value: super::OptionSettlementPricesResult) -> Self {
Self {
expiries: Ok(value.expiries),
}
}
}
#[derive(Clone, Debug)]
pub struct OptionSettlementResponse {
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
expiry: ::std::result::Result<u64, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
settlement_price: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
settlement_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for OptionSettlementResponse {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
settlement_price: Err(
"no value supplied for settlement_price".to_string(),
),
settlement_value: Err(
"no value supplied for settlement_value".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl OptionSettlementResponse {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn settlement_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.settlement_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for settlement_price: {e}")
});
self
}
pub fn settlement_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.settlement_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for settlement_value: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OptionSettlementResponse>
for super::OptionSettlementResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OptionSettlementResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
expiry: value.expiry?,
instrument_name: value.instrument_name?,
settlement_price: value.settlement_price?,
settlement_value: value.settlement_value?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::OptionSettlementResponse>
for OptionSettlementResponse {
fn from(value: super::OptionSettlementResponse) -> Self {
Self {
amount: Ok(value.amount),
expiry: Ok(value.expiry),
instrument_name: Ok(value.instrument_name),
settlement_price: Ok(value.settlement_price),
settlement_value: Ok(value.settlement_value),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct OracleSignatureDataResponse {
signatures: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
signers: ::std::result::Result<
::std::vec::Vec<super::Address>,
::std::string::String,
>,
}
impl ::std::default::Default for OracleSignatureDataResponse {
fn default() -> Self {
Self {
signatures: Err("no value supplied for signatures".to_string()),
signers: Err("no value supplied for signers".to_string()),
}
}
}
impl OracleSignatureDataResponse {
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn signers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Address>>,
T::Error: ::std::fmt::Display,
{
self.signers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signers: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OracleSignatureDataResponse>
for super::OracleSignatureDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OracleSignatureDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
signatures: value.signatures?,
signers: value.signers?,
})
}
}
impl ::std::convert::From<super::OracleSignatureDataResponse>
for OracleSignatureDataResponse {
fn from(value: super::OracleSignatureDataResponse) -> Self {
Self {
signatures: Ok(value.signatures),
signers: Ok(value.signers),
}
}
}
#[derive(Clone, Debug)]
pub struct Order {
algo_duration_sec: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_num_slices: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_slices_completed: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_type: ::std::result::Result<
::std::option::Option<super::AlgoType>,
::std::string::String,
>,
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
average_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
cancel_reason: ::std::result::Result<super::CancelReason, ::std::string::String>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
filled_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
limit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
order_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
order_id: ::std::result::Result<::std::string::String, ::std::string::String>,
order_status: ::std::result::Result<super::OrderStatus, ::std::string::String>,
order_type: ::std::result::Result<super::OrderType, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
replaced_order_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signed_limit_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
time_in_force: ::std::result::Result<super::TimeInForce, ::std::string::String>,
trigger_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
trigger_price_type: ::std::result::Result<
::std::option::Option<super::TriggerPriceType>,
::std::string::String,
>,
trigger_reject_message: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
trigger_type: ::std::result::Result<
::std::option::Option<super::TriggerType>,
::std::string::String,
>,
}
impl ::std::default::Default for Order {
fn default() -> Self {
Self {
algo_duration_sec: Ok(Default::default()),
algo_num_slices: Ok(Default::default()),
algo_slices_completed: Ok(Default::default()),
algo_type: Ok(Default::default()),
amount: Err("no value supplied for amount".to_string()),
average_price: Err("no value supplied for average_price".to_string()),
cancel_reason: Ok(super::defaults::order_cancel_reason()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Err("no value supplied for extra_fee".to_string()),
filled_amount: Err("no value supplied for filled_amount".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Ok(Default::default()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
limit_price: Err("no value supplied for limit_price".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Err("no value supplied for mmp".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
order_fee: Err("no value supplied for order_fee".to_string()),
order_id: Err("no value supplied for order_id".to_string()),
order_status: Err("no value supplied for order_status".to_string()),
order_type: Err("no value supplied for order_type".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
replaced_order_id: Err(
"no value supplied for replaced_order_id".to_string(),
),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signed_limit_price: Err(
"no value supplied for signed_limit_price".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
time_in_force: Err("no value supplied for time_in_force".to_string()),
trigger_price: Err("no value supplied for trigger_price".to_string()),
trigger_price_type: Ok(Default::default()),
trigger_reject_message: Ok(Default::default()),
trigger_type: Ok(Default::default()),
}
}
}
impl Order {
pub fn algo_duration_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_duration_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_duration_sec: {e}")
});
self
}
pub fn algo_num_slices<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_num_slices = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_num_slices: {e}")
});
self
}
pub fn algo_slices_completed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_slices_completed = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for algo_slices_completed: {e}"
)
});
self
}
pub fn algo_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AlgoType>>,
T::Error: ::std::fmt::Display,
{
self.algo_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_type: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn average_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.average_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for average_price: {e}")
});
self
}
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn filled_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.filled_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_amount: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.limit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for limit_price: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn order_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.order_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_fee: {e}")
});
self
}
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn order_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderStatus>,
T::Error: ::std::fmt::Display,
{
self.order_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_status: {e}")
});
self
}
pub fn order_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderType>,
T::Error: ::std::fmt::Display,
{
self.order_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_type: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn replaced_order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.replaced_order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for replaced_order_id: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signed_limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.signed_limit_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signed_limit_price: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn time_in_force<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TimeInForce>,
T::Error: ::std::fmt::Display,
{
self.time_in_force = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for time_in_force: {e}")
});
self
}
pub fn trigger_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_price: {e}")
});
self
}
pub fn trigger_price_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerPriceType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price_type = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for trigger_price_type: {e}"
)
});
self
}
pub fn trigger_reject_message<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.trigger_reject_message = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for trigger_reject_message: {e}"
)
});
self
}
pub fn trigger_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Order> for super::Order {
type Error = super::error::ConversionError;
fn try_from(
value: Order,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
algo_duration_sec: value.algo_duration_sec?,
algo_num_slices: value.algo_num_slices?,
algo_slices_completed: value.algo_slices_completed?,
algo_type: value.algo_type?,
amount: value.amount?,
average_price: value.average_price?,
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
direction: value.direction?,
extra_fee: value.extra_fee?,
filled_amount: value.filled_amount?,
instrument_name: value.instrument_name?,
is_transfer: value.is_transfer?,
label: value.label?,
last_update_timestamp: value.last_update_timestamp?,
limit_price: value.limit_price?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
order_fee: value.order_fee?,
order_id: value.order_id?,
order_status: value.order_status?,
order_type: value.order_type?,
quote_id: value.quote_id?,
replaced_order_id: value.replaced_order_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signed_limit_price: value.signed_limit_price?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
time_in_force: value.time_in_force?,
trigger_price: value.trigger_price?,
trigger_price_type: value.trigger_price_type?,
trigger_reject_message: value.trigger_reject_message?,
trigger_type: value.trigger_type?,
})
}
}
impl ::std::convert::From<super::Order> for Order {
fn from(value: super::Order) -> Self {
Self {
algo_duration_sec: Ok(value.algo_duration_sec),
algo_num_slices: Ok(value.algo_num_slices),
algo_slices_completed: Ok(value.algo_slices_completed),
algo_type: Ok(value.algo_type),
amount: Ok(value.amount),
average_price: Ok(value.average_price),
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
filled_amount: Ok(value.filled_amount),
instrument_name: Ok(value.instrument_name),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
last_update_timestamp: Ok(value.last_update_timestamp),
limit_price: Ok(value.limit_price),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
order_fee: Ok(value.order_fee),
order_id: Ok(value.order_id),
order_status: Ok(value.order_status),
order_type: Ok(value.order_type),
quote_id: Ok(value.quote_id),
replaced_order_id: Ok(value.replaced_order_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signed_limit_price: Ok(value.signed_limit_price),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
time_in_force: Ok(value.time_in_force),
trigger_price: Ok(value.trigger_price),
trigger_price_type: Ok(value.trigger_price_type),
trigger_reject_message: Ok(value.trigger_reject_message),
trigger_type: Ok(value.trigger_type),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderActionDataResponse {
asset_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
asset_sub_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
desired_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
is_bid: ::std::result::Result<bool, ::std::string::String>,
limit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
recipient_id: ::std::result::Result<u64, ::std::string::String>,
worst_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
}
impl ::std::default::Default for OrderActionDataResponse {
fn default() -> Self {
Self {
asset_address: Err("no value supplied for asset_address".to_string()),
asset_sub_id: Err("no value supplied for asset_sub_id".to_string()),
desired_amount: Err("no value supplied for desired_amount".to_string()),
is_bid: Err("no value supplied for is_bid".to_string()),
limit_price: Err("no value supplied for limit_price".to_string()),
recipient_id: Err("no value supplied for recipient_id".to_string()),
worst_fee: Err("no value supplied for worst_fee".to_string()),
}
}
}
impl OrderActionDataResponse {
pub fn asset_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_address: {e}")
});
self
}
pub fn asset_sub_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_sub_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_sub_id: {e}")
});
self
}
pub fn desired_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.desired_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for desired_amount: {e}")
});
self
}
pub fn is_bid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_bid = value
.try_into()
.map_err(|e| format!("error converting supplied value for is_bid: {e}"));
self
}
pub fn limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.limit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for limit_price: {e}")
});
self
}
pub fn recipient_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.recipient_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recipient_id: {e}")
});
self
}
pub fn worst_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.worst_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for worst_fee: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderActionDataResponse>
for super::OrderActionDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OrderActionDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
asset_address: value.asset_address?,
asset_sub_id: value.asset_sub_id?,
desired_amount: value.desired_amount?,
is_bid: value.is_bid?,
limit_price: value.limit_price?,
recipient_id: value.recipient_id?,
worst_fee: value.worst_fee?,
})
}
}
impl ::std::convert::From<super::OrderActionDataResponse>
for OrderActionDataResponse {
fn from(value: super::OrderActionDataResponse) -> Self {
Self {
asset_address: Ok(value.asset_address),
asset_sub_id: Ok(value.asset_sub_id),
desired_amount: Ok(value.desired_amount),
is_bid: Ok(value.is_bid),
limit_price: Ok(value.limit_price),
recipient_id: Ok(value.recipient_id),
worst_fee: Ok(value.worst_fee),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderActionInputData {
data: ::std::result::Result<
super::OrderActionDataResponse,
::std::string::String,
>,
expiry: ::std::result::Result<u64, ::std::string::String>,
module: ::std::result::Result<::std::string::String, ::std::string::String>,
nonce: ::std::result::Result<u64, ::std::string::String>,
owner: ::std::result::Result<::std::string::String, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for OrderActionInputData {
fn default() -> Self {
Self {
data: Err("no value supplied for data".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
module: Err("no value supplied for module".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
owner: Err("no value supplied for owner".to_string()),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl OrderActionInputData {
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderActionDataResponse>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn module<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.module = value
.try_into()
.map_err(|e| format!("error converting supplied value for module: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn owner<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.owner = value
.try_into()
.map_err(|e| format!("error converting supplied value for owner: {e}"));
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderActionInputData> for super::OrderActionInputData {
type Error = super::error::ConversionError;
fn try_from(
value: OrderActionInputData,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
data: value.data?,
expiry: value.expiry?,
module: value.module?,
nonce: value.nonce?,
owner: value.owner?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::OrderActionInputData> for OrderActionInputData {
fn from(value: super::OrderActionInputData) -> Self {
Self {
data: Ok(value.data),
expiry: Ok(value.expiry),
module: Ok(value.module),
nonce: Ok(value.nonce),
owner: Ok(value.owner),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderCreatedResponse {
order: ::std::result::Result<super::Order, ::std::string::String>,
trades: ::std::result::Result<
::std::vec::Vec<super::Trade>,
::std::string::String,
>,
}
impl ::std::default::Default for OrderCreatedResponse {
fn default() -> Self {
Self {
order: Err("no value supplied for order".to_string()),
trades: Err("no value supplied for trades".to_string()),
}
}
}
impl OrderCreatedResponse {
pub fn order<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Order>,
T::Error: ::std::fmt::Display,
{
self.order = value
.try_into()
.map_err(|e| format!("error converting supplied value for order: {e}"));
self
}
pub fn trades<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Trade>>,
T::Error: ::std::fmt::Display,
{
self.trades = value
.try_into()
.map_err(|e| format!("error converting supplied value for trades: {e}"));
self
}
}
impl ::std::convert::TryFrom<OrderCreatedResponse> for super::OrderCreatedResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OrderCreatedResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
order: value.order?,
trades: value.trades?,
})
}
}
impl ::std::convert::From<super::OrderCreatedResponse> for OrderCreatedResponse {
fn from(value: super::OrderCreatedResponse) -> Self {
Self {
order: Ok(value.order),
trades: Ok(value.trades),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderDebugResponse {
action_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
action_typehash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
domain_separator: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
encoded_data: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
encoded_data_hashed: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
expected_signer: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
input_data: ::std::result::Result<
super::OrderActionInputData,
::std::string::String,
>,
module: ::std::result::Result<::std::string::String, ::std::string::String>,
owner: ::std::result::Result<::std::string::String, ::std::string::String>,
recovered_signer: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
typed_data_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for OrderDebugResponse {
fn default() -> Self {
Self {
action_hash: Err("no value supplied for action_hash".to_string()),
action_typehash: Err(
"no value supplied for action_typehash".to_string(),
),
domain_separator: Err(
"no value supplied for domain_separator".to_string(),
),
encoded_data: Err("no value supplied for encoded_data".to_string()),
encoded_data_hashed: Err(
"no value supplied for encoded_data_hashed".to_string(),
),
expected_signer: Err(
"no value supplied for expected_signer".to_string(),
),
input_data: Err("no value supplied for input_data".to_string()),
module: Err("no value supplied for module".to_string()),
owner: Err("no value supplied for owner".to_string()),
recovered_signer: Ok(Default::default()),
typed_data_hash: Err("no value supplied for typed_data_hash".to_string()),
}
}
}
impl OrderDebugResponse {
pub fn action_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_hash: {e}")
});
self
}
pub fn action_typehash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_typehash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_typehash: {e}")
});
self
}
pub fn domain_separator<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.domain_separator = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for domain_separator: {e}")
});
self
}
pub fn encoded_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for encoded_data: {e}")
});
self
}
pub fn encoded_data_hashed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data_hashed = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for encoded_data_hashed: {e}"
)
});
self
}
pub fn expected_signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.expected_signer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expected_signer: {e}")
});
self
}
pub fn input_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderActionInputData>,
T::Error: ::std::fmt::Display,
{
self.input_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for input_data: {e}")
});
self
}
pub fn module<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.module = value
.try_into()
.map_err(|e| format!("error converting supplied value for module: {e}"));
self
}
pub fn owner<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.owner = value
.try_into()
.map_err(|e| format!("error converting supplied value for owner: {e}"));
self
}
pub fn recovered_signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.recovered_signer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recovered_signer: {e}")
});
self
}
pub fn typed_data_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.typed_data_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for typed_data_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderDebugResponse> for super::OrderDebugResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OrderDebugResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_hash: value.action_hash?,
action_typehash: value.action_typehash?,
domain_separator: value.domain_separator?,
encoded_data: value.encoded_data?,
encoded_data_hashed: value.encoded_data_hashed?,
expected_signer: value.expected_signer?,
input_data: value.input_data?,
module: value.module?,
owner: value.owner?,
recovered_signer: value.recovered_signer?,
typed_data_hash: value.typed_data_hash?,
})
}
}
impl ::std::convert::From<super::OrderDebugResponse> for OrderDebugResponse {
fn from(value: super::OrderDebugResponse) -> Self {
Self {
action_hash: Ok(value.action_hash),
action_typehash: Ok(value.action_typehash),
domain_separator: Ok(value.domain_separator),
encoded_data: Ok(value.encoded_data),
encoded_data_hashed: Ok(value.encoded_data_hashed),
expected_signer: Ok(value.expected_signer),
input_data: Ok(value.input_data),
module: Ok(value.module),
owner: Ok(value.owner),
recovered_signer: Ok(value.recovered_signer),
typed_data_hash: Ok(value.typed_data_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderQuoteRequest {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
client: ::std::result::Result<::std::string::String, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_atomic_signing: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
limit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
order_type: ::std::result::Result<super::OrderType, ::std::string::String>,
reduce_only: ::std::result::Result<bool, ::std::string::String>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
reject_post_only: ::std::result::Result<bool, ::std::string::String>,
reject_timestamp: ::std::result::Result<i64, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
time_in_force: ::std::result::Result<super::TimeInForce, ::std::string::String>,
trigger_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
trigger_price_type: ::std::result::Result<
::std::option::Option<super::TriggerPriceType>,
::std::string::String,
>,
trigger_type: ::std::result::Result<
::std::option::Option<super::TriggerType>,
::std::string::String,
>,
}
impl ::std::default::Default for OrderQuoteRequest {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Ok(Default::default()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_atomic_signing: Ok(Default::default()),
label: Ok(Default::default()),
limit_price: Err("no value supplied for limit_price".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
order_type: Ok(super::defaults::order_quote_request_order_type()),
reduce_only: Ok(Default::default()),
referral_code: Ok(Default::default()),
reject_post_only: Ok(super::defaults::default_bool::<true>()),
reject_timestamp: Ok(
super::defaults::default_u64::<i64, 9223372036854775807>(),
),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
time_in_force: Ok(super::defaults::order_quote_request_time_in_force()),
trigger_price: Ok(Default::default()),
trigger_price_type: Ok(Default::default()),
trigger_type: Ok(Default::default()),
}
}
}
impl OrderQuoteRequest {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_atomic_signing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_atomic_signing = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_atomic_signing: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.limit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for limit_price: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn order_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderType>,
T::Error: ::std::fmt::Display,
{
self.order_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_type: {e}")
});
self
}
pub fn reduce_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.reduce_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reduce_only: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn reject_post_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.reject_post_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_post_only: {e}")
});
self
}
pub fn reject_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.reject_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_timestamp: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn time_in_force<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TimeInForce>,
T::Error: ::std::fmt::Display,
{
self.time_in_force = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for time_in_force: {e}")
});
self
}
pub fn trigger_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_price: {e}")
});
self
}
pub fn trigger_price_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerPriceType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price_type = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for trigger_price_type: {e}"
)
});
self
}
pub fn trigger_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderQuoteRequest> for super::OrderQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: OrderQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
client: value.client?,
direction: value.direction?,
extra_fee: value.extra_fee?,
instrument_name: value.instrument_name?,
is_atomic_signing: value.is_atomic_signing?,
label: value.label?,
limit_price: value.limit_price?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
order_type: value.order_type?,
reduce_only: value.reduce_only?,
referral_code: value.referral_code?,
reject_post_only: value.reject_post_only?,
reject_timestamp: value.reject_timestamp?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
time_in_force: value.time_in_force?,
trigger_price: value.trigger_price?,
trigger_price_type: value.trigger_price_type?,
trigger_type: value.trigger_type?,
})
}
}
impl ::std::convert::From<super::OrderQuoteRequest> for OrderQuoteRequest {
fn from(value: super::OrderQuoteRequest) -> Self {
Self {
amount: Ok(value.amount),
client: Ok(value.client),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
instrument_name: Ok(value.instrument_name),
is_atomic_signing: Ok(value.is_atomic_signing),
label: Ok(value.label),
limit_price: Ok(value.limit_price),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
order_type: Ok(value.order_type),
reduce_only: Ok(value.reduce_only),
referral_code: Ok(value.referral_code),
reject_post_only: Ok(value.reject_post_only),
reject_timestamp: Ok(value.reject_timestamp),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
time_in_force: Ok(value.time_in_force),
trigger_price: Ok(value.trigger_price),
trigger_price_type: Ok(value.trigger_price_type),
trigger_type: Ok(value.trigger_type),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderQuoteResponse {
estimated_fee: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_fill_amount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_fill_price: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_order_status: ::std::result::Result<
super::OrderStatus,
::std::string::String,
>,
estimated_realized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
estimated_realized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
invalid_reason: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
is_valid: ::std::result::Result<bool, ::std::string::String>,
max_amount: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
post_initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
post_liquidation_price: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
pre_initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
suggested_max_fee: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for OrderQuoteResponse {
fn default() -> Self {
Self {
estimated_fee: Err("no value supplied for estimated_fee".to_string()),
estimated_fill_amount: Err(
"no value supplied for estimated_fill_amount".to_string(),
),
estimated_fill_price: Err(
"no value supplied for estimated_fill_price".to_string(),
),
estimated_order_status: Err(
"no value supplied for estimated_order_status".to_string(),
),
estimated_realized_pnl: Err(
"no value supplied for estimated_realized_pnl".to_string(),
),
estimated_realized_pnl_excl_fees: Err(
"no value supplied for estimated_realized_pnl_excl_fees".to_string(),
),
invalid_reason: Ok(Default::default()),
is_valid: Err("no value supplied for is_valid".to_string()),
max_amount: Ok(Default::default()),
post_initial_margin: Err(
"no value supplied for post_initial_margin".to_string(),
),
post_liquidation_price: Ok(Default::default()),
pre_initial_margin: Err(
"no value supplied for pre_initial_margin".to_string(),
),
suggested_max_fee: Err(
"no value supplied for suggested_max_fee".to_string(),
),
}
}
}
impl OrderQuoteResponse {
pub fn estimated_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for estimated_fee: {e}")
});
self
}
pub fn estimated_fill_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_fill_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_fill_amount: {e}"
)
});
self
}
pub fn estimated_fill_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_fill_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_fill_price: {e}"
)
});
self
}
pub fn estimated_order_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderStatus>,
T::Error: ::std::fmt::Display,
{
self.estimated_order_status = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_order_status: {e}"
)
});
self
}
pub fn estimated_realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_realized_pnl = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_realized_pnl: {e}"
)
});
self
}
pub fn estimated_realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.estimated_realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn invalid_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.invalid_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for invalid_reason: {e}")
});
self
}
pub fn is_valid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_valid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_valid: {e}")
});
self
}
pub fn max_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.max_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_amount: {e}")
});
self
}
pub fn post_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.post_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for post_initial_margin: {e}"
)
});
self
}
pub fn post_liquidation_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.post_liquidation_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for post_liquidation_price: {e}"
)
});
self
}
pub fn pre_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pre_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for pre_initial_margin: {e}"
)
});
self
}
pub fn suggested_max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.suggested_max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for suggested_max_fee: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderQuoteResponse> for super::OrderQuoteResponse {
type Error = super::error::ConversionError;
fn try_from(
value: OrderQuoteResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
estimated_fee: value.estimated_fee?,
estimated_fill_amount: value.estimated_fill_amount?,
estimated_fill_price: value.estimated_fill_price?,
estimated_order_status: value.estimated_order_status?,
estimated_realized_pnl: value.estimated_realized_pnl?,
estimated_realized_pnl_excl_fees: value
.estimated_realized_pnl_excl_fees?,
invalid_reason: value.invalid_reason?,
is_valid: value.is_valid?,
max_amount: value.max_amount?,
post_initial_margin: value.post_initial_margin?,
post_liquidation_price: value.post_liquidation_price?,
pre_initial_margin: value.pre_initial_margin?,
suggested_max_fee: value.suggested_max_fee?,
})
}
}
impl ::std::convert::From<super::OrderQuoteResponse> for OrderQuoteResponse {
fn from(value: super::OrderQuoteResponse) -> Self {
Self {
estimated_fee: Ok(value.estimated_fee),
estimated_fill_amount: Ok(value.estimated_fill_amount),
estimated_fill_price: Ok(value.estimated_fill_price),
estimated_order_status: Ok(value.estimated_order_status),
estimated_realized_pnl: Ok(value.estimated_realized_pnl),
estimated_realized_pnl_excl_fees: Ok(
value.estimated_realized_pnl_excl_fees,
),
invalid_reason: Ok(value.invalid_reason),
is_valid: Ok(value.is_valid),
max_amount: Ok(value.max_amount),
post_initial_margin: Ok(value.post_initial_margin),
post_liquidation_price: Ok(value.post_liquidation_price),
pre_initial_margin: Ok(value.pre_initial_margin),
suggested_max_fee: Ok(value.suggested_max_fee),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderSnapshot {
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
price: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for OrderSnapshot {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
price: Err("no value supplied for price".to_string()),
}
}
}
impl OrderSnapshot {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
}
impl ::std::convert::TryFrom<OrderSnapshot> for super::OrderSnapshot {
type Error = super::error::ConversionError;
fn try_from(
value: OrderSnapshot,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
price: value.price?,
})
}
}
impl ::std::convert::From<super::OrderSnapshot> for OrderSnapshot {
fn from(value: super::OrderSnapshot) -> Self {
Self {
amount: Ok(value.amount),
price: Ok(value.price),
}
}
}
#[derive(Clone, Debug)]
pub struct OrderbookSnapshot {
asks: ::std::result::Result<
::std::vec::Vec<super::OrderSnapshot>,
::std::string::String,
>,
bids: ::std::result::Result<
::std::vec::Vec<super::OrderSnapshot>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
publish_id: ::std::result::Result<u64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for OrderbookSnapshot {
fn default() -> Self {
Self {
asks: Err("no value supplied for asks".to_string()),
bids: Err("no value supplied for bids".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
publish_id: Err("no value supplied for publish_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl OrderbookSnapshot {
pub fn asks<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::OrderSnapshot>>,
T::Error: ::std::fmt::Display,
{
self.asks = value
.try_into()
.map_err(|e| format!("error converting supplied value for asks: {e}"));
self
}
pub fn bids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::OrderSnapshot>>,
T::Error: ::std::fmt::Display,
{
self.bids = value
.try_into()
.map_err(|e| format!("error converting supplied value for bids: {e}"));
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn publish_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.publish_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for publish_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<OrderbookSnapshot> for super::OrderbookSnapshot {
type Error = super::error::ConversionError;
fn try_from(
value: OrderbookSnapshot,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
asks: value.asks?,
bids: value.bids?,
instrument_name: value.instrument_name?,
publish_id: value.publish_id?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::OrderbookSnapshot> for OrderbookSnapshot {
fn from(value: super::OrderbookSnapshot) -> Self {
Self {
asks: Ok(value.asks),
bids: Ok(value.bids),
instrument_name: Ok(value.instrument_name),
publish_id: Ok(value.publish_id),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct PaginatedOrdersResult {
orders: ::std::result::Result<
::std::vec::Vec<super::Order>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for PaginatedOrdersResult {
fn default() -> Self {
Self {
orders: Err("no value supplied for orders".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PaginatedOrdersResult {
pub fn orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Order>>,
T::Error: ::std::fmt::Display,
{
self.orders = value
.try_into()
.map_err(|e| format!("error converting supplied value for orders: {e}"));
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PaginatedOrdersResult>
for super::PaginatedOrdersResult {
type Error = super::error::ConversionError;
fn try_from(
value: PaginatedOrdersResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
orders: value.orders?,
pagination: value.pagination?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PaginatedOrdersResult> for PaginatedOrdersResult {
fn from(value: super::PaginatedOrdersResult) -> Self {
Self {
orders: Ok(value.orders),
pagination: Ok(value.pagination),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PaginatedTradesResult {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
trades: ::std::result::Result<
::std::vec::Vec<super::TradeHistoryResponse>,
::std::string::String,
>,
}
impl ::std::default::Default for PaginatedTradesResult {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
trades: Err("no value supplied for trades".to_string()),
}
}
}
impl PaginatedTradesResult {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn trades<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::TradeHistoryResponse>>,
T::Error: ::std::fmt::Display,
{
self.trades = value
.try_into()
.map_err(|e| format!("error converting supplied value for trades: {e}"));
self
}
}
impl ::std::convert::TryFrom<PaginatedTradesResult>
for super::PaginatedTradesResult {
type Error = super::error::ConversionError;
fn try_from(
value: PaginatedTradesResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
subaccount_id: value.subaccount_id?,
trades: value.trades?,
})
}
}
impl ::std::convert::From<super::PaginatedTradesResult> for PaginatedTradesResult {
fn from(value: super::PaginatedTradesResult) -> Self {
Self {
pagination: Ok(value.pagination),
subaccount_id: Ok(value.subaccount_id),
trades: Ok(value.trades),
}
}
}
#[derive(Clone, Debug)]
pub struct PaginatedVaultActionHistory {
events: ::std::result::Result<
::std::vec::Vec<super::PublicVaultActionResponse>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PaginatedVaultActionHistory {
fn default() -> Self {
Self {
events: Err("no value supplied for events".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PaginatedVaultActionHistory {
pub fn events<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PublicVaultActionResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.events = value
.try_into()
.map_err(|e| format!("error converting supplied value for events: {e}"));
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PaginatedVaultActionHistory>
for super::PaginatedVaultActionHistory {
type Error = super::error::ConversionError;
fn try_from(
value: PaginatedVaultActionHistory,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
events: value.events?,
pagination: value.pagination?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PaginatedVaultActionHistory>
for PaginatedVaultActionHistory {
fn from(value: super::PaginatedVaultActionHistory) -> Self {
Self {
events: Ok(value.events),
pagination: Ok(value.pagination),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PaginatedVaultRequestHistory {
actions: ::std::result::Result<
::std::vec::Vec<super::VaultActionResponse>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for PaginatedVaultRequestHistory {
fn default() -> Self {
Self {
actions: Err("no value supplied for actions".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl PaginatedVaultRequestHistory {
pub fn actions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VaultActionResponse>>,
T::Error: ::std::fmt::Display,
{
self.actions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for actions: {e}")
});
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<PaginatedVaultRequestHistory>
for super::PaginatedVaultRequestHistory {
type Error = super::error::ConversionError;
fn try_from(
value: PaginatedVaultRequestHistory,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
actions: value.actions?,
pagination: value.pagination?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::PaginatedVaultRequestHistory>
for PaginatedVaultRequestHistory {
fn from(value: super::PaginatedVaultRequestHistory) -> Self {
Self {
actions: Ok(value.actions),
pagination: Ok(value.pagination),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct Pagination {
count: ::std::result::Result<u64, ::std::string::String>,
num_pages: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for Pagination {
fn default() -> Self {
Self {
count: Err("no value supplied for count".to_string()),
num_pages: Err("no value supplied for num_pages".to_string()),
}
}
}
impl Pagination {
pub fn count<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.count = value
.try_into()
.map_err(|e| format!("error converting supplied value for count: {e}"));
self
}
pub fn num_pages<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.num_pages = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for num_pages: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Pagination> for super::Pagination {
type Error = super::error::ConversionError;
fn try_from(
value: Pagination,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
count: value.count?,
num_pages: value.num_pages?,
})
}
}
impl ::std::convert::From<super::Pagination> for Pagination {
fn from(value: super::Pagination) -> Self {
Self {
count: Ok(value.count),
num_pages: Ok(value.num_pages),
}
}
}
#[derive(Clone, Debug)]
pub struct PendingDepositEntry {
action_id: ::std::result::Result<u64, ::std::string::String>,
action_type: ::std::result::Result<::std::string::String, ::std::string::String>,
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
asset: ::std::result::Result<::std::string::String, ::std::string::String>,
block_number: ::std::result::Result<u64, ::std::string::String>,
credit_nonce: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
deposit_type: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
log_index: ::std::result::Result<u64, ::std::string::String>,
manager_id: ::std::result::Result<u32, ::std::string::String>,
status: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
tx_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
updated_at_ms: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for PendingDepositEntry {
fn default() -> Self {
Self {
action_id: Err("no value supplied for action_id".to_string()),
action_type: Err("no value supplied for action_type".to_string()),
amount: Err("no value supplied for amount".to_string()),
asset: Err("no value supplied for asset".to_string()),
block_number: Err("no value supplied for block_number".to_string()),
credit_nonce: Ok(Default::default()),
deposit_type: Err("no value supplied for deposit_type".to_string()),
log_index: Err("no value supplied for log_index".to_string()),
manager_id: Err("no value supplied for manager_id".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
tx_hash: Err("no value supplied for tx_hash".to_string()),
updated_at_ms: Err("no value supplied for updated_at_ms".to_string()),
}
}
}
impl PendingDepositEntry {
pub fn action_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.action_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_id: {e}")
});
self
}
pub fn action_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_type: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset = value
.try_into()
.map_err(|e| format!("error converting supplied value for asset: {e}"));
self
}
pub fn block_number<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.block_number = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for block_number: {e}")
});
self
}
pub fn credit_nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.credit_nonce = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for credit_nonce: {e}")
});
self
}
pub fn deposit_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.deposit_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposit_type: {e}")
});
self
}
pub fn log_index<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.log_index = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for log_index: {e}")
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
pub fn updated_at_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.updated_at_ms = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for updated_at_ms: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PendingDepositEntry> for super::PendingDepositEntry {
type Error = super::error::ConversionError;
fn try_from(
value: PendingDepositEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_id: value.action_id?,
action_type: value.action_type?,
amount: value.amount?,
asset: value.asset?,
block_number: value.block_number?,
credit_nonce: value.credit_nonce?,
deposit_type: value.deposit_type?,
log_index: value.log_index?,
manager_id: value.manager_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
tx_hash: value.tx_hash?,
updated_at_ms: value.updated_at_ms?,
})
}
}
impl ::std::convert::From<super::PendingDepositEntry> for PendingDepositEntry {
fn from(value: super::PendingDepositEntry) -> Self {
Self {
action_id: Ok(value.action_id),
action_type: Ok(value.action_type),
amount: Ok(value.amount),
asset: Ok(value.asset),
block_number: Ok(value.block_number),
credit_nonce: Ok(value.credit_nonce),
deposit_type: Ok(value.deposit_type),
log_index: Ok(value.log_index),
manager_id: Ok(value.manager_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
tx_hash: Ok(value.tx_hash),
updated_at_ms: Ok(value.updated_at_ms),
}
}
}
#[derive(Clone, Debug)]
pub struct PerpDetails {
aggregate_funding: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
funding_rate: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
index: ::std::result::Result<::std::string::String, ::std::string::String>,
max_rate_per_hour: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
min_rate_per_hour: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for PerpDetails {
fn default() -> Self {
Self {
aggregate_funding: Err(
"no value supplied for aggregate_funding".to_string(),
),
funding_rate: Err("no value supplied for funding_rate".to_string()),
index: Err("no value supplied for index".to_string()),
max_rate_per_hour: Err(
"no value supplied for max_rate_per_hour".to_string(),
),
min_rate_per_hour: Err(
"no value supplied for min_rate_per_hour".to_string(),
),
}
}
}
impl PerpDetails {
pub fn aggregate_funding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.aggregate_funding = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for aggregate_funding: {e}")
});
self
}
pub fn funding_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.funding_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for funding_rate: {e}")
});
self
}
pub fn index<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.index = value
.try_into()
.map_err(|e| format!("error converting supplied value for index: {e}"));
self
}
pub fn max_rate_per_hour<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.max_rate_per_hour = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_rate_per_hour: {e}")
});
self
}
pub fn min_rate_per_hour<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.min_rate_per_hour = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_rate_per_hour: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PerpDetails> for super::PerpDetails {
type Error = super::error::ConversionError;
fn try_from(
value: PerpDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
aggregate_funding: value.aggregate_funding?,
funding_rate: value.funding_rate?,
index: value.index?,
max_rate_per_hour: value.max_rate_per_hour?,
min_rate_per_hour: value.min_rate_per_hour?,
})
}
}
impl ::std::convert::From<super::PerpDetails> for PerpDetails {
fn from(value: super::PerpDetails) -> Self {
Self {
aggregate_funding: Ok(value.aggregate_funding),
funding_rate: Ok(value.funding_rate),
index: Ok(value.index),
max_rate_per_hour: Ok(value.max_rate_per_hour),
min_rate_per_hour: Ok(value.min_rate_per_hour),
}
}
}
#[derive(Clone, Debug)]
pub struct PerpFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
spot_diff_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
type_: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for PerpFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
spot_diff_value: Err(
"no value supplied for spot_diff_value".to_string(),
),
timestamp: Err("no value supplied for timestamp".to_string()),
type_: Err("no value supplied for type_".to_string()),
}
}
}
impl PerpFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn spot_diff_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.spot_diff_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for spot_diff_value: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn type_<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.type_ = value
.try_into()
.map_err(|e| format!("error converting supplied value for type_: {e}"));
self
}
}
impl ::std::convert::TryFrom<PerpFeedDataResponse> for super::PerpFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PerpFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
signatures: value.signatures?,
spot_diff_value: value.spot_diff_value?,
timestamp: value.timestamp?,
type_: value.type_?,
})
}
}
impl ::std::convert::From<super::PerpFeedDataResponse> for PerpFeedDataResponse {
fn from(value: super::PerpFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
signatures: Ok(value.signatures),
spot_diff_value: Ok(value.spot_diff_value),
timestamp: Ok(value.timestamp),
type_: Ok(value.type_),
}
}
}
#[derive(Clone, Debug)]
pub struct PerpSettlementEventResponse {
batch_status: ::std::result::Result<super::BatchStatus, ::std::string::String>,
batch_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
funding: ::std::result::Result<::std::string::String, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
pnl: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for PerpSettlementEventResponse {
fn default() -> Self {
Self {
batch_status: Err("no value supplied for batch_status".to_string()),
batch_uuid: Err("no value supplied for batch_uuid".to_string()),
funding: Err("no value supplied for funding".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
pnl: Err("no value supplied for pnl".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl PerpSettlementEventResponse {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BatchStatus>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn batch_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.batch_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_uuid: {e}")
});
self
}
pub fn funding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.funding = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for funding: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pnl = value
.try_into()
.map_err(|e| format!("error converting supplied value for pnl: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PerpSettlementEventResponse>
for super::PerpSettlementEventResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PerpSettlementEventResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
batch_uuid: value.batch_uuid?,
funding: value.funding?,
instrument_name: value.instrument_name?,
pnl: value.pnl?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::PerpSettlementEventResponse>
for PerpSettlementEventResponse {
fn from(value: super::PerpSettlementEventResponse) -> Self {
Self {
batch_status: Ok(value.batch_status),
batch_uuid: Ok(value.batch_uuid),
funding: Ok(value.funding),
instrument_name: Ok(value.instrument_name),
pnl: Ok(value.pnl),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct PerpSettlementHistoryResponse {
events: ::std::result::Result<
::std::vec::Vec<super::PerpSettlementEventResponse>,
::std::string::String,
>,
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
}
impl ::std::default::Default for PerpSettlementHistoryResponse {
fn default() -> Self {
Self {
events: Err("no value supplied for events".to_string()),
pagination: Err("no value supplied for pagination".to_string()),
}
}
}
impl PerpSettlementHistoryResponse {
pub fn events<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PerpSettlementEventResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.events = value
.try_into()
.map_err(|e| format!("error converting supplied value for events: {e}"));
self
}
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PerpSettlementHistoryResponse>
for super::PerpSettlementHistoryResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PerpSettlementHistoryResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
events: value.events?,
pagination: value.pagination?,
})
}
}
impl ::std::convert::From<super::PerpSettlementHistoryResponse>
for PerpSettlementHistoryResponse {
fn from(value: super::PerpSettlementHistoryResponse) -> Self {
Self {
events: Ok(value.events),
pagination: Ok(value.pagination),
}
}
}
#[derive(Clone, Debug)]
pub struct PollQuotesRequest {
from_timestamp: ::std::result::Result<i64, ::std::string::String>,
page: ::std::result::Result<u64, ::std::string::String>,
page_size: ::std::result::Result<u64, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
to_timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for PollQuotesRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
page: Ok(super::defaults::default_u64::<u64, 1>()),
page_size: Ok(super::defaults::default_u64::<u64, 20>()),
quote_id: Ok(Default::default()),
rfq_id: Ok(Default::default()),
status: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_timestamp: Ok(
super::defaults::default_u64::<i64, 9223372036854775807>(),
),
}
}
}
impl PollQuotesRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PollQuotesRequest> for super::PollQuotesRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PollQuotesRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
page: value.page?,
page_size: value.page_size?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
})
}
}
impl ::std::convert::From<super::PollQuotesRequest> for PollQuotesRequest {
fn from(value: super::PollQuotesRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct PollRfqsRequest {
from_timestamp: ::std::result::Result<i64, ::std::string::String>,
page: ::std::result::Result<u64, ::std::string::String>,
page_size: ::std::result::Result<u64, ::std::string::String>,
rfq_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rfq_subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
status: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
to_timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for PollRfqsRequest {
fn default() -> Self {
Self {
from_timestamp: Ok(Default::default()),
page: Ok(super::defaults::default_u64::<u64, 1>()),
page_size: Ok(super::defaults::default_u64::<u64, 20>()),
rfq_id: Ok(Default::default()),
rfq_subaccount_id: Ok(Default::default()),
status: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_timestamp: Ok(
super::defaults::default_u64::<i64, 9223372036854775807>(),
),
}
}
}
impl PollRfqsRequest {
pub fn from_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.from_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_timestamp: {e}")
});
self
}
pub fn page<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page = value
.try_into()
.map_err(|e| format!("error converting supplied value for page: {e}"));
self
}
pub fn page_size<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.page_size = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for page_size: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn rfq_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.rfq_subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for rfq_subaccount_id: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.to_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PollRfqsRequest> for super::PollRfqsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PollRfqsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
from_timestamp: value.from_timestamp?,
page: value.page?,
page_size: value.page_size?,
rfq_id: value.rfq_id?,
rfq_subaccount_id: value.rfq_subaccount_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
to_timestamp: value.to_timestamp?,
})
}
}
impl ::std::convert::From<super::PollRfqsRequest> for PollRfqsRequest {
fn from(value: super::PollRfqsRequest) -> Self {
Self {
from_timestamp: Ok(value.from_timestamp),
page: Ok(value.page),
page_size: Ok(value.page_size),
rfq_id: Ok(value.rfq_id),
rfq_subaccount_id: Ok(value.rfq_subaccount_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
to_timestamp: Ok(value.to_timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct Position {
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
amount_step: ::std::result::Result<::std::string::String, ::std::string::String>,
average_price: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
average_price_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
cumulative_funding: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
delta: ::std::result::Result<::std::string::String, ::std::string::String>,
gamma: ::std::result::Result<::std::string::String, ::std::string::String>,
index_price: ::std::result::Result<::std::string::String, ::std::string::String>,
initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
instrument_type: ::std::result::Result<super::AssetType, ::std::string::String>,
leverage: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
liquidation_price: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mark_price: ::std::result::Result<::std::string::String, ::std::string::String>,
mark_value: ::std::result::Result<::std::string::String, ::std::string::String>,
net_settlements: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
open_orders_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
pending_funding: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
theta: ::std::result::Result<::std::string::String, ::std::string::String>,
total_fees: ::std::result::Result<::std::string::String, ::std::string::String>,
unrealized_pnl: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
unrealized_pnl_excl_fees: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
vega: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Position {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
amount_step: Err("no value supplied for amount_step".to_string()),
average_price: Err("no value supplied for average_price".to_string()),
average_price_excl_fees: Err(
"no value supplied for average_price_excl_fees".to_string(),
),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
cumulative_funding: Err(
"no value supplied for cumulative_funding".to_string(),
),
delta: Err("no value supplied for delta".to_string()),
gamma: Err("no value supplied for gamma".to_string()),
index_price: Err("no value supplied for index_price".to_string()),
initial_margin: Err("no value supplied for initial_margin".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
instrument_type: Err(
"no value supplied for instrument_type".to_string(),
),
leverage: Ok(Default::default()),
liquidation_price: Ok(Default::default()),
maintenance_margin: Err(
"no value supplied for maintenance_margin".to_string(),
),
mark_price: Err("no value supplied for mark_price".to_string()),
mark_value: Err("no value supplied for mark_value".to_string()),
net_settlements: Err(
"no value supplied for net_settlements".to_string(),
),
open_orders_margin: Err(
"no value supplied for open_orders_margin".to_string(),
),
pending_funding: Err(
"no value supplied for pending_funding".to_string(),
),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
theta: Err("no value supplied for theta".to_string()),
total_fees: Err("no value supplied for total_fees".to_string()),
unrealized_pnl: Err("no value supplied for unrealized_pnl".to_string()),
unrealized_pnl_excl_fees: Err(
"no value supplied for unrealized_pnl_excl_fees".to_string(),
),
vega: Err("no value supplied for vega".to_string()),
}
}
}
impl Position {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn amount_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for amount_step: {e}")
});
self
}
pub fn average_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.average_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for average_price: {e}")
});
self
}
pub fn average_price_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.average_price_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for average_price_excl_fees: {e}"
)
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn cumulative_funding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.cumulative_funding = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cumulative_funding: {e}"
)
});
self
}
pub fn delta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.delta = value
.try_into()
.map_err(|e| format!("error converting supplied value for delta: {e}"));
self
}
pub fn gamma<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.gamma = value
.try_into()
.map_err(|e| format!("error converting supplied value for gamma: {e}"));
self
}
pub fn index_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.index_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for index_price: {e}")
});
self
}
pub fn initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.initial_margin = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for initial_margin: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn instrument_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AssetType>,
T::Error: ::std::fmt::Display,
{
self.instrument_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_type: {e}")
});
self
}
pub fn leverage<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.leverage = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for leverage: {e}")
});
self
}
pub fn liquidation_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.liquidation_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidation_price: {e}")
});
self
}
pub fn maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for maintenance_margin: {e}"
)
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn mark_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mark_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_value: {e}")
});
self
}
pub fn net_settlements<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.net_settlements = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for net_settlements: {e}")
});
self
}
pub fn open_orders_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open_orders_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for open_orders_margin: {e}"
)
});
self
}
pub fn pending_funding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pending_funding = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pending_funding: {e}")
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn theta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.theta = value
.try_into()
.map_err(|e| format!("error converting supplied value for theta: {e}"));
self
}
pub fn total_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.total_fees = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_fees: {e}")
});
self
}
pub fn unrealized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.unrealized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for unrealized_pnl: {e}")
});
self
}
pub fn unrealized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.unrealized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for unrealized_pnl_excl_fees: {e}"
)
});
self
}
pub fn vega<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.vega = value
.try_into()
.map_err(|e| format!("error converting supplied value for vega: {e}"));
self
}
}
impl ::std::convert::TryFrom<Position> for super::Position {
type Error = super::error::ConversionError;
fn try_from(
value: Position,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
amount_step: value.amount_step?,
average_price: value.average_price?,
average_price_excl_fees: value.average_price_excl_fees?,
creation_timestamp: value.creation_timestamp?,
cumulative_funding: value.cumulative_funding?,
delta: value.delta?,
gamma: value.gamma?,
index_price: value.index_price?,
initial_margin: value.initial_margin?,
instrument_name: value.instrument_name?,
instrument_type: value.instrument_type?,
leverage: value.leverage?,
liquidation_price: value.liquidation_price?,
maintenance_margin: value.maintenance_margin?,
mark_price: value.mark_price?,
mark_value: value.mark_value?,
net_settlements: value.net_settlements?,
open_orders_margin: value.open_orders_margin?,
pending_funding: value.pending_funding?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
theta: value.theta?,
total_fees: value.total_fees?,
unrealized_pnl: value.unrealized_pnl?,
unrealized_pnl_excl_fees: value.unrealized_pnl_excl_fees?,
vega: value.vega?,
})
}
}
impl ::std::convert::From<super::Position> for Position {
fn from(value: super::Position) -> Self {
Self {
amount: Ok(value.amount),
amount_step: Ok(value.amount_step),
average_price: Ok(value.average_price),
average_price_excl_fees: Ok(value.average_price_excl_fees),
creation_timestamp: Ok(value.creation_timestamp),
cumulative_funding: Ok(value.cumulative_funding),
delta: Ok(value.delta),
gamma: Ok(value.gamma),
index_price: Ok(value.index_price),
initial_margin: Ok(value.initial_margin),
instrument_name: Ok(value.instrument_name),
instrument_type: Ok(value.instrument_type),
leverage: Ok(value.leverage),
liquidation_price: Ok(value.liquidation_price),
maintenance_margin: Ok(value.maintenance_margin),
mark_price: Ok(value.mark_price),
mark_value: Ok(value.mark_value),
net_settlements: Ok(value.net_settlements),
open_orders_margin: Ok(value.open_orders_margin),
pending_funding: Ok(value.pending_funding),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
theta: Ok(value.theta),
total_fees: Ok(value.total_fees),
unrealized_pnl: Ok(value.unrealized_pnl),
unrealized_pnl_excl_fees: Ok(value.unrealized_pnl_excl_fees),
vega: Ok(value.vega),
}
}
}
#[derive(Clone, Debug)]
pub struct PricedLegParamsAndResponse {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
price: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
}
impl ::std::default::Default for PricedLegParamsAndResponse {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
direction: Err("no value supplied for direction".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
price: Err("no value supplied for price".to_string()),
}
}
}
impl PricedLegParamsAndResponse {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
}
impl ::std::convert::TryFrom<PricedLegParamsAndResponse>
for super::PricedLegParamsAndResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PricedLegParamsAndResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
direction: value.direction?,
instrument_name: value.instrument_name?,
price: value.price?,
})
}
}
impl ::std::convert::From<super::PricedLegParamsAndResponse>
for PricedLegParamsAndResponse {
fn from(value: super::PricedLegParamsAndResponse) -> Self {
Self {
amount: Ok(value.amount),
direction: Ok(value.direction),
instrument_name: Ok(value.instrument_name),
price: Ok(value.price),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateChangeSubaccountLabelResponse {
label: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateChangeSubaccountLabelResponse {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PrivateChangeSubaccountLabelResponse {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateChangeSubaccountLabelResponse>
for super::PrivateChangeSubaccountLabelResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateChangeSubaccountLabelResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateChangeSubaccountLabelResponse>
for PrivateChangeSubaccountLabelResponse {
fn from(value: super::PrivateChangeSubaccountLabelResponse) -> Self {
Self {
label: Ok(value.label),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateGetAccountResponse {
cancel_on_disconnect: ::std::result::Result<bool, ::std::string::String>,
creation_timestamp_sec: ::std::result::Result<
::std::option::Option<u64>,
::std::string::String,
>,
fallback_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
fee_info: ::std::result::Result<super::AccountFeeInfo, ::std::string::String>,
is_rfq_maker: ::std::result::Result<bool, ::std::string::String>,
per_endpoint_tps: ::std::result::Result<
::std::collections::HashMap<::std::string::String, u16>,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_ids: ::std::result::Result<
::std::vec::Vec<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
websocket_matching_tps: ::std::result::Result<u16, ::std::string::String>,
websocket_non_matching_tps: ::std::result::Result<u16, ::std::string::String>,
websocket_option_tps: ::std::result::Result<u16, ::std::string::String>,
websocket_perp_tps: ::std::result::Result<u16, ::std::string::String>,
whitelisted_recipients: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for PrivateGetAccountResponse {
fn default() -> Self {
Self {
cancel_on_disconnect: Err(
"no value supplied for cancel_on_disconnect".to_string(),
),
creation_timestamp_sec: Ok(Default::default()),
fallback_subaccount_id: Err(
"no value supplied for fallback_subaccount_id".to_string(),
),
fee_info: Err("no value supplied for fee_info".to_string()),
is_rfq_maker: Err("no value supplied for is_rfq_maker".to_string()),
per_endpoint_tps: Err(
"no value supplied for per_endpoint_tps".to_string(),
),
referral_code: Ok(Default::default()),
subaccount_ids: Err("no value supplied for subaccount_ids".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
websocket_matching_tps: Err(
"no value supplied for websocket_matching_tps".to_string(),
),
websocket_non_matching_tps: Err(
"no value supplied for websocket_non_matching_tps".to_string(),
),
websocket_option_tps: Err(
"no value supplied for websocket_option_tps".to_string(),
),
websocket_perp_tps: Err(
"no value supplied for websocket_perp_tps".to_string(),
),
whitelisted_recipients: Err(
"no value supplied for whitelisted_recipients".to_string(),
),
}
}
}
impl PrivateGetAccountResponse {
pub fn cancel_on_disconnect<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.cancel_on_disconnect = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cancel_on_disconnect: {e}"
)
});
self
}
pub fn creation_timestamp_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u64>>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp_sec: {e}"
)
});
self
}
pub fn fallback_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.fallback_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for fallback_subaccount_id: {e}"
)
});
self
}
pub fn fee_info<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::AccountFeeInfo>,
T::Error: ::std::fmt::Display,
{
self.fee_info = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fee_info: {e}")
});
self
}
pub fn is_rfq_maker<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_rfq_maker = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_rfq_maker: {e}")
});
self
}
pub fn per_endpoint_tps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, u16>,
>,
T::Error: ::std::fmt::Display,
{
self.per_endpoint_tps = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for per_endpoint_tps: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
pub fn websocket_matching_tps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.websocket_matching_tps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for websocket_matching_tps: {e}"
)
});
self
}
pub fn websocket_non_matching_tps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.websocket_non_matching_tps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for websocket_non_matching_tps: {e}"
)
});
self
}
pub fn websocket_option_tps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.websocket_option_tps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for websocket_option_tps: {e}"
)
});
self
}
pub fn websocket_perp_tps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.websocket_perp_tps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for websocket_perp_tps: {e}"
)
});
self
}
pub fn whitelisted_recipients<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.whitelisted_recipients = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for whitelisted_recipients: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<PrivateGetAccountResponse>
for super::PrivateGetAccountResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateGetAccountResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancel_on_disconnect: value.cancel_on_disconnect?,
creation_timestamp_sec: value.creation_timestamp_sec?,
fallback_subaccount_id: value.fallback_subaccount_id?,
fee_info: value.fee_info?,
is_rfq_maker: value.is_rfq_maker?,
per_endpoint_tps: value.per_endpoint_tps?,
referral_code: value.referral_code?,
subaccount_ids: value.subaccount_ids?,
wallet: value.wallet?,
websocket_matching_tps: value.websocket_matching_tps?,
websocket_non_matching_tps: value.websocket_non_matching_tps?,
websocket_option_tps: value.websocket_option_tps?,
websocket_perp_tps: value.websocket_perp_tps?,
whitelisted_recipients: value.whitelisted_recipients?,
})
}
}
impl ::std::convert::From<super::PrivateGetAccountResponse>
for PrivateGetAccountResponse {
fn from(value: super::PrivateGetAccountResponse) -> Self {
Self {
cancel_on_disconnect: Ok(value.cancel_on_disconnect),
creation_timestamp_sec: Ok(value.creation_timestamp_sec),
fallback_subaccount_id: Ok(value.fallback_subaccount_id),
fee_info: Ok(value.fee_info),
is_rfq_maker: Ok(value.is_rfq_maker),
per_endpoint_tps: Ok(value.per_endpoint_tps),
referral_code: Ok(value.referral_code),
subaccount_ids: Ok(value.subaccount_ids),
wallet: Ok(value.wallet),
websocket_matching_tps: Ok(value.websocket_matching_tps),
websocket_non_matching_tps: Ok(value.websocket_non_matching_tps),
websocket_option_tps: Ok(value.websocket_option_tps),
websocket_perp_tps: Ok(value.websocket_perp_tps),
whitelisted_recipients: Ok(value.whitelisted_recipients),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateGetCollateralsResponse {
collaterals: ::std::result::Result<
::std::vec::Vec<super::Collateral>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateGetCollateralsResponse {
fn default() -> Self {
Self {
collaterals: Err("no value supplied for collaterals".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PrivateGetCollateralsResponse {
pub fn collaterals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Collateral>>,
T::Error: ::std::fmt::Display,
{
self.collaterals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for collaterals: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateGetCollateralsResponse>
for super::PrivateGetCollateralsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateGetCollateralsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
collaterals: value.collaterals?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateGetCollateralsResponse>
for PrivateGetCollateralsResponse {
fn from(value: super::PrivateGetCollateralsResponse) -> Self {
Self {
collaterals: Ok(value.collaterals),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateGetPositionsResponse {
positions: ::std::result::Result<
::std::vec::Vec<super::Position>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateGetPositionsResponse {
fn default() -> Self {
Self {
positions: Err("no value supplied for positions".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PrivateGetPositionsResponse {
pub fn positions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Position>>,
T::Error: ::std::fmt::Display,
{
self.positions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for positions: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateGetPositionsResponse>
for super::PrivateGetPositionsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateGetPositionsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
positions: value.positions?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateGetPositionsResponse>
for PrivateGetPositionsResponse {
fn from(value: super::PrivateGetPositionsResponse) -> Self {
Self {
positions: Ok(value.positions),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateGetSubaccountsResponse {
subaccount_ids: ::std::result::Result<
::std::vec::Vec<u64>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for PrivateGetSubaccountsResponse {
fn default() -> Self {
Self {
subaccount_ids: Err("no value supplied for subaccount_ids".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl PrivateGetSubaccountsResponse {
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<PrivateGetSubaccountsResponse>
for super::PrivateGetSubaccountsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateGetSubaccountsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_ids: value.subaccount_ids?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::PrivateGetSubaccountsResponse>
for PrivateGetSubaccountsResponse {
fn from(value: super::PrivateGetSubaccountsResponse) -> Self {
Self {
subaccount_ids: Ok(value.subaccount_ids),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateLiquidateRequest {
cash_transfer: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
last_seen_trade_id: ::std::result::Result<u64, ::std::string::String>,
liquidate_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
merge_account: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
percent_of_acc: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
price_limit: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateLiquidateRequest {
fn default() -> Self {
Self {
cash_transfer: Err("no value supplied for cash_transfer".to_string()),
last_seen_trade_id: Err(
"no value supplied for last_seen_trade_id".to_string(),
),
liquidate_subaccount_id: Err(
"no value supplied for liquidate_subaccount_id".to_string(),
),
merge_account: Err("no value supplied for merge_account".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
percent_of_acc: Err("no value supplied for percent_of_acc".to_string()),
price_limit: Err("no value supplied for price_limit".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PrivateLiquidateRequest {
pub fn cash_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.cash_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cash_transfer: {e}")
});
self
}
pub fn last_seen_trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.last_seen_trade_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_seen_trade_id: {e}"
)
});
self
}
pub fn liquidate_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.liquidate_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for liquidate_subaccount_id: {e}"
)
});
self
}
pub fn merge_account<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.merge_account = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for merge_account: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn percent_of_acc<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.percent_of_acc = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for percent_of_acc: {e}")
});
self
}
pub fn price_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.price_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for price_limit: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateLiquidateRequest>
for super::PrivateLiquidateRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateLiquidateRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cash_transfer: value.cash_transfer?,
last_seen_trade_id: value.last_seen_trade_id?,
liquidate_subaccount_id: value.liquidate_subaccount_id?,
merge_account: value.merge_account?,
nonce: value.nonce?,
percent_of_acc: value.percent_of_acc?,
price_limit: value.price_limit?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateLiquidateRequest>
for PrivateLiquidateRequest {
fn from(value: super::PrivateLiquidateRequest) -> Self {
Self {
cash_transfer: Ok(value.cash_transfer),
last_seen_trade_id: Ok(value.last_seen_trade_id),
liquidate_subaccount_id: Ok(value.liquidate_subaccount_id),
merge_account: Ok(value.merge_account),
nonce: Ok(value.nonce),
percent_of_acc: Ok(value.percent_of_acc),
price_limit: Ok(value.price_limit),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateLiquidateResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateLiquidateResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl PrivateLiquidateResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateLiquidateResponse>
for super::PrivateLiquidateResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateLiquidateResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::PrivateLiquidateResponse>
for PrivateLiquidateResponse {
fn from(value: super::PrivateLiquidateResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateSessionKeysResponse {
public_session_keys: ::std::result::Result<
::std::vec::Vec<super::SessionKey>,
::std::string::String,
>,
}
impl ::std::default::Default for PrivateSessionKeysResponse {
fn default() -> Self {
Self {
public_session_keys: Err(
"no value supplied for public_session_keys".to_string(),
),
}
}
}
impl PrivateSessionKeysResponse {
pub fn public_session_keys<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::SessionKey>>,
T::Error: ::std::fmt::Display,
{
self.public_session_keys = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_keys: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<PrivateSessionKeysResponse>
for super::PrivateSessionKeysResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateSessionKeysResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
public_session_keys: value.public_session_keys?,
})
}
}
impl ::std::convert::From<super::PrivateSessionKeysResponse>
for PrivateSessionKeysResponse {
fn from(value: super::PrivateSessionKeysResponse) -> Self {
Self {
public_session_keys: Ok(value.public_session_keys),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateSetCancelOnDisconnectRequest {
headers: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
id: ::std::result::Result<super::JsonRpcId, ::std::string::String>,
method: ::std::result::Result<::std::string::String, ::std::string::String>,
params: ::std::result::Result<
super::SetCancelOnDisconnectRequest,
::std::string::String,
>,
}
impl ::std::default::Default for PrivateSetCancelOnDisconnectRequest {
fn default() -> Self {
Self {
headers: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
method: Err("no value supplied for method".to_string()),
params: Err("no value supplied for params".to_string()),
}
}
}
impl PrivateSetCancelOnDisconnectRequest {
pub fn headers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.headers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for headers: {e}")
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::JsonRpcId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.method = value
.try_into()
.map_err(|e| format!("error converting supplied value for method: {e}"));
self
}
pub fn params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SetCancelOnDisconnectRequest>,
T::Error: ::std::fmt::Display,
{
self.params = value
.try_into()
.map_err(|e| format!("error converting supplied value for params: {e}"));
self
}
}
impl ::std::convert::TryFrom<PrivateSetCancelOnDisconnectRequest>
for super::PrivateSetCancelOnDisconnectRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateSetCancelOnDisconnectRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
headers: value.headers?,
id: value.id?,
method: value.method?,
params: value.params?,
})
}
}
impl ::std::convert::From<super::PrivateSetCancelOnDisconnectRequest>
for PrivateSetCancelOnDisconnectRequest {
fn from(value: super::PrivateSetCancelOnDisconnectRequest) -> Self {
Self {
headers: Ok(value.headers),
id: Ok(value.id),
method: Ok(value.method),
params: Ok(value.params),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateSetSessionKeyResponse {
expiry_sec: ::std::result::Result<u64, ::std::string::String>,
ip_whitelist: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
offchain_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
protocol_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
public_session_key: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_ids: ::std::result::Result<
::std::vec::Vec<u64>,
::std::string::String,
>,
}
impl ::std::default::Default for PrivateSetSessionKeyResponse {
fn default() -> Self {
Self {
expiry_sec: Err("no value supplied for expiry_sec".to_string()),
ip_whitelist: Err("no value supplied for ip_whitelist".to_string()),
label: Ok(Default::default()),
offchain_scopes: Err(
"no value supplied for offchain_scopes".to_string(),
),
protocol_scopes: Err(
"no value supplied for protocol_scopes".to_string(),
),
public_session_key: Err(
"no value supplied for public_session_key".to_string(),
),
subaccount_ids: Err("no value supplied for subaccount_ids".to_string()),
}
}
}
impl PrivateSetSessionKeyResponse {
pub fn expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiry_sec: {e}")
});
self
}
pub fn ip_whitelist<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.ip_whitelist = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ip_whitelist: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn offchain_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.offchain_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for offchain_scopes: {e}")
});
self
}
pub fn protocol_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.protocol_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for protocol_scopes: {e}")
});
self
}
pub fn public_session_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.public_session_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_key: {e}"
)
});
self
}
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateSetSessionKeyResponse>
for super::PrivateSetSessionKeyResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateSetSessionKeyResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
expiry_sec: value.expiry_sec?,
ip_whitelist: value.ip_whitelist?,
label: value.label?,
offchain_scopes: value.offchain_scopes?,
protocol_scopes: value.protocol_scopes?,
public_session_key: value.public_session_key?,
subaccount_ids: value.subaccount_ids?,
})
}
}
impl ::std::convert::From<super::PrivateSetSessionKeyResponse>
for PrivateSetSessionKeyResponse {
fn from(value: super::PrivateSetSessionKeyResponse) -> Self {
Self {
expiry_sec: Ok(value.expiry_sec),
ip_whitelist: Ok(value.ip_whitelist),
label: Ok(value.label),
offchain_scopes: Ok(value.offchain_scopes),
protocol_scopes: Ok(value.protocol_scopes),
public_session_key: Ok(value.public_session_key),
subaccount_ids: Ok(value.subaccount_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateTransferSpotExternalRequest {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
max_fee_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
new_subaccount_manager: ::std::result::Result<u32, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
recipient_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
sub_id: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
to_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateTransferSpotExternalRequest {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
asset_name: Err("no value supplied for asset_name".to_string()),
max_fee_usd: Err("no value supplied for max_fee_usd".to_string()),
new_subaccount_manager: Err(
"no value supplied for new_subaccount_manager".to_string(),
),
nonce: Err("no value supplied for nonce".to_string()),
recipient_address: Err(
"no value supplied for recipient_address".to_string(),
),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
sub_id: Err("no value supplied for sub_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_subaccount_id: Err(
"no value supplied for to_subaccount_id".to_string(),
),
}
}
}
impl PrivateTransferSpotExternalRequest {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn max_fee_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee_usd: {e}")
});
self
}
pub fn new_subaccount_manager<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.new_subaccount_manager = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for new_subaccount_manager: {e}"
)
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn recipient_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.recipient_address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recipient_address: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn sub_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.sub_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for sub_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.to_subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateTransferSpotExternalRequest>
for super::PrivateTransferSpotExternalRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateTransferSpotExternalRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
asset_name: value.asset_name?,
max_fee_usd: value.max_fee_usd?,
new_subaccount_manager: value.new_subaccount_manager?,
nonce: value.nonce?,
recipient_address: value.recipient_address?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
sub_id: value.sub_id?,
subaccount_id: value.subaccount_id?,
to_subaccount_id: value.to_subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateTransferSpotExternalRequest>
for PrivateTransferSpotExternalRequest {
fn from(value: super::PrivateTransferSpotExternalRequest) -> Self {
Self {
amount: Ok(value.amount),
asset_name: Ok(value.asset_name),
max_fee_usd: Ok(value.max_fee_usd),
new_subaccount_manager: Ok(value.new_subaccount_manager),
nonce: Ok(value.nonce),
recipient_address: Ok(value.recipient_address),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
sub_id: Ok(value.sub_id),
subaccount_id: Ok(value.subaccount_id),
to_subaccount_id: Ok(value.to_subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateTransferSpotExternalResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateTransferSpotExternalResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl PrivateTransferSpotExternalResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateTransferSpotExternalResponse>
for super::PrivateTransferSpotExternalResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateTransferSpotExternalResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::PrivateTransferSpotExternalResponse>
for PrivateTransferSpotExternalResponse {
fn from(value: super::PrivateTransferSpotExternalResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateTransferSpotRequest {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
max_fee_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
new_subaccount_manager: ::std::result::Result<u32, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
sub_id: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
to_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateTransferSpotRequest {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
asset_name: Err("no value supplied for asset_name".to_string()),
max_fee_usd: Err("no value supplied for max_fee_usd".to_string()),
new_subaccount_manager: Err(
"no value supplied for new_subaccount_manager".to_string(),
),
nonce: Err("no value supplied for nonce".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
sub_id: Err("no value supplied for sub_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
to_subaccount_id: Err(
"no value supplied for to_subaccount_id".to_string(),
),
}
}
}
impl PrivateTransferSpotRequest {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn max_fee_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee_usd: {e}")
});
self
}
pub fn new_subaccount_manager<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.new_subaccount_manager = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for new_subaccount_manager: {e}"
)
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn sub_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.sub_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for sub_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn to_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.to_subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateTransferSpotRequest>
for super::PrivateTransferSpotRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateTransferSpotRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
asset_name: value.asset_name?,
max_fee_usd: value.max_fee_usd?,
new_subaccount_manager: value.new_subaccount_manager?,
nonce: value.nonce?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
sub_id: value.sub_id?,
subaccount_id: value.subaccount_id?,
to_subaccount_id: value.to_subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateTransferSpotRequest>
for PrivateTransferSpotRequest {
fn from(value: super::PrivateTransferSpotRequest) -> Self {
Self {
amount: Ok(value.amount),
asset_name: Ok(value.asset_name),
max_fee_usd: Ok(value.max_fee_usd),
new_subaccount_manager: Ok(value.new_subaccount_manager),
nonce: Ok(value.nonce),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
sub_id: Ok(value.sub_id),
subaccount_id: Ok(value.subaccount_id),
to_subaccount_id: Ok(value.to_subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateTransferSpotResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateTransferSpotResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl PrivateTransferSpotResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateTransferSpotResponse>
for super::PrivateTransferSpotResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateTransferSpotResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::PrivateTransferSpotResponse>
for PrivateTransferSpotResponse {
fn from(value: super::PrivateTransferSpotResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateWithdrawRequest {
amount_in_underlying: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
force_batch: ::std::result::Result<bool, ::std::string::String>,
max_fee_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
nonce: ::std::result::Result<i64, ::std::string::String>,
recipient: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateWithdrawRequest {
fn default() -> Self {
Self {
amount_in_underlying: Err(
"no value supplied for amount_in_underlying".to_string(),
),
asset_name: Err("no value supplied for asset_name".to_string()),
force_batch: Err("no value supplied for force_batch".to_string()),
max_fee_usd: Err("no value supplied for max_fee_usd".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
recipient: Ok(Default::default()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PrivateWithdrawRequest {
pub fn amount_in_underlying<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount_in_underlying = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for amount_in_underlying: {e}"
)
});
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn force_batch<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.force_batch = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for force_batch: {e}")
});
self
}
pub fn max_fee_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee_usd: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn recipient<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.recipient = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recipient: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateWithdrawRequest>
for super::PrivateWithdrawRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateWithdrawRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount_in_underlying: value.amount_in_underlying?,
asset_name: value.asset_name?,
force_batch: value.force_batch?,
max_fee_usd: value.max_fee_usd?,
nonce: value.nonce?,
recipient: value.recipient?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PrivateWithdrawRequest> for PrivateWithdrawRequest {
fn from(value: super::PrivateWithdrawRequest) -> Self {
Self {
amount_in_underlying: Ok(value.amount_in_underlying),
asset_name: Ok(value.asset_name),
force_batch: Ok(value.force_batch),
max_fee_usd: Ok(value.max_fee_usd),
nonce: Ok(value.nonce),
recipient: Ok(value.recipient),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PrivateWithdrawResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PrivateWithdrawResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl PrivateWithdrawResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PrivateWithdrawResponse>
for super::PrivateWithdrawResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PrivateWithdrawResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::PrivateWithdrawResponse>
for PrivateWithdrawResponse {
fn from(value: super::PrivateWithdrawResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ProtocolVault {
closed: ::std::result::Result<bool, ::std::string::String>,
config: ::std::result::Result<super::VaultConfig, ::std::string::String>,
global_hwm: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
last_fee_settled_at_sec: ::std::result::Result<u64, ::std::string::String>,
protocol_fee_share_bps: ::std::result::Result<u16, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
total_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
}
impl ::std::default::Default for ProtocolVault {
fn default() -> Self {
Self {
closed: Err("no value supplied for closed".to_string()),
config: Err("no value supplied for config".to_string()),
global_hwm: Err("no value supplied for global_hwm".to_string()),
last_fee_settled_at_sec: Err(
"no value supplied for last_fee_settled_at_sec".to_string(),
),
protocol_fee_share_bps: Err(
"no value supplied for protocol_fee_share_bps".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
total_shares: Err("no value supplied for total_shares".to_string()),
}
}
}
impl ProtocolVault {
pub fn closed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.closed = value
.try_into()
.map_err(|e| format!("error converting supplied value for closed: {e}"));
self
}
pub fn config<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultConfig>,
T::Error: ::std::fmt::Display,
{
self.config = value
.try_into()
.map_err(|e| format!("error converting supplied value for config: {e}"));
self
}
pub fn global_hwm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.global_hwm = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for global_hwm: {e}")
});
self
}
pub fn last_fee_settled_at_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.last_fee_settled_at_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_fee_settled_at_sec: {e}"
)
});
self
}
pub fn protocol_fee_share_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.protocol_fee_share_bps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for protocol_fee_share_bps: {e}"
)
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn total_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.total_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_shares: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ProtocolVault> for super::ProtocolVault {
type Error = super::error::ConversionError;
fn try_from(
value: ProtocolVault,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
closed: value.closed?,
config: value.config?,
global_hwm: value.global_hwm?,
last_fee_settled_at_sec: value.last_fee_settled_at_sec?,
protocol_fee_share_bps: value.protocol_fee_share_bps?,
subaccount_id: value.subaccount_id?,
total_shares: value.total_shares?,
})
}
}
impl ::std::convert::From<super::ProtocolVault> for ProtocolVault {
fn from(value: super::ProtocolVault) -> Self {
Self {
closed: Ok(value.closed),
config: Ok(value.config),
global_hwm: Ok(value.global_hwm),
last_fee_settled_at_sec: Ok(value.last_fee_settled_at_sec),
protocol_fee_share_bps: Ok(value.protocol_fee_share_bps),
subaccount_id: Ok(value.subaccount_id),
total_shares: Ok(value.total_shares),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicExecuteQuoteDebugRequest {
direction: ::std::result::Result<super::Direction, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PublicExecuteQuoteDebugRequest {
fn default() -> Self {
Self {
direction: Err("no value supplied for direction".to_string()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PublicExecuteQuoteDebugRequest {
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicExecuteQuoteDebugRequest>
for super::PublicExecuteQuoteDebugRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PublicExecuteQuoteDebugRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
direction: value.direction?,
legs: value.legs?,
max_fee: value.max_fee?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PublicExecuteQuoteDebugRequest>
for PublicExecuteQuoteDebugRequest {
fn from(value: super::PublicExecuteQuoteDebugRequest) -> Self {
Self {
direction: Ok(value.direction),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicGetWalletsFromSessionKeyResponse {
wallets: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for PublicGetWalletsFromSessionKeyResponse {
fn default() -> Self {
Self {
wallets: Err("no value supplied for wallets".to_string()),
}
}
}
impl PublicGetWalletsFromSessionKeyResponse {
pub fn wallets<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallets = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for wallets: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicGetWalletsFromSessionKeyResponse>
for super::PublicGetWalletsFromSessionKeyResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PublicGetWalletsFromSessionKeyResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallets: value.wallets? })
}
}
impl ::std::convert::From<super::PublicGetWalletsFromSessionKeyResponse>
for PublicGetWalletsFromSessionKeyResponse {
fn from(value: super::PublicGetWalletsFromSessionKeyResponse) -> Self {
Self { wallets: Ok(value.wallets) }
}
}
#[derive(Clone, Debug)]
pub struct PublicLoginRequest {
headers: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
id: ::std::result::Result<super::JsonRpcId, ::std::string::String>,
method: ::std::result::Result<::std::string::String, ::std::string::String>,
params: ::std::result::Result<super::LoginRequest, ::std::string::String>,
}
impl ::std::default::Default for PublicLoginRequest {
fn default() -> Self {
Self {
headers: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
method: Err("no value supplied for method".to_string()),
params: Err("no value supplied for params".to_string()),
}
}
}
impl PublicLoginRequest {
pub fn headers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.headers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for headers: {e}")
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::JsonRpcId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.method = value
.try_into()
.map_err(|e| format!("error converting supplied value for method: {e}"));
self
}
pub fn params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LoginRequest>,
T::Error: ::std::fmt::Display,
{
self.params = value
.try_into()
.map_err(|e| format!("error converting supplied value for params: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublicLoginRequest> for super::PublicLoginRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PublicLoginRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
headers: value.headers?,
id: value.id?,
method: value.method?,
params: value.params?,
})
}
}
impl ::std::convert::From<super::PublicLoginRequest> for PublicLoginRequest {
fn from(value: super::PublicLoginRequest) -> Self {
Self {
headers: Ok(value.headers),
id: Ok(value.id),
method: Ok(value.method),
params: Ok(value.params),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicQuote {
cancel_reason: ::std::result::Result<
super::RfqCancelReason,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
fill_pct: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
legs_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for PublicQuote {
fn default() -> Self {
Self {
cancel_reason: Err("no value supplied for cancel_reason".to_string()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
direction: Err("no value supplied for direction".to_string()),
fill_pct: Err("no value supplied for fill_pct".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
legs_hash: Err("no value supplied for legs_hash".to_string()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl PublicQuote {
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqCancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn fill_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fill_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fill_pct: {e}")
});
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn legs_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.legs_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legs_hash: {e}")
});
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublicQuote> for super::PublicQuote {
type Error = super::error::ConversionError;
fn try_from(
value: PublicQuote,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
direction: value.direction?,
fill_pct: value.fill_pct?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
legs_hash: value.legs_hash?,
liquidity_role: value.liquidity_role?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::PublicQuote> for PublicQuote {
fn from(value: super::PublicQuote) -> Self {
Self {
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
direction: Ok(value.direction),
fill_pct: Ok(value.fill_pct),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
legs_hash: Ok(value.legs_hash),
liquidity_role: Ok(value.liquidity_role),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicRfq {
cancel_reason: ::std::result::Result<
super::RfqCancelReason,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
fill_rate: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
filled_direction: ::std::result::Result<
::std::option::Option<super::Direction>,
::std::string::String,
>,
filled_pct: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::LegUnpricedParams>,
::std::string::String,
>,
partial_fill_step: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
recent_fill_rate: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
valid_until: ::std::result::Result<i64, ::std::string::String>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for PublicRfq {
fn default() -> Self {
Self {
cancel_reason: Err("no value supplied for cancel_reason".to_string()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
fill_rate: Err("no value supplied for fill_rate".to_string()),
filled_direction: Ok(Default::default()),
filled_pct: Err("no value supplied for filled_pct".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
partial_fill_step: Err(
"no value supplied for partial_fill_step".to_string(),
),
recent_fill_rate: Err(
"no value supplied for recent_fill_rate".to_string(),
),
rfq_id: Err("no value supplied for rfq_id".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
total_cost: Err("no value supplied for total_cost".to_string()),
valid_until: Err("no value supplied for valid_until".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl PublicRfq {
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqCancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn fill_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.fill_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fill_rate: {e}")
});
self
}
pub fn filled_direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Direction>>,
T::Error: ::std::fmt::Display,
{
self.filled_direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_direction: {e}")
});
self
}
pub fn filled_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.filled_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_pct: {e}")
});
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::LegUnpricedParams>>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn partial_fill_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.partial_fill_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for partial_fill_step: {e}")
});
self
}
pub fn recent_fill_rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.recent_fill_rate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recent_fill_rate: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_cost: {e}")
});
self
}
pub fn valid_until<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.valid_until = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for valid_until: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublicRfq> for super::PublicRfq {
type Error = super::error::ConversionError;
fn try_from(
value: PublicRfq,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
fill_rate: value.fill_rate?,
filled_direction: value.filled_direction?,
filled_pct: value.filled_pct?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
partial_fill_step: value.partial_fill_step?,
recent_fill_rate: value.recent_fill_rate?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
total_cost: value.total_cost?,
valid_until: value.valid_until?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::PublicRfq> for PublicRfq {
fn from(value: super::PublicRfq) -> Self {
Self {
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
fill_rate: Ok(value.fill_rate),
filled_direction: Ok(value.filled_direction),
filled_pct: Ok(value.filled_pct),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
partial_fill_step: Ok(value.partial_fill_step),
recent_fill_rate: Ok(value.recent_fill_rate),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
total_cost: Ok(value.total_cost),
valid_until: Ok(value.valid_until),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicSendQuoteDebugRequest {
direction: ::std::result::Result<super::Direction, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PublicSendQuoteDebugRequest {
fn default() -> Self {
Self {
direction: Err("no value supplied for direction".to_string()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PublicSendQuoteDebugRequest {
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicSendQuoteDebugRequest>
for super::PublicSendQuoteDebugRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PublicSendQuoteDebugRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
direction: value.direction?,
legs: value.legs?,
max_fee: value.max_fee?,
nonce: value.nonce?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PublicSendQuoteDebugRequest>
for PublicSendQuoteDebugRequest {
fn from(value: super::PublicSendQuoteDebugRequest) -> Self {
Self {
direction: Ok(value.direction),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
nonce: Ok(value.nonce),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicStartAuctionRequest {
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PublicStartAuctionRequest {
fn default() -> Self {
Self {
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PublicStartAuctionRequest {
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicStartAuctionRequest>
for super::PublicStartAuctionRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PublicStartAuctionRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PublicStartAuctionRequest>
for PublicStartAuctionRequest {
fn from(value: super::PublicStartAuctionRequest) -> Self {
Self {
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicStartAuctionResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PublicStartAuctionResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl PublicStartAuctionResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicStartAuctionResponse>
for super::PublicStartAuctionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PublicStartAuctionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::PublicStartAuctionResponse>
for PublicStartAuctionResponse {
fn from(value: super::PublicStartAuctionResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicTrade {
direction: ::std::result::Result<super::Direction, ::std::string::String>,
index_price: ::std::result::Result<::std::string::String, ::std::string::String>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mark_price: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
trade_amount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
trade_id: ::std::result::Result<::std::string::String, ::std::string::String>,
trade_price: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for PublicTrade {
fn default() -> Self {
Self {
direction: Err("no value supplied for direction".to_string()),
index_price: Err("no value supplied for index_price".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
mark_price: Err("no value supplied for mark_price".to_string()),
quote_id: Ok(Default::default()),
rfq_id: Ok(Default::default()),
timestamp: Err("no value supplied for timestamp".to_string()),
trade_amount: Err("no value supplied for trade_amount".to_string()),
trade_id: Err("no value supplied for trade_id".to_string()),
trade_price: Err("no value supplied for trade_price".to_string()),
}
}
}
impl PublicTrade {
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn index_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.index_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for index_price: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn trade_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_amount: {e}")
});
self
}
pub fn trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_id: {e}")
});
self
}
pub fn trade_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_price: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicTrade> for super::PublicTrade {
type Error = super::error::ConversionError;
fn try_from(
value: PublicTrade,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
direction: value.direction?,
index_price: value.index_price?,
instrument_name: value.instrument_name?,
mark_price: value.mark_price?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
timestamp: value.timestamp?,
trade_amount: value.trade_amount?,
trade_id: value.trade_id?,
trade_price: value.trade_price?,
})
}
}
impl ::std::convert::From<super::PublicTrade> for PublicTrade {
fn from(value: super::PublicTrade) -> Self {
Self {
direction: Ok(value.direction),
index_price: Ok(value.index_price),
instrument_name: Ok(value.instrument_name),
mark_price: Ok(value.mark_price),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
timestamp: Ok(value.timestamp),
trade_amount: Ok(value.trade_amount),
trade_id: Ok(value.trade_id),
trade_price: Ok(value.trade_price),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicTradesResult {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
trades: ::std::result::Result<
::std::vec::Vec<super::SettledTrade>,
::std::string::String,
>,
}
impl ::std::default::Default for PublicTradesResult {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
trades: Err("no value supplied for trades".to_string()),
}
}
}
impl PublicTradesResult {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn trades<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::SettledTrade>>,
T::Error: ::std::fmt::Display,
{
self.trades = value
.try_into()
.map_err(|e| format!("error converting supplied value for trades: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublicTradesResult> for super::PublicTradesResult {
type Error = super::error::ConversionError;
fn try_from(
value: PublicTradesResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
trades: value.trades?,
})
}
}
impl ::std::convert::From<super::PublicTradesResult> for PublicTradesResult {
fn from(value: super::PublicTradesResult) -> Self {
Self {
pagination: Ok(value.pagination),
trades: Ok(value.trades),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicVaultActionResponse {
curator_shares_minted: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
event_ts: ::std::result::Result<i64, ::std::string::String>,
event_type: ::std::result::Result<::std::string::String, ::std::string::String>,
holder: ::std::result::Result<::std::string::String, ::std::string::String>,
management_shares_minted: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
nav: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
new_high_water_mark: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
old_high_water_mark: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
operation_uuid: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
performance_shares_minted: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
protocol_shares_minted: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
share_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
shares_delta: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
status: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
total_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
}
impl ::std::default::Default for PublicVaultActionResponse {
fn default() -> Self {
Self {
curator_shares_minted: Err(
"no value supplied for curator_shares_minted".to_string(),
),
event_ts: Err("no value supplied for event_ts".to_string()),
event_type: Err("no value supplied for event_type".to_string()),
holder: Err("no value supplied for holder".to_string()),
management_shares_minted: Err(
"no value supplied for management_shares_minted".to_string(),
),
nav: Err("no value supplied for nav".to_string()),
new_high_water_mark: Err(
"no value supplied for new_high_water_mark".to_string(),
),
old_high_water_mark: Err(
"no value supplied for old_high_water_mark".to_string(),
),
operation_uuid: Err("no value supplied for operation_uuid".to_string()),
performance_shares_minted: Err(
"no value supplied for performance_shares_minted".to_string(),
),
protocol_shares_minted: Err(
"no value supplied for protocol_shares_minted".to_string(),
),
share_price: Err("no value supplied for share_price".to_string()),
shares_delta: Err("no value supplied for shares_delta".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
total_shares: Err("no value supplied for total_shares".to_string()),
}
}
}
impl PublicVaultActionResponse {
pub fn curator_shares_minted<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.curator_shares_minted = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for curator_shares_minted: {e}"
)
});
self
}
pub fn event_ts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.event_ts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for event_ts: {e}")
});
self
}
pub fn event_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.event_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for event_type: {e}")
});
self
}
pub fn holder<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.holder = value
.try_into()
.map_err(|e| format!("error converting supplied value for holder: {e}"));
self
}
pub fn management_shares_minted<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.management_shares_minted = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for management_shares_minted: {e}"
)
});
self
}
pub fn nav<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.nav = value
.try_into()
.map_err(|e| format!("error converting supplied value for nav: {e}"));
self
}
pub fn new_high_water_mark<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.new_high_water_mark = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for new_high_water_mark: {e}"
)
});
self
}
pub fn old_high_water_mark<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.old_high_water_mark = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for old_high_water_mark: {e}"
)
});
self
}
pub fn operation_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.operation_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_uuid: {e}")
});
self
}
pub fn performance_shares_minted<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.performance_shares_minted = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for performance_shares_minted: {e}"
)
});
self
}
pub fn protocol_shares_minted<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.protocol_shares_minted = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for protocol_shares_minted: {e}"
)
});
self
}
pub fn share_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.share_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for share_price: {e}")
});
self
}
pub fn shares_delta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.shares_delta = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for shares_delta: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn total_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.total_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_shares: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicVaultActionResponse>
for super::PublicVaultActionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PublicVaultActionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
curator_shares_minted: value.curator_shares_minted?,
event_ts: value.event_ts?,
event_type: value.event_type?,
holder: value.holder?,
management_shares_minted: value.management_shares_minted?,
nav: value.nav?,
new_high_water_mark: value.new_high_water_mark?,
old_high_water_mark: value.old_high_water_mark?,
operation_uuid: value.operation_uuid?,
performance_shares_minted: value.performance_shares_minted?,
protocol_shares_minted: value.protocol_shares_minted?,
share_price: value.share_price?,
shares_delta: value.shares_delta?,
status: value.status?,
subaccount_id: value.subaccount_id?,
total_shares: value.total_shares?,
})
}
}
impl ::std::convert::From<super::PublicVaultActionResponse>
for PublicVaultActionResponse {
fn from(value: super::PublicVaultActionResponse) -> Self {
Self {
curator_shares_minted: Ok(value.curator_shares_minted),
event_ts: Ok(value.event_ts),
event_type: Ok(value.event_type),
holder: Ok(value.holder),
management_shares_minted: Ok(value.management_shares_minted),
nav: Ok(value.nav),
new_high_water_mark: Ok(value.new_high_water_mark),
old_high_water_mark: Ok(value.old_high_water_mark),
operation_uuid: Ok(value.operation_uuid),
performance_shares_minted: Ok(value.performance_shares_minted),
protocol_shares_minted: Ok(value.protocol_shares_minted),
share_price: Ok(value.share_price),
shares_delta: Ok(value.shares_delta),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
total_shares: Ok(value.total_shares),
}
}
}
#[derive(Clone, Debug)]
pub struct PublicWithdrawDebugRequest {
amount_in_underlying: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
force_batch: ::std::result::Result<bool, ::std::string::String>,
max_fee_usd: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
nonce: ::std::result::Result<i64, ::std::string::String>,
recipient: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for PublicWithdrawDebugRequest {
fn default() -> Self {
Self {
amount_in_underlying: Err(
"no value supplied for amount_in_underlying".to_string(),
),
asset_name: Err("no value supplied for asset_name".to_string()),
force_batch: Err("no value supplied for force_batch".to_string()),
max_fee_usd: Err("no value supplied for max_fee_usd".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
recipient: Ok(Default::default()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl PublicWithdrawDebugRequest {
pub fn amount_in_underlying<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount_in_underlying = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for amount_in_underlying: {e}"
)
});
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn force_batch<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.force_batch = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for force_batch: {e}")
});
self
}
pub fn max_fee_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee_usd: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn recipient<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.recipient = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recipient: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<PublicWithdrawDebugRequest>
for super::PublicWithdrawDebugRequest {
type Error = super::error::ConversionError;
fn try_from(
value: PublicWithdrawDebugRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount_in_underlying: value.amount_in_underlying?,
asset_name: value.asset_name?,
force_batch: value.force_batch?,
max_fee_usd: value.max_fee_usd?,
nonce: value.nonce?,
recipient: value.recipient?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::PublicWithdrawDebugRequest>
for PublicWithdrawDebugRequest {
fn from(value: super::PublicWithdrawDebugRequest) -> Self {
Self {
amount_in_underlying: Ok(value.amount_in_underlying),
asset_name: Ok(value.asset_name),
force_batch: Ok(value.force_batch),
max_fee_usd: Ok(value.max_fee_usd),
nonce: Ok(value.nonce),
recipient: Ok(value.recipient),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct Quote {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
cancel_reason: ::std::result::Result<
super::RfqCancelReason,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
fill_pct: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
legs_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Quote {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
cancel_reason: Err("no value supplied for cancel_reason".to_string()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Err("no value supplied for extra_fee".to_string()),
fee: Err("no value supplied for fee".to_string()),
fill_pct: Err("no value supplied for fill_pct".to_string()),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Err("no value supplied for label".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
legs_hash: Err("no value supplied for legs_hash".to_string()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Err("no value supplied for mmp".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl Quote {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqCancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn fill_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fill_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fill_pct: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn legs_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.legs_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legs_hash: {e}")
});
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Quote> for super::Quote {
type Error = super::error::ConversionError;
fn try_from(
value: Quote,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
direction: value.direction?,
extra_fee: value.extra_fee?,
fee: value.fee?,
fill_pct: value.fill_pct?,
is_transfer: value.is_transfer?,
label: value.label?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
legs_hash: value.legs_hash?,
liquidity_role: value.liquidity_role?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
signature_expiry_sec: value.signature_expiry_sec?,
status: value.status?,
subaccount_id: value.subaccount_id?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::Quote> for Quote {
fn from(value: super::Quote) -> Self {
Self {
batch_status: Ok(value.batch_status),
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
fee: Ok(value.fee),
fill_pct: Ok(value.fill_pct),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
legs_hash: Ok(value.legs_hash),
liquidity_role: Ok(value.liquidity_role),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
signature_expiry_sec: Ok(value.signature_expiry_sec),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct QuoteExecuteDebugResult {
action_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
encoded_data: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
encoded_data_hashed: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
encoded_legs: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
legs_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
typed_data_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for QuoteExecuteDebugResult {
fn default() -> Self {
Self {
action_hash: Err("no value supplied for action_hash".to_string()),
encoded_data: Err("no value supplied for encoded_data".to_string()),
encoded_data_hashed: Err(
"no value supplied for encoded_data_hashed".to_string(),
),
encoded_legs: Err("no value supplied for encoded_legs".to_string()),
legs_hash: Err("no value supplied for legs_hash".to_string()),
typed_data_hash: Err("no value supplied for typed_data_hash".to_string()),
}
}
}
impl QuoteExecuteDebugResult {
pub fn action_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_hash: {e}")
});
self
}
pub fn encoded_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for encoded_data: {e}")
});
self
}
pub fn encoded_data_hashed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data_hashed = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for encoded_data_hashed: {e}"
)
});
self
}
pub fn encoded_legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_legs = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for encoded_legs: {e}")
});
self
}
pub fn legs_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.legs_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legs_hash: {e}")
});
self
}
pub fn typed_data_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.typed_data_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for typed_data_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<QuoteExecuteDebugResult>
for super::QuoteExecuteDebugResult {
type Error = super::error::ConversionError;
fn try_from(
value: QuoteExecuteDebugResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_hash: value.action_hash?,
encoded_data: value.encoded_data?,
encoded_data_hashed: value.encoded_data_hashed?,
encoded_legs: value.encoded_legs?,
legs_hash: value.legs_hash?,
typed_data_hash: value.typed_data_hash?,
})
}
}
impl ::std::convert::From<super::QuoteExecuteDebugResult>
for QuoteExecuteDebugResult {
fn from(value: super::QuoteExecuteDebugResult) -> Self {
Self {
action_hash: Ok(value.action_hash),
encoded_data: Ok(value.encoded_data),
encoded_data_hashed: Ok(value.encoded_data_hashed),
encoded_legs: Ok(value.encoded_legs),
legs_hash: Ok(value.legs_hash),
typed_data_hash: Ok(value.typed_data_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct QuoteExecuteResponse {
cancel_reason: ::std::result::Result<
super::RfqCancelReason,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
fill_pct: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
legs_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_filled_pct: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for QuoteExecuteResponse {
fn default() -> Self {
Self {
cancel_reason: Err("no value supplied for cancel_reason".to_string()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Err("no value supplied for extra_fee".to_string()),
fee: Err("no value supplied for fee".to_string()),
fill_pct: Err("no value supplied for fill_pct".to_string()),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Err("no value supplied for label".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
legs_hash: Err("no value supplied for legs_hash".to_string()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Err("no value supplied for mmp".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_filled_pct: Err("no value supplied for rfq_filled_pct".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl QuoteExecuteResponse {
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqCancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn fill_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fill_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fill_pct: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn legs_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.legs_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legs_hash: {e}")
});
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_filled_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.rfq_filled_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for rfq_filled_pct: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<QuoteExecuteResponse> for super::QuoteExecuteResponse {
type Error = super::error::ConversionError;
fn try_from(
value: QuoteExecuteResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
direction: value.direction?,
extra_fee: value.extra_fee?,
fee: value.fee?,
fill_pct: value.fill_pct?,
is_transfer: value.is_transfer?,
label: value.label?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
legs_hash: value.legs_hash?,
liquidity_role: value.liquidity_role?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_filled_pct: value.rfq_filled_pct?,
rfq_id: value.rfq_id?,
signature_expiry_sec: value.signature_expiry_sec?,
status: value.status?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::QuoteExecuteResponse> for QuoteExecuteResponse {
fn from(value: super::QuoteExecuteResponse) -> Self {
Self {
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
fee: Ok(value.fee),
fill_pct: Ok(value.fill_pct),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
legs_hash: Ok(value.legs_hash),
liquidity_role: Ok(value.liquidity_role),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_filled_pct: Ok(value.rfq_filled_pct),
rfq_id: Ok(value.rfq_id),
signature_expiry_sec: Ok(value.signature_expiry_sec),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct QuoteGetResponse {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
quotes: ::std::result::Result<
::std::vec::Vec<super::Quote>,
::std::string::String,
>,
}
impl ::std::default::Default for QuoteGetResponse {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
quotes: Err("no value supplied for quotes".to_string()),
}
}
}
impl QuoteGetResponse {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn quotes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Quote>>,
T::Error: ::std::fmt::Display,
{
self.quotes = value
.try_into()
.map_err(|e| format!("error converting supplied value for quotes: {e}"));
self
}
}
impl ::std::convert::TryFrom<QuoteGetResponse> for super::QuoteGetResponse {
type Error = super::error::ConversionError;
fn try_from(
value: QuoteGetResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
quotes: value.quotes?,
})
}
}
impl ::std::convert::From<super::QuoteGetResponse> for QuoteGetResponse {
fn from(value: super::QuoteGetResponse) -> Self {
Self {
pagination: Ok(value.pagination),
quotes: Ok(value.quotes),
}
}
}
#[derive(Clone, Debug)]
pub struct QuotePollResponse {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
quotes: ::std::result::Result<
::std::vec::Vec<super::PublicQuote>,
::std::string::String,
>,
}
impl ::std::default::Default for QuotePollResponse {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
quotes: Err("no value supplied for quotes".to_string()),
}
}
}
impl QuotePollResponse {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn quotes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PublicQuote>>,
T::Error: ::std::fmt::Display,
{
self.quotes = value
.try_into()
.map_err(|e| format!("error converting supplied value for quotes: {e}"));
self
}
}
impl ::std::convert::TryFrom<QuotePollResponse> for super::QuotePollResponse {
type Error = super::error::ConversionError;
fn try_from(
value: QuotePollResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
quotes: value.quotes?,
})
}
}
impl ::std::convert::From<super::QuotePollResponse> for QuotePollResponse {
fn from(value: super::QuotePollResponse) -> Self {
Self {
pagination: Ok(value.pagination),
quotes: Ok(value.quotes),
}
}
}
#[derive(Clone, Debug)]
pub struct QuotePublishResult {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
cancel_reason: ::std::result::Result<
::std::option::Option<super::RfqCancelReason>,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
fill_pct: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
legs_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for QuotePublishResult {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
cancel_reason: Ok(Default::default()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Err("no value supplied for extra_fee".to_string()),
fee: Err("no value supplied for fee".to_string()),
fill_pct: Err("no value supplied for fill_pct".to_string()),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Err("no value supplied for label".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
legs_hash: Err("no value supplied for legs_hash".to_string()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Err("no value supplied for mmp".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl QuotePublishResult {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RfqCancelReason>>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn fill_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fill_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fill_pct: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn legs_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.legs_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for legs_hash: {e}")
});
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<QuotePublishResult> for super::QuotePublishResult {
type Error = super::error::ConversionError;
fn try_from(
value: QuotePublishResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
cancel_reason: value.cancel_reason?,
creation_timestamp: value.creation_timestamp?,
direction: value.direction?,
extra_fee: value.extra_fee?,
fee: value.fee?,
fill_pct: value.fill_pct?,
is_transfer: value.is_transfer?,
label: value.label?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
legs_hash: value.legs_hash?,
liquidity_role: value.liquidity_role?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
quote_id: value.quote_id?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
status: value.status?,
subaccount_id: value.subaccount_id?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::QuotePublishResult> for QuotePublishResult {
fn from(value: super::QuotePublishResult) -> Self {
Self {
batch_status: Ok(value.batch_status),
cancel_reason: Ok(value.cancel_reason),
creation_timestamp: Ok(value.creation_timestamp),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
fee: Ok(value.fee),
fill_pct: Ok(value.fill_pct),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
legs_hash: Ok(value.legs_hash),
liquidity_role: Ok(value.liquidity_role),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
quote_id: Ok(value.quote_id),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct QuoteReplaceResponse {
cancelled_quote: ::std::result::Result<super::Quote, ::std::string::String>,
create_quote_error: ::std::result::Result<
::std::option::Option<super::RpcError>,
::std::string::String,
>,
quote: ::std::result::Result<
::std::option::Option<super::Quote>,
::std::string::String,
>,
}
impl ::std::default::Default for QuoteReplaceResponse {
fn default() -> Self {
Self {
cancelled_quote: Err(
"no value supplied for cancelled_quote".to_string(),
),
create_quote_error: Ok(Default::default()),
quote: Ok(Default::default()),
}
}
}
impl QuoteReplaceResponse {
pub fn cancelled_quote<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Quote>,
T::Error: ::std::fmt::Display,
{
self.cancelled_quote = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_quote: {e}")
});
self
}
pub fn create_quote_error<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RpcError>>,
T::Error: ::std::fmt::Display,
{
self.create_quote_error = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for create_quote_error: {e}"
)
});
self
}
pub fn quote<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Quote>>,
T::Error: ::std::fmt::Display,
{
self.quote = value
.try_into()
.map_err(|e| format!("error converting supplied value for quote: {e}"));
self
}
}
impl ::std::convert::TryFrom<QuoteReplaceResponse> for super::QuoteReplaceResponse {
type Error = super::error::ConversionError;
fn try_from(
value: QuoteReplaceResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_quote: value.cancelled_quote?,
create_quote_error: value.create_quote_error?,
quote: value.quote?,
})
}
}
impl ::std::convert::From<super::QuoteReplaceResponse> for QuoteReplaceResponse {
fn from(value: super::QuoteReplaceResponse) -> Self {
Self {
cancelled_quote: Ok(value.cancelled_quote),
create_quote_error: Ok(value.create_quote_error),
quote: Ok(value.quote),
}
}
}
#[derive(Clone, Debug)]
pub struct QuoteSendDebugResult {
action_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
encoded_data: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
encoded_data_hashed: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
typed_data_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for QuoteSendDebugResult {
fn default() -> Self {
Self {
action_hash: Err("no value supplied for action_hash".to_string()),
encoded_data: Err("no value supplied for encoded_data".to_string()),
encoded_data_hashed: Err(
"no value supplied for encoded_data_hashed".to_string(),
),
typed_data_hash: Err("no value supplied for typed_data_hash".to_string()),
}
}
}
impl QuoteSendDebugResult {
pub fn action_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.action_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for action_hash: {e}")
});
self
}
pub fn encoded_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for encoded_data: {e}")
});
self
}
pub fn encoded_data_hashed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.encoded_data_hashed = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for encoded_data_hashed: {e}"
)
});
self
}
pub fn typed_data_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.typed_data_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for typed_data_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<QuoteSendDebugResult> for super::QuoteSendDebugResult {
type Error = super::error::ConversionError;
fn try_from(
value: QuoteSendDebugResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action_hash: value.action_hash?,
encoded_data: value.encoded_data?,
encoded_data_hashed: value.encoded_data_hashed?,
typed_data_hash: value.typed_data_hash?,
})
}
}
impl ::std::convert::From<super::QuoteSendDebugResult> for QuoteSendDebugResult {
fn from(value: super::QuoteSendDebugResult) -> Self {
Self {
action_hash: Ok(value.action_hash),
encoded_data: Ok(value.encoded_data),
encoded_data_hashed: Ok(value.encoded_data_hashed),
typed_data_hash: Ok(value.typed_data_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct RateFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
expiry: ::std::result::Result<u64, ::std::string::String>,
rate: ::std::result::Result<::std::string::String, ::std::string::String>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for RateFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
rate: Err("no value supplied for rate".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl RateFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn rate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.rate = value
.try_into()
.map_err(|e| format!("error converting supplied value for rate: {e}"));
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RateFeedDataResponse> for super::RateFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: RateFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
expiry: value.expiry?,
rate: value.rate?,
signatures: value.signatures?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::RateFeedDataResponse> for RateFeedDataResponse {
fn from(value: super::RateFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
expiry: Ok(value.expiry),
rate: Ok(value.rate),
signatures: Ok(value.signatures),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct RateLimitInfo {
consumed_points: ::std::result::Result<i64, ::std::string::String>,
is_first_in_duration: ::std::result::Result<bool, ::std::string::String>,
ms_before_next: ::std::result::Result<u64, ::std::string::String>,
remaining_points: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for RateLimitInfo {
fn default() -> Self {
Self {
consumed_points: Err(
"no value supplied for consumed_points".to_string(),
),
is_first_in_duration: Err(
"no value supplied for is_first_in_duration".to_string(),
),
ms_before_next: Err("no value supplied for ms_before_next".to_string()),
remaining_points: Err(
"no value supplied for remaining_points".to_string(),
),
}
}
}
impl RateLimitInfo {
pub fn consumed_points<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.consumed_points = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for consumed_points: {e}")
});
self
}
pub fn is_first_in_duration<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_first_in_duration = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for is_first_in_duration: {e}"
)
});
self
}
pub fn ms_before_next<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.ms_before_next = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ms_before_next: {e}")
});
self
}
pub fn remaining_points<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.remaining_points = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for remaining_points: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RateLimitInfo> for super::RateLimitInfo {
type Error = super::error::ConversionError;
fn try_from(
value: RateLimitInfo,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
consumed_points: value.consumed_points?,
is_first_in_duration: value.is_first_in_duration?,
ms_before_next: value.ms_before_next?,
remaining_points: value.remaining_points?,
})
}
}
impl ::std::convert::From<super::RateLimitInfo> for RateLimitInfo {
fn from(value: super::RateLimitInfo) -> Self {
Self {
consumed_points: Ok(value.consumed_points),
is_first_in_duration: Ok(value.is_first_in_duration),
ms_before_next: Ok(value.ms_before_next),
remaining_points: Ok(value.remaining_points),
}
}
}
#[derive(Clone, Debug)]
pub struct RateLimitResult {
remaining_connections: ::std::result::Result<
::std::option::Option<super::RateLimitInfo>,
::std::string::String,
>,
remaining_matching: ::std::result::Result<
super::RateLimitInfo,
::std::string::String,
>,
remaining_non_matching: ::std::result::Result<
super::RateLimitInfo,
::std::string::String,
>,
remaining_per_endpoint: ::std::result::Result<
::std::collections::HashMap<::std::string::String, super::RateLimitInfo>,
::std::string::String,
>,
}
impl ::std::default::Default for RateLimitResult {
fn default() -> Self {
Self {
remaining_connections: Ok(Default::default()),
remaining_matching: Err(
"no value supplied for remaining_matching".to_string(),
),
remaining_non_matching: Err(
"no value supplied for remaining_non_matching".to_string(),
),
remaining_per_endpoint: Err(
"no value supplied for remaining_per_endpoint".to_string(),
),
}
}
}
impl RateLimitResult {
pub fn remaining_connections<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RateLimitInfo>>,
T::Error: ::std::fmt::Display,
{
self.remaining_connections = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remaining_connections: {e}"
)
});
self
}
pub fn remaining_matching<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RateLimitInfo>,
T::Error: ::std::fmt::Display,
{
self.remaining_matching = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remaining_matching: {e}"
)
});
self
}
pub fn remaining_non_matching<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RateLimitInfo>,
T::Error: ::std::fmt::Display,
{
self.remaining_non_matching = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remaining_non_matching: {e}"
)
});
self
}
pub fn remaining_per_endpoint<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, super::RateLimitInfo>,
>,
T::Error: ::std::fmt::Display,
{
self.remaining_per_endpoint = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remaining_per_endpoint: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<RateLimitResult> for super::RateLimitResult {
type Error = super::error::ConversionError;
fn try_from(
value: RateLimitResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
remaining_connections: value.remaining_connections?,
remaining_matching: value.remaining_matching?,
remaining_non_matching: value.remaining_non_matching?,
remaining_per_endpoint: value.remaining_per_endpoint?,
})
}
}
impl ::std::convert::From<super::RateLimitResult> for RateLimitResult {
fn from(value: super::RateLimitResult) -> Self {
Self {
remaining_connections: Ok(value.remaining_connections),
remaining_matching: Ok(value.remaining_matching),
remaining_non_matching: Ok(value.remaining_non_matching),
remaining_per_endpoint: Ok(value.remaining_per_endpoint),
}
}
}
#[derive(Clone, Debug)]
pub struct ReferralPerformanceByInstrumentType {
builder_fee: ::std::result::Result<::std::string::String, ::std::string::String>,
fee_reward: ::std::result::Result<::std::string::String, ::std::string::String>,
notional_volume: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
referred_fee: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
unique_traders_referred: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ReferralPerformanceByInstrumentType {
fn default() -> Self {
Self {
builder_fee: Err("no value supplied for builder_fee".to_string()),
fee_reward: Err("no value supplied for fee_reward".to_string()),
notional_volume: Err(
"no value supplied for notional_volume".to_string(),
),
referred_fee: Err("no value supplied for referred_fee".to_string()),
unique_traders_referred: Err(
"no value supplied for unique_traders_referred".to_string(),
),
}
}
}
impl ReferralPerformanceByInstrumentType {
pub fn builder_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.builder_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for builder_fee: {e}")
});
self
}
pub fn fee_reward<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.fee_reward = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for fee_reward: {e}")
});
self
}
pub fn notional_volume<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.notional_volume = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for notional_volume: {e}")
});
self
}
pub fn referred_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referred_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referred_fee: {e}")
});
self
}
pub fn unique_traders_referred<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.unique_traders_referred = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for unique_traders_referred: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<ReferralPerformanceByInstrumentType>
for super::ReferralPerformanceByInstrumentType {
type Error = super::error::ConversionError;
fn try_from(
value: ReferralPerformanceByInstrumentType,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
builder_fee: value.builder_fee?,
fee_reward: value.fee_reward?,
notional_volume: value.notional_volume?,
referred_fee: value.referred_fee?,
unique_traders_referred: value.unique_traders_referred?,
})
}
}
impl ::std::convert::From<super::ReferralPerformanceByInstrumentType>
for ReferralPerformanceByInstrumentType {
fn from(value: super::ReferralPerformanceByInstrumentType) -> Self {
Self {
builder_fee: Ok(value.builder_fee),
fee_reward: Ok(value.fee_reward),
notional_volume: Ok(value.notional_volume),
referred_fee: Ok(value.referred_fee),
unique_traders_referred: Ok(value.unique_traders_referred),
}
}
}
#[derive(Clone, Debug)]
pub struct Referrer {
receiving_wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for Referrer {
fn default() -> Self {
Self {
receiving_wallet: Ok(Default::default()),
referral_code: Err("no value supplied for referral_code".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl Referrer {
pub fn receiving_wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.receiving_wallet = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for receiving_wallet: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<Referrer> for super::Referrer {
type Error = super::error::ConversionError;
fn try_from(
value: Referrer,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
receiving_wallet: value.receiving_wallet?,
referral_code: value.referral_code?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::Referrer> for Referrer {
fn from(value: super::Referrer) -> Self {
Self {
receiving_wallet: Ok(value.receiving_wallet),
referral_code: Ok(value.referral_code),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct RegisterDepositAddressParams {
deposit_type: ::std::result::Result<super::DepositType, ::std::string::String>,
manager_id: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for RegisterDepositAddressParams {
fn default() -> Self {
Self {
deposit_type: Err("no value supplied for deposit_type".to_string()),
manager_id: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl RegisterDepositAddressParams {
pub fn deposit_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DepositType>,
T::Error: ::std::fmt::Display,
{
self.deposit_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposit_type: {e}")
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<RegisterDepositAddressParams>
for super::RegisterDepositAddressParams {
type Error = super::error::ConversionError;
fn try_from(
value: RegisterDepositAddressParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
deposit_type: value.deposit_type?,
manager_id: value.manager_id?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::RegisterDepositAddressParams>
for RegisterDepositAddressParams {
fn from(value: super::RegisterDepositAddressParams) -> Self {
Self {
deposit_type: Ok(value.deposit_type),
manager_id: Ok(value.manager_id),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct RegisterDepositAddressResult {
deposit_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
deposit_type: ::std::result::Result<super::DepositType, ::std::string::String>,
manager_id: ::std::result::Result<
::std::option::Option<u32>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for RegisterDepositAddressResult {
fn default() -> Self {
Self {
deposit_address: Err(
"no value supplied for deposit_address".to_string(),
),
deposit_type: Err("no value supplied for deposit_type".to_string()),
manager_id: Ok(Default::default()),
subaccount_id: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl RegisterDepositAddressResult {
pub fn deposit_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.deposit_address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposit_address: {e}")
});
self
}
pub fn deposit_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::DepositType>,
T::Error: ::std::fmt::Display,
{
self.deposit_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deposit_type: {e}")
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<RegisterDepositAddressResult>
for super::RegisterDepositAddressResult {
type Error = super::error::ConversionError;
fn try_from(
value: RegisterDepositAddressResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
deposit_address: value.deposit_address?,
deposit_type: value.deposit_type?,
manager_id: value.manager_id?,
subaccount_id: value.subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::RegisterDepositAddressResult>
for RegisterDepositAddressResult {
fn from(value: super::RegisterDepositAddressResult) -> Self {
Self {
deposit_address: Ok(value.deposit_address),
deposit_type: Ok(value.deposit_type),
manager_id: Ok(value.manager_id),
subaccount_id: Ok(value.subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct RejectDepositRequestRequest {
reason: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
request_id: ::std::result::Result<super::VaultRequestId, ::std::string::String>,
}
impl ::std::default::Default for RejectDepositRequestRequest {
fn default() -> Self {
Self {
reason: Ok(Default::default()),
request_id: Err("no value supplied for request_id".to_string()),
}
}
}
impl RejectDepositRequestRequest {
pub fn reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.reason = value
.try_into()
.map_err(|e| format!("error converting supplied value for reason: {e}"));
self
}
pub fn request_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultRequestId>,
T::Error: ::std::fmt::Display,
{
self.request_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for request_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RejectDepositRequestRequest>
for super::RejectDepositRequestRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RejectDepositRequestRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
reason: value.reason?,
request_id: value.request_id?,
})
}
}
impl ::std::convert::From<super::RejectDepositRequestRequest>
for RejectDepositRequestRequest {
fn from(value: super::RejectDepositRequestRequest) -> Self {
Self {
reason: Ok(value.reason),
request_id: Ok(value.request_id),
}
}
}
#[derive(Clone, Debug)]
pub struct ReplaceOrderRequest {
algo_duration_sec: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_num_slices: ::std::result::Result<
::std::option::Option<i32>,
::std::string::String,
>,
algo_type: ::std::result::Result<
::std::option::Option<super::AlgoType>,
::std::string::String,
>,
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
client: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
expected_filled_amount: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
extra_fee: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_atomic_signing: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
limit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
nonce_to_cancel: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
order_id_to_cancel: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
order_type: ::std::result::Result<super::OrderType, ::std::string::String>,
reduce_only: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
reject_post_only: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
reject_timestamp: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
time_in_force: ::std::result::Result<super::TimeInForce, ::std::string::String>,
trigger_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
trigger_price_type: ::std::result::Result<
::std::option::Option<super::TriggerPriceType>,
::std::string::String,
>,
trigger_type: ::std::result::Result<
::std::option::Option<super::TriggerType>,
::std::string::String,
>,
}
impl ::std::default::Default for ReplaceOrderRequest {
fn default() -> Self {
Self {
algo_duration_sec: Ok(Default::default()),
algo_num_slices: Ok(Default::default()),
algo_type: Ok(Default::default()),
amount: Err("no value supplied for amount".to_string()),
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
expected_filled_amount: Ok(Default::default()),
extra_fee: Ok(Default::default()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_atomic_signing: Ok(Default::default()),
label: Ok(Default::default()),
limit_price: Err("no value supplied for limit_price".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
nonce_to_cancel: Ok(Default::default()),
order_id_to_cancel: Ok(Default::default()),
order_type: Ok(super::defaults::replace_order_request_order_type()),
reduce_only: Ok(Default::default()),
referral_code: Ok(Default::default()),
reject_post_only: Ok(Default::default()),
reject_timestamp: Ok(Default::default()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
time_in_force: Ok(
super::defaults::replace_order_request_time_in_force(),
),
trigger_price: Ok(Default::default()),
trigger_price_type: Ok(Default::default()),
trigger_type: Ok(Default::default()),
}
}
}
impl ReplaceOrderRequest {
pub fn algo_duration_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_duration_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_duration_sec: {e}")
});
self
}
pub fn algo_num_slices<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i32>>,
T::Error: ::std::fmt::Display,
{
self.algo_num_slices = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_num_slices: {e}")
});
self
}
pub fn algo_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::AlgoType>>,
T::Error: ::std::fmt::Display,
{
self.algo_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for algo_type: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn expected_filled_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.expected_filled_amount = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for expected_filled_amount: {e}"
)
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_atomic_signing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.is_atomic_signing = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_atomic_signing: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn limit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.limit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for limit_price: {e}")
});
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn nonce_to_cancel<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.nonce_to_cancel = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for nonce_to_cancel: {e}")
});
self
}
pub fn order_id_to_cancel<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.order_id_to_cancel = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for order_id_to_cancel: {e}"
)
});
self
}
pub fn order_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OrderType>,
T::Error: ::std::fmt::Display,
{
self.order_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_type: {e}")
});
self
}
pub fn reduce_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.reduce_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reduce_only: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn reject_post_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.reject_post_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_post_only: {e}")
});
self
}
pub fn reject_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.reject_timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for reject_timestamp: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn time_in_force<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TimeInForce>,
T::Error: ::std::fmt::Display,
{
self.time_in_force = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for time_in_force: {e}")
});
self
}
pub fn trigger_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_price: {e}")
});
self
}
pub fn trigger_price_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerPriceType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_price_type = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for trigger_price_type: {e}"
)
});
self
}
pub fn trigger_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::TriggerType>>,
T::Error: ::std::fmt::Display,
{
self.trigger_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trigger_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ReplaceOrderRequest> for super::ReplaceOrderRequest {
type Error = super::error::ConversionError;
fn try_from(
value: ReplaceOrderRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
algo_duration_sec: value.algo_duration_sec?,
algo_num_slices: value.algo_num_slices?,
algo_type: value.algo_type?,
amount: value.amount?,
client: value.client?,
direction: value.direction?,
expected_filled_amount: value.expected_filled_amount?,
extra_fee: value.extra_fee?,
instrument_name: value.instrument_name?,
is_atomic_signing: value.is_atomic_signing?,
label: value.label?,
limit_price: value.limit_price?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
nonce_to_cancel: value.nonce_to_cancel?,
order_id_to_cancel: value.order_id_to_cancel?,
order_type: value.order_type?,
reduce_only: value.reduce_only?,
referral_code: value.referral_code?,
reject_post_only: value.reject_post_only?,
reject_timestamp: value.reject_timestamp?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
time_in_force: value.time_in_force?,
trigger_price: value.trigger_price?,
trigger_price_type: value.trigger_price_type?,
trigger_type: value.trigger_type?,
})
}
}
impl ::std::convert::From<super::ReplaceOrderRequest> for ReplaceOrderRequest {
fn from(value: super::ReplaceOrderRequest) -> Self {
Self {
algo_duration_sec: Ok(value.algo_duration_sec),
algo_num_slices: Ok(value.algo_num_slices),
algo_type: Ok(value.algo_type),
amount: Ok(value.amount),
client: Ok(value.client),
direction: Ok(value.direction),
expected_filled_amount: Ok(value.expected_filled_amount),
extra_fee: Ok(value.extra_fee),
instrument_name: Ok(value.instrument_name),
is_atomic_signing: Ok(value.is_atomic_signing),
label: Ok(value.label),
limit_price: Ok(value.limit_price),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
nonce_to_cancel: Ok(value.nonce_to_cancel),
order_id_to_cancel: Ok(value.order_id_to_cancel),
order_type: Ok(value.order_type),
reduce_only: Ok(value.reduce_only),
referral_code: Ok(value.referral_code),
reject_post_only: Ok(value.reject_post_only),
reject_timestamp: Ok(value.reject_timestamp),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
time_in_force: Ok(value.time_in_force),
trigger_price: Ok(value.trigger_price),
trigger_price_type: Ok(value.trigger_price_type),
trigger_type: Ok(value.trigger_type),
}
}
}
#[derive(Clone, Debug)]
pub struct ReplaceOrderResponse {
cancelled_order: ::std::result::Result<super::Order, ::std::string::String>,
create_order_error: ::std::result::Result<
::std::option::Option<super::RpcError>,
::std::string::String,
>,
order: ::std::result::Result<
::std::option::Option<super::Order>,
::std::string::String,
>,
trades: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::Trade>>,
::std::string::String,
>,
}
impl ::std::default::Default for ReplaceOrderResponse {
fn default() -> Self {
Self {
cancelled_order: Err(
"no value supplied for cancelled_order".to_string(),
),
create_order_error: Ok(Default::default()),
order: Ok(Default::default()),
trades: Ok(Default::default()),
}
}
}
impl ReplaceOrderResponse {
pub fn cancelled_order<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Order>,
T::Error: ::std::fmt::Display,
{
self.cancelled_order = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancelled_order: {e}")
});
self
}
pub fn create_order_error<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RpcError>>,
T::Error: ::std::fmt::Display,
{
self.create_order_error = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for create_order_error: {e}"
)
});
self
}
pub fn order<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Order>>,
T::Error: ::std::fmt::Display,
{
self.order = value
.try_into()
.map_err(|e| format!("error converting supplied value for order: {e}"));
self
}
pub fn trades<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::Trade>>,
>,
T::Error: ::std::fmt::Display,
{
self.trades = value
.try_into()
.map_err(|e| format!("error converting supplied value for trades: {e}"));
self
}
}
impl ::std::convert::TryFrom<ReplaceOrderResponse> for super::ReplaceOrderResponse {
type Error = super::error::ConversionError;
fn try_from(
value: ReplaceOrderResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_order: value.cancelled_order?,
create_order_error: value.create_order_error?,
order: value.order?,
trades: value.trades?,
})
}
}
impl ::std::convert::From<super::ReplaceOrderResponse> for ReplaceOrderResponse {
fn from(value: super::ReplaceOrderResponse) -> Self {
Self {
cancelled_order: Ok(value.cancelled_order),
create_order_error: Ok(value.create_order_error),
order: Ok(value.order),
trades: Ok(value.trades),
}
}
}
#[derive(Clone, Debug)]
pub struct ReplaceQuoteRequest {
client: ::std::result::Result<::std::string::String, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
nonce_to_cancel: ::std::result::Result<
::std::option::Option<i64>,
::std::string::String,
>,
quote_id_to_cancel: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for ReplaceQuoteRequest {
fn default() -> Self {
Self {
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Ok(super::defaults::replace_quote_request_extra_fee()),
label: Ok(Default::default()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
nonce_to_cancel: Ok(Default::default()),
quote_id_to_cancel: Ok(Default::default()),
referral_code: Ok(Default::default()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl ReplaceQuoteRequest {
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn nonce_to_cancel<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<i64>>,
T::Error: ::std::fmt::Display,
{
self.nonce_to_cancel = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for nonce_to_cancel: {e}")
});
self
}
pub fn quote_id_to_cancel<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id_to_cancel = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for quote_id_to_cancel: {e}"
)
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<ReplaceQuoteRequest> for super::ReplaceQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: ReplaceQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
client: value.client?,
direction: value.direction?,
extra_fee: value.extra_fee?,
label: value.label?,
legs: value.legs?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
nonce_to_cancel: value.nonce_to_cancel?,
quote_id_to_cancel: value.quote_id_to_cancel?,
referral_code: value.referral_code?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::ReplaceQuoteRequest> for ReplaceQuoteRequest {
fn from(value: super::ReplaceQuoteRequest) -> Self {
Self {
client: Ok(value.client),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
label: Ok(value.label),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
nonce_to_cancel: Ok(value.nonce_to_cancel),
quote_id_to_cancel: Ok(value.quote_id_to_cancel),
referral_code: Ok(value.referral_code),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct RequestVaultDepositRequest {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
deposit_spot_asset: ::std::result::Result<super::Address, ::std::string::String>,
nonce: ::std::result::Result<u64, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
vault_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for RequestVaultDepositRequest {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
deposit_spot_asset: Err(
"no value supplied for deposit_spot_asset".to_string(),
),
nonce: Err("no value supplied for nonce".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
vault_subaccount_id: Err(
"no value supplied for vault_subaccount_id".to_string(),
),
}
}
}
impl RequestVaultDepositRequest {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn deposit_spot_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.deposit_spot_asset = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for deposit_spot_asset: {e}"
)
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn vault_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_subaccount_id: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<RequestVaultDepositRequest>
for super::RequestVaultDepositRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RequestVaultDepositRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
deposit_spot_asset: value.deposit_spot_asset?,
nonce: value.nonce?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
vault_subaccount_id: value.vault_subaccount_id?,
})
}
}
impl ::std::convert::From<super::RequestVaultDepositRequest>
for RequestVaultDepositRequest {
fn from(value: super::RequestVaultDepositRequest) -> Self {
Self {
amount: Ok(value.amount),
deposit_spot_asset: Ok(value.deposit_spot_asset),
nonce: Ok(value.nonce),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
vault_subaccount_id: Ok(value.vault_subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct RequestVaultWithdrawRequest {
nonce: ::std::result::Result<u64, ::std::string::String>,
shares_to_burn: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
vault_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for RequestVaultWithdrawRequest {
fn default() -> Self {
Self {
nonce: Err("no value supplied for nonce".to_string()),
shares_to_burn: Err("no value supplied for shares_to_burn".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
vault_subaccount_id: Err(
"no value supplied for vault_subaccount_id".to_string(),
),
}
}
}
impl RequestVaultWithdrawRequest {
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn shares_to_burn<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.shares_to_burn = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for shares_to_burn: {e}")
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn vault_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_subaccount_id: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<RequestVaultWithdrawRequest>
for super::RequestVaultWithdrawRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RequestVaultWithdrawRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
nonce: value.nonce?,
shares_to_burn: value.shares_to_burn?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
vault_subaccount_id: value.vault_subaccount_id?,
})
}
}
impl ::std::convert::From<super::RequestVaultWithdrawRequest>
for RequestVaultWithdrawRequest {
fn from(value: super::RequestVaultWithdrawRequest) -> Self {
Self {
nonce: Ok(value.nonce),
shares_to_burn: Ok(value.shares_to_burn),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
vault_subaccount_id: Ok(value.vault_subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct Rfq {
ask_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
bid_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
cancel_reason: ::std::result::Result<
super::RfqCancelReason,
::std::string::String,
>,
counterparties: ::std::result::Result<
::std::option::Option<::std::vec::Vec<super::Address>>,
::std::string::String,
>,
creation_timestamp: ::std::result::Result<i64, ::std::string::String>,
filled_direction: ::std::result::Result<
::std::option::Option<super::Direction>,
::std::string::String,
>,
filled_pct: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
last_update_timestamp: ::std::result::Result<i64, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::LegUnpricedParams>,
::std::string::String,
>,
mark_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
max_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
min_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
partial_fill_step: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
status: ::std::result::Result<super::RfqStatus, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
valid_until: ::std::result::Result<i64, ::std::string::String>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for Rfq {
fn default() -> Self {
Self {
ask_total_cost: Err("no value supplied for ask_total_cost".to_string()),
bid_total_cost: Err("no value supplied for bid_total_cost".to_string()),
cancel_reason: Err("no value supplied for cancel_reason".to_string()),
counterparties: Ok(Default::default()),
creation_timestamp: Err(
"no value supplied for creation_timestamp".to_string(),
),
filled_direction: Ok(Default::default()),
filled_pct: Err("no value supplied for filled_pct".to_string()),
label: Err("no value supplied for label".to_string()),
last_update_timestamp: Err(
"no value supplied for last_update_timestamp".to_string(),
),
legs: Err("no value supplied for legs".to_string()),
mark_total_cost: Err(
"no value supplied for mark_total_cost".to_string(),
),
max_total_cost: Err("no value supplied for max_total_cost".to_string()),
min_total_cost: Err("no value supplied for min_total_cost".to_string()),
partial_fill_step: Err(
"no value supplied for partial_fill_step".to_string(),
),
rfq_id: Err("no value supplied for rfq_id".to_string()),
status: Err("no value supplied for status".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
total_cost: Err("no value supplied for total_cost".to_string()),
valid_until: Err("no value supplied for valid_until".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl Rfq {
pub fn ask_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.ask_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ask_total_cost: {e}")
});
self
}
pub fn bid_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.bid_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for bid_total_cost: {e}")
});
self
}
pub fn cancel_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqCancelReason>,
T::Error: ::std::fmt::Display,
{
self.cancel_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cancel_reason: {e}")
});
self
}
pub fn counterparties<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<super::Address>>,
>,
T::Error: ::std::fmt::Display,
{
self.counterparties = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for counterparties: {e}")
});
self
}
pub fn creation_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp: {e}"
)
});
self
}
pub fn filled_direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Direction>>,
T::Error: ::std::fmt::Display,
{
self.filled_direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_direction: {e}")
});
self
}
pub fn filled_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.filled_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_pct: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn last_update_timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.last_update_timestamp = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for last_update_timestamp: {e}"
)
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::LegUnpricedParams>>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn mark_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.mark_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_total_cost: {e}")
});
self
}
pub fn max_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.max_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_total_cost: {e}")
});
self
}
pub fn min_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.min_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_total_cost: {e}")
});
self
}
pub fn partial_fill_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.partial_fill_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for partial_fill_step: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RfqStatus>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_cost: {e}")
});
self
}
pub fn valid_until<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.valid_until = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for valid_until: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<Rfq> for super::Rfq {
type Error = super::error::ConversionError;
fn try_from(
value: Rfq,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ask_total_cost: value.ask_total_cost?,
bid_total_cost: value.bid_total_cost?,
cancel_reason: value.cancel_reason?,
counterparties: value.counterparties?,
creation_timestamp: value.creation_timestamp?,
filled_direction: value.filled_direction?,
filled_pct: value.filled_pct?,
label: value.label?,
last_update_timestamp: value.last_update_timestamp?,
legs: value.legs?,
mark_total_cost: value.mark_total_cost?,
max_total_cost: value.max_total_cost?,
min_total_cost: value.min_total_cost?,
partial_fill_step: value.partial_fill_step?,
rfq_id: value.rfq_id?,
status: value.status?,
subaccount_id: value.subaccount_id?,
total_cost: value.total_cost?,
valid_until: value.valid_until?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::Rfq> for Rfq {
fn from(value: super::Rfq) -> Self {
Self {
ask_total_cost: Ok(value.ask_total_cost),
bid_total_cost: Ok(value.bid_total_cost),
cancel_reason: Ok(value.cancel_reason),
counterparties: Ok(value.counterparties),
creation_timestamp: Ok(value.creation_timestamp),
filled_direction: Ok(value.filled_direction),
filled_pct: Ok(value.filled_pct),
label: Ok(value.label),
last_update_timestamp: Ok(value.last_update_timestamp),
legs: Ok(value.legs),
mark_total_cost: Ok(value.mark_total_cost),
max_total_cost: Ok(value.max_total_cost),
min_total_cost: Ok(value.min_total_cost),
partial_fill_step: Ok(value.partial_fill_step),
rfq_id: Ok(value.rfq_id),
status: Ok(value.status),
subaccount_id: Ok(value.subaccount_id),
total_cost: Ok(value.total_cost),
valid_until: Ok(value.valid_until),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct RfqGetBestQuoteRequest {
client: ::std::result::Result<::std::string::String, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
legs: ::std::result::Result<
::std::vec::Vec<super::LegUnpricedParams>,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for RfqGetBestQuoteRequest {
fn default() -> Self {
Self {
client: Ok(Default::default()),
direction: Ok(super::defaults::rfq_get_best_quote_request_direction()),
extra_fee: Ok(super::defaults::rfq_get_best_quote_request_extra_fee()),
legs: Ok(Default::default()),
rfq_id: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl RfqGetBestQuoteRequest {
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::LegUnpricedParams>>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RfqGetBestQuoteRequest>
for super::RfqGetBestQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RfqGetBestQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
client: value.client?,
direction: value.direction?,
extra_fee: value.extra_fee?,
legs: value.legs?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::RfqGetBestQuoteRequest> for RfqGetBestQuoteRequest {
fn from(value: super::RfqGetBestQuoteRequest) -> Self {
Self {
client: Ok(value.client),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
legs: Ok(value.legs),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct RfqGetBestQuoteResponse {
best_quote: ::std::result::Result<
::std::option::Option<super::PublicQuote>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
down_liquidation_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
estimated_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
estimated_realized_pnl: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
estimated_realized_pnl_excl_fees: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
estimated_total_cost: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
filled_pct: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
invalid_reason: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
is_valid: ::std::result::Result<bool, ::std::string::String>,
orderbook_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
post_initial_margin: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
post_liquidation_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
pre_initial_margin: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
suggested_max_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
up_liquidation_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
}
impl ::std::default::Default for RfqGetBestQuoteResponse {
fn default() -> Self {
Self {
best_quote: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
down_liquidation_price: Err(
"no value supplied for down_liquidation_price".to_string(),
),
estimated_fee: Err("no value supplied for estimated_fee".to_string()),
estimated_realized_pnl: Err(
"no value supplied for estimated_realized_pnl".to_string(),
),
estimated_realized_pnl_excl_fees: Err(
"no value supplied for estimated_realized_pnl_excl_fees".to_string(),
),
estimated_total_cost: Err(
"no value supplied for estimated_total_cost".to_string(),
),
filled_pct: Err("no value supplied for filled_pct".to_string()),
invalid_reason: Ok(Default::default()),
is_valid: Err("no value supplied for is_valid".to_string()),
orderbook_total_cost: Err(
"no value supplied for orderbook_total_cost".to_string(),
),
post_initial_margin: Err(
"no value supplied for post_initial_margin".to_string(),
),
post_liquidation_price: Err(
"no value supplied for post_liquidation_price".to_string(),
),
pre_initial_margin: Err(
"no value supplied for pre_initial_margin".to_string(),
),
suggested_max_fee: Err(
"no value supplied for suggested_max_fee".to_string(),
),
up_liquidation_price: Err(
"no value supplied for up_liquidation_price".to_string(),
),
}
}
}
impl RfqGetBestQuoteResponse {
pub fn best_quote<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::PublicQuote>>,
T::Error: ::std::fmt::Display,
{
self.best_quote = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for best_quote: {e}")
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn down_liquidation_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.down_liquidation_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for down_liquidation_price: {e}"
)
});
self
}
pub fn estimated_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.estimated_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for estimated_fee: {e}")
});
self
}
pub fn estimated_realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.estimated_realized_pnl = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_realized_pnl: {e}"
)
});
self
}
pub fn estimated_realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.estimated_realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn estimated_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.estimated_total_cost = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for estimated_total_cost: {e}"
)
});
self
}
pub fn filled_pct<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.filled_pct = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for filled_pct: {e}")
});
self
}
pub fn invalid_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.invalid_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for invalid_reason: {e}")
});
self
}
pub fn is_valid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_valid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_valid: {e}")
});
self
}
pub fn orderbook_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.orderbook_total_cost = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for orderbook_total_cost: {e}"
)
});
self
}
pub fn post_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.post_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for post_initial_margin: {e}"
)
});
self
}
pub fn post_liquidation_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.post_liquidation_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for post_liquidation_price: {e}"
)
});
self
}
pub fn pre_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.pre_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for pre_initial_margin: {e}"
)
});
self
}
pub fn suggested_max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.suggested_max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for suggested_max_fee: {e}")
});
self
}
pub fn up_liquidation_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.up_liquidation_price = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for up_liquidation_price: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<RfqGetBestQuoteResponse>
for super::RfqGetBestQuoteResponse {
type Error = super::error::ConversionError;
fn try_from(
value: RfqGetBestQuoteResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
best_quote: value.best_quote?,
direction: value.direction?,
down_liquidation_price: value.down_liquidation_price?,
estimated_fee: value.estimated_fee?,
estimated_realized_pnl: value.estimated_realized_pnl?,
estimated_realized_pnl_excl_fees: value
.estimated_realized_pnl_excl_fees?,
estimated_total_cost: value.estimated_total_cost?,
filled_pct: value.filled_pct?,
invalid_reason: value.invalid_reason?,
is_valid: value.is_valid?,
orderbook_total_cost: value.orderbook_total_cost?,
post_initial_margin: value.post_initial_margin?,
post_liquidation_price: value.post_liquidation_price?,
pre_initial_margin: value.pre_initial_margin?,
suggested_max_fee: value.suggested_max_fee?,
up_liquidation_price: value.up_liquidation_price?,
})
}
}
impl ::std::convert::From<super::RfqGetBestQuoteResponse>
for RfqGetBestQuoteResponse {
fn from(value: super::RfqGetBestQuoteResponse) -> Self {
Self {
best_quote: Ok(value.best_quote),
direction: Ok(value.direction),
down_liquidation_price: Ok(value.down_liquidation_price),
estimated_fee: Ok(value.estimated_fee),
estimated_realized_pnl: Ok(value.estimated_realized_pnl),
estimated_realized_pnl_excl_fees: Ok(
value.estimated_realized_pnl_excl_fees,
),
estimated_total_cost: Ok(value.estimated_total_cost),
filled_pct: Ok(value.filled_pct),
invalid_reason: Ok(value.invalid_reason),
is_valid: Ok(value.is_valid),
orderbook_total_cost: Ok(value.orderbook_total_cost),
post_initial_margin: Ok(value.post_initial_margin),
post_liquidation_price: Ok(value.post_liquidation_price),
pre_initial_margin: Ok(value.pre_initial_margin),
suggested_max_fee: Ok(value.suggested_max_fee),
up_liquidation_price: Ok(value.up_liquidation_price),
}
}
}
#[derive(Clone, Debug)]
pub struct RfqGetResponse {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
rfqs: ::std::result::Result<::std::vec::Vec<super::Rfq>, ::std::string::String>,
}
impl ::std::default::Default for RfqGetResponse {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
rfqs: Err("no value supplied for rfqs".to_string()),
}
}
}
impl RfqGetResponse {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn rfqs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Rfq>>,
T::Error: ::std::fmt::Display,
{
self.rfqs = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfqs: {e}"));
self
}
}
impl ::std::convert::TryFrom<RfqGetResponse> for super::RfqGetResponse {
type Error = super::error::ConversionError;
fn try_from(
value: RfqGetResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
rfqs: value.rfqs?,
})
}
}
impl ::std::convert::From<super::RfqGetResponse> for RfqGetResponse {
fn from(value: super::RfqGetResponse) -> Self {
Self {
pagination: Ok(value.pagination),
rfqs: Ok(value.rfqs),
}
}
}
#[derive(Clone, Debug)]
pub struct RfqPollResponse {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
rfqs: ::std::result::Result<
::std::vec::Vec<super::PublicRfq>,
::std::string::String,
>,
}
impl ::std::default::Default for RfqPollResponse {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
rfqs: Err("no value supplied for rfqs".to_string()),
}
}
}
impl RfqPollResponse {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn rfqs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PublicRfq>>,
T::Error: ::std::fmt::Display,
{
self.rfqs = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfqs: {e}"));
self
}
}
impl ::std::convert::TryFrom<RfqPollResponse> for super::RfqPollResponse {
type Error = super::error::ConversionError;
fn try_from(
value: RfqPollResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
rfqs: value.rfqs?,
})
}
}
impl ::std::convert::From<super::RfqPollResponse> for RfqPollResponse {
fn from(value: super::RfqPollResponse) -> Self {
Self {
pagination: Ok(value.pagination),
rfqs: Ok(value.rfqs),
}
}
}
#[derive(Clone, Debug)]
pub struct RiskUniverse {
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
managers: ::std::result::Result<
::std::vec::Vec<super::RiskUniverseManager>,
::std::string::String,
>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
security_module: ::std::result::Result<
super::SecurityModuleDetails,
::std::string::String,
>,
}
impl ::std::default::Default for RiskUniverse {
fn default() -> Self {
Self {
description: Ok(Default::default()),
managers: Err("no value supplied for managers".to_string()),
name: Ok(Default::default()),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
security_module: Err("no value supplied for security_module".to_string()),
}
}
}
impl RiskUniverse {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn managers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::RiskUniverseManager>>,
T::Error: ::std::fmt::Display,
{
self.managers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for managers: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn security_module<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SecurityModuleDetails>,
T::Error: ::std::fmt::Display,
{
self.security_module = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for security_module: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RiskUniverse> for super::RiskUniverse {
type Error = super::error::ConversionError;
fn try_from(
value: RiskUniverse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
managers: value.managers?,
name: value.name?,
risk_universe_id: value.risk_universe_id?,
security_module: value.security_module?,
})
}
}
impl ::std::convert::From<super::RiskUniverse> for RiskUniverse {
fn from(value: super::RiskUniverse) -> Self {
Self {
description: Ok(value.description),
managers: Ok(value.managers),
name: Ok(value.name),
risk_universe_id: Ok(value.risk_universe_id),
security_module: Ok(value.security_module),
}
}
}
#[derive(Clone, Debug)]
pub struct RiskUniverseManager {
collaterals: ::std::result::Result<
::std::vec::Vec<super::ManagerCollateral>,
::std::string::String,
>,
instruments: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
manager_id: ::std::result::Result<u32, ::std::string::String>,
margin_type: ::std::result::Result<super::MarginType, ::std::string::String>,
}
impl ::std::default::Default for RiskUniverseManager {
fn default() -> Self {
Self {
collaterals: Err("no value supplied for collaterals".to_string()),
instruments: Err("no value supplied for instruments".to_string()),
manager_id: Err("no value supplied for manager_id".to_string()),
margin_type: Err("no value supplied for margin_type".to_string()),
}
}
}
impl RiskUniverseManager {
pub fn collaterals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ManagerCollateral>>,
T::Error: ::std::fmt::Display,
{
self.collaterals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for collaterals: {e}")
});
self
}
pub fn instruments<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.instruments = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instruments: {e}")
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn margin_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::MarginType>,
T::Error: ::std::fmt::Display,
{
self.margin_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for margin_type: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RiskUniverseManager> for super::RiskUniverseManager {
type Error = super::error::ConversionError;
fn try_from(
value: RiskUniverseManager,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
collaterals: value.collaterals?,
instruments: value.instruments?,
manager_id: value.manager_id?,
margin_type: value.margin_type?,
})
}
}
impl ::std::convert::From<super::RiskUniverseManager> for RiskUniverseManager {
fn from(value: super::RiskUniverseManager) -> Self {
Self {
collaterals: Ok(value.collaterals),
instruments: Ok(value.instruments),
manager_id: Ok(value.manager_id),
margin_type: Ok(value.margin_type),
}
}
}
#[derive(Clone, Debug)]
pub struct RpcError {
code: ::std::result::Result<i64, ::std::string::String>,
data: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
message: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for RpcError {
fn default() -> Self {
Self {
code: Err("no value supplied for code".to_string()),
data: Ok(Default::default()),
message: Err("no value supplied for message".to_string()),
}
}
}
impl RpcError {
pub fn code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.code = value
.try_into()
.map_err(|e| format!("error converting supplied value for code: {e}"));
self
}
pub fn data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.data = value
.try_into()
.map_err(|e| format!("error converting supplied value for data: {e}"));
self
}
pub fn message<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.message = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for message: {e}")
});
self
}
}
impl ::std::convert::TryFrom<RpcError> for super::RpcError {
type Error = super::error::ConversionError;
fn try_from(
value: RpcError,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
code: value.code?,
data: value.data?,
message: value.message?,
})
}
}
impl ::std::convert::From<super::RpcError> for RpcError {
fn from(value: super::RpcError) -> Self {
Self {
code: Ok(value.code),
data: Ok(value.data),
message: Ok(value.message),
}
}
}
#[derive(Clone, Debug)]
pub struct SecurityModuleDetails {
cash_asset: ::std::result::Result<::std::string::String, ::std::string::String>,
cash_currency: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SecurityModuleDetails {
fn default() -> Self {
Self {
cash_asset: Err("no value supplied for cash_asset".to_string()),
cash_currency: Err("no value supplied for cash_currency".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SecurityModuleDetails {
pub fn cash_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.cash_asset = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cash_asset: {e}")
});
self
}
pub fn cash_currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.cash_currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cash_currency: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SecurityModuleDetails>
for super::SecurityModuleDetails {
type Error = super::error::ConversionError;
fn try_from(
value: SecurityModuleDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cash_asset: value.cash_asset?,
cash_currency: value.cash_currency?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SecurityModuleDetails> for SecurityModuleDetails {
fn from(value: super::SecurityModuleDetails) -> Self {
Self {
cash_asset: Ok(value.cash_asset),
cash_currency: Ok(value.cash_currency),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SendQuoteRequest {
client: ::std::result::Result<::std::string::String, ::std::string::String>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
mmp: ::std::result::Result<bool, ::std::string::String>,
nonce: ::std::result::Result<i64, ::std::string::String>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
rfq_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SendQuoteRequest {
fn default() -> Self {
Self {
client: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
extra_fee: Ok(super::defaults::send_quote_request_extra_fee()),
label: Ok(Default::default()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
mmp: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
referral_code: Ok(Default::default()),
rfq_id: Err("no value supplied for rfq_id".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SendQuoteRequest {
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn mmp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.mmp = value
.try_into()
.map_err(|e| format!("error converting supplied value for mmp: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::uuid::Uuid>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SendQuoteRequest> for super::SendQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SendQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
client: value.client?,
direction: value.direction?,
extra_fee: value.extra_fee?,
label: value.label?,
legs: value.legs?,
max_fee: value.max_fee?,
mmp: value.mmp?,
nonce: value.nonce?,
referral_code: value.referral_code?,
rfq_id: value.rfq_id?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SendQuoteRequest> for SendQuoteRequest {
fn from(value: super::SendQuoteRequest) -> Self {
Self {
client: Ok(value.client),
direction: Ok(value.direction),
extra_fee: Ok(value.extra_fee),
label: Ok(value.label),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
mmp: Ok(value.mmp),
nonce: Ok(value.nonce),
referral_code: Ok(value.referral_code),
rfq_id: Ok(value.rfq_id),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SendRfqRequest {
client: ::std::result::Result<::std::string::String, ::std::string::String>,
counterparties: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::LegUnpricedParams>,
::std::string::String,
>,
max_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
min_total_cost: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
partial_fill_step: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
referral_code: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SendRfqRequest {
fn default() -> Self {
Self {
client: Ok(Default::default()),
counterparties: Ok(Default::default()),
extra_fee: Ok(super::defaults::send_rfq_request_extra_fee()),
label: Ok(Default::default()),
legs: Err("no value supplied for legs".to_string()),
max_total_cost: Ok(Default::default()),
min_total_cost: Ok(Default::default()),
partial_fill_step: Ok(
super::defaults::send_rfq_request_partial_fill_step(),
),
referral_code: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SendRfqRequest {
pub fn client<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.client = value
.try_into()
.map_err(|e| format!("error converting supplied value for client: {e}"));
self
}
pub fn counterparties<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.counterparties = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for counterparties: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::LegUnpricedParams>>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.max_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_total_cost: {e}")
});
self
}
pub fn min_total_cost<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.min_total_cost = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_total_cost: {e}")
});
self
}
pub fn partial_fill_step<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.partial_fill_step = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for partial_fill_step: {e}")
});
self
}
pub fn referral_code<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.referral_code = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for referral_code: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SendRfqRequest> for super::SendRfqRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SendRfqRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
client: value.client?,
counterparties: value.counterparties?,
extra_fee: value.extra_fee?,
label: value.label?,
legs: value.legs?,
max_total_cost: value.max_total_cost?,
min_total_cost: value.min_total_cost?,
partial_fill_step: value.partial_fill_step?,
referral_code: value.referral_code?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SendRfqRequest> for SendRfqRequest {
fn from(value: super::SendRfqRequest) -> Self {
Self {
client: Ok(value.client),
counterparties: Ok(value.counterparties),
extra_fee: Ok(value.extra_fee),
label: Ok(value.label),
legs: Ok(value.legs),
max_total_cost: Ok(value.max_total_cost),
min_total_cost: Ok(value.min_total_cost),
partial_fill_step: Ok(value.partial_fill_step),
referral_code: Ok(value.referral_code),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SessionKey {
expiry_sec: ::std::result::Result<u64, ::std::string::String>,
ip_whitelist: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
offchain_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
protocol_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
public_session_key: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
registered_sec: ::std::result::Result<u64, ::std::string::String>,
subaccount_ids: ::std::result::Result<
::std::vec::Vec<u64>,
::std::string::String,
>,
}
impl ::std::default::Default for SessionKey {
fn default() -> Self {
Self {
expiry_sec: Err("no value supplied for expiry_sec".to_string()),
ip_whitelist: Err("no value supplied for ip_whitelist".to_string()),
label: Err("no value supplied for label".to_string()),
offchain_scopes: Err(
"no value supplied for offchain_scopes".to_string(),
),
protocol_scopes: Err(
"no value supplied for protocol_scopes".to_string(),
),
public_session_key: Err(
"no value supplied for public_session_key".to_string(),
),
registered_sec: Err("no value supplied for registered_sec".to_string()),
subaccount_ids: Err("no value supplied for subaccount_ids".to_string()),
}
}
}
impl SessionKey {
pub fn expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiry_sec: {e}")
});
self
}
pub fn ip_whitelist<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.ip_whitelist = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ip_whitelist: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn offchain_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.offchain_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for offchain_scopes: {e}")
});
self
}
pub fn protocol_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.protocol_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for protocol_scopes: {e}")
});
self
}
pub fn public_session_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.public_session_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_key: {e}"
)
});
self
}
pub fn registered_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.registered_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for registered_sec: {e}")
});
self
}
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SessionKey> for super::SessionKey {
type Error = super::error::ConversionError;
fn try_from(
value: SessionKey,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
expiry_sec: value.expiry_sec?,
ip_whitelist: value.ip_whitelist?,
label: value.label?,
offchain_scopes: value.offchain_scopes?,
protocol_scopes: value.protocol_scopes?,
public_session_key: value.public_session_key?,
registered_sec: value.registered_sec?,
subaccount_ids: value.subaccount_ids?,
})
}
}
impl ::std::convert::From<super::SessionKey> for SessionKey {
fn from(value: super::SessionKey) -> Self {
Self {
expiry_sec: Ok(value.expiry_sec),
ip_whitelist: Ok(value.ip_whitelist),
label: Ok(value.label),
offchain_scopes: Ok(value.offchain_scopes),
protocol_scopes: Ok(value.protocol_scopes),
public_session_key: Ok(value.public_session_key),
registered_sec: Ok(value.registered_sec),
subaccount_ids: Ok(value.subaccount_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct SessionKeysRequest {
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for SessionKeysRequest {
fn default() -> Self {
Self {
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl SessionKeysRequest {
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<SessionKeysRequest> for super::SessionKeysRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SessionKeysRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { wallet: value.wallet? })
}
}
impl ::std::convert::From<super::SessionKeysRequest> for SessionKeysRequest {
fn from(value: super::SessionKeysRequest) -> Self {
Self { wallet: Ok(value.wallet) }
}
}
#[derive(Clone, Debug)]
pub struct SetCancelOnDisconnectRequest {
enabled: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
wallet: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for SetCancelOnDisconnectRequest {
fn default() -> Self {
Self {
enabled: Ok(Default::default()),
wallet: Ok(Default::default()),
}
}
}
impl SetCancelOnDisconnectRequest {
pub fn enabled<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.enabled = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for enabled: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<SetCancelOnDisconnectRequest>
for super::SetCancelOnDisconnectRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SetCancelOnDisconnectRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
enabled: value.enabled?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::SetCancelOnDisconnectRequest>
for SetCancelOnDisconnectRequest {
fn from(value: super::SetCancelOnDisconnectRequest) -> Self {
Self {
enabled: Ok(value.enabled),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct SetMmpConfigRequest {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
mmp_amount_limit: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
mmp_delta_limit: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
mmp_frozen_time: ::std::result::Result<u64, ::std::string::String>,
mmp_interval: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SetMmpConfigRequest {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
mmp_amount_limit: Ok(
super::defaults::set_mmp_config_request_mmp_amount_limit(),
),
mmp_delta_limit: Ok(
super::defaults::set_mmp_config_request_mmp_delta_limit(),
),
mmp_frozen_time: Err(
"no value supplied for mmp_frozen_time".to_string(),
),
mmp_interval: Err("no value supplied for mmp_interval".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SetMmpConfigRequest {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn mmp_amount_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.mmp_amount_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_amount_limit: {e}")
});
self
}
pub fn mmp_delta_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.mmp_delta_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_delta_limit: {e}")
});
self
}
pub fn mmp_frozen_time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_frozen_time = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_frozen_time: {e}")
});
self
}
pub fn mmp_interval<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_interval = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_interval: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SetMmpConfigRequest> for super::SetMmpConfigRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SetMmpConfigRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
mmp_amount_limit: value.mmp_amount_limit?,
mmp_delta_limit: value.mmp_delta_limit?,
mmp_frozen_time: value.mmp_frozen_time?,
mmp_interval: value.mmp_interval?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SetMmpConfigRequest> for SetMmpConfigRequest {
fn from(value: super::SetMmpConfigRequest) -> Self {
Self {
currency: Ok(value.currency),
mmp_amount_limit: Ok(value.mmp_amount_limit),
mmp_delta_limit: Ok(value.mmp_delta_limit),
mmp_frozen_time: Ok(value.mmp_frozen_time),
mmp_interval: Ok(value.mmp_interval),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SetMmpConfigResponse {
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
mmp_amount_limit: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mmp_delta_limit: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
mmp_frozen_time: ::std::result::Result<u64, ::std::string::String>,
mmp_interval: ::std::result::Result<u64, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SetMmpConfigResponse {
fn default() -> Self {
Self {
currency: Err("no value supplied for currency".to_string()),
mmp_amount_limit: Err(
"no value supplied for mmp_amount_limit".to_string(),
),
mmp_delta_limit: Err(
"no value supplied for mmp_delta_limit".to_string(),
),
mmp_frozen_time: Err(
"no value supplied for mmp_frozen_time".to_string(),
),
mmp_interval: Err("no value supplied for mmp_interval".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SetMmpConfigResponse {
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn mmp_amount_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mmp_amount_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_amount_limit: {e}")
});
self
}
pub fn mmp_delta_limit<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.mmp_delta_limit = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_delta_limit: {e}")
});
self
}
pub fn mmp_frozen_time<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_frozen_time = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_frozen_time: {e}")
});
self
}
pub fn mmp_interval<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.mmp_interval = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mmp_interval: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SetMmpConfigResponse> for super::SetMmpConfigResponse {
type Error = super::error::ConversionError;
fn try_from(
value: SetMmpConfigResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
currency: value.currency?,
mmp_amount_limit: value.mmp_amount_limit?,
mmp_delta_limit: value.mmp_delta_limit?,
mmp_frozen_time: value.mmp_frozen_time?,
mmp_interval: value.mmp_interval?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SetMmpConfigResponse> for SetMmpConfigResponse {
fn from(value: super::SetMmpConfigResponse) -> Self {
Self {
currency: Ok(value.currency),
mmp_amount_limit: Ok(value.mmp_amount_limit),
mmp_delta_limit: Ok(value.mmp_delta_limit),
mmp_frozen_time: Ok(value.mmp_frozen_time),
mmp_interval: Ok(value.mmp_interval),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SetSessionKeyRequest {
expiry_sec: ::std::result::Result<u64, ::std::string::String>,
ip_whitelist: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
label: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
offchain_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
protocol_scopes: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
public_session_key: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_ids: ::std::result::Result<
::std::option::Option<::std::vec::Vec<u64>>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for SetSessionKeyRequest {
fn default() -> Self {
Self {
expiry_sec: Err("no value supplied for expiry_sec".to_string()),
ip_whitelist: Ok(Default::default()),
label: Ok(Default::default()),
nonce: Err("no value supplied for nonce".to_string()),
offchain_scopes: Err(
"no value supplied for offchain_scopes".to_string(),
),
protocol_scopes: Err(
"no value supplied for protocol_scopes".to_string(),
),
public_session_key: Err(
"no value supplied for public_session_key".to_string(),
),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_ids: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl SetSessionKeyRequest {
pub fn expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expiry_sec: {e}")
});
self
}
pub fn ip_whitelist<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.ip_whitelist = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for ip_whitelist: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn offchain_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.offchain_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for offchain_scopes: {e}")
});
self
}
pub fn protocol_scopes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.protocol_scopes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for protocol_scopes: {e}")
});
self
}
pub fn public_session_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.public_session_key = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for public_session_key: {e}"
)
});
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::vec::Vec<u64>>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<SetSessionKeyRequest> for super::SetSessionKeyRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SetSessionKeyRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
expiry_sec: value.expiry_sec?,
ip_whitelist: value.ip_whitelist?,
label: value.label?,
nonce: value.nonce?,
offchain_scopes: value.offchain_scopes?,
protocol_scopes: value.protocol_scopes?,
public_session_key: value.public_session_key?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_ids: value.subaccount_ids?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::SetSessionKeyRequest> for SetSessionKeyRequest {
fn from(value: super::SetSessionKeyRequest) -> Self {
Self {
expiry_sec: Ok(value.expiry_sec),
ip_whitelist: Ok(value.ip_whitelist),
label: Ok(value.label),
nonce: Ok(value.nonce),
offchain_scopes: Ok(value.offchain_scopes),
protocol_scopes: Ok(value.protocol_scopes),
public_session_key: Ok(value.public_session_key),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_ids: Ok(value.subaccount_ids),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct SettledTrade {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
expected_rebate: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
index_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
mark_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
quote_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
trade_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_id: ::std::result::Result<::std::string::String, ::std::string::String>,
trade_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
tx_hash: ::std::result::Result<::std::string::String, ::std::string::String>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for SettledTrade {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
expected_rebate: Err(
"no value supplied for expected_rebate".to_string(),
),
extra_fee: Err("no value supplied for extra_fee".to_string()),
index_price: Err("no value supplied for index_price".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
mark_price: Err("no value supplied for mark_price".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
rfq_id: Err("no value supplied for rfq_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
trade_amount: Err("no value supplied for trade_amount".to_string()),
trade_fee: Err("no value supplied for trade_fee".to_string()),
trade_id: Err("no value supplied for trade_id".to_string()),
trade_price: Err("no value supplied for trade_price".to_string()),
tx_hash: Err("no value supplied for tx_hash".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl SettledTrade {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn expected_rebate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.expected_rebate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expected_rebate: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn index_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.index_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for index_price: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn trade_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_amount: {e}")
});
self
}
pub fn trade_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_fee: {e}")
});
self
}
pub fn trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_id: {e}")
});
self
}
pub fn trade_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_price: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<SettledTrade> for super::SettledTrade {
type Error = super::error::ConversionError;
fn try_from(
value: SettledTrade,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
direction: value.direction?,
expected_rebate: value.expected_rebate?,
extra_fee: value.extra_fee?,
index_price: value.index_price?,
instrument_name: value.instrument_name?,
liquidity_role: value.liquidity_role?,
mark_price: value.mark_price?,
quote_id: value.quote_id?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
trade_amount: value.trade_amount?,
trade_fee: value.trade_fee?,
trade_id: value.trade_id?,
trade_price: value.trade_price?,
tx_hash: value.tx_hash?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::SettledTrade> for SettledTrade {
fn from(value: super::SettledTrade) -> Self {
Self {
batch_status: Ok(value.batch_status),
direction: Ok(value.direction),
expected_rebate: Ok(value.expected_rebate),
extra_fee: Ok(value.extra_fee),
index_price: Ok(value.index_price),
instrument_name: Ok(value.instrument_name),
liquidity_role: Ok(value.liquidity_role),
mark_price: Ok(value.mark_price),
quote_id: Ok(value.quote_id),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
trade_amount: Ok(value.trade_amount),
trade_fee: Ok(value.trade_fee),
trade_id: Ok(value.trade_id),
trade_price: Ok(value.trade_price),
tx_hash: Ok(value.tx_hash),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct SignedAction {
action: ::std::result::Result<super::Action, ::std::string::String>,
signature: ::std::result::Result<::std::vec::Vec<u8>, ::std::string::String>,
}
impl ::std::default::Default for SignedAction {
fn default() -> Self {
Self {
action: Err("no value supplied for action".to_string()),
signature: Err("no value supplied for signature".to_string()),
}
}
}
impl SignedAction {
pub fn action<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Action>,
T::Error: ::std::fmt::Display,
{
self.action = value
.try_into()
.map_err(|e| format!("error converting supplied value for action: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u8>>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SignedAction> for super::SignedAction {
type Error = super::error::ConversionError;
fn try_from(
value: SignedAction,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
action: value.action?,
signature: value.signature?,
})
}
}
impl ::std::convert::From<super::SignedAction> for SignedAction {
fn from(value: super::SignedAction) -> Self {
Self {
action: Ok(value.action),
signature: Ok(value.signature),
}
}
}
#[derive(Clone, Debug)]
pub struct SignedTransferQuoteRequest {
direction: ::std::result::Result<super::Direction, ::std::string::String>,
legs: ::std::result::Result<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
::std::string::String,
>,
max_fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<i64, ::std::string::String>,
signer: ::std::result::Result<super::Address, ::std::string::String>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for SignedTransferQuoteRequest {
fn default() -> Self {
Self {
direction: Err("no value supplied for direction".to_string()),
legs: Err("no value supplied for legs".to_string()),
max_fee: Err("no value supplied for max_fee".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl SignedTransferQuoteRequest {
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn legs<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::PricedLegParamsAndResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.legs = value
.try_into()
.map_err(|e| format!("error converting supplied value for legs: {e}"));
self
}
pub fn max_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.max_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_fee: {e}")
});
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SignedTransferQuoteRequest>
for super::SignedTransferQuoteRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SignedTransferQuoteRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
direction: value.direction?,
legs: value.legs?,
max_fee: value.max_fee?,
nonce: value.nonce?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::SignedTransferQuoteRequest>
for SignedTransferQuoteRequest {
fn from(value: super::SignedTransferQuoteRequest) -> Self {
Self {
direction: Ok(value.direction),
legs: Ok(value.legs),
max_fee: Ok(value.max_fee),
nonce: Ok(value.nonce),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotAssetEntry {
address: ::std::result::Result<::std::string::String, ::std::string::String>,
erc20: ::std::result::Result<super::Erc20Details, ::std::string::String>,
min_deposit_usd: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
universes: ::std::result::Result<
::std::vec::Vec<super::SpotUniverse>,
::std::string::String,
>,
}
impl ::std::default::Default for SpotAssetEntry {
fn default() -> Self {
Self {
address: Err("no value supplied for address".to_string()),
erc20: Err("no value supplied for erc20".to_string()),
min_deposit_usd: Err(
"no value supplied for min_deposit_usd".to_string(),
),
name: Err("no value supplied for name".to_string()),
universes: Err("no value supplied for universes".to_string()),
}
}
}
impl SpotAssetEntry {
pub fn address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for address: {e}")
});
self
}
pub fn erc20<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Erc20Details>,
T::Error: ::std::fmt::Display,
{
self.erc20 = value
.try_into()
.map_err(|e| format!("error converting supplied value for erc20: {e}"));
self
}
pub fn min_deposit_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.min_deposit_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for min_deposit_usd: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn universes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::SpotUniverse>>,
T::Error: ::std::fmt::Display,
{
self.universes = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for universes: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SpotAssetEntry> for super::SpotAssetEntry {
type Error = super::error::ConversionError;
fn try_from(
value: SpotAssetEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
address: value.address?,
erc20: value.erc20?,
min_deposit_usd: value.min_deposit_usd?,
name: value.name?,
universes: value.universes?,
})
}
}
impl ::std::convert::From<super::SpotAssetEntry> for SpotAssetEntry {
fn from(value: super::SpotAssetEntry) -> Self {
Self {
address: Ok(value.address),
erc20: Ok(value.erc20),
min_deposit_usd: Ok(value.min_deposit_usd),
name: Ok(value.name),
universes: Ok(value.universes),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
feed_source_type: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
price: ::std::result::Result<::std::string::String, ::std::string::String>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for SpotFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
feed_source_type: Ok(Default::default()),
price: Err("no value supplied for price".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl SpotFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn feed_source_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.feed_source_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for feed_source_type: {e}")
});
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SpotFeedDataResponse> for super::SpotFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: SpotFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
feed_source_type: value.feed_source_type?,
price: value.price?,
signatures: value.signatures?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::SpotFeedDataResponse> for SpotFeedDataResponse {
fn from(value: super::SpotFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
feed_source_type: Ok(value.feed_source_type),
price: Ok(value.price),
signatures: Ok(value.signatures),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotFeedEntry {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
confidence_prev_daily: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
price: ::std::result::Result<::std::string::String, ::std::string::String>,
price_prev_daily: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
timestamp_prev_daily: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for SpotFeedEntry {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
confidence_prev_daily: Err(
"no value supplied for confidence_prev_daily".to_string(),
),
price: Err("no value supplied for price".to_string()),
price_prev_daily: Err(
"no value supplied for price_prev_daily".to_string(),
),
timestamp_prev_daily: Err(
"no value supplied for timestamp_prev_daily".to_string(),
),
}
}
}
impl SpotFeedEntry {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn confidence_prev_daily<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence_prev_daily = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for confidence_prev_daily: {e}"
)
});
self
}
pub fn price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.price = value
.try_into()
.map_err(|e| format!("error converting supplied value for price: {e}"));
self
}
pub fn price_prev_daily<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.price_prev_daily = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for price_prev_daily: {e}")
});
self
}
pub fn timestamp_prev_daily<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp_prev_daily = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for timestamp_prev_daily: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<SpotFeedEntry> for super::SpotFeedEntry {
type Error = super::error::ConversionError;
fn try_from(
value: SpotFeedEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
confidence_prev_daily: value.confidence_prev_daily?,
price: value.price?,
price_prev_daily: value.price_prev_daily?,
timestamp_prev_daily: value.timestamp_prev_daily?,
})
}
}
impl ::std::convert::From<super::SpotFeedEntry> for SpotFeedEntry {
fn from(value: super::SpotFeedEntry) -> Self {
Self {
confidence: Ok(value.confidence),
confidence_prev_daily: Ok(value.confidence_prev_daily),
price: Ok(value.price),
price_prev_daily: Ok(value.price_prev_daily),
timestamp_prev_daily: Ok(value.timestamp_prev_daily),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotFeedPayload {
feeds: ::std::result::Result<super::SpotFeedPayloadFeeds, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for SpotFeedPayload {
fn default() -> Self {
Self {
feeds: Err("no value supplied for feeds".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl SpotFeedPayload {
pub fn feeds<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SpotFeedPayloadFeeds>,
T::Error: ::std::fmt::Display,
{
self.feeds = value
.try_into()
.map_err(|e| format!("error converting supplied value for feeds: {e}"));
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SpotFeedPayload> for super::SpotFeedPayload {
type Error = super::error::ConversionError;
fn try_from(
value: SpotFeedPayload,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
feeds: value.feeds?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::SpotFeedPayload> for SpotFeedPayload {
fn from(value: super::SpotFeedPayload) -> Self {
Self {
feeds: Ok(value.feeds),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotFeedPayloadFeeds {
key: ::std::result::Result<
::std::option::Option<super::SpotFeedEntry>,
::std::string::String,
>,
extra: ::std::result::Result<
::std::collections::HashMap<::std::string::String, super::SpotFeedEntry>,
::std::string::String,
>,
}
impl ::std::default::Default for SpotFeedPayloadFeeds {
fn default() -> Self {
Self {
key: Ok(Default::default()),
extra: Err("no value supplied for extra".to_string()),
}
}
}
impl SpotFeedPayloadFeeds {
pub fn key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::SpotFeedEntry>>,
T::Error: ::std::fmt::Display,
{
self.key = value
.try_into()
.map_err(|e| format!("error converting supplied value for key: {e}"));
self
}
pub fn extra<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::collections::HashMap<::std::string::String, super::SpotFeedEntry>,
>,
T::Error: ::std::fmt::Display,
{
self.extra = value
.try_into()
.map_err(|e| format!("error converting supplied value for extra: {e}"));
self
}
}
impl ::std::convert::TryFrom<SpotFeedPayloadFeeds> for super::SpotFeedPayloadFeeds {
type Error = super::error::ConversionError;
fn try_from(
value: SpotFeedPayloadFeeds,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
key: value.key?,
extra: value.extra?,
})
}
}
impl ::std::convert::From<super::SpotFeedPayloadFeeds> for SpotFeedPayloadFeeds {
fn from(value: super::SpotFeedPayloadFeeds) -> Self {
Self {
key: Ok(value.key),
extra: Ok(value.extra),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotPublicDetails {
borrow_index: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
decimals: ::std::result::Result<u8, ::std::string::String>,
supply_index: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
underlying_erc20_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for SpotPublicDetails {
fn default() -> Self {
Self {
borrow_index: Err("no value supplied for borrow_index".to_string()),
decimals: Err("no value supplied for decimals".to_string()),
supply_index: Err("no value supplied for supply_index".to_string()),
underlying_erc20_address: Err(
"no value supplied for underlying_erc20_address".to_string(),
),
}
}
}
impl SpotPublicDetails {
pub fn borrow_index<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.borrow_index = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for borrow_index: {e}")
});
self
}
pub fn decimals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u8>,
T::Error: ::std::fmt::Display,
{
self.decimals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for decimals: {e}")
});
self
}
pub fn supply_index<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.supply_index = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for supply_index: {e}")
});
self
}
pub fn underlying_erc20_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.underlying_erc20_address = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for underlying_erc20_address: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<SpotPublicDetails> for super::SpotPublicDetails {
type Error = super::error::ConversionError;
fn try_from(
value: SpotPublicDetails,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
borrow_index: value.borrow_index?,
decimals: value.decimals?,
supply_index: value.supply_index?,
underlying_erc20_address: value.underlying_erc20_address?,
})
}
}
impl ::std::convert::From<super::SpotPublicDetails> for SpotPublicDetails {
fn from(value: super::SpotPublicDetails) -> Self {
Self {
borrow_index: Ok(value.borrow_index),
decimals: Ok(value.decimals),
supply_index: Ok(value.supply_index),
underlying_erc20_address: Ok(value.underlying_erc20_address),
}
}
}
#[derive(Clone, Debug)]
pub struct SpotUniverse {
lending: ::std::result::Result<
::std::option::Option<super::LendingDetails>,
::std::string::String,
>,
oi: ::std::result::Result<super::OpenInterestStats, ::std::string::String>,
pm2_im_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
pm2_mm_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
srm_im_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
srm_mm_discount: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
}
impl ::std::default::Default for SpotUniverse {
fn default() -> Self {
Self {
lending: Ok(Default::default()),
oi: Err("no value supplied for oi".to_string()),
pm2_im_discount: Err(
"no value supplied for pm2_im_discount".to_string(),
),
pm2_mm_discount: Err(
"no value supplied for pm2_mm_discount".to_string(),
),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
srm_im_discount: Err(
"no value supplied for srm_im_discount".to_string(),
),
srm_mm_discount: Err("no value supplied for srm_mm_discount".to_string()),
}
}
}
impl SpotUniverse {
pub fn lending<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::LendingDetails>>,
T::Error: ::std::fmt::Display,
{
self.lending = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for lending: {e}")
});
self
}
pub fn oi<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OpenInterestStats>,
T::Error: ::std::fmt::Display,
{
self.oi = value
.try_into()
.map_err(|e| format!("error converting supplied value for oi: {e}"));
self
}
pub fn pm2_im_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pm2_im_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pm2_im_discount: {e}")
});
self
}
pub fn pm2_mm_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.pm2_mm_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pm2_mm_discount: {e}")
});
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn srm_im_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.srm_im_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for srm_im_discount: {e}")
});
self
}
pub fn srm_mm_discount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.srm_mm_discount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for srm_mm_discount: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SpotUniverse> for super::SpotUniverse {
type Error = super::error::ConversionError;
fn try_from(
value: SpotUniverse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
lending: value.lending?,
oi: value.oi?,
pm2_im_discount: value.pm2_im_discount?,
pm2_mm_discount: value.pm2_mm_discount?,
risk_universe_id: value.risk_universe_id?,
srm_im_discount: value.srm_im_discount?,
srm_mm_discount: value.srm_mm_discount?,
})
}
}
impl ::std::convert::From<super::SpotUniverse> for SpotUniverse {
fn from(value: super::SpotUniverse) -> Self {
Self {
lending: Ok(value.lending),
oi: Ok(value.oi),
pm2_im_discount: Ok(value.pm2_im_discount),
pm2_mm_discount: Ok(value.pm2_mm_discount),
risk_universe_id: Ok(value.risk_universe_id),
srm_im_discount: Ok(value.srm_im_discount),
srm_mm_discount: Ok(value.srm_mm_discount),
}
}
}
#[derive(Clone, Debug)]
pub struct Subaccount {
collaterals: ::std::result::Result<
::std::vec::Vec<super::Collateral>,
::std::string::String,
>,
collaterals_initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
collaterals_maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
collaterals_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
currency: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
failed_to_fetch: ::std::result::Result<bool, ::std::string::String>,
initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_under_liquidation: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
manager_id: ::std::result::Result<u32, ::std::string::String>,
margin_type: ::std::result::Result<::std::string::String, ::std::string::String>,
mm_credits: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
open_orders: ::std::result::Result<
::std::vec::Vec<super::Order>,
::std::string::String,
>,
open_orders_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
positions: ::std::result::Result<
::std::vec::Vec<super::Position>,
::std::string::String,
>,
positions_initial_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
positions_maintenance_margin: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
positions_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
projected_margin_change: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
subaccount_value: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
vault_deposit_holds: ::std::result::Result<
::std::vec::Vec<super::VaultDepositHold>,
::std::string::String,
>,
}
impl ::std::default::Default for Subaccount {
fn default() -> Self {
Self {
collaterals: Err("no value supplied for collaterals".to_string()),
collaterals_initial_margin: Err(
"no value supplied for collaterals_initial_margin".to_string(),
),
collaterals_maintenance_margin: Err(
"no value supplied for collaterals_maintenance_margin".to_string(),
),
collaterals_value: Err(
"no value supplied for collaterals_value".to_string(),
),
currency: Err("no value supplied for currency".to_string()),
failed_to_fetch: Err(
"no value supplied for failed_to_fetch".to_string(),
),
initial_margin: Err("no value supplied for initial_margin".to_string()),
is_under_liquidation: Err(
"no value supplied for is_under_liquidation".to_string(),
),
label: Err("no value supplied for label".to_string()),
maintenance_margin: Err(
"no value supplied for maintenance_margin".to_string(),
),
manager_id: Err("no value supplied for manager_id".to_string()),
margin_type: Err("no value supplied for margin_type".to_string()),
mm_credits: Ok(Default::default()),
open_orders: Err("no value supplied for open_orders".to_string()),
open_orders_margin: Err(
"no value supplied for open_orders_margin".to_string(),
),
positions: Err("no value supplied for positions".to_string()),
positions_initial_margin: Err(
"no value supplied for positions_initial_margin".to_string(),
),
positions_maintenance_margin: Err(
"no value supplied for positions_maintenance_margin".to_string(),
),
positions_value: Err(
"no value supplied for positions_value".to_string(),
),
projected_margin_change: Err(
"no value supplied for projected_margin_change".to_string(),
),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
subaccount_value: Err(
"no value supplied for subaccount_value".to_string(),
),
vault_deposit_holds: Err(
"no value supplied for vault_deposit_holds".to_string(),
),
}
}
}
impl Subaccount {
pub fn collaterals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Collateral>>,
T::Error: ::std::fmt::Display,
{
self.collaterals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for collaterals: {e}")
});
self
}
pub fn collaterals_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.collaterals_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for collaterals_initial_margin: {e}"
)
});
self
}
pub fn collaterals_maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.collaterals_maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for collaterals_maintenance_margin: {e}"
)
});
self
}
pub fn collaterals_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.collaterals_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for collaterals_value: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn failed_to_fetch<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.failed_to_fetch = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for failed_to_fetch: {e}")
});
self
}
pub fn initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.initial_margin = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for initial_margin: {e}")
});
self
}
pub fn is_under_liquidation<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_under_liquidation = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for is_under_liquidation: {e}"
)
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for maintenance_margin: {e}"
)
});
self
}
pub fn manager_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.manager_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for manager_id: {e}")
});
self
}
pub fn margin_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.margin_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for margin_type: {e}")
});
self
}
pub fn mm_credits<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.mm_credits = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mm_credits: {e}")
});
self
}
pub fn open_orders<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Order>>,
T::Error: ::std::fmt::Display,
{
self.open_orders = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for open_orders: {e}")
});
self
}
pub fn open_orders_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open_orders_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for open_orders_margin: {e}"
)
});
self
}
pub fn positions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Position>>,
T::Error: ::std::fmt::Display,
{
self.positions = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for positions: {e}")
});
self
}
pub fn positions_initial_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.positions_initial_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for positions_initial_margin: {e}"
)
});
self
}
pub fn positions_maintenance_margin<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.positions_maintenance_margin = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for positions_maintenance_margin: {e}"
)
});
self
}
pub fn positions_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.positions_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for positions_value: {e}")
});
self
}
pub fn projected_margin_change<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.projected_margin_change = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for projected_margin_change: {e}"
)
});
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn subaccount_value<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.subaccount_value = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_value: {e}")
});
self
}
pub fn vault_deposit_holds<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VaultDepositHold>>,
T::Error: ::std::fmt::Display,
{
self.vault_deposit_holds = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_deposit_holds: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<Subaccount> for super::Subaccount {
type Error = super::error::ConversionError;
fn try_from(
value: Subaccount,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
collaterals: value.collaterals?,
collaterals_initial_margin: value.collaterals_initial_margin?,
collaterals_maintenance_margin: value.collaterals_maintenance_margin?,
collaterals_value: value.collaterals_value?,
currency: value.currency?,
failed_to_fetch: value.failed_to_fetch?,
initial_margin: value.initial_margin?,
is_under_liquidation: value.is_under_liquidation?,
label: value.label?,
maintenance_margin: value.maintenance_margin?,
manager_id: value.manager_id?,
margin_type: value.margin_type?,
mm_credits: value.mm_credits?,
open_orders: value.open_orders?,
open_orders_margin: value.open_orders_margin?,
positions: value.positions?,
positions_initial_margin: value.positions_initial_margin?,
positions_maintenance_margin: value.positions_maintenance_margin?,
positions_value: value.positions_value?,
projected_margin_change: value.projected_margin_change?,
risk_universe_id: value.risk_universe_id?,
subaccount_id: value.subaccount_id?,
subaccount_value: value.subaccount_value?,
vault_deposit_holds: value.vault_deposit_holds?,
})
}
}
impl ::std::convert::From<super::Subaccount> for Subaccount {
fn from(value: super::Subaccount) -> Self {
Self {
collaterals: Ok(value.collaterals),
collaterals_initial_margin: Ok(value.collaterals_initial_margin),
collaterals_maintenance_margin: Ok(value.collaterals_maintenance_margin),
collaterals_value: Ok(value.collaterals_value),
currency: Ok(value.currency),
failed_to_fetch: Ok(value.failed_to_fetch),
initial_margin: Ok(value.initial_margin),
is_under_liquidation: Ok(value.is_under_liquidation),
label: Ok(value.label),
maintenance_margin: Ok(value.maintenance_margin),
manager_id: Ok(value.manager_id),
margin_type: Ok(value.margin_type),
mm_credits: Ok(value.mm_credits),
open_orders: Ok(value.open_orders),
open_orders_margin: Ok(value.open_orders_margin),
positions: Ok(value.positions),
positions_initial_margin: Ok(value.positions_initial_margin),
positions_maintenance_margin: Ok(value.positions_maintenance_margin),
positions_value: Ok(value.positions_value),
projected_margin_change: Ok(value.projected_margin_change),
risk_universe_id: Ok(value.risk_universe_id),
subaccount_id: Ok(value.subaccount_id),
subaccount_value: Ok(value.subaccount_value),
vault_deposit_holds: Ok(value.vault_deposit_holds),
}
}
}
#[derive(Clone, Debug)]
pub struct SubscribeParams {
channels: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for SubscribeParams {
fn default() -> Self {
Self {
channels: Err("no value supplied for channels".to_string()),
}
}
}
impl SubscribeParams {
pub fn channels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.channels = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for channels: {e}")
});
self
}
}
impl ::std::convert::TryFrom<SubscribeParams> for super::SubscribeParams {
type Error = super::error::ConversionError;
fn try_from(
value: SubscribeParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { channels: value.channels? })
}
}
impl ::std::convert::From<super::SubscribeParams> for SubscribeParams {
fn from(value: super::SubscribeParams) -> Self {
Self {
channels: Ok(value.channels),
}
}
}
#[derive(Clone, Debug)]
pub struct SubscribeRequest {
headers: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
id: ::std::result::Result<super::JsonRpcId, ::std::string::String>,
method: ::std::result::Result<::std::string::String, ::std::string::String>,
params: ::std::result::Result<super::SubscribeParams, ::std::string::String>,
}
impl ::std::default::Default for SubscribeRequest {
fn default() -> Self {
Self {
headers: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
method: Err("no value supplied for method".to_string()),
params: Err("no value supplied for params".to_string()),
}
}
}
impl SubscribeRequest {
pub fn headers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.headers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for headers: {e}")
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::JsonRpcId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.method = value
.try_into()
.map_err(|e| format!("error converting supplied value for method: {e}"));
self
}
pub fn params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SubscribeParams>,
T::Error: ::std::fmt::Display,
{
self.params = value
.try_into()
.map_err(|e| format!("error converting supplied value for params: {e}"));
self
}
}
impl ::std::convert::TryFrom<SubscribeRequest> for super::SubscribeRequest {
type Error = super::error::ConversionError;
fn try_from(
value: SubscribeRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
headers: value.headers?,
id: value.id?,
method: value.method?,
params: value.params?,
})
}
}
impl ::std::convert::From<super::SubscribeRequest> for SubscribeRequest {
fn from(value: super::SubscribeRequest) -> Self {
Self {
headers: Ok(value.headers),
id: Ok(value.id),
method: Ok(value.method),
params: Ok(value.params),
}
}
}
#[derive(Clone, Debug)]
pub struct SubscribeResult {
current_subscriptions: ::std::result::Result<
Vec<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
}
impl ::std::default::Default for SubscribeResult {
fn default() -> Self {
Self {
current_subscriptions: Err(
"no value supplied for current_subscriptions".to_string(),
),
status: Err("no value supplied for status".to_string()),
}
}
}
impl SubscribeResult {
pub fn current_subscriptions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.current_subscriptions = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for current_subscriptions: {e}"
)
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
}
impl ::std::convert::TryFrom<SubscribeResult> for super::SubscribeResult {
type Error = super::error::ConversionError;
fn try_from(
value: SubscribeResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
current_subscriptions: value.current_subscriptions?,
status: value.status?,
})
}
}
impl ::std::convert::From<super::SubscribeResult> for SubscribeResult {
fn from(value: super::SubscribeResult) -> Self {
Self {
current_subscriptions: Ok(value.current_subscriptions),
status: Ok(value.status),
}
}
}
#[derive(Clone, Debug)]
pub struct TickerSlimPayload {
instrument_ticker: ::std::result::Result<
crate::models::ticker_slim_schema::TickerSlimSchema,
::std::string::String,
>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for TickerSlimPayload {
fn default() -> Self {
Self {
instrument_ticker: Err(
"no value supplied for instrument_ticker".to_string(),
),
timestamp: Err("no value supplied for timestamp".to_string()),
}
}
}
impl TickerSlimPayload {
pub fn instrument_ticker<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
crate::models::ticker_slim_schema::TickerSlimSchema,
>,
T::Error: ::std::fmt::Display,
{
self.instrument_ticker = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_ticker: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TickerSlimPayload> for super::TickerSlimPayload {
type Error = super::error::ConversionError;
fn try_from(
value: TickerSlimPayload,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
instrument_ticker: value.instrument_ticker?,
timestamp: value.timestamp?,
})
}
}
impl ::std::convert::From<super::TickerSlimPayload> for TickerSlimPayload {
fn from(value: super::TickerSlimPayload) -> Self {
Self {
instrument_ticker: Ok(value.instrument_ticker),
timestamp: Ok(value.timestamp),
}
}
}
#[derive(Clone, Debug)]
pub struct Trade {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
expected_rebate: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
index_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
mark_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
order_id: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
trade_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_id: ::std::result::Result<::std::string::String, ::std::string::String>,
trade_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for Trade {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
expected_rebate: Err(
"no value supplied for expected_rebate".to_string(),
),
extra_fee: Err("no value supplied for extra_fee".to_string()),
index_price: Err("no value supplied for index_price".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Ok(Default::default()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
mark_price: Err("no value supplied for mark_price".to_string()),
op_uuid: Err("no value supplied for op_uuid".to_string()),
order_id: Err("no value supplied for order_id".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
rfq_id: Err("no value supplied for rfq_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
trade_amount: Err("no value supplied for trade_amount".to_string()),
trade_fee: Err("no value supplied for trade_fee".to_string()),
trade_id: Err("no value supplied for trade_id".to_string()),
trade_price: Err("no value supplied for trade_price".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl Trade {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn expected_rebate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.expected_rebate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expected_rebate: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn index_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.index_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for index_price: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn trade_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_amount: {e}")
});
self
}
pub fn trade_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_fee: {e}")
});
self
}
pub fn trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_id: {e}")
});
self
}
pub fn trade_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_price: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Trade> for super::Trade {
type Error = super::error::ConversionError;
fn try_from(
value: Trade,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
direction: value.direction?,
expected_rebate: value.expected_rebate?,
extra_fee: value.extra_fee?,
index_price: value.index_price?,
instrument_name: value.instrument_name?,
is_transfer: value.is_transfer?,
label: value.label?,
liquidity_role: value.liquidity_role?,
mark_price: value.mark_price?,
op_uuid: value.op_uuid?,
order_id: value.order_id?,
quote_id: value.quote_id?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
trade_amount: value.trade_amount?,
trade_fee: value.trade_fee?,
trade_id: value.trade_id?,
trade_price: value.trade_price?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::Trade> for Trade {
fn from(value: super::Trade) -> Self {
Self {
batch_status: Ok(value.batch_status),
direction: Ok(value.direction),
expected_rebate: Ok(value.expected_rebate),
extra_fee: Ok(value.extra_fee),
index_price: Ok(value.index_price),
instrument_name: Ok(value.instrument_name),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
liquidity_role: Ok(value.liquidity_role),
mark_price: Ok(value.mark_price),
op_uuid: Ok(value.op_uuid),
order_id: Ok(value.order_id),
quote_id: Ok(value.quote_id),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
trade_amount: Ok(value.trade_amount),
trade_fee: Ok(value.trade_fee),
trade_id: Ok(value.trade_id),
trade_price: Ok(value.trade_price),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct TradeHistoryResponse {
batch_status: ::std::result::Result<
::std::option::Option<super::BatchStatus>,
::std::string::String,
>,
direction: ::std::result::Result<super::Direction, ::std::string::String>,
expected_rebate: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
extra_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
index_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
instrument_name: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
is_transfer: ::std::result::Result<bool, ::std::string::String>,
label: ::std::result::Result<::std::string::String, ::std::string::String>,
liquidity_role: ::std::result::Result<
super::LiquidityRole,
::std::string::String,
>,
mark_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
order_id: ::std::result::Result<::std::string::String, ::std::string::String>,
quote_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
realized_pnl: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
realized_pnl_excl_fees: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
rfq_id: ::std::result::Result<
::std::option::Option<::uuid::Uuid>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<i64, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
trade_amount: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_fee: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
trade_id: ::std::result::Result<::std::string::String, ::std::string::String>,
trade_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for TradeHistoryResponse {
fn default() -> Self {
Self {
batch_status: Ok(Default::default()),
direction: Err("no value supplied for direction".to_string()),
expected_rebate: Err(
"no value supplied for expected_rebate".to_string(),
),
extra_fee: Err("no value supplied for extra_fee".to_string()),
index_price: Err("no value supplied for index_price".to_string()),
instrument_name: Err(
"no value supplied for instrument_name".to_string(),
),
is_transfer: Err("no value supplied for is_transfer".to_string()),
label: Err("no value supplied for label".to_string()),
liquidity_role: Err("no value supplied for liquidity_role".to_string()),
mark_price: Err("no value supplied for mark_price".to_string()),
op_uuid: Err("no value supplied for op_uuid".to_string()),
order_id: Err("no value supplied for order_id".to_string()),
quote_id: Err("no value supplied for quote_id".to_string()),
realized_pnl: Err("no value supplied for realized_pnl".to_string()),
realized_pnl_excl_fees: Err(
"no value supplied for realized_pnl_excl_fees".to_string(),
),
rfq_id: Err("no value supplied for rfq_id".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
trade_amount: Err("no value supplied for trade_amount".to_string()),
trade_fee: Err("no value supplied for trade_fee".to_string()),
trade_id: Err("no value supplied for trade_id".to_string()),
trade_price: Err("no value supplied for trade_price".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl TradeHistoryResponse {
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::BatchStatus>>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn direction<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Direction>,
T::Error: ::std::fmt::Display,
{
self.direction = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for direction: {e}")
});
self
}
pub fn expected_rebate<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.expected_rebate = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for expected_rebate: {e}")
});
self
}
pub fn extra_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.extra_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for extra_fee: {e}")
});
self
}
pub fn index_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.index_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for index_price: {e}")
});
self
}
pub fn instrument_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.instrument_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for instrument_name: {e}")
});
self
}
pub fn is_transfer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_transfer = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_transfer: {e}")
});
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn liquidity_role<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::LiquidityRole>,
T::Error: ::std::fmt::Display,
{
self.liquidity_role = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for liquidity_role: {e}")
});
self
}
pub fn mark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.mark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mark_price: {e}")
});
self
}
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn order_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.order_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for order_id: {e}")
});
self
}
pub fn quote_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.quote_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for quote_id: {e}")
});
self
}
pub fn realized_pnl<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for realized_pnl: {e}")
});
self
}
pub fn realized_pnl_excl_fees<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.realized_pnl_excl_fees = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for realized_pnl_excl_fees: {e}"
)
});
self
}
pub fn rfq_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>,
T::Error: ::std::fmt::Display,
{
self.rfq_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for rfq_id: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn trade_amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_amount = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_amount: {e}")
});
self
}
pub fn trade_fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_fee = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_fee: {e}")
});
self
}
pub fn trade_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.trade_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_id: {e}")
});
self
}
pub fn trade_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.trade_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for trade_price: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TradeHistoryResponse> for super::TradeHistoryResponse {
type Error = super::error::ConversionError;
fn try_from(
value: TradeHistoryResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
batch_status: value.batch_status?,
direction: value.direction?,
expected_rebate: value.expected_rebate?,
extra_fee: value.extra_fee?,
index_price: value.index_price?,
instrument_name: value.instrument_name?,
is_transfer: value.is_transfer?,
label: value.label?,
liquidity_role: value.liquidity_role?,
mark_price: value.mark_price?,
op_uuid: value.op_uuid?,
order_id: value.order_id?,
quote_id: value.quote_id?,
realized_pnl: value.realized_pnl?,
realized_pnl_excl_fees: value.realized_pnl_excl_fees?,
rfq_id: value.rfq_id?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
trade_amount: value.trade_amount?,
trade_fee: value.trade_fee?,
trade_id: value.trade_id?,
trade_price: value.trade_price?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::TradeHistoryResponse> for TradeHistoryResponse {
fn from(value: super::TradeHistoryResponse) -> Self {
Self {
batch_status: Ok(value.batch_status),
direction: Ok(value.direction),
expected_rebate: Ok(value.expected_rebate),
extra_fee: Ok(value.extra_fee),
index_price: Ok(value.index_price),
instrument_name: Ok(value.instrument_name),
is_transfer: Ok(value.is_transfer),
label: Ok(value.label),
liquidity_role: Ok(value.liquidity_role),
mark_price: Ok(value.mark_price),
op_uuid: Ok(value.op_uuid),
order_id: Ok(value.order_id),
quote_id: Ok(value.quote_id),
realized_pnl: Ok(value.realized_pnl),
realized_pnl_excl_fees: Ok(value.realized_pnl_excl_fees),
rfq_id: Ok(value.rfq_id),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
trade_amount: Ok(value.trade_amount),
trade_fee: Ok(value.trade_fee),
trade_id: Ok(value.trade_id),
trade_price: Ok(value.trade_price),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct TradingviewCandle {
close_price: ::std::result::Result<::std::string::String, ::std::string::String>,
high_price: ::std::result::Result<::std::string::String, ::std::string::String>,
low_price: ::std::result::Result<::std::string::String, ::std::string::String>,
open_price: ::std::result::Result<::std::string::String, ::std::string::String>,
timestamp: ::std::result::Result<i64, ::std::string::String>,
timestamp_bucket: ::std::result::Result<i64, ::std::string::String>,
volume_contracts: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
volume_usd: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for TradingviewCandle {
fn default() -> Self {
Self {
close_price: Err("no value supplied for close_price".to_string()),
high_price: Err("no value supplied for high_price".to_string()),
low_price: Err("no value supplied for low_price".to_string()),
open_price: Err("no value supplied for open_price".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
timestamp_bucket: Err(
"no value supplied for timestamp_bucket".to_string(),
),
volume_contracts: Err(
"no value supplied for volume_contracts".to_string(),
),
volume_usd: Err("no value supplied for volume_usd".to_string()),
}
}
}
impl TradingviewCandle {
pub fn close_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.close_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for close_price: {e}")
});
self
}
pub fn high_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.high_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for high_price: {e}")
});
self
}
pub fn low_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.low_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for low_price: {e}")
});
self
}
pub fn open_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.open_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for open_price: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn timestamp_bucket<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.timestamp_bucket = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp_bucket: {e}")
});
self
}
pub fn volume_contracts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.volume_contracts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for volume_contracts: {e}")
});
self
}
pub fn volume_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.volume_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for volume_usd: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TradingviewCandle> for super::TradingviewCandle {
type Error = super::error::ConversionError;
fn try_from(
value: TradingviewCandle,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
close_price: value.close_price?,
high_price: value.high_price?,
low_price: value.low_price?,
open_price: value.open_price?,
timestamp: value.timestamp?,
timestamp_bucket: value.timestamp_bucket?,
volume_contracts: value.volume_contracts?,
volume_usd: value.volume_usd?,
})
}
}
impl ::std::convert::From<super::TradingviewCandle> for TradingviewCandle {
fn from(value: super::TradingviewCandle) -> Self {
Self {
close_price: Ok(value.close_price),
high_price: Ok(value.high_price),
low_price: Ok(value.low_price),
open_price: Ok(value.open_price),
timestamp: Ok(value.timestamp),
timestamp_bucket: Ok(value.timestamp_bucket),
volume_contracts: Ok(value.volume_contracts),
volume_usd: Ok(value.volume_usd),
}
}
}
#[derive(Clone, Debug)]
pub struct TransferEntry {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
asset: ::std::result::Result<::std::string::String, ::std::string::String>,
batch_status: ::std::result::Result<super::BatchStatus, ::std::string::String>,
batch_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
from_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
from_wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
is_outgoing: ::std::result::Result<bool, ::std::string::String>,
operation_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
to_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
to_wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for TransferEntry {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
asset: Err("no value supplied for asset".to_string()),
batch_status: Err("no value supplied for batch_status".to_string()),
batch_uuid: Err("no value supplied for batch_uuid".to_string()),
fee: Err("no value supplied for fee".to_string()),
from_subaccount_id: Err(
"no value supplied for from_subaccount_id".to_string(),
),
from_wallet: Err("no value supplied for from_wallet".to_string()),
is_outgoing: Err("no value supplied for is_outgoing".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
to_subaccount_id: Err(
"no value supplied for to_subaccount_id".to_string(),
),
to_wallet: Err("no value supplied for to_wallet".to_string()),
tx_hash: Ok(Default::default()),
}
}
}
impl TransferEntry {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset = value
.try_into()
.map_err(|e| format!("error converting supplied value for asset: {e}"));
self
}
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BatchStatus>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn batch_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.batch_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_uuid: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn from_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.from_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for from_subaccount_id: {e}"
)
});
self
}
pub fn from_wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.from_wallet = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for from_wallet: {e}")
});
self
}
pub fn is_outgoing<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.is_outgoing = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for is_outgoing: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn to_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.to_subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_subaccount_id: {e}")
});
self
}
pub fn to_wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.to_wallet = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for to_wallet: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TransferEntry> for super::TransferEntry {
type Error = super::error::ConversionError;
fn try_from(
value: TransferEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
asset: value.asset?,
batch_status: value.batch_status?,
batch_uuid: value.batch_uuid?,
fee: value.fee?,
from_subaccount_id: value.from_subaccount_id?,
from_wallet: value.from_wallet?,
is_outgoing: value.is_outgoing?,
operation_id: value.operation_id?,
timestamp: value.timestamp?,
to_subaccount_id: value.to_subaccount_id?,
to_wallet: value.to_wallet?,
tx_hash: value.tx_hash?,
})
}
}
impl ::std::convert::From<super::TransferEntry> for TransferEntry {
fn from(value: super::TransferEntry) -> Self {
Self {
amount: Ok(value.amount),
asset: Ok(value.asset),
batch_status: Ok(value.batch_status),
batch_uuid: Ok(value.batch_uuid),
fee: Ok(value.fee),
from_subaccount_id: Ok(value.from_subaccount_id),
from_wallet: Ok(value.from_wallet),
is_outgoing: Ok(value.is_outgoing),
operation_id: Ok(value.operation_id),
timestamp: Ok(value.timestamp),
to_subaccount_id: Ok(value.to_subaccount_id),
to_wallet: Ok(value.to_wallet),
tx_hash: Ok(value.tx_hash),
}
}
}
#[derive(Clone, Debug)]
pub struct TransferHistoryResult {
transfers: ::std::result::Result<
::std::vec::Vec<super::TransferEntry>,
::std::string::String,
>,
}
impl ::std::default::Default for TransferHistoryResult {
fn default() -> Self {
Self {
transfers: Err("no value supplied for transfers".to_string()),
}
}
}
impl TransferHistoryResult {
pub fn transfers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::TransferEntry>>,
T::Error: ::std::fmt::Display,
{
self.transfers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for transfers: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TransferHistoryResult>
for super::TransferHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: TransferHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
transfers: value.transfers?,
})
}
}
impl ::std::convert::From<super::TransferHistoryResult> for TransferHistoryResult {
fn from(value: super::TransferHistoryResult) -> Self {
Self {
transfers: Ok(value.transfers),
}
}
}
#[derive(Clone, Debug)]
pub struct TransferPositionsRequest {
maker_params: ::std::result::Result<
super::SignedTransferQuoteRequest,
::std::string::String,
>,
taker_params: ::std::result::Result<
super::SignedTransferQuoteRequest,
::std::string::String,
>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for TransferPositionsRequest {
fn default() -> Self {
Self {
maker_params: Err("no value supplied for maker_params".to_string()),
taker_params: Err("no value supplied for taker_params".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl TransferPositionsRequest {
pub fn maker_params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SignedTransferQuoteRequest>,
T::Error: ::std::fmt::Display,
{
self.maker_params = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for maker_params: {e}")
});
self
}
pub fn taker_params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SignedTransferQuoteRequest>,
T::Error: ::std::fmt::Display,
{
self.taker_params = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for taker_params: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<TransferPositionsRequest>
for super::TransferPositionsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: TransferPositionsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
maker_params: value.maker_params?,
taker_params: value.taker_params?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::TransferPositionsRequest>
for TransferPositionsRequest {
fn from(value: super::TransferPositionsRequest) -> Self {
Self {
maker_params: Ok(value.maker_params),
taker_params: Ok(value.taker_params),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct TransferPositionsResponse {
maker_quote: ::std::result::Result<super::Quote, ::std::string::String>,
taker_quote: ::std::result::Result<super::Quote, ::std::string::String>,
}
impl ::std::default::Default for TransferPositionsResponse {
fn default() -> Self {
Self {
maker_quote: Err("no value supplied for maker_quote".to_string()),
taker_quote: Err("no value supplied for taker_quote".to_string()),
}
}
}
impl TransferPositionsResponse {
pub fn maker_quote<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Quote>,
T::Error: ::std::fmt::Display,
{
self.maker_quote = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for maker_quote: {e}")
});
self
}
pub fn taker_quote<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Quote>,
T::Error: ::std::fmt::Display,
{
self.taker_quote = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for taker_quote: {e}")
});
self
}
}
impl ::std::convert::TryFrom<TransferPositionsResponse>
for super::TransferPositionsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: TransferPositionsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
maker_quote: value.maker_quote?,
taker_quote: value.taker_quote?,
})
}
}
impl ::std::convert::From<super::TransferPositionsResponse>
for TransferPositionsResponse {
fn from(value: super::TransferPositionsResponse) -> Self {
Self {
maker_quote: Ok(value.maker_quote),
taker_quote: Ok(value.taker_quote),
}
}
}
#[derive(Clone, Debug)]
pub struct UniverseManagers {
pm: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
risk_universe_id: ::std::result::Result<u32, ::std::string::String>,
risk_universe_name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
sm: ::std::result::Result<::std::option::Option<u32>, ::std::string::String>,
}
impl ::std::default::Default for UniverseManagers {
fn default() -> Self {
Self {
pm: Ok(Default::default()),
risk_universe_id: Err(
"no value supplied for risk_universe_id".to_string(),
),
risk_universe_name: Ok(Default::default()),
sm: Ok(Default::default()),
}
}
}
impl UniverseManagers {
pub fn pm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.pm = value
.try_into()
.map_err(|e| format!("error converting supplied value for pm: {e}"));
self
}
pub fn risk_universe_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u32>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for risk_universe_id: {e}")
});
self
}
pub fn risk_universe_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.risk_universe_name = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for risk_universe_name: {e}"
)
});
self
}
pub fn sm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<u32>>,
T::Error: ::std::fmt::Display,
{
self.sm = value
.try_into()
.map_err(|e| format!("error converting supplied value for sm: {e}"));
self
}
}
impl ::std::convert::TryFrom<UniverseManagers> for super::UniverseManagers {
type Error = super::error::ConversionError;
fn try_from(
value: UniverseManagers,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pm: value.pm?,
risk_universe_id: value.risk_universe_id?,
risk_universe_name: value.risk_universe_name?,
sm: value.sm?,
})
}
}
impl ::std::convert::From<super::UniverseManagers> for UniverseManagers {
fn from(value: super::UniverseManagers) -> Self {
Self {
pm: Ok(value.pm),
risk_universe_id: Ok(value.risk_universe_id),
risk_universe_name: Ok(value.risk_universe_name),
sm: Ok(value.sm),
}
}
}
#[derive(Clone, Debug)]
pub struct UnsubscribeParams {
channels: ::std::result::Result<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
::std::string::String,
>,
}
impl ::std::default::Default for UnsubscribeParams {
fn default() -> Self {
Self {
channels: Ok(Default::default()),
}
}
}
impl UnsubscribeParams {
pub fn channels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<::std::vec::Vec<::std::string::String>>,
>,
T::Error: ::std::fmt::Display,
{
self.channels = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for channels: {e}")
});
self
}
}
impl ::std::convert::TryFrom<UnsubscribeParams> for super::UnsubscribeParams {
type Error = super::error::ConversionError;
fn try_from(
value: UnsubscribeParams,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { channels: value.channels? })
}
}
impl ::std::convert::From<super::UnsubscribeParams> for UnsubscribeParams {
fn from(value: super::UnsubscribeParams) -> Self {
Self {
channels: Ok(value.channels),
}
}
}
#[derive(Clone, Debug)]
pub struct UnsubscribeRequest {
headers: ::std::result::Result<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
::std::string::String,
>,
id: ::std::result::Result<super::JsonRpcId, ::std::string::String>,
method: ::std::result::Result<::std::string::String, ::std::string::String>,
params: ::std::result::Result<super::UnsubscribeParams, ::std::string::String>,
}
impl ::std::default::Default for UnsubscribeRequest {
fn default() -> Self {
Self {
headers: Ok(Default::default()),
id: Err("no value supplied for id".to_string()),
method: Err("no value supplied for method".to_string()),
params: Err("no value supplied for params".to_string()),
}
}
}
impl UnsubscribeRequest {
pub fn headers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
>,
T::Error: ::std::fmt::Display,
{
self.headers = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for headers: {e}")
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::JsonRpcId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.method = value
.try_into()
.map_err(|e| format!("error converting supplied value for method: {e}"));
self
}
pub fn params<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::UnsubscribeParams>,
T::Error: ::std::fmt::Display,
{
self.params = value
.try_into()
.map_err(|e| format!("error converting supplied value for params: {e}"));
self
}
}
impl ::std::convert::TryFrom<UnsubscribeRequest> for super::UnsubscribeRequest {
type Error = super::error::ConversionError;
fn try_from(
value: UnsubscribeRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
headers: value.headers?,
id: value.id?,
method: value.method?,
params: value.params?,
})
}
}
impl ::std::convert::From<super::UnsubscribeRequest> for UnsubscribeRequest {
fn from(value: super::UnsubscribeRequest) -> Self {
Self {
headers: Ok(value.headers),
id: Ok(value.id),
method: Ok(value.method),
params: Ok(value.params),
}
}
}
#[derive(Clone, Debug)]
pub struct UnsubscribeResult {
remaining_subscriptions: ::std::result::Result<
Vec<::std::string::String>,
::std::string::String,
>,
status: ::std::result::Result<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
::std::string::String,
>,
}
impl ::std::default::Default for UnsubscribeResult {
fn default() -> Self {
Self {
remaining_subscriptions: Err(
"no value supplied for remaining_subscriptions".to_string(),
),
status: Err("no value supplied for status".to_string()),
}
}
}
impl UnsubscribeResult {
pub fn remaining_subscriptions<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.remaining_subscriptions = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for remaining_subscriptions: {e}"
)
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::serde_json::Map<::std::string::String, ::serde_json::Value>,
>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
}
impl ::std::convert::TryFrom<UnsubscribeResult> for super::UnsubscribeResult {
type Error = super::error::ConversionError;
fn try_from(
value: UnsubscribeResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
remaining_subscriptions: value.remaining_subscriptions?,
status: value.status?,
})
}
}
impl ::std::convert::From<super::UnsubscribeResult> for UnsubscribeResult {
fn from(value: super::UnsubscribeResult) -> Self {
Self {
remaining_subscriptions: Ok(value.remaining_subscriptions),
status: Ok(value.status),
}
}
}
#[derive(Clone, Debug)]
pub struct UpdateVaultInfoRequest {
description: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
mtm_cap: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
name: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
whitelist_only: ::std::result::Result<
::std::option::Option<bool>,
::std::string::String,
>,
}
impl ::std::default::Default for UpdateVaultInfoRequest {
fn default() -> Self {
Self {
description: Ok(Default::default()),
mtm_cap: Ok(Default::default()),
name: Ok(Default::default()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
whitelist_only: Ok(Default::default()),
}
}
}
impl UpdateVaultInfoRequest {
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn mtm_cap<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.mtm_cap = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mtm_cap: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn whitelist_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.whitelist_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for whitelist_only: {e}")
});
self
}
}
impl ::std::convert::TryFrom<UpdateVaultInfoRequest>
for super::UpdateVaultInfoRequest {
type Error = super::error::ConversionError;
fn try_from(
value: UpdateVaultInfoRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
mtm_cap: value.mtm_cap?,
name: value.name?,
subaccount_id: value.subaccount_id?,
whitelist_only: value.whitelist_only?,
})
}
}
impl ::std::convert::From<super::UpdateVaultInfoRequest> for UpdateVaultInfoRequest {
fn from(value: super::UpdateVaultInfoRequest) -> Self {
Self {
description: Ok(value.description),
mtm_cap: Ok(value.mtm_cap),
name: Ok(value.name),
subaccount_id: Ok(value.subaccount_id),
whitelist_only: Ok(value.whitelist_only),
}
}
}
#[derive(Clone, Debug)]
pub struct UpdateWhitelistedRecipientsRequest {
add: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
nonce: ::std::result::Result<u64, ::std::string::String>,
remove: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
signature: ::std::result::Result<::std::string::String, ::std::string::String>,
signature_expiry_sec: ::std::result::Result<u64, ::std::string::String>,
signer: ::std::result::Result<::std::string::String, ::std::string::String>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for UpdateWhitelistedRecipientsRequest {
fn default() -> Self {
Self {
add: Err("no value supplied for add".to_string()),
nonce: Err("no value supplied for nonce".to_string()),
remove: Err("no value supplied for remove".to_string()),
signature: Err("no value supplied for signature".to_string()),
signature_expiry_sec: Err(
"no value supplied for signature_expiry_sec".to_string(),
),
signer: Err("no value supplied for signer".to_string()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl UpdateWhitelistedRecipientsRequest {
pub fn add<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.add = value
.try_into()
.map_err(|e| format!("error converting supplied value for add: {e}"));
self
}
pub fn nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.nonce = value
.try_into()
.map_err(|e| format!("error converting supplied value for nonce: {e}"));
self
}
pub fn remove<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.remove = value
.try_into()
.map_err(|e| format!("error converting supplied value for remove: {e}"));
self
}
pub fn signature<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signature = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signature: {e}")
});
self
}
pub fn signature_expiry_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.signature_expiry_sec = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for signature_expiry_sec: {e}"
)
});
self
}
pub fn signer<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.signer = value
.try_into()
.map_err(|e| format!("error converting supplied value for signer: {e}"));
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<UpdateWhitelistedRecipientsRequest>
for super::UpdateWhitelistedRecipientsRequest {
type Error = super::error::ConversionError;
fn try_from(
value: UpdateWhitelistedRecipientsRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
add: value.add?,
nonce: value.nonce?,
remove: value.remove?,
signature: value.signature?,
signature_expiry_sec: value.signature_expiry_sec?,
signer: value.signer?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::UpdateWhitelistedRecipientsRequest>
for UpdateWhitelistedRecipientsRequest {
fn from(value: super::UpdateWhitelistedRecipientsRequest) -> Self {
Self {
add: Ok(value.add),
nonce: Ok(value.nonce),
remove: Ok(value.remove),
signature: Ok(value.signature),
signature_expiry_sec: Ok(value.signature_expiry_sec),
signer: Ok(value.signer),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct UpdateWhitelistedRecipientsResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
whitelisted_recipients: ::std::result::Result<
::std::vec::Vec<::std::string::String>,
::std::string::String,
>,
}
impl ::std::default::Default for UpdateWhitelistedRecipientsResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
whitelisted_recipients: Err(
"no value supplied for whitelisted_recipients".to_string(),
),
}
}
}
impl UpdateWhitelistedRecipientsResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
pub fn whitelisted_recipients<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.whitelisted_recipients = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for whitelisted_recipients: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<UpdateWhitelistedRecipientsResponse>
for super::UpdateWhitelistedRecipientsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: UpdateWhitelistedRecipientsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
whitelisted_recipients: value.whitelisted_recipients?,
})
}
}
impl ::std::convert::From<super::UpdateWhitelistedRecipientsResponse>
for UpdateWhitelistedRecipientsResponse {
fn from(value: super::UpdateWhitelistedRecipientsResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
whitelisted_recipients: Ok(value.whitelisted_recipients),
}
}
}
#[derive(Clone, Debug)]
pub struct Vault {
benchmark_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
curator: ::std::result::Result<super::Address, ::std::string::String>,
curator_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
description: ::std::result::Result<::std::string::String, ::std::string::String>,
mtm_cap: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
name: ::std::result::Result<::std::string::String, ::std::string::String>,
nav_benchmark: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
nav_usd: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
protocol: ::std::result::Result<super::ProtocolVault, ::std::string::String>,
simulated_share_price_usd: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
whitelist_only: ::std::result::Result<bool, ::std::string::String>,
}
impl ::std::default::Default for Vault {
fn default() -> Self {
Self {
benchmark_price: Ok(Default::default()),
curator: Err("no value supplied for curator".to_string()),
curator_shares: Err("no value supplied for curator_shares".to_string()),
description: Err("no value supplied for description".to_string()),
mtm_cap: Ok(Default::default()),
name: Err("no value supplied for name".to_string()),
nav_benchmark: Ok(Default::default()),
nav_usd: Ok(Default::default()),
protocol: Err("no value supplied for protocol".to_string()),
simulated_share_price_usd: Ok(Default::default()),
whitelist_only: Err("no value supplied for whitelist_only".to_string()),
}
}
}
impl Vault {
pub fn benchmark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.benchmark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for benchmark_price: {e}")
});
self
}
pub fn curator<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.curator = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for curator: {e}")
});
self
}
pub fn curator_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.curator_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for curator_shares: {e}")
});
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for description: {e}")
});
self
}
pub fn mtm_cap<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.mtm_cap = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for mtm_cap: {e}")
});
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
pub fn nav_benchmark<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.nav_benchmark = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for nav_benchmark: {e}")
});
self
}
pub fn nav_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.nav_usd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for nav_usd: {e}")
});
self
}
pub fn protocol<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ProtocolVault>,
T::Error: ::std::fmt::Display,
{
self.protocol = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for protocol: {e}")
});
self
}
pub fn simulated_share_price_usd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.simulated_share_price_usd = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for simulated_share_price_usd: {e}"
)
});
self
}
pub fn whitelist_only<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.whitelist_only = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for whitelist_only: {e}")
});
self
}
}
impl ::std::convert::TryFrom<Vault> for super::Vault {
type Error = super::error::ConversionError;
fn try_from(
value: Vault,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
benchmark_price: value.benchmark_price?,
curator: value.curator?,
curator_shares: value.curator_shares?,
description: value.description?,
mtm_cap: value.mtm_cap?,
name: value.name?,
nav_benchmark: value.nav_benchmark?,
nav_usd: value.nav_usd?,
protocol: value.protocol?,
simulated_share_price_usd: value.simulated_share_price_usd?,
whitelist_only: value.whitelist_only?,
})
}
}
impl ::std::convert::From<super::Vault> for Vault {
fn from(value: super::Vault) -> Self {
Self {
benchmark_price: Ok(value.benchmark_price),
curator: Ok(value.curator),
curator_shares: Ok(value.curator_shares),
description: Ok(value.description),
mtm_cap: Ok(value.mtm_cap),
name: Ok(value.name),
nav_benchmark: Ok(value.nav_benchmark),
nav_usd: Ok(value.nav_usd),
protocol: Ok(value.protocol),
simulated_share_price_usd: Ok(value.simulated_share_price_usd),
whitelist_only: Ok(value.whitelist_only),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultActionResponse {
after_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
before_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
creation_timestamp_ms: ::std::result::Result<i64, ::std::string::String>,
entry_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
error_reason: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
event_ts: ::std::result::Result<i64, ::std::string::String>,
event_type: ::std::result::Result<::std::string::String, ::std::string::String>,
exit_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
operation_uuid: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
share_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
shares_delta: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
shares_requested: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
status: ::std::result::Result<::std::string::String, ::std::string::String>,
user_action_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
vault_nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
vault_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for VaultActionResponse {
fn default() -> Self {
Self {
after_shares: Err("no value supplied for after_shares".to_string()),
amount: Err("no value supplied for amount".to_string()),
before_shares: Err("no value supplied for before_shares".to_string()),
creation_timestamp_ms: Err(
"no value supplied for creation_timestamp_ms".to_string(),
),
entry_price: Err("no value supplied for entry_price".to_string()),
error_reason: Err("no value supplied for error_reason".to_string()),
event_ts: Err("no value supplied for event_ts".to_string()),
event_type: Err("no value supplied for event_type".to_string()),
exit_price: Err("no value supplied for exit_price".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
operation_uuid: Err("no value supplied for operation_uuid".to_string()),
share_price: Err("no value supplied for share_price".to_string()),
shares_delta: Err("no value supplied for shares_delta".to_string()),
shares_requested: Err(
"no value supplied for shares_requested".to_string(),
),
status: Err("no value supplied for status".to_string()),
user_action_hash: Err(
"no value supplied for user_action_hash".to_string(),
),
vault_nonce: Err("no value supplied for vault_nonce".to_string()),
vault_subaccount_id: Err(
"no value supplied for vault_subaccount_id".to_string(),
),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl VaultActionResponse {
pub fn after_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.after_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for after_shares: {e}")
});
self
}
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn before_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.before_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for before_shares: {e}")
});
self
}
pub fn creation_timestamp_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp_ms = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp_ms: {e}"
)
});
self
}
pub fn entry_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.entry_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for entry_price: {e}")
});
self
}
pub fn error_reason<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.error_reason = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for error_reason: {e}")
});
self
}
pub fn event_ts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.event_ts = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for event_ts: {e}")
});
self
}
pub fn event_type<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.event_type = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for event_type: {e}")
});
self
}
pub fn exit_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.exit_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for exit_price: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
pub fn operation_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.operation_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_uuid: {e}")
});
self
}
pub fn share_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.share_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for share_price: {e}")
});
self
}
pub fn shares_delta<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.shares_delta = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for shares_delta: {e}")
});
self
}
pub fn shares_requested<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.shares_requested = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for shares_requested: {e}")
});
self
}
pub fn status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.status = value
.try_into()
.map_err(|e| format!("error converting supplied value for status: {e}"));
self
}
pub fn user_action_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.user_action_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for user_action_hash: {e}")
});
self
}
pub fn vault_nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.vault_nonce = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vault_nonce: {e}")
});
self
}
pub fn vault_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_subaccount_id: {e}"
)
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultActionResponse> for super::VaultActionResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultActionResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
after_shares: value.after_shares?,
amount: value.amount?,
before_shares: value.before_shares?,
creation_timestamp_ms: value.creation_timestamp_ms?,
entry_price: value.entry_price?,
error_reason: value.error_reason?,
event_ts: value.event_ts?,
event_type: value.event_type?,
exit_price: value.exit_price?,
operation_id: value.operation_id?,
operation_uuid: value.operation_uuid?,
share_price: value.share_price?,
shares_delta: value.shares_delta?,
shares_requested: value.shares_requested?,
status: value.status?,
user_action_hash: value.user_action_hash?,
vault_nonce: value.vault_nonce?,
vault_subaccount_id: value.vault_subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::VaultActionResponse> for VaultActionResponse {
fn from(value: super::VaultActionResponse) -> Self {
Self {
after_shares: Ok(value.after_shares),
amount: Ok(value.amount),
before_shares: Ok(value.before_shares),
creation_timestamp_ms: Ok(value.creation_timestamp_ms),
entry_price: Ok(value.entry_price),
error_reason: Ok(value.error_reason),
event_ts: Ok(value.event_ts),
event_type: Ok(value.event_type),
exit_price: Ok(value.exit_price),
operation_id: Ok(value.operation_id),
operation_uuid: Ok(value.operation_uuid),
share_price: Ok(value.share_price),
shares_delta: Ok(value.shares_delta),
shares_requested: Ok(value.shares_requested),
status: Ok(value.status),
user_action_hash: Ok(value.user_action_hash),
vault_nonce: Ok(value.vault_nonce),
vault_subaccount_id: Ok(value.vault_subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultCancelResponse {
cancelled_request_ids: ::std::result::Result<
::std::vec::Vec<super::VaultRequestId>,
::std::string::String,
>,
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultCancelResponse {
fn default() -> Self {
Self {
cancelled_request_ids: Err(
"no value supplied for cancelled_request_ids".to_string(),
),
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl VaultCancelResponse {
pub fn cancelled_request_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VaultRequestId>>,
T::Error: ::std::fmt::Display,
{
self.cancelled_request_ids = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for cancelled_request_ids: {e}"
)
});
self
}
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultCancelResponse> for super::VaultCancelResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultCancelResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
cancelled_request_ids: value.cancelled_request_ids?,
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::VaultCancelResponse> for VaultCancelResponse {
fn from(value: super::VaultCancelResponse) -> Self {
Self {
cancelled_request_ids: Ok(value.cancelled_request_ids),
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultConfig {
benchmark_asset: ::std::result::Result<
::std::option::Option<super::Address>,
::std::string::String,
>,
cooldown_sec: ::std::result::Result<u64, ::std::string::String>,
deposit_spot_asset: ::std::result::Result<super::Address, ::std::string::String>,
management_fee_bps: ::std::result::Result<u16, ::std::string::String>,
max_slippage_bps: ::std::result::Result<u16, ::std::string::String>,
performance_fee_bps: ::std::result::Result<u16, ::std::string::String>,
}
impl ::std::default::Default for VaultConfig {
fn default() -> Self {
Self {
benchmark_asset: Ok(Default::default()),
cooldown_sec: Err("no value supplied for cooldown_sec".to_string()),
deposit_spot_asset: Err(
"no value supplied for deposit_spot_asset".to_string(),
),
management_fee_bps: Err(
"no value supplied for management_fee_bps".to_string(),
),
max_slippage_bps: Err(
"no value supplied for max_slippage_bps".to_string(),
),
performance_fee_bps: Err(
"no value supplied for performance_fee_bps".to_string(),
),
}
}
}
impl VaultConfig {
pub fn benchmark_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Address>>,
T::Error: ::std::fmt::Display,
{
self.benchmark_asset = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for benchmark_asset: {e}")
});
self
}
pub fn cooldown_sec<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.cooldown_sec = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for cooldown_sec: {e}")
});
self
}
pub fn deposit_spot_asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.deposit_spot_asset = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for deposit_spot_asset: {e}"
)
});
self
}
pub fn management_fee_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.management_fee_bps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for management_fee_bps: {e}"
)
});
self
}
pub fn max_slippage_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.max_slippage_bps = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for max_slippage_bps: {e}")
});
self
}
pub fn performance_fee_bps<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u16>,
T::Error: ::std::fmt::Display,
{
self.performance_fee_bps = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for performance_fee_bps: {e}"
)
});
self
}
}
impl ::std::convert::TryFrom<VaultConfig> for super::VaultConfig {
type Error = super::error::ConversionError;
fn try_from(
value: VaultConfig,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
benchmark_asset: value.benchmark_asset?,
cooldown_sec: value.cooldown_sec?,
deposit_spot_asset: value.deposit_spot_asset?,
management_fee_bps: value.management_fee_bps?,
max_slippage_bps: value.max_slippage_bps?,
performance_fee_bps: value.performance_fee_bps?,
})
}
}
impl ::std::convert::From<super::VaultConfig> for VaultConfig {
fn from(value: super::VaultConfig) -> Self {
Self {
benchmark_asset: Ok(value.benchmark_asset),
cooldown_sec: Ok(value.cooldown_sec),
deposit_spot_asset: Ok(value.deposit_spot_asset),
management_fee_bps: Ok(value.management_fee_bps),
max_slippage_bps: Ok(value.max_slippage_bps),
performance_fee_bps: Ok(value.performance_fee_bps),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultCreateResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultCreateResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl VaultCreateResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultCreateResponse> for super::VaultCreateResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultCreateResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::VaultCreateResponse> for VaultCreateResponse {
fn from(value: super::VaultCreateResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultDepositHold {
amount: ::std::result::Result<::std::string::String, ::std::string::String>,
asset_name: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
vault_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultDepositHold {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
asset_name: Err("no value supplied for asset_name".to_string()),
currency: Err("no value supplied for currency".to_string()),
vault_id: Err("no value supplied for vault_id".to_string()),
}
}
}
impl VaultDepositHold {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset_name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset_name = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for asset_name: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn vault_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vault_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultDepositHold> for super::VaultDepositHold {
type Error = super::error::ConversionError;
fn try_from(
value: VaultDepositHold,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
asset_name: value.asset_name?,
currency: value.currency?,
vault_id: value.vault_id?,
})
}
}
impl ::std::convert::From<super::VaultDepositHold> for VaultDepositHold {
fn from(value: super::VaultDepositHold) -> Self {
Self {
amount: Ok(value.amount),
asset_name: Ok(value.asset_name),
currency: Ok(value.currency),
vault_id: Ok(value.vault_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultForceBurnResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultForceBurnResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl VaultForceBurnResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultForceBurnResponse>
for super::VaultForceBurnResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultForceBurnResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::VaultForceBurnResponse> for VaultForceBurnResponse {
fn from(value: super::VaultForceBurnResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultIdsResponse {
subaccount_ids: ::std::result::Result<
::std::vec::Vec<u64>,
::std::string::String,
>,
}
impl ::std::default::Default for VaultIdsResponse {
fn default() -> Self {
Self {
subaccount_ids: Err("no value supplied for subaccount_ids".to_string()),
}
}
}
impl VaultIdsResponse {
pub fn subaccount_ids<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<u64>>,
T::Error: ::std::fmt::Display,
{
self.subaccount_ids = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_ids: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultIdsResponse> for super::VaultIdsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultIdsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
subaccount_ids: value.subaccount_ids?,
})
}
}
impl ::std::convert::From<super::VaultIdsResponse> for VaultIdsResponse {
fn from(value: super::VaultIdsResponse) -> Self {
Self {
subaccount_ids: Ok(value.subaccount_ids),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultPerformanceHistoryResult {
points: ::std::result::Result<
::std::vec::Vec<super::VaultPerformancePointResponse>,
::std::string::String,
>,
resolution: ::std::result::Result<
super::PerformanceResolution,
::std::string::String,
>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultPerformanceHistoryResult {
fn default() -> Self {
Self {
points: Err("no value supplied for points".to_string()),
resolution: Err("no value supplied for resolution".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
}
}
}
impl VaultPerformanceHistoryResult {
pub fn points<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::vec::Vec<super::VaultPerformancePointResponse>,
>,
T::Error: ::std::fmt::Display,
{
self.points = value
.try_into()
.map_err(|e| format!("error converting supplied value for points: {e}"));
self
}
pub fn resolution<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PerformanceResolution>,
T::Error: ::std::fmt::Display,
{
self.resolution = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for resolution: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultPerformanceHistoryResult>
for super::VaultPerformanceHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: VaultPerformanceHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
points: value.points?,
resolution: value.resolution?,
subaccount_id: value.subaccount_id?,
})
}
}
impl ::std::convert::From<super::VaultPerformanceHistoryResult>
for VaultPerformanceHistoryResult {
fn from(value: super::VaultPerformanceHistoryResult) -> Self {
Self {
points: Ok(value.points),
resolution: Ok(value.resolution),
subaccount_id: Ok(value.subaccount_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultPerformancePointResponse {
benchmark_price: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
curator_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
global_hwm: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
nav: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
nav_benchmark: ::std::result::Result<
::std::option::Option<::bigdecimal::BigDecimal>,
::std::string::String,
>,
share_price: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
total_shares: ::std::result::Result<
::bigdecimal::BigDecimal,
::std::string::String,
>,
ts: ::std::result::Result<i64, ::std::string::String>,
}
impl ::std::default::Default for VaultPerformancePointResponse {
fn default() -> Self {
Self {
benchmark_price: Err(
"no value supplied for benchmark_price".to_string(),
),
curator_shares: Err("no value supplied for curator_shares".to_string()),
global_hwm: Err("no value supplied for global_hwm".to_string()),
nav: Err("no value supplied for nav".to_string()),
nav_benchmark: Err("no value supplied for nav_benchmark".to_string()),
share_price: Err("no value supplied for share_price".to_string()),
total_shares: Err("no value supplied for total_shares".to_string()),
ts: Err("no value supplied for ts".to_string()),
}
}
}
impl VaultPerformancePointResponse {
pub fn benchmark_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.benchmark_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for benchmark_price: {e}")
});
self
}
pub fn curator_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.curator_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for curator_shares: {e}")
});
self
}
pub fn global_hwm<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.global_hwm = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for global_hwm: {e}")
});
self
}
pub fn nav<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.nav = value
.try_into()
.map_err(|e| format!("error converting supplied value for nav: {e}"));
self
}
pub fn nav_benchmark<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::bigdecimal::BigDecimal>>,
T::Error: ::std::fmt::Display,
{
self.nav_benchmark = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for nav_benchmark: {e}")
});
self
}
pub fn share_price<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.share_price = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for share_price: {e}")
});
self
}
pub fn total_shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.total_shares = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for total_shares: {e}")
});
self
}
pub fn ts<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<i64>,
T::Error: ::std::fmt::Display,
{
self.ts = value
.try_into()
.map_err(|e| format!("error converting supplied value for ts: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultPerformancePointResponse>
for super::VaultPerformancePointResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultPerformancePointResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
benchmark_price: value.benchmark_price?,
curator_shares: value.curator_shares?,
global_hwm: value.global_hwm?,
nav: value.nav?,
nav_benchmark: value.nav_benchmark?,
share_price: value.share_price?,
total_shares: value.total_shares?,
ts: value.ts?,
})
}
}
impl ::std::convert::From<super::VaultPerformancePointResponse>
for VaultPerformancePointResponse {
fn from(value: super::VaultPerformancePointResponse) -> Self {
Self {
benchmark_price: Ok(value.benchmark_price),
curator_shares: Ok(value.curator_shares),
global_hwm: Ok(value.global_hwm),
nav: Ok(value.nav),
nav_benchmark: Ok(value.nav_benchmark),
share_price: Ok(value.share_price),
total_shares: Ok(value.total_shares),
ts: Ok(value.ts),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultRequestAckResponse {
request_id: ::std::result::Result<super::VaultRequestId, ::std::string::String>,
}
impl ::std::default::Default for VaultRequestAckResponse {
fn default() -> Self {
Self {
request_id: Err("no value supplied for request_id".to_string()),
}
}
}
impl VaultRequestAckResponse {
pub fn request_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultRequestId>,
T::Error: ::std::fmt::Display,
{
self.request_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for request_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultRequestAckResponse>
for super::VaultRequestAckResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultRequestAckResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
request_id: value.request_id?,
})
}
}
impl ::std::convert::From<super::VaultRequestAckResponse>
for VaultRequestAckResponse {
fn from(value: super::VaultRequestAckResponse) -> Self {
Self {
request_id: Ok(value.request_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultRequestId {
vault_nonce: ::std::result::Result<::std::string::String, ::std::string::String>,
vault_subaccount_id: ::std::result::Result<u64, ::std::string::String>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for VaultRequestId {
fn default() -> Self {
Self {
vault_nonce: Err("no value supplied for vault_nonce".to_string()),
vault_subaccount_id: Err(
"no value supplied for vault_subaccount_id".to_string(),
),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl VaultRequestId {
pub fn vault_nonce<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.vault_nonce = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vault_nonce: {e}")
});
self
}
pub fn vault_subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.vault_subaccount_id = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for vault_subaccount_id: {e}"
)
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultRequestId> for super::VaultRequestId {
type Error = super::error::ConversionError;
fn try_from(
value: VaultRequestId,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
vault_nonce: value.vault_nonce?,
vault_subaccount_id: value.vault_subaccount_id?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::VaultRequestId> for VaultRequestId {
fn from(value: super::VaultRequestId) -> Self {
Self {
vault_nonce: Ok(value.vault_nonce),
vault_subaccount_id: Ok(value.vault_subaccount_id),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultRequestResponse {
creation_timestamp_ms: ::std::result::Result<u64, ::std::string::String>,
id: ::std::result::Result<super::VaultRequestId, ::std::string::String>,
signed_action: ::std::result::Result<super::SignedAction, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
user_action_hash: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
wallet: ::std::result::Result<super::Address, ::std::string::String>,
}
impl ::std::default::Default for VaultRequestResponse {
fn default() -> Self {
Self {
creation_timestamp_ms: Err(
"no value supplied for creation_timestamp_ms".to_string(),
),
id: Err("no value supplied for id".to_string()),
signed_action: Err("no value supplied for signed_action".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
user_action_hash: Err(
"no value supplied for user_action_hash".to_string(),
),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl VaultRequestResponse {
pub fn creation_timestamp_ms<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.creation_timestamp_ms = value
.try_into()
.map_err(|e| {
format!(
"error converting supplied value for creation_timestamp_ms: {e}"
)
});
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VaultRequestId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn signed_action<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::SignedAction>,
T::Error: ::std::fmt::Display,
{
self.signed_action = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signed_action: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn user_action_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.user_action_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for user_action_hash: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Address>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultRequestResponse> for super::VaultRequestResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultRequestResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
creation_timestamp_ms: value.creation_timestamp_ms?,
id: value.id?,
signed_action: value.signed_action?,
subaccount_id: value.subaccount_id?,
user_action_hash: value.user_action_hash?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::VaultRequestResponse> for VaultRequestResponse {
fn from(value: super::VaultRequestResponse) -> Self {
Self {
creation_timestamp_ms: Ok(value.creation_timestamp_ms),
id: Ok(value.id),
signed_action: Ok(value.signed_action),
subaccount_id: Ok(value.subaccount_id),
user_action_hash: Ok(value.user_action_hash),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultSettleResponse {
op_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
operation_id: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VaultSettleResponse {
fn default() -> Self {
Self {
op_uuid: Err("no value supplied for op_uuid".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
}
}
}
impl VaultSettleResponse {
pub fn op_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.op_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for op_uuid: {e}")
});
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VaultSettleResponse> for super::VaultSettleResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultSettleResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
op_uuid: value.op_uuid?,
operation_id: value.operation_id?,
})
}
}
impl ::std::convert::From<super::VaultSettleResponse> for VaultSettleResponse {
fn from(value: super::VaultSettleResponse) -> Self {
Self {
op_uuid: Ok(value.op_uuid),
operation_id: Ok(value.operation_id),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultShareEntryResponse {
shares: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
vault: ::std::result::Result<super::Vault, ::std::string::String>,
}
impl ::std::default::Default for VaultShareEntryResponse {
fn default() -> Self {
Self {
shares: Err("no value supplied for shares".to_string()),
vault: Err("no value supplied for vault".to_string()),
}
}
}
impl VaultShareEntryResponse {
pub fn shares<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.shares = value
.try_into()
.map_err(|e| format!("error converting supplied value for shares: {e}"));
self
}
pub fn vault<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Vault>,
T::Error: ::std::fmt::Display,
{
self.vault = value
.try_into()
.map_err(|e| format!("error converting supplied value for vault: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultShareEntryResponse>
for super::VaultShareEntryResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultShareEntryResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
shares: value.shares?,
vault: value.vault?,
})
}
}
impl ::std::convert::From<super::VaultShareEntryResponse>
for VaultShareEntryResponse {
fn from(value: super::VaultShareEntryResponse) -> Self {
Self {
shares: Ok(value.shares),
vault: Ok(value.vault),
}
}
}
#[derive(Clone, Debug)]
pub struct VaultSharesResponse {
vaults: ::std::result::Result<
::std::vec::Vec<super::VaultShareEntryResponse>,
::std::string::String,
>,
}
impl ::std::default::Default for VaultSharesResponse {
fn default() -> Self {
Self {
vaults: Err("no value supplied for vaults".to_string()),
}
}
}
impl VaultSharesResponse {
pub fn vaults<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VaultShareEntryResponse>>,
T::Error: ::std::fmt::Display,
{
self.vaults = value
.try_into()
.map_err(|e| format!("error converting supplied value for vaults: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultSharesResponse> for super::VaultSharesResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultSharesResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { vaults: value.vaults? })
}
}
impl ::std::convert::From<super::VaultSharesResponse> for VaultSharesResponse {
fn from(value: super::VaultSharesResponse) -> Self {
Self { vaults: Ok(value.vaults) }
}
}
#[derive(Clone, Debug)]
pub struct VaultsResponse {
pagination: ::std::result::Result<super::Pagination, ::std::string::String>,
vaults: ::std::result::Result<
::std::vec::Vec<super::Vault>,
::std::string::String,
>,
}
impl ::std::default::Default for VaultsResponse {
fn default() -> Self {
Self {
pagination: Err("no value supplied for pagination".to_string()),
vaults: Err("no value supplied for vaults".to_string()),
}
}
}
impl VaultsResponse {
pub fn pagination<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Pagination>,
T::Error: ::std::fmt::Display,
{
self.pagination = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for pagination: {e}")
});
self
}
pub fn vaults<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Vault>>,
T::Error: ::std::fmt::Display,
{
self.vaults = value
.try_into()
.map_err(|e| format!("error converting supplied value for vaults: {e}"));
self
}
}
impl ::std::convert::TryFrom<VaultsResponse> for super::VaultsResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VaultsResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
pagination: value.pagination?,
vaults: value.vaults?,
})
}
}
impl ::std::convert::From<super::VaultsResponse> for VaultsResponse {
fn from(value: super::VaultsResponse) -> Self {
Self {
pagination: Ok(value.pagination),
vaults: Ok(value.vaults),
}
}
}
#[derive(Clone, Debug)]
pub struct VolFeedDataResponse {
confidence: ::std::result::Result<::std::string::String, ::std::string::String>,
currency: ::std::result::Result<::std::string::String, ::std::string::String>,
deadline: ::std::result::Result<u64, ::std::string::String>,
expiry: ::std::result::Result<u64, ::std::string::String>,
signatures: ::std::result::Result<
super::OracleSignatureDataResponse,
::std::string::String,
>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
vol_data: ::std::result::Result<
super::VolSviParamDataResponse,
::std::string::String,
>,
}
impl ::std::default::Default for VolFeedDataResponse {
fn default() -> Self {
Self {
confidence: Err("no value supplied for confidence".to_string()),
currency: Err("no value supplied for currency".to_string()),
deadline: Err("no value supplied for deadline".to_string()),
expiry: Err("no value supplied for expiry".to_string()),
signatures: Err("no value supplied for signatures".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
vol_data: Err("no value supplied for vol_data".to_string()),
}
}
}
impl VolFeedDataResponse {
pub fn confidence<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.confidence = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for confidence: {e}")
});
self
}
pub fn currency<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.currency = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for currency: {e}")
});
self
}
pub fn deadline<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.deadline = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for deadline: {e}")
});
self
}
pub fn expiry<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.expiry = value
.try_into()
.map_err(|e| format!("error converting supplied value for expiry: {e}"));
self
}
pub fn signatures<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::OracleSignatureDataResponse>,
T::Error: ::std::fmt::Display,
{
self.signatures = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for signatures: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn vol_data<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VolSviParamDataResponse>,
T::Error: ::std::fmt::Display,
{
self.vol_data = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for vol_data: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VolFeedDataResponse> for super::VolFeedDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VolFeedDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
confidence: value.confidence?,
currency: value.currency?,
deadline: value.deadline?,
expiry: value.expiry?,
signatures: value.signatures?,
timestamp: value.timestamp?,
vol_data: value.vol_data?,
})
}
}
impl ::std::convert::From<super::VolFeedDataResponse> for VolFeedDataResponse {
fn from(value: super::VolFeedDataResponse) -> Self {
Self {
confidence: Ok(value.confidence),
currency: Ok(value.currency),
deadline: Ok(value.deadline),
expiry: Ok(value.expiry),
signatures: Ok(value.signatures),
timestamp: Ok(value.timestamp),
vol_data: Ok(value.vol_data),
}
}
}
#[derive(Clone, Debug)]
pub struct VolSviParamDataResponse {
svi_a: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_b: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_fwd: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_m: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_ref_tau: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_rho: ::std::result::Result<::std::string::String, ::std::string::String>,
svi_sigma: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for VolSviParamDataResponse {
fn default() -> Self {
Self {
svi_a: Err("no value supplied for svi_a".to_string()),
svi_b: Err("no value supplied for svi_b".to_string()),
svi_fwd: Err("no value supplied for svi_fwd".to_string()),
svi_m: Err("no value supplied for svi_m".to_string()),
svi_ref_tau: Err("no value supplied for svi_ref_tau".to_string()),
svi_rho: Err("no value supplied for svi_rho".to_string()),
svi_sigma: Err("no value supplied for svi_sigma".to_string()),
}
}
}
impl VolSviParamDataResponse {
pub fn svi_a<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_a = value
.try_into()
.map_err(|e| format!("error converting supplied value for svi_a: {e}"));
self
}
pub fn svi_b<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_b = value
.try_into()
.map_err(|e| format!("error converting supplied value for svi_b: {e}"));
self
}
pub fn svi_fwd<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_fwd = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for svi_fwd: {e}")
});
self
}
pub fn svi_m<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_m = value
.try_into()
.map_err(|e| format!("error converting supplied value for svi_m: {e}"));
self
}
pub fn svi_ref_tau<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_ref_tau = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for svi_ref_tau: {e}")
});
self
}
pub fn svi_rho<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_rho = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for svi_rho: {e}")
});
self
}
pub fn svi_sigma<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.svi_sigma = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for svi_sigma: {e}")
});
self
}
}
impl ::std::convert::TryFrom<VolSviParamDataResponse>
for super::VolSviParamDataResponse {
type Error = super::error::ConversionError;
fn try_from(
value: VolSviParamDataResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
svi_a: value.svi_a?,
svi_b: value.svi_b?,
svi_fwd: value.svi_fwd?,
svi_m: value.svi_m?,
svi_ref_tau: value.svi_ref_tau?,
svi_rho: value.svi_rho?,
svi_sigma: value.svi_sigma?,
})
}
}
impl ::std::convert::From<super::VolSviParamDataResponse>
for VolSviParamDataResponse {
fn from(value: super::VolSviParamDataResponse) -> Self {
Self {
svi_a: Ok(value.svi_a),
svi_b: Ok(value.svi_b),
svi_fwd: Ok(value.svi_fwd),
svi_m: Ok(value.svi_m),
svi_ref_tau: Ok(value.svi_ref_tau),
svi_rho: Ok(value.svi_rho),
svi_sigma: Ok(value.svi_sigma),
}
}
}
#[derive(Clone, Debug)]
pub struct WithdrawalEntry {
amount: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
asset: ::std::result::Result<::std::string::String, ::std::string::String>,
batch_status: ::std::result::Result<super::BatchStatus, ::std::string::String>,
batch_uuid: ::std::result::Result<::std::string::String, ::std::string::String>,
erc20_address: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
fee: ::std::result::Result<::bigdecimal::BigDecimal, ::std::string::String>,
operation_id: ::std::result::Result<
::std::string::String,
::std::string::String,
>,
recipient: ::std::result::Result<::std::string::String, ::std::string::String>,
subaccount_id: ::std::result::Result<u64, ::std::string::String>,
timestamp: ::std::result::Result<u64, ::std::string::String>,
tx_hash: ::std::result::Result<
::std::option::Option<::std::string::String>,
::std::string::String,
>,
wallet: ::std::result::Result<::std::string::String, ::std::string::String>,
}
impl ::std::default::Default for WithdrawalEntry {
fn default() -> Self {
Self {
amount: Err("no value supplied for amount".to_string()),
asset: Err("no value supplied for asset".to_string()),
batch_status: Err("no value supplied for batch_status".to_string()),
batch_uuid: Err("no value supplied for batch_uuid".to_string()),
erc20_address: Err("no value supplied for erc20_address".to_string()),
fee: Err("no value supplied for fee".to_string()),
operation_id: Err("no value supplied for operation_id".to_string()),
recipient: Err("no value supplied for recipient".to_string()),
subaccount_id: Err("no value supplied for subaccount_id".to_string()),
timestamp: Err("no value supplied for timestamp".to_string()),
tx_hash: Ok(Default::default()),
wallet: Err("no value supplied for wallet".to_string()),
}
}
}
impl WithdrawalEntry {
pub fn amount<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.amount = value
.try_into()
.map_err(|e| format!("error converting supplied value for amount: {e}"));
self
}
pub fn asset<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.asset = value
.try_into()
.map_err(|e| format!("error converting supplied value for asset: {e}"));
self
}
pub fn batch_status<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::BatchStatus>,
T::Error: ::std::fmt::Display,
{
self.batch_status = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_status: {e}")
});
self
}
pub fn batch_uuid<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.batch_uuid = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for batch_uuid: {e}")
});
self
}
pub fn erc20_address<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.erc20_address = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for erc20_address: {e}")
});
self
}
pub fn fee<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::bigdecimal::BigDecimal>,
T::Error: ::std::fmt::Display,
{
self.fee = value
.try_into()
.map_err(|e| format!("error converting supplied value for fee: {e}"));
self
}
pub fn operation_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.operation_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for operation_id: {e}")
});
self
}
pub fn recipient<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.recipient = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for recipient: {e}")
});
self
}
pub fn subaccount_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.subaccount_id = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for subaccount_id: {e}")
});
self
}
pub fn timestamp<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.timestamp = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for timestamp: {e}")
});
self
}
pub fn tx_hash<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>,
T::Error: ::std::fmt::Display,
{
self.tx_hash = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for tx_hash: {e}")
});
self
}
pub fn wallet<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::string::String>,
T::Error: ::std::fmt::Display,
{
self.wallet = value
.try_into()
.map_err(|e| format!("error converting supplied value for wallet: {e}"));
self
}
}
impl ::std::convert::TryFrom<WithdrawalEntry> for super::WithdrawalEntry {
type Error = super::error::ConversionError;
fn try_from(
value: WithdrawalEntry,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
amount: value.amount?,
asset: value.asset?,
batch_status: value.batch_status?,
batch_uuid: value.batch_uuid?,
erc20_address: value.erc20_address?,
fee: value.fee?,
operation_id: value.operation_id?,
recipient: value.recipient?,
subaccount_id: value.subaccount_id?,
timestamp: value.timestamp?,
tx_hash: value.tx_hash?,
wallet: value.wallet?,
})
}
}
impl ::std::convert::From<super::WithdrawalEntry> for WithdrawalEntry {
fn from(value: super::WithdrawalEntry) -> Self {
Self {
amount: Ok(value.amount),
asset: Ok(value.asset),
batch_status: Ok(value.batch_status),
batch_uuid: Ok(value.batch_uuid),
erc20_address: Ok(value.erc20_address),
fee: Ok(value.fee),
operation_id: Ok(value.operation_id),
recipient: Ok(value.recipient),
subaccount_id: Ok(value.subaccount_id),
timestamp: Ok(value.timestamp),
tx_hash: Ok(value.tx_hash),
wallet: Ok(value.wallet),
}
}
}
#[derive(Clone, Debug)]
pub struct WithdrawalHistoryResult {
withdrawals: ::std::result::Result<
::std::vec::Vec<super::WithdrawalEntry>,
::std::string::String,
>,
}
impl ::std::default::Default for WithdrawalHistoryResult {
fn default() -> Self {
Self {
withdrawals: Err("no value supplied for withdrawals".to_string()),
}
}
}
impl WithdrawalHistoryResult {
pub fn withdrawals<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::WithdrawalEntry>>,
T::Error: ::std::fmt::Display,
{
self.withdrawals = value
.try_into()
.map_err(|e| {
format!("error converting supplied value for withdrawals: {e}")
});
self
}
}
impl ::std::convert::TryFrom<WithdrawalHistoryResult>
for super::WithdrawalHistoryResult {
type Error = super::error::ConversionError;
fn try_from(
value: WithdrawalHistoryResult,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
withdrawals: value.withdrawals?,
})
}
}
impl ::std::convert::From<super::WithdrawalHistoryResult>
for WithdrawalHistoryResult {
fn from(value: super::WithdrawalHistoryResult) -> Self {
Self {
withdrawals: Ok(value.withdrawals),
}
}
}
}
/// Generation of default values for serde.
pub mod defaults {
pub(super) fn default_bool<const V: bool>() -> bool {
V
}
pub(super) fn default_u64<T, const V: u64>() -> T
where
T: ::std::convert::TryFrom<u64>,
<T as ::std::convert::TryFrom<u64>>::Error: ::std::fmt::Debug,
{
T::try_from(V).unwrap()
}
pub(super) fn create_order_request_order_type() -> super::OrderType {
super::OrderType::Limit
}
pub(super) fn create_order_request_time_in_force() -> super::TimeInForce {
super::TimeInForce::Gtc
}
pub(super) fn order_cancel_reason() -> super::CancelReason {
super::CancelReason::X
}
pub(super) fn order_quote_request_order_type() -> super::OrderType {
super::OrderType::Limit
}
pub(super) fn order_quote_request_time_in_force() -> super::TimeInForce {
super::TimeInForce::Gtc
}
pub(super) fn replace_order_request_order_type() -> super::OrderType {
super::OrderType::Limit
}
pub(super) fn replace_order_request_time_in_force() -> super::TimeInForce {
super::TimeInForce::Gtc
}
pub(super) fn replace_quote_request_extra_fee() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
pub(super) fn rfq_get_best_quote_request_direction() -> super::Direction {
super::Direction::Buy
}
pub(super) fn rfq_get_best_quote_request_extra_fee() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
pub(super) fn send_quote_request_extra_fee() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
pub(super) fn send_rfq_request_extra_fee() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
pub(super) fn send_rfq_request_partial_fill_step() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"1\"").unwrap()
}
pub(super) fn set_mmp_config_request_mmp_amount_limit() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
pub(super) fn set_mmp_config_request_mmp_delta_limit() -> ::bigdecimal::BigDecimal {
::serde_json::from_str::<::bigdecimal::BigDecimal>("\"0\"").unwrap()
}
}