#![allow(clippy::large_enum_variant)]
#![allow(clippy::format_in_format_args)]
#![allow(clippy::let_unit_value)]
#![allow(unreachable_patterns)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct UltraHoldingsResponse {
pub amount: String,
pub tokens: UltraHoldingsResponseTokens,
#[serde(rename = "uiAmount")]
pub ui_amount: f64,
#[serde(rename = "uiAmountString")]
pub ui_amount_string: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraHoldingsResponseTokens {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<UltraTokenAccount>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct UltraTokenAccount {
pub account: String,
pub amount: String,
pub decimals: f64,
#[serde(rename = "isAssociatedTokenAccount")]
pub is_associated_token_account: bool,
#[serde(rename = "isFrozen")]
pub is_frozen: bool,
#[serde(rename = "programId")]
pub program_id: String,
#[serde(rename = "uiAmount")]
pub ui_amount: f64,
#[serde(rename = "uiAmountString")]
pub ui_amount_string: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TriggerV2ErrorResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<TriggerV2ErrorResponseDetails>,
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TriggerV2ErrorResponseDetails {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV2VerificationExpressExecuteResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "metadataCreated")]
pub metadata_created: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub status: TokensV2VerificationExpressExecuteResponseStatus,
#[serde(rename = "totalTime")]
pub total_time: f64,
#[serde(rename = "verificationCreated")]
pub verification_created: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TokensV2VerificationExpressExecuteResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl TokensV2VerificationExpressExecuteResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for TokensV2VerificationExpressExecuteResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TokensV2VerificationExpressExecuteResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV2VerificationExpressExecuteBody {
pub description: String,
#[serde(rename = "jupOutputAmount", skip_serializing_if = "Option::is_none")]
pub jup_output_amount: Option<String>,
#[serde(rename = "paymentAmount", skip_serializing_if = "Option::is_none")]
pub payment_amount: Option<String>,
#[serde(rename = "paymentCurrency", skip_serializing_if = "Option::is_none")]
pub payment_currency: Option<TokensV2VerificationPaymentCurrency>,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "senderAddress")]
pub sender_address: String,
#[serde(
rename = "senderTwitterHandle",
skip_serializing_if = "Option::is_none"
)]
pub sender_twitter_handle: Option<String>,
#[serde(rename = "tokenId")]
pub token_id: String,
#[serde(rename = "tokenMetadata", skip_serializing_if = "Option::is_none")]
pub token_metadata: Option<TokensV2VerificationTokenMetadataInput>,
pub transaction: String,
#[serde(rename = "twitterHandle")]
pub twitter_handle: String,
}
impl TokensV2VerificationExpressExecuteBody {
pub fn new(
description: String,
request_id: String,
sender_address: String,
token_id: String,
transaction: String,
twitter_handle: String,
) -> Self {
Self {
description,
request_id,
sender_address,
token_id,
transaction,
twitter_handle,
jup_output_amount: None,
payment_amount: None,
payment_currency: None,
sender_twitter_handle: None,
token_metadata: None,
}
}
pub fn builder(
description: String,
request_id: String,
sender_address: String,
token_id: String,
transaction: String,
twitter_handle: String,
) -> TokensV2VerificationExpressExecuteBodyBuilder {
TokensV2VerificationExpressExecuteBodyBuilder::new(
description,
request_id,
sender_address,
token_id,
transaction,
twitter_handle,
)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct TokensV2VerificationExpressExecuteBodyBuilder {
value: TokensV2VerificationExpressExecuteBody,
}
impl TokensV2VerificationExpressExecuteBodyBuilder {
pub fn new(
description: String,
request_id: String,
sender_address: String,
token_id: String,
transaction: String,
twitter_handle: String,
) -> Self {
Self {
value: TokensV2VerificationExpressExecuteBody::new(
description,
request_id,
sender_address,
token_id,
transaction,
twitter_handle,
),
}
}
#[doc = concat!("Set the optional `", "jupOutputAmount", "` request field.")]
#[must_use]
pub fn jup_output_amount(mut self, jup_output_amount: String) -> Self {
self.value.jup_output_amount = Some(jup_output_amount);
self
}
#[doc = concat!("Set the optional `", "paymentAmount", "` request field.")]
#[must_use]
pub fn payment_amount(mut self, payment_amount: String) -> Self {
self.value.payment_amount = Some(payment_amount);
self
}
#[doc = concat!("Set the optional `", "paymentCurrency", "` request field.")]
#[must_use]
pub fn payment_currency(
mut self,
payment_currency: TokensV2VerificationPaymentCurrency,
) -> Self {
self.value.payment_currency = Some(payment_currency);
self
}
#[doc = concat!("Set the optional `", "senderTwitterHandle", "` request field.")]
#[must_use]
pub fn sender_twitter_handle(mut self, sender_twitter_handle: String) -> Self {
self.value.sender_twitter_handle = Some(sender_twitter_handle);
self
}
#[doc = concat!("Set the optional `", "tokenMetadata", "` request field.")]
#[must_use]
pub fn token_metadata(
mut self,
token_metadata: TokensV2VerificationTokenMetadataInput,
) -> Self {
self.value.token_metadata = Some(token_metadata);
self
}
pub fn build(self) -> TokensV2VerificationExpressExecuteBody {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV2VerificationTokenMetadataInput {
#[serde(rename = "circulatingSupply", skip_serializing_if = "Option::is_none")]
pub circulating_supply: Option<String>,
#[serde(
rename = "circulatingSupplyUrl",
skip_serializing_if = "Option::is_none"
)]
pub circulating_supply_url: Option<String>,
#[serde(rename = "coingeckoCoinId", skip_serializing_if = "Option::is_none")]
pub coingecko_coin_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub discord: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub instagram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "otherUrl", skip_serializing_if = "Option::is_none")]
pub other_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub symbol: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub telegram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tiktok: Option<String>,
#[serde(rename = "tokenDescription", skip_serializing_if = "Option::is_none")]
pub token_description: Option<String>,
#[serde(rename = "tokenId")]
pub token_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub twitter: Option<String>,
#[serde(rename = "twitterCommunity", skip_serializing_if = "Option::is_none")]
pub twitter_community: Option<String>,
#[serde(
rename = "useCirculatingSupply",
skip_serializing_if = "Option::is_none"
)]
pub use_circulating_supply: Option<bool>,
#[serde(
rename = "useCirculatingSupplyUrl",
skip_serializing_if = "Option::is_none"
)]
pub use_circulating_supply_url: Option<bool>,
#[serde(rename = "useCoingeckoCoinId", skip_serializing_if = "Option::is_none")]
pub use_coingecko_coin_id: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TokensV2VerificationPaymentCurrency {
#[default]
#[serde(rename = "JUP")]
Jup,
#[serde(rename = "SOL")]
Sol,
#[serde(rename = "USDC")]
Usdc,
#[serde(rename = "JUPUSD")]
Jupusd,
}
impl TokensV2VerificationPaymentCurrency {
pub fn as_str(&self) -> &'static str {
match self {
Self::Jup => "JUP",
Self::Sol => "SOL",
Self::Usdc => "USDC",
Self::Jupusd => "JUPUSD",
}
}
}
impl ::std::fmt::Display for TokensV2VerificationPaymentCurrency {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TokensV2VerificationPaymentCurrency {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1SwapRequest {
#[serde(
rename = "asLegacyTransaction",
skip_serializing_if = "Option::is_none"
)]
pub as_legacy_transaction: Option<bool>,
#[serde(
rename = "blockhashSlotsToExpiry",
skip_serializing_if = "Option::is_none"
)]
pub blockhash_slots_to_expiry: Option<i64>,
#[serde(
rename = "computeUnitPriceMicroLamports",
skip_serializing_if = "Option::is_none"
)]
pub compute_unit_price_micro_lamports: Option<u64>,
#[serde(
rename = "destinationTokenAccount",
skip_serializing_if = "Option::is_none"
)]
pub destination_token_account: Option<String>,
#[serde(
rename = "dynamicComputeUnitLimit",
skip_serializing_if = "Option::is_none"
)]
pub dynamic_compute_unit_limit: Option<bool>,
#[serde(rename = "dynamicSlippage", skip_serializing_if = "Option::is_none")]
pub dynamic_slippage: Option<bool>,
#[serde(rename = "feeAccount", skip_serializing_if = "Option::is_none")]
pub fee_account: Option<String>,
#[serde(
rename = "nativeDestinationAccount",
skip_serializing_if = "Option::is_none"
)]
pub native_destination_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payer: Option<String>,
#[serde(
rename = "prioritizationFeeLamports",
skip_serializing_if = "Option::is_none"
)]
pub prioritization_fee_lamports: Option<SwapV1SwapRequestPrioritizationFeeLamports>,
#[serde(rename = "quoteResponse")]
pub quote_response: SwapV1QuoteResponse,
#[serde(
rename = "skipUserAccountsRpcCalls",
skip_serializing_if = "Option::is_none"
)]
pub skip_user_accounts_rpc_calls: Option<bool>,
#[serde(rename = "trackingAccount", skip_serializing_if = "Option::is_none")]
pub tracking_account: Option<String>,
#[serde(rename = "useSharedAccounts", skip_serializing_if = "Option::is_none")]
pub use_shared_accounts: Option<bool>,
#[serde(rename = "userPublicKey")]
pub user_public_key: String,
#[serde(rename = "wrapAndUnwrapSol", skip_serializing_if = "Option::is_none")]
pub wrap_and_unwrap_sol: Option<bool>,
}
impl SwapV1SwapRequest {
pub fn new(quote_response: SwapV1QuoteResponse, user_public_key: String) -> Self {
Self {
quote_response,
user_public_key,
as_legacy_transaction: None,
blockhash_slots_to_expiry: None,
compute_unit_price_micro_lamports: None,
destination_token_account: None,
dynamic_compute_unit_limit: None,
dynamic_slippage: None,
fee_account: None,
native_destination_account: None,
payer: None,
prioritization_fee_lamports: None,
skip_user_accounts_rpc_calls: None,
tracking_account: None,
use_shared_accounts: None,
wrap_and_unwrap_sol: None,
}
}
pub fn builder(
quote_response: SwapV1QuoteResponse,
user_public_key: String,
) -> SwapV1SwapRequestBuilder {
SwapV1SwapRequestBuilder::new(quote_response, user_public_key)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct SwapV1SwapRequestBuilder {
value: SwapV1SwapRequest,
}
impl SwapV1SwapRequestBuilder {
pub fn new(quote_response: SwapV1QuoteResponse, user_public_key: String) -> Self {
Self {
value: SwapV1SwapRequest::new(quote_response, user_public_key),
}
}
#[doc = concat!("Set the optional `", "asLegacyTransaction", "` request field.")]
#[must_use]
pub fn as_legacy_transaction(mut self, as_legacy_transaction: bool) -> Self {
self.value.as_legacy_transaction = Some(as_legacy_transaction);
self
}
#[doc = concat!("Set the optional `", "blockhashSlotsToExpiry", "` request field.")]
#[must_use]
pub fn blockhash_slots_to_expiry(mut self, blockhash_slots_to_expiry: i64) -> Self {
self.value.blockhash_slots_to_expiry = Some(blockhash_slots_to_expiry);
self
}
#[doc = concat!(
"Set the optional `", "computeUnitPriceMicroLamports", "` request field."
)]
#[must_use]
pub fn compute_unit_price_micro_lamports(
mut self,
compute_unit_price_micro_lamports: u64,
) -> Self {
self.value.compute_unit_price_micro_lamports = Some(compute_unit_price_micro_lamports);
self
}
#[doc = concat!("Set the optional `", "destinationTokenAccount", "` request field.")]
#[must_use]
pub fn destination_token_account(mut self, destination_token_account: String) -> Self {
self.value.destination_token_account = Some(destination_token_account);
self
}
#[doc = concat!("Set the optional `", "dynamicComputeUnitLimit", "` request field.")]
#[must_use]
pub fn dynamic_compute_unit_limit(mut self, dynamic_compute_unit_limit: bool) -> Self {
self.value.dynamic_compute_unit_limit = Some(dynamic_compute_unit_limit);
self
}
#[doc = concat!("Set the optional `", "dynamicSlippage", "` request field.")]
#[must_use]
pub fn dynamic_slippage(mut self, dynamic_slippage: bool) -> Self {
self.value.dynamic_slippage = Some(dynamic_slippage);
self
}
#[doc = concat!("Set the optional `", "feeAccount", "` request field.")]
#[must_use]
pub fn fee_account(mut self, fee_account: String) -> Self {
self.value.fee_account = Some(fee_account);
self
}
#[doc = concat!(
"Set the optional `", "nativeDestinationAccount", "` request field."
)]
#[must_use]
pub fn native_destination_account(mut self, native_destination_account: String) -> Self {
self.value.native_destination_account = Some(native_destination_account);
self
}
#[doc = concat!("Set the optional `", "payer", "` request field.")]
#[must_use]
pub fn payer(mut self, payer: String) -> Self {
self.value.payer = Some(payer);
self
}
#[doc = concat!(
"Set the optional `", "prioritizationFeeLamports", "` request field."
)]
#[must_use]
pub fn prioritization_fee_lamports(
mut self,
prioritization_fee_lamports: SwapV1SwapRequestPrioritizationFeeLamports,
) -> Self {
self.value.prioritization_fee_lamports = Some(prioritization_fee_lamports);
self
}
#[doc = concat!(
"Set the optional `", "skipUserAccountsRpcCalls", "` request field."
)]
#[must_use]
pub fn skip_user_accounts_rpc_calls(mut self, skip_user_accounts_rpc_calls: bool) -> Self {
self.value.skip_user_accounts_rpc_calls = Some(skip_user_accounts_rpc_calls);
self
}
#[doc = concat!("Set the optional `", "trackingAccount", "` request field.")]
#[must_use]
pub fn tracking_account(mut self, tracking_account: String) -> Self {
self.value.tracking_account = Some(tracking_account);
self
}
#[doc = concat!("Set the optional `", "useSharedAccounts", "` request field.")]
#[must_use]
pub fn use_shared_accounts(mut self, use_shared_accounts: bool) -> Self {
self.value.use_shared_accounts = Some(use_shared_accounts);
self
}
#[doc = concat!("Set the optional `", "wrapAndUnwrapSol", "` request field.")]
#[must_use]
pub fn wrap_and_unwrap_sol(mut self, wrap_and_unwrap_sol: bool) -> Self {
self.value.wrap_and_unwrap_sol = Some(wrap_and_unwrap_sol);
self
}
pub fn build(self) -> SwapV1SwapRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum SwapV1SwapRequestPrioritizationFeeLamports {
SwapV1PriorityLevelWithMaxLamports(SwapV1PriorityLevelWithMaxLamports),
SwapV1JitoTipLamports(SwapV1JitoTipLamports),
SwapV1JitoTipLamportsWithPayer(SwapV1JitoTipLamportsWithPayer),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1JitoTipLamports {
#[serde(rename = "jitoTipLamports")]
pub jito_tip_lamports: u64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1SwapInstructionsResponse {
#[serde(rename = "addressLookupTableAddresses")]
pub address_lookup_table_addresses: Vec<String>,
#[serde(rename = "cleanupInstruction", skip_serializing_if = "Option::is_none")]
pub cleanup_instruction: Option<SwapV1Instruction>,
#[serde(rename = "computeBudgetInstructions")]
pub compute_budget_instructions: Vec<SwapV1Instruction>,
#[serde(rename = "otherInstructions")]
pub other_instructions: Vec<SwapV1Instruction>,
#[serde(rename = "setupInstructions")]
pub setup_instructions: Vec<SwapV1Instruction>,
#[serde(rename = "swapInstruction")]
pub swap_instruction: SwapV1Instruction,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1QuoteResponse {
#[serde(rename = "contextSlot", skip_serializing_if = "Option::is_none")]
pub context_slot: Option<u64>,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(
rename = "mostReliableAmmsQuoteReport",
skip_serializing_if = "Option::is_none"
)]
pub most_reliable_amms_quote_report: Option<SwapV1QuoteResponseMostReliableAmmsQuoteReport>,
#[serde(rename = "otherAmountThreshold")]
pub other_amount_threshold: String,
#[serde(rename = "outAmount")]
pub out_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "platformFee", skip_serializing_if = "Option::is_none")]
pub platform_fee: Option<SwapV1PlatformFee>,
#[serde(rename = "priceImpactPct")]
pub price_impact_pct: String,
#[serde(rename = "routePlan")]
pub route_plan: Vec<SwapV1RoutePlanStep>,
#[serde(rename = "slippageBps")]
pub slippage_bps: i64,
#[serde(rename = "swapMode")]
pub swap_mode: SwapV1SwapMode,
#[serde(rename = "timeTaken", skip_serializing_if = "Option::is_none")]
pub time_taken: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum SwapV1SwapMode {
#[default]
#[serde(rename = "ExactIn")]
ExactIn,
#[serde(rename = "ExactOut")]
ExactOut,
}
impl SwapV1SwapMode {
pub fn as_str(&self) -> &'static str {
match self {
Self::ExactIn => "ExactIn",
Self::ExactOut => "ExactOut",
}
}
}
impl ::std::fmt::Display for SwapV1SwapMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for SwapV1SwapMode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1RoutePlanStep {
#[serde(skip_serializing_if = "Option::is_none")]
pub bps: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub percent: Option<i64>,
#[serde(rename = "swapInfo")]
pub swap_info: SwapV1SwapInfo,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1SwapInfo {
#[serde(rename = "ammKey")]
pub amm_key: String,
#[serde(rename = "feeAmount", skip_serializing_if = "Option::is_none")]
pub fee_amount: Option<String>,
#[serde(rename = "feeMint", skip_serializing_if = "Option::is_none")]
pub fee_mint: Option<String>,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(rename = "outAmount")]
pub out_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV1QuoteResponseMostReliableAmmsQuoteReport {
#[serde(skip_serializing_if = "Option::is_none")]
pub info: Option<SwapV1QuoteResponseInfo>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV1QuoteResponseInfo {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV1PlatformFee {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(rename = "feeBps", skip_serializing_if = "Option::is_none")]
pub fee_bps: Option<i64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1PriorityLevelWithMaxLamports {
#[serde(rename = "priorityLevelWithMaxLamports")]
pub priority_level_with_max_lamports:
SwapV1PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports {
#[serde(skip_serializing_if = "Option::is_none")]
pub global: Option<bool>,
#[serde(rename = "maxLamports")]
pub max_lamports: u64,
#[serde(rename = "priorityLevel")]
pub priority_level: SwapV1PriorityLevelWithMaxLamportsPriorityLevel,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum SwapV1PriorityLevelWithMaxLamportsPriorityLevel {
#[default]
#[serde(rename = "medium")]
Medium,
#[serde(rename = "high")]
High,
#[serde(rename = "veryHigh")]
VeryHigh,
}
impl SwapV1PriorityLevelWithMaxLamportsPriorityLevel {
pub fn as_str(&self) -> &'static str {
match self {
Self::Medium => "medium",
Self::High => "high",
Self::VeryHigh => "veryHigh",
}
}
}
impl ::std::fmt::Display for SwapV1PriorityLevelWithMaxLamportsPriorityLevel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for SwapV1PriorityLevelWithMaxLamportsPriorityLevel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1JitoTipLamportsWithPayer {
#[serde(rename = "jitoTipLamportsWithPayer")]
pub jito_tip_lamports_with_payer: SwapV1JitoTipLamportsWithPayerJitoTipLamportsWithPayer,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1JitoTipLamportsWithPayerJitoTipLamportsWithPayer {
pub lamports: u64,
pub payer: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1Instruction {
pub accounts: Vec<SwapV1AccountMeta>,
pub data: String,
#[serde(rename = "programId")]
pub program_id: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1AccountMeta {
#[serde(rename = "isSigner")]
pub is_signer: bool,
#[serde(rename = "isWritable")]
pub is_writable: bool,
pub pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1IndexedRouteMapResponse {
#[serde(rename = "indexedRouteMap")]
pub indexed_route_map: SwapV1IndexedRouteMapResponseIndexedRouteMap,
#[serde(rename = "mintKeys")]
pub mint_keys: Vec<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV1IndexedRouteMapResponseIndexedRouteMap {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<f64>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateDBCTransactionRequestBody {
#[serde(rename = "antiSniping")]
pub anti_sniping: bool,
#[serde(rename = "buildCurveByMarketCapParam")]
pub build_curve_by_market_cap_param:
StudioCreateDBCTransactionRequestBodyBuildCurveByMarketCapParam,
pub creator: String,
pub fee: StudioCreateDBCTransactionRequestBodyFee,
#[serde(rename = "isLpLocked", skip_serializing_if = "Option::is_none")]
pub is_lp_locked: Option<bool>,
#[serde(rename = "tokenImageContentType")]
pub token_image_content_type: StudioCreateDBCTransactionRequestBodyTokenImageContentType,
#[serde(rename = "tokenName")]
pub token_name: String,
#[serde(rename = "tokenSymbol")]
pub token_symbol: String,
}
impl StudioCreateDBCTransactionRequestBody {
pub fn new(
anti_sniping: bool,
build_curve_by_market_cap_param: StudioCreateDBCTransactionRequestBodyBuildCurveByMarketCapParam,
creator: String,
fee: StudioCreateDBCTransactionRequestBodyFee,
token_image_content_type: StudioCreateDBCTransactionRequestBodyTokenImageContentType,
token_name: String,
token_symbol: String,
) -> Self {
Self {
anti_sniping,
build_curve_by_market_cap_param,
creator,
fee,
token_image_content_type,
token_name,
token_symbol,
is_lp_locked: None,
}
}
pub fn builder(
anti_sniping: bool,
build_curve_by_market_cap_param: StudioCreateDBCTransactionRequestBodyBuildCurveByMarketCapParam,
creator: String,
fee: StudioCreateDBCTransactionRequestBodyFee,
token_image_content_type: StudioCreateDBCTransactionRequestBodyTokenImageContentType,
token_name: String,
token_symbol: String,
) -> StudioCreateDBCTransactionRequestBodyBuilder {
StudioCreateDBCTransactionRequestBodyBuilder::new(
anti_sniping,
build_curve_by_market_cap_param,
creator,
fee,
token_image_content_type,
token_name,
token_symbol,
)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct StudioCreateDBCTransactionRequestBodyBuilder {
value: StudioCreateDBCTransactionRequestBody,
}
impl StudioCreateDBCTransactionRequestBodyBuilder {
pub fn new(
anti_sniping: bool,
build_curve_by_market_cap_param: StudioCreateDBCTransactionRequestBodyBuildCurveByMarketCapParam,
creator: String,
fee: StudioCreateDBCTransactionRequestBodyFee,
token_image_content_type: StudioCreateDBCTransactionRequestBodyTokenImageContentType,
token_name: String,
token_symbol: String,
) -> Self {
Self {
value: StudioCreateDBCTransactionRequestBody::new(
anti_sniping,
build_curve_by_market_cap_param,
creator,
fee,
token_image_content_type,
token_name,
token_symbol,
),
}
}
#[doc = concat!("Set the optional `", "isLpLocked", "` request field.")]
#[must_use]
pub fn is_lp_locked(mut self, is_lp_locked: bool) -> Self {
self.value.is_lp_locked = Some(is_lp_locked);
self
}
pub fn build(self) -> StudioCreateDBCTransactionRequestBody {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum StudioCreateDBCTransactionRequestBodyTokenImageContentType {
#[default]
#[serde(rename = "image/jpeg")]
ImageJpeg,
#[serde(rename = "image/png")]
ImagePng,
#[serde(rename = "image/gif")]
ImageGif,
#[serde(rename = "image/webp")]
ImageWebp,
}
impl StudioCreateDBCTransactionRequestBodyTokenImageContentType {
pub fn as_str(&self) -> &'static str {
match self {
Self::ImageJpeg => "image/jpeg",
Self::ImagePng => "image/png",
Self::ImageGif => "image/gif",
Self::ImageWebp => "image/webp",
}
}
}
impl ::std::fmt::Display for StudioCreateDBCTransactionRequestBodyTokenImageContentType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for StudioCreateDBCTransactionRequestBodyTokenImageContentType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateDBCTransactionRequestBodyFee {
#[serde(rename = "baseFeeMode", skip_serializing_if = "Option::is_none")]
pub base_fee_mode: Option<StudioCreateDBCTransactionRequestBodyBaseFeeMode>,
#[serde(rename = "feeBps", default)]
pub fee_bps: f64,
#[serde(rename = "totalDuration", skip_serializing_if = "Option::is_none")]
pub total_duration: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateDBCTransactionRequestBodyBuildCurveByMarketCapParam {
#[serde(rename = "initialMarketCap")]
pub initial_market_cap: f64,
#[serde(rename = "lockedVestingParam")]
pub locked_vesting_param: StudioCreateDBCTransactionRequestBodyLockedVestingParam,
#[serde(rename = "migrationMarketCap")]
pub migration_market_cap: f64,
#[serde(rename = "quoteMint")]
pub quote_mint: String,
#[serde(rename = "tokenQuoteDecimal")]
pub token_quote_decimal: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateDBCTransactionRequestBodyLockedVestingParam {
#[serde(rename = "cliffDurationFromMigrationTime")]
pub cliff_duration_from_migration_time: f64,
#[serde(rename = "cliffUnlockAmount")]
pub cliff_unlock_amount: f64,
#[serde(rename = "numberOfVestingPeriod")]
pub number_of_vesting_period: f64,
#[serde(rename = "totalLockedVestingAmount")]
pub total_locked_vesting_amount: f64,
#[serde(rename = "totalVestingDuration")]
pub total_vesting_duration: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum StudioCreateDBCTransactionRequestBodyBaseFeeMode {
#[default]
#[serde(rename = "linear")]
Linear,
#[serde(rename = "exponential")]
Exponential,
}
impl StudioCreateDBCTransactionRequestBodyBaseFeeMode {
pub fn as_str(&self) -> &'static str {
match self {
Self::Linear => "linear",
Self::Exponential => "exponential",
}
}
}
impl ::std::fmt::Display for StudioCreateDBCTransactionRequestBodyBaseFeeMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for StudioCreateDBCTransactionRequestBodyBaseFeeMode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SendInviteDataResponse {
#[serde(rename = "hasMoreData")]
pub has_more_data: bool,
pub invites: Vec<SendInviteDataResponseInvitesItem>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SendInviteDataResponseInvitesItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
pub amount: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub confirmed: Option<i64>,
pub creation_time: String,
pub creation_tx: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub deletion_time: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deletion_tx: Option<String>,
pub expiry: String,
pub invite_pda: String,
pub invite_signer: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub receiver: Option<String>,
pub sender: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringWithdrawPriceRecurring {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(rename = "inputOrOutput")]
pub input_or_output: RecurringWithdrawal,
pub order: String,
pub user: String,
}
impl RecurringWithdrawPriceRecurring {
pub fn new(input_or_output: RecurringWithdrawal, order: String, user: String) -> Self {
Self {
input_or_output,
order,
user,
amount: None,
}
}
pub fn builder(
input_or_output: RecurringWithdrawal,
order: String,
user: String,
) -> RecurringWithdrawPriceRecurringBuilder {
RecurringWithdrawPriceRecurringBuilder::new(input_or_output, order, user)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct RecurringWithdrawPriceRecurringBuilder {
value: RecurringWithdrawPriceRecurring,
}
impl RecurringWithdrawPriceRecurringBuilder {
pub fn new(input_or_output: RecurringWithdrawal, order: String, user: String) -> Self {
Self {
value: RecurringWithdrawPriceRecurring::new(input_or_output, order, user),
}
}
#[doc = concat!("Set the optional `", "amount", "` request field.")]
#[must_use]
pub fn amount(mut self, amount: String) -> Self {
self.value.amount = Some(amount);
self
}
pub fn build(self) -> RecurringWithdrawPriceRecurring {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringWithdrawal {
#[default]
#[serde(rename = "In")]
In,
#[serde(rename = "Out")]
Out,
}
impl RecurringWithdrawal {
pub fn as_str(&self) -> &'static str {
match self {
Self::In => "In",
Self::Out => "Out",
}
}
}
impl ::std::fmt::Display for RecurringWithdrawal {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringWithdrawal {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringRecurringTypeVariant2 {
pub price: RecurringOpenIxArgsWithoutIdx,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringRecurringTypeVariant {
pub time: RecurringTimeRecurringCreationParams,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringGetRecurringOrderResponseVariant3 {
pub all: Vec<RecurringAllRecurringResponse>,
#[serde(rename = "orderStatus")]
pub order_status: RecurringOrderState,
pub page: i64,
#[serde(rename = "totalPages")]
pub total_pages: i64,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringGetRecurringOrderResponseVariant2 {
#[serde(rename = "orderStatus")]
pub order_status: RecurringOrderState,
pub page: i64,
pub price: Vec<RecurringPriceRecurringResponse>,
#[serde(rename = "totalPages")]
pub total_pages: i64,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringGetRecurringOrderResponseVariant {
#[serde(rename = "orderStatus")]
pub order_status: RecurringOrderState,
pub page: i64,
pub time: Vec<RecurringTimeRecurringResponse>,
#[serde(rename = "totalPages")]
pub total_pages: i64,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum RecurringGetRecurringOrderResponse {
RecurringGetRecurringOrderResponseVariant(RecurringGetRecurringOrderResponseVariant),
RecurringGetRecurringOrderResponseVariant2(RecurringGetRecurringOrderResponseVariant2),
RecurringGetRecurringOrderResponseVariant3(RecurringGetRecurringOrderResponseVariant3),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringGetRecurringOrderParams {
#[serde(rename = "includeFailedTx")]
pub include_failed_tx: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint: Option<String>,
#[serde(rename = "orderStatus")]
pub order_status: RecurringOrderState,
#[serde(skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
#[serde(rename = "recurringType")]
pub recurring_type: RecurringRecurringOrderType,
pub user: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringRecurringOrderType {
#[default]
#[serde(rename = "time")]
Time,
#[serde(rename = "price")]
Price,
#[serde(rename = "all")]
All,
}
impl RecurringRecurringOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Time => "time",
Self::Price => "price",
Self::All => "all",
}
}
}
impl ::std::fmt::Display for RecurringRecurringOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringRecurringOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringOrderState {
#[default]
#[serde(rename = "active")]
Active,
#[serde(rename = "history")]
History,
}
impl RecurringOrderState {
pub fn as_str(&self) -> &'static str {
match self {
Self::Active => "active",
Self::History => "history",
}
}
}
impl ::std::fmt::Display for RecurringOrderState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringOrderState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringExecuteRecurringResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<String>,
pub signature: String,
pub status: RecurringExecuteRecurringResponseStatus,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringExecuteRecurringResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl RecurringExecuteRecurringResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for RecurringExecuteRecurringResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringExecuteRecurringResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringCreateRecurring {
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
pub params: RecurringRecurringType,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum RecurringRecurringType {
RecurringRecurringTypeVariant(RecurringRecurringTypeVariant),
RecurringRecurringTypeVariant2(RecurringRecurringTypeVariant2),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringTimeRecurringCreationParams {
#[serde(rename = "inAmount")]
pub in_amount: i64,
pub interval: i64,
#[serde(rename = "maxPrice", skip_serializing_if = "Option::is_none")]
pub max_price: Option<f64>,
#[serde(rename = "minPrice", skip_serializing_if = "Option::is_none")]
pub min_price: Option<f64>,
#[serde(rename = "numberOfOrders")]
pub number_of_orders: i64,
#[serde(rename = "startAt", skip_serializing_if = "Option::is_none")]
pub start_at: Option<i64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringOpenIxArgsWithoutIdx {
#[serde(rename = "depositAmount")]
pub deposit_amount: i64,
#[serde(rename = "incrementUsdcValue")]
pub increment_usdc_value: i64,
pub interval: i64,
#[serde(rename = "startAt", skip_serializing_if = "Option::is_none")]
pub start_at: Option<i64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringCloseRecurring {
pub order: String,
#[serde(rename = "recurringType")]
pub recurring_type: RecurringCloseRecurringType,
pub user: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringCloseRecurringType {
#[default]
#[serde(rename = "time")]
Time,
#[serde(rename = "price")]
Price,
}
impl RecurringCloseRecurringType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Time => "time",
Self::Price => "price",
}
}
}
impl ::std::fmt::Display for RecurringCloseRecurringType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringCloseRecurringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringAllRecurringResponseVariant2 {
#[serde(rename = "closeTx")]
pub close_tx: String,
#[serde(rename = "closedBy")]
pub closed_by: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "estimatedUsdcValueSpent")]
pub estimated_usdc_value_spent: String,
#[serde(rename = "inDeposited")]
pub in_deposited: String,
#[serde(rename = "inLeft")]
pub in_left: String,
#[serde(rename = "inUsed")]
pub in_used: String,
#[serde(rename = "inWithdrawn")]
pub in_withdrawn: String,
#[serde(rename = "incrementalUsdValue")]
pub incremental_usd_value: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "openTx")]
pub open_tx: String,
#[serde(rename = "orderInterval")]
pub order_interval: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outReceived")]
pub out_received: String,
#[serde(rename = "outWithdrawn")]
pub out_withdrawn: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "rawEstimatedUsdcValueSpent")]
pub raw_estimated_usdc_value_spent: String,
#[serde(rename = "rawInDeposited")]
pub raw_in_deposited: String,
#[serde(rename = "rawInLeft")]
pub raw_in_left: String,
#[serde(rename = "rawInUsed")]
pub raw_in_used: String,
#[serde(rename = "rawInWithdrawn")]
pub raw_in_withdrawn: String,
#[serde(rename = "rawIncrementalUsdValue")]
pub raw_incremental_usd_value: String,
#[serde(rename = "rawOutReceived")]
pub raw_out_received: String,
#[serde(rename = "rawOutWithdrawn")]
pub raw_out_withdrawn: String,
#[serde(rename = "rawSupposedUsdValue")]
pub raw_supposed_usd_value: String,
#[serde(rename = "recurringType")]
pub recurring_type: RecurringAllRecurringResponseVariant2RecurringType,
#[serde(rename = "startAt")]
pub start_at: chrono::DateTime<chrono::Utc>,
pub status: String,
#[serde(rename = "supposedUsdValue")]
pub supposed_usd_value: String,
pub trades: Vec<RecurringOrderHistoryResponse>,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringAllRecurringResponseVariant {
#[serde(rename = "closeTx")]
pub close_tx: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "cycleFrequency")]
pub cycle_frequency: String,
#[serde(rename = "inAmountPerCycle")]
pub in_amount_per_cycle: String,
#[serde(rename = "inDeposited")]
pub in_deposited: String,
#[serde(rename = "inUsed")]
pub in_used: String,
#[serde(rename = "inWithdrawn")]
pub in_withdrawn: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "maxOutAmount")]
pub max_out_amount: String,
#[serde(rename = "minOutAmount")]
pub min_out_amount: String,
#[serde(rename = "openTx")]
pub open_tx: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outReceived")]
pub out_received: String,
#[serde(rename = "outWithdrawn")]
pub out_withdrawn: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "rawInAmountPerCycle")]
pub raw_in_amount_per_cycle: String,
#[serde(rename = "rawInDeposited")]
pub raw_in_deposited: String,
#[serde(rename = "rawInUsed")]
pub raw_in_used: String,
#[serde(rename = "rawInWithdrawn")]
pub raw_in_withdrawn: String,
#[serde(rename = "rawMaxOutAmount")]
pub raw_max_out_amount: String,
#[serde(rename = "rawMinOutAmount")]
pub raw_min_out_amount: String,
#[serde(rename = "rawOutReceived")]
pub raw_out_received: String,
#[serde(rename = "rawOutWithdrawn")]
pub raw_out_withdrawn: String,
#[serde(rename = "recurringType")]
pub recurring_type: RecurringAllRecurringResponseVariantRecurringType,
pub trades: Vec<RecurringOrderHistoryResponse>,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "userClosed")]
pub user_closed: bool,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum RecurringAllRecurringResponse {
RecurringAllRecurringResponseVariant(RecurringAllRecurringResponseVariant),
RecurringAllRecurringResponseVariant2(RecurringAllRecurringResponseVariant2),
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringTimeRecurringResponseRecurringType {
#[default]
#[serde(rename = "price")]
Price,
}
impl RecurringTimeRecurringResponseRecurringType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Price => "price",
}
}
}
impl ::std::fmt::Display for RecurringTimeRecurringResponseRecurringType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringTimeRecurringResponseRecurringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringTimeRecurringResponse {
#[serde(rename = "closeTx")]
pub close_tx: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "cycleFrequency")]
pub cycle_frequency: String,
#[serde(rename = "inAmountPerCycle")]
pub in_amount_per_cycle: String,
#[serde(rename = "inDeposited")]
pub in_deposited: String,
#[serde(rename = "inUsed")]
pub in_used: String,
#[serde(rename = "inWithdrawn")]
pub in_withdrawn: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "maxOutAmount")]
pub max_out_amount: String,
#[serde(rename = "minOutAmount")]
pub min_out_amount: String,
#[serde(rename = "openTx")]
pub open_tx: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outReceived")]
pub out_received: String,
#[serde(rename = "outWithdrawn")]
pub out_withdrawn: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "rawInAmountPerCycle")]
pub raw_in_amount_per_cycle: String,
#[serde(rename = "rawInDeposited")]
pub raw_in_deposited: String,
#[serde(rename = "rawInUsed")]
pub raw_in_used: String,
#[serde(rename = "rawInWithdrawn")]
pub raw_in_withdrawn: String,
#[serde(rename = "rawMaxOutAmount")]
pub raw_max_out_amount: String,
#[serde(rename = "rawMinOutAmount")]
pub raw_min_out_amount: String,
#[serde(rename = "rawOutReceived")]
pub raw_out_received: String,
#[serde(rename = "rawOutWithdrawn")]
pub raw_out_withdrawn: String,
pub trades: Vec<RecurringOrderHistoryResponse>,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "userClosed")]
pub user_closed: bool,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringPriceRecurringResponse {
#[serde(rename = "closeTx")]
pub close_tx: String,
#[serde(rename = "closedBy")]
pub closed_by: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "estimatedUsdcValueSpent")]
pub estimated_usdc_value_spent: String,
#[serde(rename = "inDeposited")]
pub in_deposited: String,
#[serde(rename = "inLeft")]
pub in_left: String,
#[serde(rename = "inUsed")]
pub in_used: String,
#[serde(rename = "inWithdrawn")]
pub in_withdrawn: String,
#[serde(rename = "incrementalUsdValue")]
pub incremental_usd_value: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "openTx")]
pub open_tx: String,
#[serde(rename = "orderInterval")]
pub order_interval: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outReceived")]
pub out_received: String,
#[serde(rename = "outWithdrawn")]
pub out_withdrawn: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "rawEstimatedUsdcValueSpent")]
pub raw_estimated_usdc_value_spent: String,
#[serde(rename = "rawInDeposited")]
pub raw_in_deposited: String,
#[serde(rename = "rawInLeft")]
pub raw_in_left: String,
#[serde(rename = "rawInUsed")]
pub raw_in_used: String,
#[serde(rename = "rawInWithdrawn")]
pub raw_in_withdrawn: String,
#[serde(rename = "rawIncrementalUsdValue")]
pub raw_incremental_usd_value: String,
#[serde(rename = "rawOutReceived")]
pub raw_out_received: String,
#[serde(rename = "rawOutWithdrawn")]
pub raw_out_withdrawn: String,
#[serde(rename = "rawSupposedUsdValue")]
pub raw_supposed_usd_value: String,
#[serde(rename = "startAt")]
pub start_at: chrono::DateTime<chrono::Utc>,
pub status: String,
#[serde(rename = "supposedUsdValue")]
pub supposed_usd_value: String,
pub trades: Vec<RecurringOrderHistoryResponse>,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringOrderHistoryResponse {
pub action: String,
#[serde(rename = "confirmedAt")]
pub confirmed_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "feeAmount")]
pub fee_amount: String,
#[serde(rename = "feeMint")]
pub fee_mint: String,
#[serde(rename = "inputAmount")]
pub input_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
pub keeper: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outputAmount")]
pub output_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "productMeta", skip_serializing_if = "Option::is_none")]
pub product_meta: Option<serde_json::Value>,
#[serde(rename = "rawFeeAmount")]
pub raw_fee_amount: String,
#[serde(rename = "rawInputAmount")]
pub raw_input_amount: String,
#[serde(rename = "rawOutputAmount")]
pub raw_output_amount: String,
#[serde(rename = "txId")]
pub tx_id: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringAllRecurringResponseVariantRecurringType {
#[default]
#[serde(rename = "time")]
Time,
}
impl RecurringAllRecurringResponseVariantRecurringType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Time => "time",
}
}
}
impl ::std::fmt::Display for RecurringAllRecurringResponseVariantRecurringType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringAllRecurringResponseVariantRecurringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringAllRecurringResponseVariant2RecurringType {
#[default]
#[serde(rename = "price")]
Price,
}
impl RecurringAllRecurringResponseVariant2RecurringType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Price => "price",
}
}
}
impl ::std::fmt::Display for RecurringAllRecurringResponseVariant2RecurringType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringAllRecurringResponseVariant2RecurringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum RecurringAllRecurringResponseRecurringType {
#[default]
#[serde(rename = "time")]
Time,
}
impl RecurringAllRecurringResponseRecurringType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Time => "time",
}
}
}
impl ::std::fmt::Display for RecurringAllRecurringResponseRecurringType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for RecurringAllRecurringResponseRecurringType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2PriceResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<PriceV2PriceResponseData>,
#[serde(rename = "timeTaken", skip_serializing_if = "Option::is_none")]
pub time_taken: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2PriceResponseData {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, PriceV2TokenPriceInfo>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2TokenPriceInfo {
#[serde(rename = "extraInfo", skip_serializing_if = "Option::is_none")]
pub extra_info: Option<PriceV2ExtraInfo>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub price: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2ExtraInfo {
#[serde(rename = "confidenceLevel", skip_serializing_if = "Option::is_none")]
pub confidence_level: Option<PriceV2ExtraInfoConfidenceLevel>,
#[serde(skip_serializing_if = "Option::is_none")]
pub depth: Option<PriceV2Depth>,
#[serde(rename = "lastSwappedPrice", skip_serializing_if = "Option::is_none")]
pub last_swapped_price: Option<PriceV2LastSwappedPrice>,
#[serde(rename = "quotedPrice", skip_serializing_if = "Option::is_none")]
pub quoted_price: Option<PriceV2QuotedPrice>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2QuotedPrice {
#[serde(rename = "buyAt", skip_serializing_if = "Option::is_none")]
pub buy_at: Option<i64>,
#[serde(rename = "buyPrice", skip_serializing_if = "Option::is_none")]
pub buy_price: Option<String>,
#[serde(rename = "sellAt", skip_serializing_if = "Option::is_none")]
pub sell_at: Option<i64>,
#[serde(rename = "sellPrice", skip_serializing_if = "Option::is_none")]
pub sell_price: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2LastSwappedPrice {
#[serde(rename = "lastJupiterBuyAt", skip_serializing_if = "Option::is_none")]
pub last_jupiter_buy_at: Option<i64>,
#[serde(
rename = "lastJupiterBuyPrice",
skip_serializing_if = "Option::is_none"
)]
pub last_jupiter_buy_price: Option<String>,
#[serde(rename = "lastJupiterSellAt", skip_serializing_if = "Option::is_none")]
pub last_jupiter_sell_at: Option<i64>,
#[serde(
rename = "lastJupiterSellPrice",
skip_serializing_if = "Option::is_none"
)]
pub last_jupiter_sell_price: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PriceV2ExtraInfoConfidenceLevel {
#[default]
#[serde(rename = "high")]
High,
#[serde(rename = "medium")]
Medium,
#[serde(rename = "low")]
Low,
}
impl PriceV2ExtraInfoConfidenceLevel {
pub fn as_str(&self) -> &'static str {
match self {
Self::High => "high",
Self::Medium => "medium",
Self::Low => "low",
}
}
}
impl ::std::fmt::Display for PriceV2ExtraInfoConfidenceLevel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PriceV2ExtraInfoConfidenceLevel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2Depth {
#[serde(
rename = "buyPriceImpactRatio",
skip_serializing_if = "Option::is_none"
)]
pub buy_price_impact_ratio: Option<PriceV2PriceImpactRatio>,
#[serde(
rename = "sellPriceImpactRatio",
skip_serializing_if = "Option::is_none"
)]
pub sell_price_impact_ratio: Option<PriceV2PriceImpactRatio>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2PriceImpactRatio {
#[serde(skip_serializing_if = "Option::is_none")]
pub depth: Option<PriceV2PriceImpactRatioDepth>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<i64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PriceV2PriceImpactRatioDepth {
#[serde(rename = "10", skip_serializing_if = "Option::is_none")]
pub field_10: Option<f64>,
#[serde(rename = "100", skip_serializing_if = "Option::is_none")]
pub field_100: Option<f64>,
#[serde(rename = "1000", skip_serializing_if = "Option::is_none")]
pub field_1000: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionExecuteResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub status: PredictionExecuteResponseStatus,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionExecuteResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl PredictionExecuteResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PredictionExecuteResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionExecuteResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionExecuteRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub context: Option<PredictionExecuteRequestContext>,
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
impl PredictionExecuteRequest {
pub fn new(signed_transaction: String) -> Self {
Self {
signed_transaction,
context: None,
request_id: None,
}
}
pub fn builder(signed_transaction: String) -> PredictionExecuteRequestBuilder {
PredictionExecuteRequestBuilder::new(signed_transaction)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PredictionExecuteRequestBuilder {
value: PredictionExecuteRequest,
}
impl PredictionExecuteRequestBuilder {
pub fn new(signed_transaction: String) -> Self {
Self {
value: PredictionExecuteRequest::new(signed_transaction),
}
}
#[doc = concat!("Set the optional `", "context", "` request field.")]
#[must_use]
pub fn context(mut self, context: PredictionExecuteRequestContext) -> Self {
self.value.context = Some(context);
self
}
#[doc = concat!("Set the optional `", "requestId", "` request field.")]
#[must_use]
pub fn request_id(mut self, request_id: String) -> Self {
self.value.request_id = Some(request_id);
self
}
pub fn build(self) -> PredictionExecuteRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionExecuteRequestContext {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionErrorResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub doc_url: Option<String>,
pub message: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub param: Option<String>,
pub request_id: String,
pub r#type: PredictionErrorResponseType,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionErrorResponseType {
#[default]
#[serde(rename = "invalid_request_error")]
InvalidRequestError,
#[serde(rename = "authentication_error")]
AuthenticationError,
#[serde(rename = "permission_error")]
PermissionError,
#[serde(rename = "idempotency_error")]
IdempotencyError,
#[serde(rename = "rate_limit_error")]
RateLimitError,
#[serde(rename = "api_error")]
ApiError,
}
impl PredictionErrorResponseType {
pub fn as_str(&self) -> &'static str {
match self {
Self::InvalidRequestError => "invalid_request_error",
Self::AuthenticationError => "authentication_error",
Self::PermissionError => "permission_error",
Self::IdempotencyError => "idempotency_error",
Self::RateLimitError => "rate_limit_error",
Self::ApiError => "api_error",
}
}
}
impl ::std::fmt::Display for PredictionErrorResponseType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionErrorResponseType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionCreateOrderRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub contracts: Option<PredictionCreateOrderRequestContracts>,
#[serde(rename = "contractsDecimal", skip_serializing_if = "Option::is_none")]
pub contracts_decimal: Option<PredictionCreateOrderRequestContractsDecimal>,
#[serde(rename = "contractsMicro", skip_serializing_if = "Option::is_none")]
pub contracts_micro: Option<PredictionCreateOrderRequestContractsMicro>,
#[serde(rename = "depositAmount", skip_serializing_if = "Option::is_none")]
pub deposit_amount: Option<PredictionCreateOrderRequestDepositAmount>,
#[serde(rename = "depositMint", skip_serializing_if = "Option::is_none")]
pub deposit_mint: Option<String>,
#[serde(rename = "isBuy")]
pub is_buy: bool,
#[serde(rename = "isYes", skip_serializing_if = "Option::is_none")]
pub is_yes: Option<bool>,
#[serde(rename = "marketId", skip_serializing_if = "Option::is_none")]
pub market_id: Option<String>,
#[serde(rename = "ownerPubkey", skip_serializing_if = "Option::is_none")]
pub owner_pubkey: Option<String>,
#[serde(rename = "positionPubkey", skip_serializing_if = "Option::is_none")]
pub position_pubkey: Option<String>,
}
impl PredictionCreateOrderRequest {
pub fn new(is_buy: bool) -> Self {
Self {
is_buy,
contracts: None,
contracts_decimal: None,
contracts_micro: None,
deposit_amount: None,
deposit_mint: None,
is_yes: None,
market_id: None,
owner_pubkey: None,
position_pubkey: None,
}
}
pub fn builder(is_buy: bool) -> PredictionCreateOrderRequestBuilder {
PredictionCreateOrderRequestBuilder::new(is_buy)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PredictionCreateOrderRequestBuilder {
value: PredictionCreateOrderRequest,
}
impl PredictionCreateOrderRequestBuilder {
pub fn new(is_buy: bool) -> Self {
Self {
value: PredictionCreateOrderRequest::new(is_buy),
}
}
#[doc = concat!("Set the optional `", "contracts", "` request field.")]
#[must_use]
pub fn contracts(mut self, contracts: PredictionCreateOrderRequestContracts) -> Self {
self.value.contracts = Some(contracts);
self
}
#[doc = concat!("Set the optional `", "contractsDecimal", "` request field.")]
#[must_use]
pub fn contracts_decimal(
mut self,
contracts_decimal: PredictionCreateOrderRequestContractsDecimal,
) -> Self {
self.value.contracts_decimal = Some(contracts_decimal);
self
}
#[doc = concat!("Set the optional `", "contractsMicro", "` request field.")]
#[must_use]
pub fn contracts_micro(
mut self,
contracts_micro: PredictionCreateOrderRequestContractsMicro,
) -> Self {
self.value.contracts_micro = Some(contracts_micro);
self
}
#[doc = concat!("Set the optional `", "depositAmount", "` request field.")]
#[must_use]
pub fn deposit_amount(
mut self,
deposit_amount: PredictionCreateOrderRequestDepositAmount,
) -> Self {
self.value.deposit_amount = Some(deposit_amount);
self
}
#[doc = concat!("Set the optional `", "depositMint", "` request field.")]
#[must_use]
pub fn deposit_mint(mut self, deposit_mint: String) -> Self {
self.value.deposit_mint = Some(deposit_mint);
self
}
#[doc = concat!("Set the optional `", "isYes", "` request field.")]
#[must_use]
pub fn is_yes(mut self, is_yes: bool) -> Self {
self.value.is_yes = Some(is_yes);
self
}
#[doc = concat!("Set the optional `", "marketId", "` request field.")]
#[must_use]
pub fn market_id(mut self, market_id: String) -> Self {
self.value.market_id = Some(market_id);
self
}
#[doc = concat!("Set the optional `", "ownerPubkey", "` request field.")]
#[must_use]
pub fn owner_pubkey(mut self, owner_pubkey: String) -> Self {
self.value.owner_pubkey = Some(owner_pubkey);
self
}
#[doc = concat!("Set the optional `", "positionPubkey", "` request field.")]
#[must_use]
pub fn position_pubkey(mut self, position_pubkey: String) -> Self {
self.value.position_pubkey = Some(position_pubkey);
self
}
pub fn build(self) -> PredictionCreateOrderRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PredictionCreateOrderRequestDepositAmount {
String(String),
Number(f64),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PredictionCreateOrderRequestContractsMicro {
String(String),
Number(f64),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PredictionCreateOrderRequestContractsDecimal {
String(String),
Number(f64),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PredictionCreateOrderRequestContracts {
String(String),
Number(f64),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostUltraV1ExecuteResponse {
pub code: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "inputAmountResult", skip_serializing_if = "Option::is_none")]
pub input_amount_result: Option<String>,
#[serde(rename = "outputAmountResult", skip_serializing_if = "Option::is_none")]
pub output_amount_result: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub slot: Option<String>,
pub status: PostUltraV1ExecuteResponseStatus,
#[serde(rename = "swapEvents", skip_serializing_if = "Option::is_none")]
pub swap_events: Option<Vec<PostUltraV1ExecuteResponseSwapEventsItem>>,
#[serde(rename = "totalInputAmount", skip_serializing_if = "Option::is_none")]
pub total_input_amount: Option<String>,
#[serde(rename = "totalOutputAmount", skip_serializing_if = "Option::is_none")]
pub total_output_amount: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostUltraV1ExecuteResponseSwapEventsItem {
#[serde(rename = "inputAmount")]
pub input_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "outputAmount")]
pub output_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostUltraV1ExecuteResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl PostUltraV1ExecuteResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostUltraV1ExecuteResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostUltraV1ExecuteResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersPriceRequest {
#[serde(rename = "depositRequestId")]
pub deposit_request_id: String,
#[serde(rename = "depositSignedTx")]
pub deposit_signed_tx: String,
#[serde(rename = "expiresAt")]
pub expires_at: f64,
#[serde(rename = "inputAmount")]
pub input_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "orderType")]
pub order_type: PostTriggerV2OrdersPriceRequestOrderType,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "slPriceUsd", skip_serializing_if = "Option::is_none")]
pub sl_price_usd: Option<f64>,
#[serde(rename = "slSlippageBps", skip_serializing_if = "Option::is_none")]
pub sl_slippage_bps: Option<f64>,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<f64>,
#[serde(rename = "tpPriceUsd", skip_serializing_if = "Option::is_none")]
pub tp_price_usd: Option<f64>,
#[serde(rename = "tpSlippageBps", skip_serializing_if = "Option::is_none")]
pub tp_slippage_bps: Option<f64>,
#[serde(rename = "trailingBps", skip_serializing_if = "Option::is_none")]
pub trailing_bps: Option<f64>,
#[serde(rename = "triggerCondition", skip_serializing_if = "Option::is_none")]
pub trigger_condition: Option<PostTriggerV2OrdersPriceRequestTriggerCondition>,
#[serde(rename = "triggerMint")]
pub trigger_mint: String,
#[serde(rename = "triggerPriceUsd", skip_serializing_if = "Option::is_none")]
pub trigger_price_usd: Option<f64>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
impl PostTriggerV2OrdersPriceRequest {
pub fn new(
deposit_request_id: String,
deposit_signed_tx: String,
expires_at: f64,
input_amount: String,
input_mint: String,
order_type: PostTriggerV2OrdersPriceRequestOrderType,
output_mint: String,
trigger_mint: String,
user_pubkey: String,
) -> Self {
Self {
deposit_request_id,
deposit_signed_tx,
expires_at,
input_amount,
input_mint,
order_type,
output_mint,
trigger_mint,
user_pubkey,
sl_price_usd: None,
sl_slippage_bps: None,
slippage_bps: None,
tp_price_usd: None,
tp_slippage_bps: None,
trailing_bps: None,
trigger_condition: None,
trigger_price_usd: None,
}
}
pub fn builder(
deposit_request_id: String,
deposit_signed_tx: String,
expires_at: f64,
input_amount: String,
input_mint: String,
order_type: PostTriggerV2OrdersPriceRequestOrderType,
output_mint: String,
trigger_mint: String,
user_pubkey: String,
) -> PostTriggerV2OrdersPriceRequestBuilder {
PostTriggerV2OrdersPriceRequestBuilder::new(
deposit_request_id,
deposit_signed_tx,
expires_at,
input_amount,
input_mint,
order_type,
output_mint,
trigger_mint,
user_pubkey,
)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV2OrdersPriceRequestBuilder {
value: PostTriggerV2OrdersPriceRequest,
}
impl PostTriggerV2OrdersPriceRequestBuilder {
pub fn new(
deposit_request_id: String,
deposit_signed_tx: String,
expires_at: f64,
input_amount: String,
input_mint: String,
order_type: PostTriggerV2OrdersPriceRequestOrderType,
output_mint: String,
trigger_mint: String,
user_pubkey: String,
) -> Self {
Self {
value: PostTriggerV2OrdersPriceRequest::new(
deposit_request_id,
deposit_signed_tx,
expires_at,
input_amount,
input_mint,
order_type,
output_mint,
trigger_mint,
user_pubkey,
),
}
}
#[doc = concat!("Set the optional `", "slPriceUsd", "` request field.")]
#[must_use]
pub fn sl_price_usd(mut self, sl_price_usd: f64) -> Self {
self.value.sl_price_usd = Some(sl_price_usd);
self
}
#[doc = concat!("Set the optional `", "slSlippageBps", "` request field.")]
#[must_use]
pub fn sl_slippage_bps(mut self, sl_slippage_bps: f64) -> Self {
self.value.sl_slippage_bps = Some(sl_slippage_bps);
self
}
#[doc = concat!("Set the optional `", "slippageBps", "` request field.")]
#[must_use]
pub fn slippage_bps(mut self, slippage_bps: f64) -> Self {
self.value.slippage_bps = Some(slippage_bps);
self
}
#[doc = concat!("Set the optional `", "tpPriceUsd", "` request field.")]
#[must_use]
pub fn tp_price_usd(mut self, tp_price_usd: f64) -> Self {
self.value.tp_price_usd = Some(tp_price_usd);
self
}
#[doc = concat!("Set the optional `", "tpSlippageBps", "` request field.")]
#[must_use]
pub fn tp_slippage_bps(mut self, tp_slippage_bps: f64) -> Self {
self.value.tp_slippage_bps = Some(tp_slippage_bps);
self
}
#[doc = concat!("Set the optional `", "trailingBps", "` request field.")]
#[must_use]
pub fn trailing_bps(mut self, trailing_bps: f64) -> Self {
self.value.trailing_bps = Some(trailing_bps);
self
}
#[doc = concat!("Set the optional `", "triggerCondition", "` request field.")]
#[must_use]
pub fn trigger_condition(
mut self,
trigger_condition: PostTriggerV2OrdersPriceRequestTriggerCondition,
) -> Self {
self.value.trigger_condition = Some(trigger_condition);
self
}
#[doc = concat!("Set the optional `", "triggerPriceUsd", "` request field.")]
#[must_use]
pub fn trigger_price_usd(mut self, trigger_price_usd: f64) -> Self {
self.value.trigger_price_usd = Some(trigger_price_usd);
self
}
pub fn build(self) -> PostTriggerV2OrdersPriceRequest {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2OrdersPriceRequestTriggerCondition {
#[default]
#[serde(rename = "above")]
Above,
#[serde(rename = "below")]
Below,
}
impl PostTriggerV2OrdersPriceRequestTriggerCondition {
pub fn as_str(&self) -> &'static str {
match self {
Self::Above => "above",
Self::Below => "below",
}
}
}
impl ::std::fmt::Display for PostTriggerV2OrdersPriceRequestTriggerCondition {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2OrdersPriceRequestTriggerCondition {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2OrdersPriceRequestOrderType {
#[default]
#[serde(rename = "single")]
Single,
#[serde(rename = "oco")]
Oco,
#[serde(rename = "otoco")]
Otoco,
}
impl PostTriggerV2OrdersPriceRequestOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Single => "single",
Self::Oco => "oco",
Self::Otoco => "otoco",
}
}
}
impl ::std::fmt::Display for PostTriggerV2OrdersPriceRequestOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2OrdersPriceRequestOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersDcaRequest {
#[serde(rename = "beginFillAt", skip_serializing_if = "Option::is_none")]
pub begin_fill_at: Option<String>,
#[serde(rename = "depositRequestId")]
pub deposit_request_id: String,
#[serde(rename = "depositSignedTx")]
pub deposit_signed_tx: String,
#[serde(rename = "inputAmount")]
pub input_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "intervalSeconds")]
pub interval_seconds: f64,
#[serde(rename = "jlEnabled", skip_serializing_if = "Option::is_none")]
pub jl_enabled: Option<bool>,
#[serde(rename = "jlMint", skip_serializing_if = "Option::is_none")]
pub jl_mint: Option<String>,
#[serde(rename = "maxPriceUsd", skip_serializing_if = "Option::is_none")]
pub max_price_usd: Option<f64>,
#[serde(rename = "minPriceUsd", skip_serializing_if = "Option::is_none")]
pub min_price_usd: Option<f64>,
#[serde(rename = "orderCount")]
pub order_count: f64,
#[serde(rename = "orderType", skip_serializing_if = "Option::is_none")]
pub order_type: Option<PostTriggerV2OrdersDcaRequestOrderType>,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "triggerMint", skip_serializing_if = "Option::is_none")]
pub trigger_mint: Option<String>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
impl PostTriggerV2OrdersDcaRequest {
pub fn new(
deposit_request_id: String,
deposit_signed_tx: String,
input_amount: String,
input_mint: String,
interval_seconds: f64,
order_count: f64,
output_mint: String,
user_pubkey: String,
) -> Self {
Self {
deposit_request_id,
deposit_signed_tx,
input_amount,
input_mint,
interval_seconds,
order_count,
output_mint,
user_pubkey,
begin_fill_at: None,
jl_enabled: None,
jl_mint: None,
max_price_usd: None,
min_price_usd: None,
order_type: None,
trigger_mint: None,
}
}
pub fn builder(
deposit_request_id: String,
deposit_signed_tx: String,
input_amount: String,
input_mint: String,
interval_seconds: f64,
order_count: f64,
output_mint: String,
user_pubkey: String,
) -> PostTriggerV2OrdersDcaRequestBuilder {
PostTriggerV2OrdersDcaRequestBuilder::new(
deposit_request_id,
deposit_signed_tx,
input_amount,
input_mint,
interval_seconds,
order_count,
output_mint,
user_pubkey,
)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV2OrdersDcaRequestBuilder {
value: PostTriggerV2OrdersDcaRequest,
}
impl PostTriggerV2OrdersDcaRequestBuilder {
pub fn new(
deposit_request_id: String,
deposit_signed_tx: String,
input_amount: String,
input_mint: String,
interval_seconds: f64,
order_count: f64,
output_mint: String,
user_pubkey: String,
) -> Self {
Self {
value: PostTriggerV2OrdersDcaRequest::new(
deposit_request_id,
deposit_signed_tx,
input_amount,
input_mint,
interval_seconds,
order_count,
output_mint,
user_pubkey,
),
}
}
#[doc = concat!("Set the optional `", "beginFillAt", "` request field.")]
#[must_use]
pub fn begin_fill_at(mut self, begin_fill_at: String) -> Self {
self.value.begin_fill_at = Some(begin_fill_at);
self
}
#[doc = concat!("Set the optional `", "jlEnabled", "` request field.")]
#[must_use]
pub fn jl_enabled(mut self, jl_enabled: bool) -> Self {
self.value.jl_enabled = Some(jl_enabled);
self
}
#[doc = concat!("Set the optional `", "jlMint", "` request field.")]
#[must_use]
pub fn jl_mint(mut self, jl_mint: String) -> Self {
self.value.jl_mint = Some(jl_mint);
self
}
#[doc = concat!("Set the optional `", "maxPriceUsd", "` request field.")]
#[must_use]
pub fn max_price_usd(mut self, max_price_usd: f64) -> Self {
self.value.max_price_usd = Some(max_price_usd);
self
}
#[doc = concat!("Set the optional `", "minPriceUsd", "` request field.")]
#[must_use]
pub fn min_price_usd(mut self, min_price_usd: f64) -> Self {
self.value.min_price_usd = Some(min_price_usd);
self
}
#[doc = concat!("Set the optional `", "orderType", "` request field.")]
#[must_use]
pub fn order_type(mut self, order_type: PostTriggerV2OrdersDcaRequestOrderType) -> Self {
self.value.order_type = Some(order_type);
self
}
#[doc = concat!("Set the optional `", "triggerMint", "` request field.")]
#[must_use]
pub fn trigger_mint(mut self, trigger_mint: String) -> Self {
self.value.trigger_mint = Some(trigger_mint);
self
}
pub fn build(self) -> PostTriggerV2OrdersDcaRequest {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2OrdersDcaRequestOrderType {
#[default]
#[serde(rename = "time_based")]
TimeBased,
#[serde(rename = "price_conditional")]
PriceConditional,
}
impl PostTriggerV2OrdersDcaRequestOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::TimeBased => "time_based",
Self::PriceConditional => "price_conditional",
}
}
}
impl ::std::fmt::Display for PostTriggerV2OrdersDcaRequestOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2OrdersDcaRequestOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2DepositCraftRequest {
pub amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "jlMint", skip_serializing_if = "Option::is_none")]
pub jl_mint: Option<String>,
#[serde(rename = "orderSubType", skip_serializing_if = "Option::is_none")]
pub order_sub_type: Option<PostTriggerV2DepositCraftRequestOrderSubType>,
#[serde(rename = "orderType")]
pub order_type: PostTriggerV2DepositCraftRequestOrderType,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "userAddress")]
pub user_address: String,
}
impl PostTriggerV2DepositCraftRequest {
pub fn new(
amount: String,
input_mint: String,
order_type: PostTriggerV2DepositCraftRequestOrderType,
output_mint: String,
user_address: String,
) -> Self {
Self {
amount,
input_mint,
order_type,
output_mint,
user_address,
jl_mint: None,
order_sub_type: None,
}
}
pub fn builder(
amount: String,
input_mint: String,
order_type: PostTriggerV2DepositCraftRequestOrderType,
output_mint: String,
user_address: String,
) -> PostTriggerV2DepositCraftRequestBuilder {
PostTriggerV2DepositCraftRequestBuilder::new(
amount,
input_mint,
order_type,
output_mint,
user_address,
)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV2DepositCraftRequestBuilder {
value: PostTriggerV2DepositCraftRequest,
}
impl PostTriggerV2DepositCraftRequestBuilder {
pub fn new(
amount: String,
input_mint: String,
order_type: PostTriggerV2DepositCraftRequestOrderType,
output_mint: String,
user_address: String,
) -> Self {
Self {
value: PostTriggerV2DepositCraftRequest::new(
amount,
input_mint,
order_type,
output_mint,
user_address,
),
}
}
#[doc = concat!("Set the optional `", "jlMint", "` request field.")]
#[must_use]
pub fn jl_mint(mut self, jl_mint: String) -> Self {
self.value.jl_mint = Some(jl_mint);
self
}
#[doc = concat!("Set the optional `", "orderSubType", "` request field.")]
#[must_use]
pub fn order_sub_type(
mut self,
order_sub_type: PostTriggerV2DepositCraftRequestOrderSubType,
) -> Self {
self.value.order_sub_type = Some(order_sub_type);
self
}
pub fn build(self) -> PostTriggerV2DepositCraftRequest {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2DepositCraftRequestOrderType {
#[default]
#[serde(rename = "price")]
Price,
#[serde(rename = "dca")]
Dca,
}
impl PostTriggerV2DepositCraftRequestOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Price => "price",
Self::Dca => "dca",
}
}
}
impl ::std::fmt::Display for PostTriggerV2DepositCraftRequestOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2DepositCraftRequestOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2DepositCraftRequestOrderSubType {
#[default]
#[serde(rename = "single")]
Single,
#[serde(rename = "oco")]
Oco,
#[serde(rename = "otoco")]
Otoco,
}
impl PostTriggerV2DepositCraftRequestOrderSubType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Single => "single",
Self::Oco => "oco",
Self::Otoco => "otoco",
}
}
}
impl ::std::fmt::Display for PostTriggerV2DepositCraftRequestOrderSubType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2DepositCraftRequestOrderSubType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthVerifyRequestVariant2 {
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
pub r#type: PostTriggerV2AuthVerifyRequestVariant2Type,
#[serde(rename = "walletPubkey")]
pub wallet_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthVerifyRequestVariant {
pub signature: String,
pub r#type: PostTriggerV2AuthVerifyRequestVariantType,
#[serde(rename = "walletPubkey")]
pub wallet_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PostTriggerV2AuthVerifyRequest {
PostTriggerV2AuthVerifyRequestVariant(PostTriggerV2AuthVerifyRequestVariant),
PostTriggerV2AuthVerifyRequestVariant2(PostTriggerV2AuthVerifyRequestVariant2),
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthVerifyRequestVariantType {
#[default]
#[serde(rename = "message")]
Message,
}
impl PostTriggerV2AuthVerifyRequestVariantType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Message => "message",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthVerifyRequestVariantType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthVerifyRequestVariantType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthVerifyRequestVariant2Type {
#[default]
#[serde(rename = "transaction")]
Transaction,
}
impl PostTriggerV2AuthVerifyRequestVariant2Type {
pub fn as_str(&self) -> &'static str {
match self {
Self::Transaction => "transaction",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthVerifyRequestVariant2Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthVerifyRequestVariant2Type {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthVerifyRequestTypeTransaction {
#[default]
#[serde(rename = "transaction")]
Transaction,
}
impl PostTriggerV2AuthVerifyRequestTypeTransaction {
pub fn as_str(&self) -> &'static str {
match self {
Self::Transaction => "transaction",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthVerifyRequestTypeTransaction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthVerifyRequestTypeTransaction {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthVerifyRequestType {
#[default]
#[serde(rename = "message")]
Message,
}
impl PostTriggerV2AuthVerifyRequestType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Message => "message",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthVerifyRequestType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthVerifyRequestType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthChallengeResponseVariant2 {
pub transaction: String,
pub r#type: PostTriggerV2AuthChallengeResponseVariant2Type,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthChallengeResponseVariant {
pub challenge: String,
pub r#type: PostTriggerV2AuthChallengeResponseVariantType,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PostTriggerV2AuthChallengeResponse {
PostTriggerV2AuthChallengeResponseVariant(PostTriggerV2AuthChallengeResponseVariant),
PostTriggerV2AuthChallengeResponseVariant2(PostTriggerV2AuthChallengeResponseVariant2),
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthChallengeResponseVariantType {
#[default]
#[serde(rename = "message")]
Message,
}
impl PostTriggerV2AuthChallengeResponseVariantType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Message => "message",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthChallengeResponseVariantType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthChallengeResponseVariantType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthChallengeResponseVariant2Type {
#[default]
#[serde(rename = "transaction")]
Transaction,
}
impl PostTriggerV2AuthChallengeResponseVariant2Type {
pub fn as_str(&self) -> &'static str {
match self {
Self::Transaction => "transaction",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthChallengeResponseVariant2Type {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthChallengeResponseVariant2Type {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthChallengeResponseTypeTransaction {
#[default]
#[serde(rename = "transaction")]
Transaction,
}
impl PostTriggerV2AuthChallengeResponseTypeTransaction {
pub fn as_str(&self) -> &'static str {
match self {
Self::Transaction => "transaction",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthChallengeResponseTypeTransaction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthChallengeResponseTypeTransaction {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthChallengeResponseType {
#[default]
#[serde(rename = "message")]
Message,
}
impl PostTriggerV2AuthChallengeResponseType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Message => "message",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthChallengeResponseType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthChallengeResponseType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthChallengeRequest {
pub r#type: PostTriggerV2AuthChallengeRequestType,
#[serde(rename = "walletPubkey")]
pub wallet_pubkey: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV2AuthChallengeRequestType {
#[default]
#[serde(rename = "message")]
Message,
#[serde(rename = "transaction")]
Transaction,
}
impl PostTriggerV2AuthChallengeRequestType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Message => "message",
Self::Transaction => "transaction",
}
}
}
impl ::std::fmt::Display for PostTriggerV2AuthChallengeRequestType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV2AuthChallengeRequestType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1ExecuteResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1ExecuteResponse500Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1ExecuteResponse500Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1ExecuteResponse500Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1ExecuteResponse500Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1ExecuteResponse500Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1ExecuteResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1ExecuteResponse400Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1ExecuteResponse400Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1ExecuteResponse400Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1ExecuteResponse400Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1ExecuteResponse400Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1ExecuteResponse {
pub code: f64,
pub signature: String,
pub status: PostTriggerV1ExecuteResponseStatus,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1ExecuteResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1ExecuteResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1ExecuteResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1ExecuteResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CreateOrderResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CreateOrderResponse500Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CreateOrderResponse500Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CreateOrderResponse500Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CreateOrderResponse500Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CreateOrderResponse500Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CreateOrderResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CreateOrderResponse400Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CreateOrderResponse400Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CreateOrderResponse400Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CreateOrderResponse400Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CreateOrderResponse400Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CreateOrderRequest {
#[serde(rename = "computeUnitPrice", skip_serializing_if = "Option::is_none")]
pub compute_unit_price: Option<String>,
#[serde(rename = "feeAccount", skip_serializing_if = "Option::is_none")]
pub fee_account: Option<String>,
#[serde(rename = "inputMint", default)]
pub input_mint: String,
#[serde(default)]
pub maker: String,
#[serde(rename = "outputMint", default)]
pub output_mint: String,
pub params: PostTriggerV1CreateOrderRequestParams,
#[serde(default)]
pub payer: String,
#[serde(rename = "wrapAndUnwrapSol", skip_serializing_if = "Option::is_none")]
pub wrap_and_unwrap_sol: Option<bool>,
}
impl PostTriggerV1CreateOrderRequest {
pub fn new(
input_mint: String,
maker: String,
output_mint: String,
params: PostTriggerV1CreateOrderRequestParams,
payer: String,
) -> Self {
Self {
input_mint,
maker,
output_mint,
params,
payer,
compute_unit_price: None,
fee_account: None,
wrap_and_unwrap_sol: None,
}
}
pub fn builder(
input_mint: String,
maker: String,
output_mint: String,
params: PostTriggerV1CreateOrderRequestParams,
payer: String,
) -> PostTriggerV1CreateOrderRequestBuilder {
PostTriggerV1CreateOrderRequestBuilder::new(input_mint, maker, output_mint, params, payer)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV1CreateOrderRequestBuilder {
value: PostTriggerV1CreateOrderRequest,
}
impl PostTriggerV1CreateOrderRequestBuilder {
pub fn new(
input_mint: String,
maker: String,
output_mint: String,
params: PostTriggerV1CreateOrderRequestParams,
payer: String,
) -> Self {
Self {
value: PostTriggerV1CreateOrderRequest::new(
input_mint,
maker,
output_mint,
params,
payer,
),
}
}
#[doc = concat!("Set the optional `", "computeUnitPrice", "` request field.")]
#[must_use]
pub fn compute_unit_price(mut self, compute_unit_price: String) -> Self {
self.value.compute_unit_price = Some(compute_unit_price);
self
}
#[doc = concat!("Set the optional `", "feeAccount", "` request field.")]
#[must_use]
pub fn fee_account(mut self, fee_account: String) -> Self {
self.value.fee_account = Some(fee_account);
self
}
#[doc = concat!("Set the optional `", "wrapAndUnwrapSol", "` request field.")]
#[must_use]
pub fn wrap_and_unwrap_sol(mut self, wrap_and_unwrap_sol: bool) -> Self {
self.value.wrap_and_unwrap_sol = Some(wrap_and_unwrap_sol);
self
}
pub fn build(self) -> PostTriggerV1CreateOrderRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CreateOrderRequestParams {
#[serde(rename = "expiredAt", skip_serializing_if = "Option::is_none")]
pub expired_at: Option<String>,
#[serde(rename = "feeBps", skip_serializing_if = "Option::is_none")]
pub fee_bps: Option<String>,
#[serde(rename = "makingAmount", default)]
pub making_amount: String,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<String>,
#[serde(rename = "takingAmount", default)]
pub taking_amount: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrdersResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CancelOrdersResponse500Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CancelOrdersResponse500Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CancelOrdersResponse500Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CancelOrdersResponse500Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CancelOrdersResponse500Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrdersResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CancelOrdersResponse400Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CancelOrdersResponse400Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CancelOrdersResponse400Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CancelOrdersResponse400Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CancelOrdersResponse400Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrderResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CancelOrderResponse500Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CancelOrderResponse500Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CancelOrderResponse500Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CancelOrderResponse500Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CancelOrderResponse500Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrderResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<String>,
pub code: f64,
pub error: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostTriggerV1CancelOrderResponse400Status>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostTriggerV1CancelOrderResponse400Status {
#[default]
#[serde(rename = "Failed")]
Failed,
}
impl PostTriggerV1CancelOrderResponse400Status {
pub fn as_str(&self) -> &'static str {
match self {
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostTriggerV1CancelOrderResponse400Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostTriggerV1CancelOrderResponse400Status {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcPoolSubmitResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<PostStudioV1DbcPoolSubmitResponseData>,
#[serde(skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcPoolSubmitResponseData {
#[serde(rename = "configKey", skip_serializing_if = "Option::is_none")]
pub config_key: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<PostStudioV1DbcFeeResponse400Errors>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeResponse400Errors {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<String>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeCreateTxResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<PostStudioV1DbcFeeCreateTxResponse400Errors>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeCreateTxResponse400Errors {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<String>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostExecuteResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "inputAmountResult", skip_serializing_if = "Option::is_none")]
pub input_amount_result: Option<String>,
#[serde(rename = "outputAmountResult", skip_serializing_if = "Option::is_none")]
pub output_amount_result: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub slot: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<PostExecuteResponseStatus>,
#[serde(rename = "swapEvents", skip_serializing_if = "Option::is_none")]
pub swap_events: Option<Vec<SwapV2SwapEvent>>,
#[serde(rename = "totalInputAmount", skip_serializing_if = "Option::is_none")]
pub total_input_amount: Option<String>,
#[serde(rename = "totalOutputAmount", skip_serializing_if = "Option::is_none")]
pub total_output_amount: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV2SwapEvent {
#[serde(rename = "inputAmount", skip_serializing_if = "Option::is_none")]
pub input_amount: Option<String>,
#[serde(rename = "inputMint", skip_serializing_if = "Option::is_none")]
pub input_mint: Option<String>,
#[serde(rename = "outputAmount", skip_serializing_if = "Option::is_none")]
pub output_amount: Option<String>,
#[serde(rename = "outputMint", skip_serializing_if = "Option::is_none")]
pub output_mint: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PostExecuteResponseStatus {
#[default]
#[serde(rename = "Success")]
Success,
#[serde(rename = "Failed")]
Failed,
}
impl PostExecuteResponseStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "Success",
Self::Failed => "Failed",
}
}
}
impl ::std::fmt::Display for PostExecuteResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PostExecuteResponseStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PatchTriggerV2OrdersPriceOrderIdRequest {
#[serde(rename = "orderType")]
pub order_type: PatchTriggerV2OrdersPriceOrderIdRequestOrderType,
#[serde(rename = "slPriceUsd", skip_serializing_if = "Option::is_none")]
pub sl_price_usd: Option<f64>,
#[serde(rename = "slSlippageBps", skip_serializing_if = "Option::is_none")]
pub sl_slippage_bps: Option<f64>,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<f64>,
#[serde(rename = "tpPriceUsd", skip_serializing_if = "Option::is_none")]
pub tp_price_usd: Option<f64>,
#[serde(rename = "tpSlippageBps", skip_serializing_if = "Option::is_none")]
pub tp_slippage_bps: Option<f64>,
#[serde(rename = "trailingBps", skip_serializing_if = "Option::is_none")]
pub trailing_bps: Option<f64>,
#[serde(rename = "triggerPriceUsd", skip_serializing_if = "Option::is_none")]
pub trigger_price_usd: Option<f64>,
}
impl PatchTriggerV2OrdersPriceOrderIdRequest {
pub fn new(order_type: PatchTriggerV2OrdersPriceOrderIdRequestOrderType) -> Self {
Self {
order_type,
sl_price_usd: None,
sl_slippage_bps: None,
slippage_bps: None,
tp_price_usd: None,
tp_slippage_bps: None,
trailing_bps: None,
trigger_price_usd: None,
}
}
pub fn builder(
order_type: PatchTriggerV2OrdersPriceOrderIdRequestOrderType,
) -> PatchTriggerV2OrdersPriceOrderIdRequestBuilder {
PatchTriggerV2OrdersPriceOrderIdRequestBuilder::new(order_type)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PatchTriggerV2OrdersPriceOrderIdRequestBuilder {
value: PatchTriggerV2OrdersPriceOrderIdRequest,
}
impl PatchTriggerV2OrdersPriceOrderIdRequestBuilder {
pub fn new(order_type: PatchTriggerV2OrdersPriceOrderIdRequestOrderType) -> Self {
Self {
value: PatchTriggerV2OrdersPriceOrderIdRequest::new(order_type),
}
}
#[doc = concat!("Set the optional `", "slPriceUsd", "` request field.")]
#[must_use]
pub fn sl_price_usd(mut self, sl_price_usd: f64) -> Self {
self.value.sl_price_usd = Some(sl_price_usd);
self
}
#[doc = concat!("Set the optional `", "slSlippageBps", "` request field.")]
#[must_use]
pub fn sl_slippage_bps(mut self, sl_slippage_bps: f64) -> Self {
self.value.sl_slippage_bps = Some(sl_slippage_bps);
self
}
#[doc = concat!("Set the optional `", "slippageBps", "` request field.")]
#[must_use]
pub fn slippage_bps(mut self, slippage_bps: f64) -> Self {
self.value.slippage_bps = Some(slippage_bps);
self
}
#[doc = concat!("Set the optional `", "tpPriceUsd", "` request field.")]
#[must_use]
pub fn tp_price_usd(mut self, tp_price_usd: f64) -> Self {
self.value.tp_price_usd = Some(tp_price_usd);
self
}
#[doc = concat!("Set the optional `", "tpSlippageBps", "` request field.")]
#[must_use]
pub fn tp_slippage_bps(mut self, tp_slippage_bps: f64) -> Self {
self.value.tp_slippage_bps = Some(tp_slippage_bps);
self
}
#[doc = concat!("Set the optional `", "trailingBps", "` request field.")]
#[must_use]
pub fn trailing_bps(mut self, trailing_bps: f64) -> Self {
self.value.trailing_bps = Some(trailing_bps);
self
}
#[doc = concat!("Set the optional `", "triggerPriceUsd", "` request field.")]
#[must_use]
pub fn trigger_price_usd(mut self, trigger_price_usd: f64) -> Self {
self.value.trigger_price_usd = Some(trigger_price_usd);
self
}
pub fn build(self) -> PatchTriggerV2OrdersPriceOrderIdRequest {
self.value
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PatchTriggerV2OrdersPriceOrderIdRequestOrderType {
#[default]
#[serde(rename = "single")]
Single,
#[serde(rename = "oco")]
Oco,
#[serde(rename = "otoco")]
Otoco,
}
impl PatchTriggerV2OrdersPriceOrderIdRequestOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Single => "single",
Self::Oco => "oco",
Self::Otoco => "otoco",
}
}
}
impl ::std::fmt::Display for PatchTriggerV2OrdersPriceOrderIdRequestOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PatchTriggerV2OrdersPriceOrderIdRequestOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
pub type ListBorrowVaultsResponse = Vec<LendBorrowBorrowVault>;
pub type ListBorrowPositionsResponse = Vec<LendBorrowBorrowPosition>;
pub type LendUserPositionsResponse = Vec<LendUserPosition>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendUserPosition {
pub allowance: String,
#[serde(rename = "ownerAddress")]
pub owner_address: String,
pub shares: String,
pub token: LendTokenInfo,
#[serde(rename = "underlyingAssets")]
pub underlying_assets: String,
#[serde(rename = "underlyingBalance")]
pub underlying_balance: String,
}
pub type LendTokensResponse = Vec<LendTokenInfo>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendTokenInfo {
pub address: String,
pub asset: LendAssetInfo,
#[serde(rename = "assetAddress")]
pub asset_address: String,
#[serde(rename = "convertToAssets")]
pub convert_to_assets: String,
#[serde(rename = "convertToShares")]
pub convert_to_shares: String,
pub decimals: i64,
pub id: i64,
#[serde(rename = "liquiditySupplyData")]
pub liquidity_supply_data: LendLiquiditySupplyData,
pub name: String,
#[serde(rename = "rebalanceDifference")]
pub rebalance_difference: String,
#[serde(rename = "rewardsRate")]
pub rewards_rate: String,
#[serde(rename = "supplyRate")]
pub supply_rate: String,
pub symbol: String,
#[serde(rename = "totalAssets")]
pub total_assets: String,
#[serde(rename = "totalRate")]
pub total_rate: String,
#[serde(rename = "totalSupply")]
pub total_supply: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendLiquiditySupplyData {
#[serde(rename = "baseWithdrawalLimit")]
pub base_withdrawal_limit: String,
#[serde(rename = "expandDuration")]
pub expand_duration: String,
#[serde(rename = "expandPercent")]
pub expand_percent: String,
#[serde(rename = "lastUpdateTimestamp")]
pub last_update_timestamp: String,
#[serde(rename = "modeWithInterest")]
pub mode_with_interest: bool,
pub supply: String,
pub withdrawable: String,
#[serde(rename = "withdrawableUntilLimit")]
pub withdrawable_until_limit: String,
#[serde(rename = "withdrawalLimit")]
pub withdrawal_limit: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendAssetInfo {
pub address: String,
pub chain_id: String,
pub coingecko_id: String,
pub decimals: i64,
pub logo_url: url::Url,
pub name: String,
pub price: String,
pub symbol: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendInstructionResponse {
pub accounts: Vec<LendAccountMeta>,
pub data: String,
#[serde(rename = "programId")]
pub program_id: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendAccountMeta {
#[serde(rename = "isSigner")]
pub is_signer: bool,
#[serde(rename = "isWritable")]
pub is_writable: bool,
pub pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowOperateInstructionsResponse {
#[serde(rename = "addressLookupTableAddresses")]
pub address_lookup_table_addresses: Vec<String>,
pub instructions: Vec<LendBorrowSolanaInstruction>,
#[serde(rename = "nftId")]
pub nft_id: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowSolanaInstruction {
pub accounts: Vec<LendBorrowSolanaAccountMeta>,
pub data: String,
#[serde(rename = "programId")]
pub program_id: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowSolanaAccountMeta {
#[serde(rename = "isSigner")]
pub is_signer: bool,
#[serde(rename = "isWritable")]
pub is_writable: bool,
pub pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowBorrowPosition {
pub address: String,
#[serde(rename = "beforeBorrow")]
pub before_borrow: String,
#[serde(rename = "beforeSupply")]
pub before_supply: String,
pub borrow: String,
#[serde(rename = "borrowLiquidation")]
pub borrow_liquidation: String,
pub config: LendBorrowBorrowPositionConfig,
#[serde(rename = "dustBorrow")]
pub dust_borrow: String,
pub id: i64,
#[serde(rename = "isLiquidated")]
pub is_liquidated: bool,
#[serde(rename = "isSupplyPosition")]
pub is_supply_position: bool,
#[serde(rename = "ownerAddress")]
pub owner_address: String,
pub supply: String,
#[serde(rename = "supplyLiquidation")]
pub supply_liquidation: String,
pub tick: i64,
#[serde(rename = "tickId")]
pub tick_id: i64,
pub vault: LendBorrowBorrowVault,
#[serde(rename = "vaultId")]
pub vault_id: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowBorrowVault {
#[serde(rename = "absorbedBorrow", skip_serializing_if = "Option::is_none")]
pub absorbed_borrow: Option<String>,
#[serde(rename = "absorbedSupply", skip_serializing_if = "Option::is_none")]
pub absorbed_supply: Option<String>,
pub address: String,
#[serde(rename = "borrowFee", skip_serializing_if = "Option::is_none")]
pub borrow_fee: Option<String>,
#[serde(rename = "borrowLimit", skip_serializing_if = "Option::is_none")]
pub borrow_limit: Option<String>,
#[serde(
rename = "borrowLimitUtilization",
skip_serializing_if = "Option::is_none"
)]
pub borrow_limit_utilization: Option<String>,
#[serde(rename = "borrowRate", skip_serializing_if = "Option::is_none")]
pub borrow_rate: Option<String>,
#[serde(
rename = "borrowRateLiquidity",
skip_serializing_if = "Option::is_none"
)]
pub borrow_rate_liquidity: Option<String>,
#[serde(
rename = "borrowRateMagnifier",
skip_serializing_if = "Option::is_none"
)]
pub borrow_rate_magnifier: Option<String>,
#[serde(rename = "borrowToken")]
pub borrow_token: LendBorrowToken,
#[serde(skip_serializing_if = "Option::is_none")]
pub borrowable: Option<String>,
#[serde(
rename = "borrowableUntilLimit",
skip_serializing_if = "Option::is_none"
)]
pub borrowable_until_limit: Option<String>,
#[serde(rename = "collateralFactor", skip_serializing_if = "Option::is_none")]
pub collateral_factor: Option<String>,
pub id: i64,
#[serde(
rename = "liquidationMaxLimit",
skip_serializing_if = "Option::is_none"
)]
pub liquidation_max_limit: Option<String>,
#[serde(rename = "liquidationPenalty", skip_serializing_if = "Option::is_none")]
pub liquidation_penalty: Option<String>,
#[serde(
rename = "liquidationThreshold",
skip_serializing_if = "Option::is_none"
)]
pub liquidation_threshold: Option<String>,
#[serde(
rename = "liquidityBorrowData",
skip_serializing_if = "Option::is_none"
)]
pub liquidity_borrow_data: Option<LendBorrowLiquidityBorrowData>,
#[serde(
rename = "liquiditySupplyData",
skip_serializing_if = "Option::is_none"
)]
pub liquidity_supply_data: Option<LendBorrowLiquiditySupplyData>,
pub metadata: LendBorrowVaultMetadata,
#[serde(rename = "minimumBorrowing", skip_serializing_if = "Option::is_none")]
pub minimum_borrowing: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub oracle: Option<String>,
#[serde(rename = "oraclePrice", skip_serializing_if = "Option::is_none")]
pub oracle_price: Option<String>,
#[serde(
rename = "oraclePriceLiquidate",
skip_serializing_if = "Option::is_none"
)]
pub oracle_price_liquidate: Option<String>,
#[serde(rename = "oraclePriceOperate", skip_serializing_if = "Option::is_none")]
pub oracle_price_operate: Option<String>,
#[serde(rename = "oracleSources", skip_serializing_if = "Option::is_none")]
pub oracle_sources: Option<Vec<LendBorrowOracleSource>>,
#[serde(rename = "oracleTimestamp", skip_serializing_if = "Option::is_none")]
pub oracle_timestamp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rewards: Option<Vec<LendBorrowMarketReward>>,
#[serde(rename = "supplyRate", skip_serializing_if = "Option::is_none")]
pub supply_rate: Option<String>,
#[serde(
rename = "supplyRateLiquidity",
skip_serializing_if = "Option::is_none"
)]
pub supply_rate_liquidity: Option<String>,
#[serde(
rename = "supplyRateMagnifier",
skip_serializing_if = "Option::is_none"
)]
pub supply_rate_magnifier: Option<String>,
#[serde(rename = "supplyToken")]
pub supply_token: LendBorrowToken,
#[serde(rename = "topTick", skip_serializing_if = "Option::is_none")]
pub top_tick: Option<i64>,
#[serde(rename = "totalBorrow", skip_serializing_if = "Option::is_none")]
pub total_borrow: Option<String>,
#[serde(
rename = "totalBorrowLiquidity",
skip_serializing_if = "Option::is_none"
)]
pub total_borrow_liquidity: Option<String>,
#[serde(rename = "totalPositions", skip_serializing_if = "Option::is_none")]
pub total_positions: Option<i64>,
#[serde(rename = "totalSupply", skip_serializing_if = "Option::is_none")]
pub total_supply: Option<String>,
#[serde(
rename = "totalSupplyLiquidity",
skip_serializing_if = "Option::is_none"
)]
pub total_supply_liquidity: Option<String>,
#[serde(rename = "withdrawLimit", skip_serializing_if = "Option::is_none")]
pub withdraw_limit: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub withdrawable: Option<String>,
#[serde(
rename = "withdrawableUntilLimit",
skip_serializing_if = "Option::is_none"
)]
pub withdrawable_until_limit: Option<String>,
#[serde(rename = "withdrawalGap", skip_serializing_if = "Option::is_none")]
pub withdrawal_gap: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowVaultMetadata {
#[serde(rename = "maxLeverage")]
pub max_leverage: bool,
pub multiply: LendBorrowVaultMetadataMultiply,
#[serde(rename = "nativeStake")]
pub native_stake: bool,
pub pegged: bool,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowVaultMetadataMultiply {
pub enabled: bool,
#[serde(rename = "reduceFactor")]
pub reduce_factor: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowOracleSource {
pub divisor: String,
pub invert: bool,
pub multiplier: String,
pub source: String,
#[serde(rename = "sourceType")]
pub source_type: LendBorrowOracleSourceSourceType,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowOracleSourceSourceType {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowMarketReward {
pub apr: String,
pub metadata: LendBorrowMarketRewardMetadata,
#[serde(rename = "rewardToken")]
pub reward_token: LendBorrowToken,
pub side: LendBorrowMarketRewardSide,
pub r#type: LendBorrowMarketRewardType,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowToken {
pub address: String,
#[serde(rename = "chainId")]
pub chain_id: String,
#[serde(rename = "coingeckoId", skip_serializing_if = "Option::is_none")]
pub coingecko_id: Option<String>,
pub decimals: i64,
#[serde(rename = "logoUrl", skip_serializing_if = "Option::is_none")]
pub logo_url: Option<url::Url>,
pub name: String,
#[serde(
rename = "nativeStakeVoteAccount",
skip_serializing_if = "Option::is_none"
)]
pub native_stake_vote_account: Option<String>,
pub price: String,
#[serde(rename = "scaledUiConfig", skip_serializing_if = "Option::is_none")]
pub scaled_ui_config: Option<LendBorrowTokenScaledUiConfig>,
#[serde(rename = "stakingApr", skip_serializing_if = "Option::is_none")]
pub staking_apr: Option<f64>,
pub symbol: String,
#[serde(rename = "uiSymbol")]
pub ui_symbol: String,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowTokenScaledUiConfig {
#[serde(skip_serializing_if = "Option::is_none")]
pub authority: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub multiplier: Option<f64>,
#[serde(rename = "newMultiplier", skip_serializing_if = "Option::is_none")]
pub new_multiplier: Option<f64>,
#[serde(
rename = "newMultiplierEffectiveTimestamp",
skip_serializing_if = "Option::is_none"
)]
pub new_multiplier_effective_timestamp: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum LendBorrowMarketRewardType {
#[default]
#[serde(rename = "merkle")]
Merkle,
}
impl LendBorrowMarketRewardType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Merkle => "merkle",
}
}
}
impl ::std::fmt::Display for LendBorrowMarketRewardType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for LendBorrowMarketRewardType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum LendBorrowMarketRewardSide {
#[default]
#[serde(rename = "supply")]
Supply,
#[serde(rename = "borrow")]
Borrow,
}
impl LendBorrowMarketRewardSide {
pub fn as_str(&self) -> &'static str {
match self {
Self::Supply => "supply",
Self::Borrow => "borrow",
}
}
}
impl ::std::fmt::Display for LendBorrowMarketRewardSide {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for LendBorrowMarketRewardSide {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowMarketRewardMetadata {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowLiquiditySupplyData {
#[serde(
rename = "baseWithdrawalLimit",
skip_serializing_if = "Option::is_none"
)]
pub base_withdrawal_limit: Option<String>,
#[serde(rename = "expandDuration", skip_serializing_if = "Option::is_none")]
pub expand_duration: Option<LendBorrowLiquiditySupplyDataExpandDuration>,
#[serde(rename = "expandPercent", skip_serializing_if = "Option::is_none")]
pub expand_percent: Option<i64>,
#[serde(
rename = "lastUpdateTimestamp",
skip_serializing_if = "Option::is_none"
)]
pub last_update_timestamp: Option<String>,
#[serde(rename = "modeWithInterest", skip_serializing_if = "Option::is_none")]
pub mode_with_interest: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub supply: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub withdrawable: Option<String>,
#[serde(
rename = "withdrawableUntilLimit",
skip_serializing_if = "Option::is_none"
)]
pub withdrawable_until_limit: Option<String>,
#[serde(rename = "withdrawalLimit", skip_serializing_if = "Option::is_none")]
pub withdrawal_limit: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum LendBorrowLiquiditySupplyDataExpandDuration {
String(String),
Integer(i64),
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowLiquidityBorrowData {
#[serde(rename = "baseBorrowLimit", skip_serializing_if = "Option::is_none")]
pub base_borrow_limit: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub borrow: Option<String>,
#[serde(rename = "borrowLimit", skip_serializing_if = "Option::is_none")]
pub borrow_limit: Option<String>,
#[serde(
rename = "borrowLimitUtilization",
skip_serializing_if = "Option::is_none"
)]
pub borrow_limit_utilization: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub borrowable: Option<String>,
#[serde(
rename = "borrowableUntilLimit",
skip_serializing_if = "Option::is_none"
)]
pub borrowable_until_limit: Option<String>,
#[serde(rename = "expandDuration", skip_serializing_if = "Option::is_none")]
pub expand_duration: Option<i64>,
#[serde(rename = "expandPercent", skip_serializing_if = "Option::is_none")]
pub expand_percent: Option<i64>,
#[serde(
rename = "lastUpdateTimestamp",
skip_serializing_if = "Option::is_none"
)]
pub last_update_timestamp: Option<LendBorrowLiquidityBorrowDataLastUpdateTimestamp>,
#[serde(rename = "maxBorrowLimit", skip_serializing_if = "Option::is_none")]
pub max_borrow_limit: Option<String>,
#[serde(rename = "modeWithInterest", skip_serializing_if = "Option::is_none")]
pub mode_with_interest: Option<bool>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum LendBorrowLiquidityBorrowDataLastUpdateTimestamp {
String(String),
Integer(i64),
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct LendBorrowBorrowPositionConfig {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1ShieldResponse {
pub warnings: GetUltraV1ShieldResponseWarnings,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetUltraV1ShieldResponseWarnings {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<ArrayItemItem>>,
}
pub type GetUltraV1SearchResponse = Vec<UltraMintInformation>;
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraMintInformation {
#[serde(skip_serializing_if = "Option::is_none")]
pub apy: Option<UltraMintInformationApy>,
#[serde(skip_serializing_if = "Option::is_none")]
pub audit: Option<UltraMintInformationAudit>,
#[serde(rename = "circSupply", skip_serializing_if = "Option::is_none")]
pub circ_supply: Option<f64>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub decimals: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dev: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub discord: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fdv: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fees: Option<f64>,
#[serde(rename = "firstPool", skip_serializing_if = "Option::is_none")]
pub first_pool: Option<UltraMintInformationFirstPool>,
#[serde(rename = "freezeAuthority", skip_serializing_if = "Option::is_none")]
pub freeze_authority: Option<String>,
#[serde(rename = "graduatedAt", skip_serializing_if = "Option::is_none")]
pub graduated_at: Option<String>,
#[serde(rename = "graduatedPool", skip_serializing_if = "Option::is_none")]
pub graduated_pool: Option<String>,
#[serde(rename = "holderCount", skip_serializing_if = "Option::is_none")]
pub holder_count: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub instagram: Option<String>,
#[serde(rename = "isVerified", skip_serializing_if = "Option::is_none")]
pub is_verified: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub issuer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub launchpad: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub liquidity: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mcap: Option<f64>,
#[serde(rename = "mintAuthority", skip_serializing_if = "Option::is_none")]
pub mint_authority: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "organicScore", skip_serializing_if = "Option::is_none")]
pub organic_score: Option<f64>,
#[serde(rename = "organicScoreLabel", skip_serializing_if = "Option::is_none")]
pub organic_score_label: Option<UltraMintInformationOrganicScoreLabel>,
#[serde(rename = "otherUrl", skip_serializing_if = "Option::is_none")]
pub other_url: Option<String>,
#[serde(rename = "partnerConfig", skip_serializing_if = "Option::is_none")]
pub partner_config: Option<String>,
#[serde(rename = "priceBlockId", skip_serializing_if = "Option::is_none")]
pub price_block_id: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats1h: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats24h: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats30d: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats5m: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats6h: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats7d: Option<UltraSwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub symbol: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub telegram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tiktok: Option<String>,
#[serde(rename = "tokenProgram", skip_serializing_if = "Option::is_none")]
pub token_program: Option<String>,
#[serde(rename = "totalSupply", skip_serializing_if = "Option::is_none")]
pub total_supply: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub twitter: Option<String>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
#[serde(rename = "usdPrice", skip_serializing_if = "Option::is_none")]
pub usd_price: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraSwapStats {
#[serde(rename = "buyOrganicVolume", skip_serializing_if = "Option::is_none")]
pub buy_organic_volume: Option<f64>,
#[serde(rename = "buyVolume", skip_serializing_if = "Option::is_none")]
pub buy_volume: Option<f64>,
#[serde(rename = "holderChange", skip_serializing_if = "Option::is_none")]
pub holder_change: Option<f64>,
#[serde(rename = "liquidityChange", skip_serializing_if = "Option::is_none")]
pub liquidity_change: Option<f64>,
#[serde(rename = "numBuys", skip_serializing_if = "Option::is_none")]
pub num_buys: Option<f64>,
#[serde(rename = "numNetBuyers", skip_serializing_if = "Option::is_none")]
pub num_net_buyers: Option<f64>,
#[serde(rename = "numOrganicBuyers", skip_serializing_if = "Option::is_none")]
pub num_organic_buyers: Option<f64>,
#[serde(rename = "numSells", skip_serializing_if = "Option::is_none")]
pub num_sells: Option<f64>,
#[serde(rename = "numTraders", skip_serializing_if = "Option::is_none")]
pub num_traders: Option<f64>,
#[serde(rename = "priceChange", skip_serializing_if = "Option::is_none")]
pub price_change: Option<f64>,
#[serde(rename = "sellOrganicVolume", skip_serializing_if = "Option::is_none")]
pub sell_organic_volume: Option<f64>,
#[serde(rename = "sellVolume", skip_serializing_if = "Option::is_none")]
pub sell_volume: Option<f64>,
#[serde(rename = "volumeChange", skip_serializing_if = "Option::is_none")]
pub volume_change: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum UltraMintInformationOrganicScoreLabel {
#[default]
#[serde(rename = "high")]
High,
#[serde(rename = "medium")]
Medium,
#[serde(rename = "low")]
Low,
}
impl UltraMintInformationOrganicScoreLabel {
pub fn as_str(&self) -> &'static str {
match self {
Self::High => "high",
Self::Medium => "medium",
Self::Low => "low",
}
}
}
impl ::std::fmt::Display for UltraMintInformationOrganicScoreLabel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for UltraMintInformationOrganicScoreLabel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraMintInformationFirstPool {
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraMintInformationAudit {
#[serde(
rename = "devBalancePercentage",
skip_serializing_if = "Option::is_none"
)]
pub dev_balance_percentage: Option<f64>,
#[serde(rename = "devMints", skip_serializing_if = "Option::is_none")]
pub dev_mints: Option<f64>,
#[serde(
rename = "freezeAuthorityDisabled",
skip_serializing_if = "Option::is_none"
)]
pub freeze_authority_disabled: Option<bool>,
#[serde(rename = "isSus", skip_serializing_if = "Option::is_none")]
pub is_sus: Option<bool>,
#[serde(
rename = "mintAuthorityDisabled",
skip_serializing_if = "Option::is_none"
)]
pub mint_authority_disabled: Option<bool>,
#[serde(
rename = "topHoldersPercentage",
skip_serializing_if = "Option::is_none"
)]
pub top_holders_percentage: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct UltraMintInformationApy {
#[serde(rename = "jupEarn", skip_serializing_if = "Option::is_none")]
pub jup_earn: Option<f64>,
}
pub type GetUltraV1OrderRoutersResponse = Vec<GetUltraV1OrderRoutersResponseItem>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderRoutersResponseItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
pub id: String,
pub name: GetUltraV1OrderRoutersResponseName,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1OrderRoutersResponseName {
#[default]
#[serde(rename = "Metis")]
Metis,
#[serde(rename = "JupiterZ")]
JupiterZ,
#[serde(rename = "DFlow")]
Dflow,
#[serde(rename = "OKX DEX Router")]
OkxDexRouter,
}
impl GetUltraV1OrderRoutersResponseName {
pub fn as_str(&self) -> &'static str {
match self {
Self::Metis => "Metis",
Self::JupiterZ => "JupiterZ",
Self::Dflow => "DFlow",
Self::OkxDexRouter => "OKX DEX Router",
}
}
}
impl ::std::fmt::Display for GetUltraV1OrderRoutersResponseName {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1OrderRoutersResponseName {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponse {
#[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")]
pub error_code: Option<f64>,
#[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")]
pub error_message: Option<GetUltraV1OrderResponseErrorMessage>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<String>,
#[serde(rename = "feeBps")]
pub fee_bps: f64,
#[serde(rename = "feeMint", skip_serializing_if = "Option::is_none")]
pub fee_mint: Option<String>,
pub gasless: bool,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "inUsdValue", skip_serializing_if = "Option::is_none")]
pub in_usd_value: Option<f64>,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub maker: Option<String>,
pub mode: String,
#[serde(rename = "otherAmountThreshold")]
pub other_amount_threshold: String,
#[serde(rename = "outAmount")]
pub out_amount: String,
#[serde(rename = "outUsdValue", skip_serializing_if = "Option::is_none")]
pub out_usd_value: Option<f64>,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "platformFee")]
pub platform_fee: GetUltraV1OrderResponsePlatformFee,
#[serde(rename = "priceImpact", skip_serializing_if = "Option::is_none")]
pub price_impact: Option<f64>,
#[serde(rename = "priceImpactPct")]
pub price_impact_pct: String,
#[serde(rename = "prioritizationFeeLamports")]
pub prioritization_fee_lamports: f64,
#[serde(
rename = "prioritizationFeePayer",
skip_serializing_if = "Option::is_none"
)]
pub prioritization_fee_payer: Option<String>,
#[serde(rename = "quoteId", skip_serializing_if = "Option::is_none")]
pub quote_id: Option<String>,
#[serde(rename = "referralAccount", skip_serializing_if = "Option::is_none")]
pub referral_account: Option<String>,
#[serde(rename = "rentFeeLamports")]
pub rent_fee_lamports: f64,
#[serde(rename = "rentFeePayer", skip_serializing_if = "Option::is_none")]
pub rent_fee_payer: Option<String>,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "routePlan")]
pub route_plan: Vec<GetUltraV1OrderResponseRoutePlanItem>,
pub router: GetUltraV1OrderResponseRouter,
#[serde(rename = "signatureFeeLamports")]
pub signature_fee_lamports: f64,
#[serde(rename = "signatureFeePayer", skip_serializing_if = "Option::is_none")]
pub signature_fee_payer: Option<String>,
#[serde(rename = "slippageBps")]
pub slippage_bps: f64,
#[serde(rename = "swapMode")]
pub swap_mode: String,
#[serde(rename = "swapType")]
pub swap_type: String,
#[serde(rename = "swapUsdValue", skip_serializing_if = "Option::is_none")]
pub swap_usd_value: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub taker: Option<String>,
#[serde(rename = "totalTime")]
pub total_time: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1OrderResponseRouter {
#[default]
#[serde(rename = "metis")]
Metis,
#[serde(rename = "jupiterz")]
Jupiterz,
#[serde(rename = "dflow")]
Dflow,
#[serde(rename = "okx")]
Okx,
}
impl GetUltraV1OrderResponseRouter {
pub fn as_str(&self) -> &'static str {
match self {
Self::Metis => "metis",
Self::Jupiterz => "jupiterz",
Self::Dflow => "dflow",
Self::Okx => "okx",
}
}
}
impl ::std::fmt::Display for GetUltraV1OrderResponseRouter {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1OrderResponseRouter {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponseRoutePlanItem {
pub bps: f64,
pub percent: f64,
#[serde(rename = "swapInfo")]
pub swap_info: GetUltraV1OrderResponseSwapInfo,
#[serde(rename = "usdValue", skip_serializing_if = "Option::is_none")]
pub usd_value: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponseSwapInfo {
#[serde(rename = "ammKey")]
pub amm_key: String,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
pub label: String,
#[serde(rename = "outAmount")]
pub out_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponsePlatformFee {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(rename = "feeBps")]
pub fee_bps: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1OrderResponseErrorMessage {
#[default]
#[serde(rename = "Insufficient funds")]
InsufficientFunds,
#[serde(rename = "Top up `${solAmount}` SOL for gas")]
TopUpSolAmountSolForGas,
#[serde(rename = "Minimum `${swapAmount}` for gasless")]
MinimumSwapAmountForGasless,
}
impl GetUltraV1OrderResponseErrorMessage {
pub fn as_str(&self) -> &'static str {
match self {
Self::InsufficientFunds => "Insufficient funds",
Self::TopUpSolAmountSolForGas => "Top up `${solAmount}` SOL for gas",
Self::MinimumSwapAmountForGasless => "Minimum `${swapAmount}` for gasless",
}
}
}
impl ::std::fmt::Display for GetUltraV1OrderResponseErrorMessage {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1OrderResponseErrorMessage {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetUltraV1BalancesAddressResponse {
#[serde(flatten)]
pub additional_properties:
std::collections::BTreeMap<String, GetUltraV1BalancesAddressResponseObject>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1BalancesAddressResponseObject {
pub amount: String,
#[serde(rename = "isFrozen")]
pub is_frozen: bool,
pub slot: f64,
#[serde(rename = "uiAmount")]
pub ui_amount: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV2OrdersHistoryResponse {
pub orders: Vec<TriggerV2OrderHistoryItem>,
pub pagination: GetTriggerV2OrdersHistoryResponsePagination,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetTriggerV2OrdersHistoryResponsePagination {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offset: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TriggerV2OrderHistoryItem {
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<TriggerV2OrderHistoryItemEventsItem>>,
#[serde(rename = "expiresAt", skip_serializing_if = "Option::is_none")]
pub expires_at: Option<f64>,
#[serde(rename = "fillPercent", skip_serializing_if = "Option::is_none")]
pub fill_percent: Option<f64>,
#[serde(rename = "highWatermark", skip_serializing_if = "Option::is_none")]
pub high_watermark: Option<f64>,
pub id: String,
#[serde(rename = "initialInputAmount", skip_serializing_if = "Option::is_none")]
pub initial_input_amount: Option<String>,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "inputUsed", skip_serializing_if = "Option::is_none")]
pub input_used: Option<String>,
#[serde(rename = "lowWatermark", skip_serializing_if = "Option::is_none")]
pub low_watermark: Option<f64>,
#[serde(rename = "orderState")]
pub order_state: TriggerV2OrderHistoryItemOrderState,
#[serde(rename = "orderType")]
pub order_type: TriggerV2OrderHistoryItemOrderType,
#[serde(rename = "outputAmount", skip_serializing_if = "Option::is_none")]
pub output_amount: Option<String>,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "privyWalletPubkey", skip_serializing_if = "Option::is_none")]
pub privy_wallet_pubkey: Option<String>,
#[serde(rename = "rawState", skip_serializing_if = "Option::is_none")]
pub raw_state: Option<String>,
#[serde(
rename = "remainingInputAmount",
skip_serializing_if = "Option::is_none"
)]
pub remaining_input_amount: Option<String>,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<f64>,
#[serde(rename = "trailingBps", skip_serializing_if = "Option::is_none")]
pub trailing_bps: Option<f64>,
#[serde(rename = "triggerCondition", skip_serializing_if = "Option::is_none")]
pub trigger_condition: Option<TriggerV2OrderHistoryItemTriggerCondition>,
#[serde(rename = "triggerMint", skip_serializing_if = "Option::is_none")]
pub trigger_mint: Option<String>,
#[serde(rename = "triggerPriceUsd", skip_serializing_if = "Option::is_none")]
pub trigger_price_usd: Option<f64>,
#[serde(rename = "triggeredAt", skip_serializing_if = "Option::is_none")]
pub triggered_at: Option<f64>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<f64>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2OrderHistoryItemTriggerCondition {
#[default]
#[serde(rename = "above")]
Above,
#[serde(rename = "below")]
Below,
}
impl TriggerV2OrderHistoryItemTriggerCondition {
pub fn as_str(&self) -> &'static str {
match self {
Self::Above => "above",
Self::Below => "below",
}
}
}
impl ::std::fmt::Display for TriggerV2OrderHistoryItemTriggerCondition {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2OrderHistoryItemTriggerCondition {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2OrderHistoryItemOrderType {
#[default]
#[serde(rename = "single")]
Single,
#[serde(rename = "oco")]
Oco,
#[serde(rename = "otoco")]
Otoco,
}
impl TriggerV2OrderHistoryItemOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Single => "single",
Self::Oco => "oco",
Self::Otoco => "otoco",
}
}
}
impl ::std::fmt::Display for TriggerV2OrderHistoryItemOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2OrderHistoryItemOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2OrderHistoryItemOrderState {
#[default]
#[serde(rename = "pending")]
Pending,
#[serde(rename = "open")]
Open,
#[serde(rename = "executing")]
Executing,
#[serde(rename = "filled")]
Filled,
#[serde(rename = "pending_withdraw")]
PendingWithdraw,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "expired")]
Expired,
#[serde(rename = "failed")]
Failed,
}
impl TriggerV2OrderHistoryItemOrderState {
pub fn as_str(&self) -> &'static str {
match self {
Self::Pending => "pending",
Self::Open => "open",
Self::Executing => "executing",
Self::Filled => "filled",
Self::PendingWithdraw => "pending_withdraw",
Self::Cancelled => "cancelled",
Self::Expired => "expired",
Self::Failed => "failed",
}
}
}
impl ::std::fmt::Display for TriggerV2OrderHistoryItemOrderState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2OrderHistoryItemOrderState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TriggerV2OrderHistoryItemEventsItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint: Option<String>,
#[serde(rename = "orderContext", skip_serializing_if = "Option::is_none")]
pub order_context: Option<String>,
#[serde(rename = "outputAmount", skip_serializing_if = "Option::is_none")]
pub output_amount: Option<String>,
#[serde(rename = "outputMint", skip_serializing_if = "Option::is_none")]
pub output_mint: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<TriggerV2OrderHistoryItemState>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<f64>,
#[serde(rename = "txSignature", skip_serializing_if = "Option::is_none")]
pub tx_signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<TriggerV2OrderHistoryItemType>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2OrderHistoryItemType {
#[default]
#[serde(rename = "deposit")]
Deposit,
#[serde(rename = "fill")]
Fill,
#[serde(rename = "withdrawal")]
Withdrawal,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "expired")]
Expired,
}
impl TriggerV2OrderHistoryItemType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Deposit => "deposit",
Self::Fill => "fill",
Self::Withdrawal => "withdrawal",
Self::Cancelled => "cancelled",
Self::Expired => "expired",
}
}
}
impl ::std::fmt::Display for TriggerV2OrderHistoryItemType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2OrderHistoryItemType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2OrderHistoryItemState {
#[default]
#[serde(rename = "success")]
Success,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "pending")]
Pending,
}
impl TriggerV2OrderHistoryItemState {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "success",
Self::Failed => "failed",
Self::Pending => "pending",
}
}
}
impl ::std::fmt::Display for TriggerV2OrderHistoryItemState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2OrderHistoryItemState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV2OrdersHistoryDcaResponse {
pub orders: Vec<TriggerV2DcaHistoryItem>,
pub pagination: GetTriggerV2OrdersHistoryDcaResponsePagination,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetTriggerV2OrdersHistoryDcaResponsePagination {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offset: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TriggerV2DcaHistoryItem {
#[serde(rename = "amountPerRound", skip_serializing_if = "Option::is_none")]
pub amount_per_round: Option<String>,
#[serde(rename = "beginFillAt", skip_serializing_if = "Option::is_none")]
pub begin_fill_at: Option<String>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "displayState")]
pub display_state: TriggerV2DcaHistoryItemDisplayState,
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<TriggerV2DcaHistoryItemEventsItem>>,
#[serde(rename = "fillPercent", skip_serializing_if = "Option::is_none")]
pub fill_percent: Option<f64>,
pub id: String,
#[serde(rename = "inputAmountInitial", skip_serializing_if = "Option::is_none")]
pub input_amount_initial: Option<String>,
#[serde(
rename = "inputAmountRemaining",
skip_serializing_if = "Option::is_none"
)]
pub input_amount_remaining: Option<String>,
#[serde(rename = "inputAmountUsed", skip_serializing_if = "Option::is_none")]
pub input_amount_used: Option<String>,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "intervalSeconds", skip_serializing_if = "Option::is_none")]
pub interval_seconds: Option<f64>,
#[serde(rename = "jlEnabled", skip_serializing_if = "Option::is_none")]
pub jl_enabled: Option<bool>,
#[serde(rename = "jlYieldUsd", skip_serializing_if = "Option::is_none")]
pub jl_yield_usd: Option<f64>,
#[serde(rename = "lastFillAt", skip_serializing_if = "Option::is_none")]
pub last_fill_at: Option<String>,
#[serde(rename = "maxPriceUsd", skip_serializing_if = "Option::is_none")]
pub max_price_usd: Option<f64>,
#[serde(rename = "minPriceUsd", skip_serializing_if = "Option::is_none")]
pub min_price_usd: Option<f64>,
#[serde(rename = "nextFillAt", skip_serializing_if = "Option::is_none")]
pub next_fill_at: Option<String>,
#[serde(rename = "numberOfRounds", skip_serializing_if = "Option::is_none")]
pub number_of_rounds: Option<f64>,
#[serde(rename = "orderType")]
pub order_type: TriggerV2DcaHistoryItemOrderType,
#[serde(rename = "outputAmountTotal", skip_serializing_if = "Option::is_none")]
pub output_amount_total: Option<String>,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
#[serde(rename = "retryWindowSeconds", skip_serializing_if = "Option::is_none")]
pub retry_window_seconds: Option<f64>,
#[serde(rename = "roundsFilled", skip_serializing_if = "Option::is_none")]
pub rounds_filled: Option<f64>,
pub state: TriggerV2DcaHistoryItemStateDepositing,
#[serde(rename = "triggerMint", skip_serializing_if = "Option::is_none")]
pub trigger_mint: Option<String>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
#[serde(rename = "vaultPubkey")]
pub vault_pubkey: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2DcaHistoryItemStateDepositing {
#[default]
#[serde(rename = "depositing")]
Depositing,
#[serde(rename = "deposit_failed")]
DepositFailed,
#[serde(rename = "active")]
Active,
#[serde(rename = "executing")]
Executing,
#[serde(rename = "withdrawing")]
Withdrawing,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "cancelled")]
Cancelled,
}
impl TriggerV2DcaHistoryItemStateDepositing {
pub fn as_str(&self) -> &'static str {
match self {
Self::Depositing => "depositing",
Self::DepositFailed => "deposit_failed",
Self::Active => "active",
Self::Executing => "executing",
Self::Withdrawing => "withdrawing",
Self::Completed => "completed",
Self::Cancelled => "cancelled",
}
}
}
impl ::std::fmt::Display for TriggerV2DcaHistoryItemStateDepositing {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2DcaHistoryItemStateDepositing {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2DcaHistoryItemOrderType {
#[default]
#[serde(rename = "time_based")]
TimeBased,
#[serde(rename = "price_conditional")]
PriceConditional,
}
impl TriggerV2DcaHistoryItemOrderType {
pub fn as_str(&self) -> &'static str {
match self {
Self::TimeBased => "time_based",
Self::PriceConditional => "price_conditional",
}
}
}
impl ::std::fmt::Display for TriggerV2DcaHistoryItemOrderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2DcaHistoryItemOrderType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TriggerV2DcaHistoryItemEventsItem {
#[serde(rename = "attemptCount", skip_serializing_if = "Option::is_none")]
pub attempt_count: Option<f64>,
#[serde(rename = "inputAmount", skip_serializing_if = "Option::is_none")]
pub input_amount: Option<String>,
#[serde(rename = "outputAmount", skip_serializing_if = "Option::is_none")]
pub output_amount: Option<String>,
#[serde(rename = "roundNumber", skip_serializing_if = "Option::is_none")]
pub round_number: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<TriggerV2DcaHistoryItemState>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[serde(rename = "txSignature", skip_serializing_if = "Option::is_none")]
pub tx_signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<TriggerV2DcaHistoryItemType>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2DcaHistoryItemType {
#[default]
#[serde(rename = "deposit")]
Deposit,
#[serde(rename = "fill")]
Fill,
#[serde(rename = "withdrawal")]
Withdrawal,
#[serde(rename = "cancelled")]
Cancelled,
}
impl TriggerV2DcaHistoryItemType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Deposit => "deposit",
Self::Fill => "fill",
Self::Withdrawal => "withdrawal",
Self::Cancelled => "cancelled",
}
}
}
impl ::std::fmt::Display for TriggerV2DcaHistoryItemType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2DcaHistoryItemType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2DcaHistoryItemState {
#[default]
#[serde(rename = "success")]
Success,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "rescheduled")]
Rescheduled,
#[serde(rename = "pending")]
Pending,
}
impl TriggerV2DcaHistoryItemState {
pub fn as_str(&self) -> &'static str {
match self {
Self::Success => "success",
Self::Failed => "failed",
Self::Rescheduled => "rescheduled",
Self::Pending => "pending",
}
}
}
impl ::std::fmt::Display for TriggerV2DcaHistoryItemState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2DcaHistoryItemState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TriggerV2DcaHistoryItemDisplayState {
#[default]
#[serde(rename = "pending")]
Pending,
#[serde(rename = "active")]
Active,
#[serde(rename = "executing")]
Executing,
#[serde(rename = "pending_withdraw")]
PendingWithdraw,
#[serde(rename = "completed")]
Completed,
#[serde(rename = "cancelled")]
Cancelled,
#[serde(rename = "failed")]
Failed,
}
impl TriggerV2DcaHistoryItemDisplayState {
pub fn as_str(&self) -> &'static str {
match self {
Self::Pending => "pending",
Self::Active => "active",
Self::Executing => "executing",
Self::PendingWithdraw => "pending_withdraw",
Self::Completed => "completed",
Self::Cancelled => "cancelled",
Self::Failed => "failed",
}
}
}
impl ::std::fmt::Display for TriggerV2DcaHistoryItemDisplayState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TriggerV2DcaHistoryItemDisplayState {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV1GetTriggerOrdersResponse {
#[serde(rename = "orderStatus")]
pub order_status: GetTriggerV1GetTriggerOrdersResponseOrderStatus,
pub orders: Vec<GetTriggerV1GetTriggerOrdersResponseOrdersItem>,
pub page: f64,
#[serde(rename = "totalPages")]
pub total_pages: f64,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV1GetTriggerOrdersResponseOrdersItem {
#[serde(rename = "closeTx")]
pub close_tx: String,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "expiredAt", skip_serializing_if = "Option::is_none")]
pub expired_at: Option<String>,
#[serde(rename = "inputMint")]
pub input_mint: String,
#[serde(rename = "makingAmount")]
pub making_amount: String,
#[serde(rename = "openTx")]
pub open_tx: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "programVersion")]
pub program_version: String,
#[serde(rename = "rawMakingAmount")]
pub raw_making_amount: String,
#[serde(rename = "rawRemainingMakingAmount")]
pub raw_remaining_making_amount: String,
#[serde(rename = "rawRemainingTakingAmount")]
pub raw_remaining_taking_amount: String,
#[serde(rename = "rawTakingAmount")]
pub raw_taking_amount: String,
#[serde(rename = "remainingMakingAmount")]
pub remaining_making_amount: String,
#[serde(rename = "remainingTakingAmount")]
pub remaining_taking_amount: String,
#[serde(rename = "slippageBps")]
pub slippage_bps: String,
pub status: String,
#[serde(rename = "takingAmount")]
pub taking_amount: String,
pub trades: Vec<GetTriggerV1GetTriggerOrdersResponseTradesItem>,
#[serde(rename = "updatedAt")]
pub updated_at: String,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV1GetTriggerOrdersResponseTradesItem {
pub action: String,
#[serde(rename = "confirmedAt")]
pub confirmed_at: String,
#[serde(rename = "feeAmount")]
pub fee_amount: String,
#[serde(rename = "feeMint")]
pub fee_mint: String,
#[serde(rename = "inputAmount")]
pub input_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
pub keeper: String,
#[serde(rename = "orderKey")]
pub order_key: String,
#[serde(rename = "outputAmount")]
pub output_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
#[serde(rename = "productMeta", skip_serializing_if = "Option::is_none")]
pub product_meta: Option<serde_json::Value>,
#[serde(rename = "rawFeeAmount")]
pub raw_fee_amount: String,
#[serde(rename = "rawInputAmount")]
pub raw_input_amount: String,
#[serde(rename = "rawOutputAmount")]
pub raw_output_amount: String,
#[serde(rename = "txId")]
pub tx_id: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetTriggerV1GetTriggerOrdersResponseOrderStatus {
#[default]
#[serde(rename = "active")]
Active,
#[serde(rename = "history")]
History,
}
impl GetTriggerV1GetTriggerOrdersResponseOrderStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Active => "active",
Self::History => "history",
}
}
}
impl ::std::fmt::Display for GetTriggerV1GetTriggerOrdersResponseOrderStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetTriggerV1GetTriggerOrdersResponseOrderStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
pub type GetTokensV2TagResponse = Vec<TokensV2MintInformation>;
pub type GetTokensV2SearchResponse = Vec<TokensV2MintInformation>;
pub type GetTokensV2RecentResponse = Vec<TokensV2MintInformation>;
pub type GetTokensV2CategoryIntervalResponse = Vec<TokensV2MintInformation>;
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2MintInformation {
#[serde(skip_serializing_if = "Option::is_none")]
pub apy: Option<TokensV2MintInformationApy>,
#[serde(skip_serializing_if = "Option::is_none")]
pub audit: Option<TokensV2MintInformationAudit>,
#[serde(rename = "circSupply", skip_serializing_if = "Option::is_none")]
pub circ_supply: Option<f64>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub decimals: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dev: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub discord: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fdv: Option<f64>,
#[serde(rename = "firstPool", skip_serializing_if = "Option::is_none")]
pub first_pool: Option<TokensV2MintInformationFirstPool>,
#[serde(rename = "freezeAuthority", skip_serializing_if = "Option::is_none")]
pub freeze_authority: Option<String>,
#[serde(rename = "graduatedAt", skip_serializing_if = "Option::is_none")]
pub graduated_at: Option<String>,
#[serde(rename = "graduatedPool", skip_serializing_if = "Option::is_none")]
pub graduated_pool: Option<String>,
#[serde(rename = "holderCount", skip_serializing_if = "Option::is_none")]
pub holder_count: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub instagram: Option<String>,
#[serde(rename = "isVerified", skip_serializing_if = "Option::is_none")]
pub is_verified: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub launchpad: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub liquidity: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mcap: Option<f64>,
#[serde(rename = "mintAuthority", skip_serializing_if = "Option::is_none")]
pub mint_authority: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "organicScore", skip_serializing_if = "Option::is_none")]
pub organic_score: Option<f64>,
#[serde(rename = "organicScoreLabel", skip_serializing_if = "Option::is_none")]
pub organic_score_label: Option<TokensV2MintInformationOrganicScoreLabel>,
#[serde(rename = "otherUrl", skip_serializing_if = "Option::is_none")]
pub other_url: Option<String>,
#[serde(rename = "partnerConfig", skip_serializing_if = "Option::is_none")]
pub partner_config: Option<String>,
#[serde(rename = "priceBlockId", skip_serializing_if = "Option::is_none")]
pub price_block_id: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats1h: Option<TokensV2SwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats24h: Option<TokensV2SwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats5m: Option<TokensV2SwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stats6h: Option<TokensV2SwapStats>,
#[serde(skip_serializing_if = "Option::is_none")]
pub symbol: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub telegram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tiktok: Option<String>,
#[serde(rename = "tokenProgram", skip_serializing_if = "Option::is_none")]
pub token_program: Option<String>,
#[serde(rename = "totalSupply", skip_serializing_if = "Option::is_none")]
pub total_supply: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub twitter: Option<String>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
#[serde(rename = "usdPrice", skip_serializing_if = "Option::is_none")]
pub usd_price: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2SwapStats {
#[serde(rename = "buyOrganicVolume", skip_serializing_if = "Option::is_none")]
pub buy_organic_volume: Option<f64>,
#[serde(rename = "buyVolume", skip_serializing_if = "Option::is_none")]
pub buy_volume: Option<f64>,
#[serde(rename = "holderChange", skip_serializing_if = "Option::is_none")]
pub holder_change: Option<f64>,
#[serde(rename = "liquidityChange", skip_serializing_if = "Option::is_none")]
pub liquidity_change: Option<f64>,
#[serde(rename = "numBuys", skip_serializing_if = "Option::is_none")]
pub num_buys: Option<f64>,
#[serde(rename = "numNetBuyers", skip_serializing_if = "Option::is_none")]
pub num_net_buyers: Option<f64>,
#[serde(rename = "numOrganicBuyers", skip_serializing_if = "Option::is_none")]
pub num_organic_buyers: Option<f64>,
#[serde(rename = "numSells", skip_serializing_if = "Option::is_none")]
pub num_sells: Option<f64>,
#[serde(rename = "numTraders", skip_serializing_if = "Option::is_none")]
pub num_traders: Option<f64>,
#[serde(rename = "priceChange", skip_serializing_if = "Option::is_none")]
pub price_change: Option<f64>,
#[serde(rename = "sellOrganicVolume", skip_serializing_if = "Option::is_none")]
pub sell_organic_volume: Option<f64>,
#[serde(rename = "sellVolume", skip_serializing_if = "Option::is_none")]
pub sell_volume: Option<f64>,
#[serde(rename = "volumeChange", skip_serializing_if = "Option::is_none")]
pub volume_change: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum TokensV2MintInformationOrganicScoreLabel {
#[default]
#[serde(rename = "high")]
High,
#[serde(rename = "medium")]
Medium,
#[serde(rename = "low")]
Low,
}
impl TokensV2MintInformationOrganicScoreLabel {
pub fn as_str(&self) -> &'static str {
match self {
Self::High => "high",
Self::Medium => "medium",
Self::Low => "low",
}
}
}
impl ::std::fmt::Display for TokensV2MintInformationOrganicScoreLabel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for TokensV2MintInformationOrganicScoreLabel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2MintInformationFirstPool {
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2MintInformationAudit {
#[serde(
rename = "devBalancePercentage",
skip_serializing_if = "Option::is_none"
)]
pub dev_balance_percentage: Option<f64>,
#[serde(rename = "devMints", skip_serializing_if = "Option::is_none")]
pub dev_mints: Option<f64>,
#[serde(
rename = "freezeAuthorityDisabled",
skip_serializing_if = "Option::is_none"
)]
pub freeze_authority_disabled: Option<bool>,
#[serde(rename = "isSus", skip_serializing_if = "Option::is_none")]
pub is_sus: Option<bool>,
#[serde(
rename = "mintAuthorityDisabled",
skip_serializing_if = "Option::is_none"
)]
pub mint_authority_disabled: Option<bool>,
#[serde(
rename = "topHoldersPercentage",
skip_serializing_if = "Option::is_none"
)]
pub top_holders_percentage: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2MintInformationApy {
#[serde(rename = "jupEarn", skip_serializing_if = "Option::is_none")]
pub jup_earn: Option<f64>,
}
pub type GetTokensV1NewResponse = Vec<TokensV1MintWithCreationTimeAndMarkets>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV1MintWithCreationTimeAndMarkets {
pub created_at: chrono::DateTime<chrono::Utc>,
pub decimals: i32,
#[serde(skip_serializing_if = "Option::is_none")]
pub freeze_authority: Option<String>,
pub known_markets: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub logo_uri: Option<String>,
pub metadata_updated_at: chrono::DateTime<chrono::Utc>,
pub mint: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint_authority: Option<String>,
pub name: String,
pub symbol: String,
}
pub type GetTokensV1AllResponse = Vec<TokensV1Mint>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV1Mint {
pub address: String,
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(skip_serializing_if = "Option::is_none")]
pub daily_volume: Option<f64>,
pub decimals: i32,
pub extensions: serde_json::Value,
#[serde(skip_serializing_if = "Option::is_none")]
pub freeze_authority: Option<String>,
#[serde(rename = "logoURI", skip_serializing_if = "Option::is_none")]
pub logo_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint_authority: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub minted_at: Option<chrono::DateTime<chrono::Utc>>,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub permanent_delegate: Option<String>,
pub symbol: String,
pub tags: Vec<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetStudioV1DbcPoolAddressesMintResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<GetStudioV1DbcPoolAddressesMintResponseData>,
#[serde(skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetStudioV1DbcPoolAddressesMintResponseData {
#[serde(rename = "configKey", skip_serializing_if = "Option::is_none")]
pub config_key: Option<String>,
#[serde(rename = "dammv2PoolAddress", skip_serializing_if = "Option::is_none")]
pub dammv2_pool_address: Option<String>,
#[serde(rename = "dbcPoolAddress", skip_serializing_if = "Option::is_none")]
pub dbc_pool_address: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPriceV3Response {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, GetPriceV3ResponseObject>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPriceV3ResponseObject {
#[serde(rename = "blockId", skip_serializing_if = "Option::is_none")]
pub block_id: Option<i64>,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
pub decimals: i64,
pub liquidity: f64,
#[serde(rename = "priceChange24h", skip_serializing_if = "Option::is_none")]
pub price_change24h: Option<f64>,
#[serde(rename = "usdPrice")]
pub usd_price: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1VaultInfoResponse {
pub data: GetPredictionV1VaultInfoResponseData,
pub pubkey: String,
#[serde(rename = "vaultBalance")]
pub vault_balance: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPredictionV1VaultInfoResponseData {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1TradesResponse {
pub data: Vec<GetPredictionV1TradesResponseDataItem>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1TradesResponseDataItem {
pub action: GetPredictionV1TradesResponseAction,
#[serde(rename = "amountUsd")]
pub amount_usd: String,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "eventImageUrl")]
pub event_image_url: String,
#[serde(rename = "eventTitle")]
pub event_title: String,
pub id: String,
#[serde(rename = "isTeamMarket", skip_serializing_if = "Option::is_none")]
pub is_team_market: Option<bool>,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketOptions", skip_serializing_if = "Option::is_none")]
pub market_options: Option<Vec<GetPredictionV1TradesResponseMarketOptionsItem>>,
#[serde(rename = "marketTitle")]
pub market_title: String,
pub message: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
#[serde(rename = "priceUsd")]
pub price_usd: String,
pub side: GetPredictionV1TradesResponseSide,
pub timestamp: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetPredictionV1TradesResponseSide {
#[default]
#[serde(rename = "yes")]
Yes,
#[serde(rename = "no")]
No,
}
impl GetPredictionV1TradesResponseSide {
pub fn as_str(&self) -> &'static str {
match self {
Self::Yes => "yes",
Self::No => "no",
}
}
}
impl ::std::fmt::Display for GetPredictionV1TradesResponseSide {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetPredictionV1TradesResponseSide {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPredictionV1TradesResponseMarketOptionsItem {
#[serde(rename = "buyYes", skip_serializing_if = "Option::is_none")]
pub buy_yes: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetPredictionV1TradesResponseAction {
#[default]
#[serde(rename = "buy")]
Buy,
#[serde(rename = "sell")]
Sell,
}
impl GetPredictionV1TradesResponseAction {
pub fn as_str(&self) -> &'static str {
match self {
Self::Buy => "buy",
Self::Sell => "sell",
}
}
}
impl ::std::fmt::Display for GetPredictionV1TradesResponseAction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetPredictionV1TradesResponseAction {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1ProfilesOwnerPubkeyPnlHistoryResponse {
pub history: Vec<GetPredictionV1ProfilesOwnerPubkeyPnlHistoryResponseHistoryItem>,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1ProfilesOwnerPubkeyPnlHistoryResponseHistoryItem {
#[serde(rename = "realizedPnlUsd")]
pub realized_pnl_usd: String,
pub timestamp: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1PositionsResponse {
pub data: Vec<PredictionPosition>,
pub pagination: GetPredictionV1PositionsResponsePagination,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1PositionsResponsePagination {
pub end: i64,
#[serde(rename = "hasNext")]
pub has_next: bool,
pub start: i64,
pub total: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionPosition {
#[serde(rename = "avgPriceUsd")]
pub avg_price_usd: String,
pub bump: i64,
pub claimable: bool,
#[serde(rename = "claimableAt", skip_serializing_if = "Option::is_none")]
pub claimable_at: Option<i64>,
pub claimed: bool,
#[serde(rename = "claimedUsd")]
pub claimed_usd: String,
pub contracts: String,
#[serde(rename = "contractsDecimal", skip_serializing_if = "Option::is_none")]
pub contracts_decimal: Option<String>,
#[serde(rename = "contractsMicro", skip_serializing_if = "Option::is_none")]
pub contracts_micro: Option<String>,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "eventMetadata")]
pub event_metadata: PredictionEventMetadata,
#[serde(rename = "feesPaidUsd")]
pub fees_paid_usd: String,
#[serde(rename = "isYes")]
pub is_yes: bool,
#[serde(rename = "markPriceUsd", skip_serializing_if = "Option::is_none")]
pub mark_price_usd: Option<String>,
pub market: String,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketIdHash")]
pub market_id_hash: String,
#[serde(rename = "marketMetadata")]
pub market_metadata: serde_json::Value,
#[serde(rename = "maxSlippageBps", skip_serializing_if = "Option::is_none")]
pub max_slippage_bps: Option<i64>,
#[serde(rename = "openOrders")]
pub open_orders: i64,
#[serde(rename = "openedAt")]
pub opened_at: i64,
pub owner: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
#[serde(rename = "payoutUsd")]
pub payout_usd: String,
#[serde(rename = "pnlUsd", skip_serializing_if = "Option::is_none")]
pub pnl_usd: Option<String>,
#[serde(rename = "pnlUsdAfterFees", skip_serializing_if = "Option::is_none")]
pub pnl_usd_after_fees: Option<String>,
#[serde(
rename = "pnlUsdAfterFeesPercent",
skip_serializing_if = "Option::is_none"
)]
pub pnl_usd_after_fees_percent: Option<f64>,
#[serde(rename = "pnlUsdPercent", skip_serializing_if = "Option::is_none")]
pub pnl_usd_percent: Option<f64>,
pub pubkey: String,
#[serde(rename = "realizedPnlUsd")]
pub realized_pnl_usd: f64,
#[serde(rename = "sellPriceUsd", skip_serializing_if = "Option::is_none")]
pub sell_price_usd: Option<String>,
#[serde(rename = "settlementDate", skip_serializing_if = "Option::is_none")]
pub settlement_date: Option<i64>,
#[serde(rename = "sizeUsd")]
pub size_usd: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
#[serde(rename = "totalCostUsd")]
pub total_cost_usd: String,
#[serde(rename = "updatedAt")]
pub updated_at: i64,
#[serde(rename = "valueUsd", skip_serializing_if = "Option::is_none")]
pub value_usd: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1OrdersStatusOrderPubkeyResponse {
#[serde(rename = "externalOrderId")]
pub external_order_id: String,
pub history: Vec<GetPredictionV1OrdersStatusOrderPubkeyResponseHistoryItem>,
#[serde(rename = "latestEventType")]
pub latest_event_type: String,
#[serde(rename = "latestSignature")]
pub latest_signature: String,
#[serde(rename = "orderId")]
pub order_id: String,
#[serde(rename = "orderPubkey")]
pub order_pubkey: String,
pub status: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1OrdersStatusOrderPubkeyResponseHistoryItem {
#[serde(rename = "eventType")]
pub event_type: String,
#[serde(rename = "externalOrderId")]
pub external_order_id: String,
#[serde(rename = "orderId")]
pub order_id: String,
#[serde(rename = "rawStatus")]
pub raw_status: String,
pub signature: String,
pub status: String,
pub timestamp: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1OrdersResponse {
pub data: Vec<PredictionOrder>,
pub pagination: GetPredictionV1OrdersResponsePagination,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1OrdersResponsePagination {
pub end: i64,
#[serde(rename = "hasNext")]
pub has_next: bool,
pub start: i64,
pub total: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionOrder {
#[serde(rename = "avgFillPriceUsd")]
pub avg_fill_price_usd: String,
pub bump: i64,
pub contracts: String,
#[serde(rename = "createdAt")]
pub created_at: i64,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "eventMetadata")]
pub event_metadata: PredictionEventMetadata,
#[serde(rename = "externalOrderId")]
pub external_order_id: String,
#[serde(rename = "filledAt")]
pub filled_at: i64,
#[serde(rename = "filledContracts")]
pub filled_contracts: String,
#[serde(rename = "isBuy")]
pub is_buy: bool,
#[serde(rename = "isYes")]
pub is_yes: bool,
pub market: String,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketIdHash")]
pub market_id_hash: String,
#[serde(rename = "marketMetadata")]
pub market_metadata: serde_json::Value,
#[serde(rename = "maxBuyPriceUsd", skip_serializing_if = "Option::is_none")]
pub max_buy_price_usd: Option<String>,
#[serde(rename = "maxFillPriceUsd")]
pub max_fill_price_usd: String,
#[serde(rename = "minSellPriceUsd", skip_serializing_if = "Option::is_none")]
pub min_sell_price_usd: Option<String>,
#[serde(rename = "orderId")]
pub order_id: String,
pub owner: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
pub position: String,
pub pubkey: String,
pub settled: bool,
#[serde(rename = "sizeUsd")]
pub size_usd: String,
pub status: PredictionOrderStatus,
#[serde(rename = "updatedAt")]
pub updated_at: i64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionOrderStatus {
#[default]
#[serde(rename = "pending")]
Pending,
#[serde(rename = "filled")]
Filled,
#[serde(rename = "failed")]
Failed,
}
impl PredictionOrderStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Pending => "pending",
Self::Filled => "filled",
Self::Failed => "failed",
}
}
}
impl ::std::fmt::Display for PredictionOrderStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionOrderStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponse {
pub data: Vec<GetPredictionV1LeaderboardsResponseDataItem>,
pub summary: GetPredictionV1LeaderboardsResponseSummary,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponseSummary {
pub all_time: GetPredictionV1LeaderboardsResponseAllTime,
pub monthly: GetPredictionV1LeaderboardsResponseMonthly,
pub weekly: GetPredictionV1LeaderboardsResponseWeekly,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponseWeekly {
#[serde(rename = "predictionsCount")]
pub predictions_count: f64,
#[serde(rename = "totalVolumeUsd")]
pub total_volume_usd: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponseMonthly {
#[serde(rename = "predictionsCount")]
pub predictions_count: f64,
#[serde(rename = "totalVolumeUsd")]
pub total_volume_usd: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponseAllTime {
#[serde(rename = "predictionsCount")]
pub predictions_count: f64,
#[serde(rename = "totalVolumeUsd")]
pub total_volume_usd: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1LeaderboardsResponseDataItem {
#[serde(rename = "correctPredictions")]
pub correct_predictions: f64,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
pub period: String,
#[serde(rename = "periodEnd", skip_serializing_if = "Option::is_none")]
pub period_end: Option<String>,
#[serde(rename = "periodStart", skip_serializing_if = "Option::is_none")]
pub period_start: Option<String>,
#[serde(rename = "predictionsCount")]
pub predictions_count: f64,
#[serde(rename = "realizedPnlUsd")]
pub realized_pnl_usd: String,
#[serde(rename = "totalVolumeUsd")]
pub total_volume_usd: String,
#[serde(rename = "winRatePct")]
pub win_rate_pct: String,
#[serde(rename = "wrongPredictions")]
pub wrong_predictions: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1HistoryResponse {
pub data: Vec<PredictionHistoryEvent>,
pub pagination: PredictionPagination,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionHistoryEvent {
#[serde(rename = "avgFillPriceUsd")]
pub avg_fill_price_usd: String,
pub contracts: String,
#[serde(rename = "contractsDecimal", skip_serializing_if = "Option::is_none")]
pub contracts_decimal: Option<String>,
#[serde(rename = "contractsMicro", skip_serializing_if = "Option::is_none")]
pub contracts_micro: Option<String>,
#[serde(rename = "contractsSettled")]
pub contracts_settled: String,
#[serde(
rename = "contractsSettledDecimal",
skip_serializing_if = "Option::is_none"
)]
pub contracts_settled_decimal: Option<String>,
#[serde(
rename = "contractsSettledMicro",
skip_serializing_if = "Option::is_none"
)]
pub contracts_settled_micro: Option<String>,
#[serde(rename = "depositAmountUsd")]
pub deposit_amount_usd: String,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "eventMetadata")]
pub event_metadata: PredictionEventMetadata,
#[serde(rename = "eventType")]
pub event_type: PredictionHistoryEventEventType,
#[serde(rename = "externalOrderId")]
pub external_order_id: String,
#[serde(rename = "feeUsd", skip_serializing_if = "Option::is_none")]
pub fee_usd: Option<String>,
#[serde(rename = "filledContracts")]
pub filled_contracts: String,
#[serde(
rename = "filledContractsDecimal",
skip_serializing_if = "Option::is_none"
)]
pub filled_contracts_decimal: Option<String>,
#[serde(
rename = "filledContractsMicro",
skip_serializing_if = "Option::is_none"
)]
pub filled_contracts_micro: Option<String>,
#[serde(rename = "grossProceedsUsd")]
pub gross_proceeds_usd: String,
pub id: i64,
#[serde(rename = "isBuy")]
pub is_buy: bool,
#[serde(rename = "isYes")]
pub is_yes: bool,
#[serde(rename = "keeperPubkey")]
pub keeper_pubkey: String,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketMetadata")]
pub market_metadata: serde_json::Value,
#[serde(rename = "maxBuyPriceUsd", skip_serializing_if = "Option::is_none")]
pub max_buy_price_usd: Option<String>,
#[serde(rename = "maxFillPriceUsd")]
pub max_fill_price_usd: String,
#[serde(rename = "minSellPriceUsd", skip_serializing_if = "Option::is_none")]
pub min_sell_price_usd: Option<String>,
#[serde(rename = "netProceedsUsd")]
pub net_proceeds_usd: String,
#[serde(rename = "orderId")]
pub order_id: String,
#[serde(rename = "orderPubkey")]
pub order_pubkey: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
#[serde(rename = "payoutAmountUsd")]
pub payout_amount_usd: String,
#[serde(rename = "positionPubkey")]
pub position_pubkey: String,
#[serde(rename = "realizedPnl", skip_serializing_if = "Option::is_none")]
pub realized_pnl: Option<String>,
#[serde(
rename = "realizedPnlBeforeFees",
skip_serializing_if = "Option::is_none"
)]
pub realized_pnl_before_fees: Option<String>,
pub signature: String,
pub slot: String,
pub timestamp: i64,
#[serde(rename = "totalCostUsd")]
pub total_cost_usd: String,
#[serde(
rename = "transferAmountToken",
skip_serializing_if = "Option::is_none"
)]
pub transfer_amount_token: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionMarketMetadata {
#[serde(rename = "closeTime", skip_serializing_if = "Option::is_none")]
pub close_time: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "eventId", skip_serializing_if = "Option::is_none")]
pub event_id: Option<String>,
#[serde(rename = "isTeamMarket", skip_serializing_if = "Option::is_none")]
pub is_team_market: Option<bool>,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketOptions", skip_serializing_if = "Option::is_none")]
pub market_options: Option<Vec<PredictionMarketMetadataMarketOptionsItem>>,
#[serde(rename = "openTime", skip_serializing_if = "Option::is_none")]
pub open_time: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<String>,
#[serde(rename = "rulesPrimary", skip_serializing_if = "Option::is_none")]
pub rules_primary: Option<String>,
#[serde(rename = "rulesSecondary", skip_serializing_if = "Option::is_none")]
pub rules_secondary: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subtitle: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionMarketMetadataMarketOptionsItem {
#[serde(rename = "buyYes", skip_serializing_if = "Option::is_none")]
pub buy_yes: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionHistoryEventEventType {
#[default]
#[serde(rename = "order_created")]
OrderCreated,
#[serde(rename = "order_filled")]
OrderFilled,
#[serde(rename = "order_failed")]
OrderFailed,
#[serde(rename = "order_closed")]
OrderClosed,
#[serde(rename = "payout_claimed")]
PayoutClaimed,
#[serde(rename = "position_updated")]
PositionUpdated,
#[serde(rename = "position_lost")]
PositionLost,
}
impl PredictionHistoryEventEventType {
pub fn as_str(&self) -> &'static str {
match self {
Self::OrderCreated => "order_created",
Self::OrderFilled => "order_filled",
Self::OrderFailed => "order_failed",
Self::OrderClosed => "order_closed",
Self::PayoutClaimed => "payout_claimed",
Self::PositionUpdated => "position_updated",
Self::PositionLost => "position_lost",
}
}
}
impl ::std::fmt::Display for PredictionHistoryEventEventType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionHistoryEventEventType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPredictionV1ForecastResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub forecast_history: Option<Vec<GetPredictionV1ForecastResponseForecastHistoryItem>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPredictionV1ForecastResponseForecastHistoryItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub end_period_ts: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub event_ticker: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub formatted_forecast: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub market_ticker: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub numerical_forecast: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub period_interval: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub raw_numerical_forecast: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1EventsSuggestedPubkeyResponse {
pub data: Vec<PredictionEvent>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1EventsSearchResponse {
pub data: Vec<PredictionEvent>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pagination: Option<PredictionPagination>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1EventsScoresResponse {
pub data: Vec<PredictionGameScore>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionGameScore {
#[serde(rename = "awayTeam", skip_serializing_if = "Option::is_none")]
pub away_team: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub elapsed: Option<String>,
pub ended: bool,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "finishedTimestamp", skip_serializing_if = "Option::is_none")]
pub finished_timestamp: Option<String>,
#[serde(rename = "gameId")]
pub game_id: String,
#[serde(rename = "homeTeam", skip_serializing_if = "Option::is_none")]
pub home_team: Option<String>,
#[serde(rename = "leagueAbbreviation", skip_serializing_if = "Option::is_none")]
pub league_abbreviation: Option<String>,
pub live: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub period: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub score: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "updatedAt")]
pub updated_at: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1EventsResponse {
pub data: Vec<PredictionEvent>,
pub pagination: PredictionPagination,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionEvent {
#[serde(rename = "beginAt", skip_serializing_if = "Option::is_none")]
pub begin_at: Option<String>,
pub category: String,
#[serde(rename = "closeCondition")]
pub close_condition: String,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "isActive")]
pub is_active: bool,
#[serde(rename = "isLive")]
pub is_live: bool,
#[serde(rename = "liveScore", skip_serializing_if = "Option::is_none")]
pub live_score: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub markets: Option<Vec<PredictionMarket>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<PredictionEventMetadata>,
#[serde(rename = "rulesPdf")]
pub rules_pdf: String,
pub subcategory: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub volume24hr: Option<String>,
#[serde(rename = "volumeUsd")]
pub volume_usd: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionEventMetadata {
#[serde(rename = "closeTime", skip_serializing_if = "Option::is_none")]
pub close_time: Option<String>,
#[serde(rename = "eventId")]
pub event_id: String,
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
pub image_url: Option<url::Url>,
#[serde(rename = "isLive", skip_serializing_if = "Option::is_none")]
pub is_live: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub series: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub slug: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subtitle: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1EventsEventIdMarketsResponse {
pub data: Vec<PredictionMarket>,
pub pagination: PredictionPagination,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionPagination {
pub end: i64,
#[serde(rename = "hasNext")]
pub has_next: bool,
pub start: i64,
pub total: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionMarket {
#[serde(rename = "clobTokenIds", skip_serializing_if = "Option::is_none")]
pub clob_token_ids: Option<Vec<String>>,
#[serde(rename = "closeTime")]
pub close_time: f64,
#[serde(rename = "eventId", skip_serializing_if = "Option::is_none")]
pub event_id: Option<String>,
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
pub image_url: Option<url::Url>,
#[serde(rename = "isTeamMarket", skip_serializing_if = "Option::is_none")]
pub is_team_market: Option<bool>,
#[serde(rename = "lifecycleStatus", skip_serializing_if = "Option::is_none")]
pub lifecycle_status: Option<PredictionMarketLifecycleStatus>,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketOptions", skip_serializing_if = "Option::is_none")]
pub market_options: Option<Vec<PredictionMarketMarketOptionsItem>>,
#[serde(rename = "marketPda", skip_serializing_if = "Option::is_none")]
pub market_pda: Option<String>,
#[serde(rename = "marketResultPubkey", skip_serializing_if = "Option::is_none")]
pub market_result_pubkey: Option<String>,
#[serde(rename = "openTime")]
pub open_time: f64,
#[serde(rename = "outcomeMint", skip_serializing_if = "Option::is_none")]
pub outcome_mint: Option<String>,
#[serde(rename = "outcomeSide", skip_serializing_if = "Option::is_none")]
pub outcome_side: Option<String>,
#[serde(
rename = "outcomeTokenProgram",
skip_serializing_if = "Option::is_none"
)]
pub outcome_token_program: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub outcomes: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pricing: Option<PredictionMarketPricing>,
#[serde(skip_serializing_if = "Option::is_none")]
pub provider: Option<PredictionMarketProvider>,
#[serde(rename = "resolveAt", skip_serializing_if = "Option::is_none")]
pub resolve_at: Option<PredictionMarketResolveAt>,
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<PredictionMarketResult>,
#[serde(rename = "rulesPrimary", skip_serializing_if = "Option::is_none")]
pub rules_primary: Option<String>,
#[serde(rename = "rulesSecondary", skip_serializing_if = "Option::is_none")]
pub rules_secondary: Option<String>,
#[serde(rename = "sportsLine", skip_serializing_if = "Option::is_none")]
pub sports_line: Option<f64>,
#[serde(rename = "sportsMarketType", skip_serializing_if = "Option::is_none")]
pub sports_market_type: Option<String>,
pub status: PredictionMarketStatus,
#[serde(skip_serializing_if = "Option::is_none")]
pub team: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tradable: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionMarketStatus {
#[default]
#[serde(rename = "open")]
Open,
#[serde(rename = "closed")]
Closed,
#[serde(rename = "cancelled")]
Cancelled,
}
impl PredictionMarketStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Open => "open",
Self::Closed => "closed",
Self::Cancelled => "cancelled",
}
}
}
impl ::std::fmt::Display for PredictionMarketStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionMarketStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionMarketResult {
#[default]
#[serde(rename = "yes")]
Yes,
#[serde(rename = "no")]
No,
}
impl PredictionMarketResult {
pub fn as_str(&self) -> &'static str {
match self {
Self::Yes => "yes",
Self::No => "no",
}
}
}
impl ::std::fmt::Display for PredictionMarketResult {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionMarketResult {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PredictionMarketResolveAt {
String(String),
Number(f64),
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionMarketProvider {
#[default]
#[serde(rename = "polymarket")]
Polymarket,
#[serde(rename = "gx")]
Gx,
#[serde(rename = "bisonfi")]
Bisonfi,
}
impl PredictionMarketProvider {
pub fn as_str(&self) -> &'static str {
match self {
Self::Polymarket => "polymarket",
Self::Gx => "gx",
Self::Bisonfi => "bisonfi",
}
}
}
impl ::std::fmt::Display for PredictionMarketProvider {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionMarketProvider {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionMarketPricing {
#[serde(rename = "buyNoPriceUsd", skip_serializing_if = "Option::is_none")]
pub buy_no_price_usd: Option<f64>,
#[serde(rename = "buyYesPriceUsd", skip_serializing_if = "Option::is_none")]
pub buy_yes_price_usd: Option<f64>,
#[serde(rename = "sellNoPriceUsd", skip_serializing_if = "Option::is_none")]
pub sell_no_price_usd: Option<f64>,
#[serde(rename = "sellYesPriceUsd", skip_serializing_if = "Option::is_none")]
pub sell_yes_price_usd: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub volume: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionMarketMarketOptionsItem {
#[serde(rename = "buyYes", skip_serializing_if = "Option::is_none")]
pub buy_yes: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PredictionMarketLifecycleStatus {
#[default]
#[serde(rename = "open")]
Open,
#[serde(rename = "resolving")]
Resolving,
#[serde(rename = "settled")]
Settled,
}
impl PredictionMarketLifecycleStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Open => "open",
Self::Resolving => "resolving",
Self::Settled => "settled",
}
}
}
impl ::std::fmt::Display for PredictionMarketLifecycleStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PredictionMarketLifecycleStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1StakedJupAddressResponse {
#[serde(rename = "stakedAmount", skip_serializing_if = "Option::is_none")]
pub staked_amount: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unstaking: Option<Vec<GetPortfolioV1StakedJupAddressResponseUnstakingItem>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1StakedJupAddressResponseUnstakingItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub until: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1PositionsAddressResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub elements: Option<Vec<PortfolioPortfolioElement>>,
#[serde(rename = "fetcherReports", skip_serializing_if = "Option::is_none")]
pub fetcher_reports: Option<Vec<PortfolioFetcherReport>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<String>,
#[serde(rename = "tokenInfo", skip_serializing_if = "Option::is_none")]
pub token_info: Option<GetPortfolioV1PositionsAddressResponseTokenInfo>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1PositionsAddressResponseTokenInfo {
#[serde(skip_serializing_if = "Option::is_none")]
pub solana: Option<GetPortfolioV1PositionsAddressResponseSolana>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1PositionsAddressResponseSolana {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, PortfolioTokenInfo>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioTokenInfo {
pub address: String,
pub decimals: f64,
#[serde(rename = "logoURI", skip_serializing_if = "Option::is_none")]
pub logo_uri: Option<String>,
pub name: String,
pub symbol: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(tag = "type")]
pub enum PortfolioPortfolioElement {
#[serde(rename = "multiple")]
PortfolioPortfolioElementMultiple(PortfolioPortfolioElementMultiple),
#[serde(rename = "liquidity")]
PortfolioPortfolioElementLiquidity(PortfolioPortfolioElementLiquidity),
#[serde(rename = "leverage")]
PortfolioPortfolioElementLeverage(PortfolioPortfolioElementLeverage),
#[serde(rename = "borrowlend")]
PortfolioPortfolioElementBorrowLend(PortfolioPortfolioElementBorrowLend),
#[serde(rename = "trade")]
PortfolioPortfolioElementTrade(PortfolioPortfolioElementTrade),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementTrade {
pub data: PortfolioPortfolioElementTradeData,
pub label: PortfolioPortfolioElementLabel,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netApy", skip_serializing_if = "Option::is_none")]
pub net_apy: Option<PortfolioNetApy>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(rename = "platformId")]
pub platform_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementTradeType {
#[default]
#[serde(rename = "trade")]
Trade,
}
impl PortfolioPortfolioElementTradeType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Trade => "trade",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementTradeType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementTradeType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementTradeData {
pub assets: PortfolioPortfolioElementTradeAssets,
#[serde(skip_serializing_if = "Option::is_none")]
pub contract: Option<String>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(
rename = "expectedOutputAmount",
skip_serializing_if = "Option::is_none"
)]
pub expected_output_amount: Option<f64>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<f64>,
#[serde(rename = "filledPercentage")]
pub filled_percentage: f64,
#[serde(rename = "initialInputAmount")]
pub initial_input_amount: f64,
#[serde(rename = "inputAddress")]
pub input_address: String,
#[serde(rename = "inputPrice")]
pub input_price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(rename = "outputAddress")]
pub output_address: String,
#[serde(rename = "outputPrice")]
pub output_price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub recurring: Option<PortfolioPortfolioElementTradeRecurring>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
#[serde(rename = "withdrawnOutputAmount")]
pub withdrawn_output_amount: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementTradeRecurring {
pub cycles: f64,
pub interval: f64,
#[serde(rename = "priceRange", skip_serializing_if = "Option::is_none")]
pub price_range: Option<PortfolioPortfolioElementTradePriceRange>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PortfolioPortfolioElementTradePriceRange {
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub min: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementTradeAssets {
#[serde(skip_serializing_if = "Option::is_none")]
pub input: Option<PortfolioPortfolioAsset>,
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<PortfolioPortfolioAsset>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementMultiple {
pub data: PortfolioPortfolioElementMultipleData,
pub label: PortfolioPortfolioElementLabel,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netApy", skip_serializing_if = "Option::is_none")]
pub net_apy: Option<PortfolioNetApy>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(rename = "platformId")]
pub platform_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementMultipleType {
#[default]
#[serde(rename = "multiple")]
Multiple,
}
impl PortfolioPortfolioElementMultipleType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Multiple => "multiple",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementMultipleType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementMultipleType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementMultipleData {
pub assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "assetsYields", skip_serializing_if = "Option::is_none")]
pub assets_yields: Option<Vec<Vec<PortfolioYield>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLiquidity {
pub data: PortfolioPortfolioElementLiquidityData,
pub label: PortfolioPortfolioElementLabel,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netApy", skip_serializing_if = "Option::is_none")]
pub net_apy: Option<PortfolioNetApy>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(rename = "platformId")]
pub platform_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementLiquidityType {
#[default]
#[serde(rename = "liquidity")]
Liquidity,
}
impl PortfolioPortfolioElementLiquidityType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Liquidity => "liquidity",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementLiquidityType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementLiquidityType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLiquidityData {
pub liquidities: Vec<PortfolioPortfolioLiquidity>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioLiquidity {
pub assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "assetsValue")]
pub assets_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub contract: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lp: Option<PortfolioLiquidityLp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "rewardAssets")]
pub reward_assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "rewardAssetsValue")]
pub reward_assets_value: f64,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
pub value: f64,
pub yields: Vec<PortfolioYield>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioLiquidityLp {
pub amount: f64,
pub mint: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLeverage {
pub data: PortfolioPortfolioElementLeverageData,
pub label: PortfolioPortfolioElementLabel,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netApy", skip_serializing_if = "Option::is_none")]
pub net_apy: Option<PortfolioNetApy>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(rename = "platformId")]
pub platform_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementLeverageType {
#[default]
#[serde(rename = "leverage")]
Leverage,
}
impl PortfolioPortfolioElementLeverageType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Leverage => "leverage",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementLeverageType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementLeverageType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLeverageData {
#[serde(skip_serializing_if = "Option::is_none")]
pub contract: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cross: Option<PortfolioPortfolioElementLeverageCross>,
#[serde(skip_serializing_if = "Option::is_none")]
pub isolated: Option<PortfolioPortfolioElementLeverageIsolated>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLeverageIsolated {
pub positions: Vec<PortfolioIsoLevPosition>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementLeverageCross {
#[serde(rename = "collateralAssets", skip_serializing_if = "Option::is_none")]
pub collateral_assets: Option<Vec<PortfolioPortfolioAsset>>,
#[serde(rename = "collateralValue")]
pub collateral_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub leverage: Option<f64>,
pub positions: Vec<PortfolioCrossLevPosition>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioIsoLevPosition {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(rename = "collateralValue")]
pub collateral_value: f64,
#[serde(rename = "entryPrice")]
pub entry_price: f64,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub leverage: Option<f64>,
#[serde(rename = "liquidationPrice")]
pub liquidation_price: f64,
#[serde(rename = "markPrice")]
pub mark_price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "pnlValue")]
pub pnl_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
pub side: PortfolioIsoLevPositionSide,
pub size: f64,
#[serde(rename = "sizeValue")]
pub size_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub sl: Option<f64>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tp: Option<f64>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioIsoLevPositionSide {
#[default]
#[serde(rename = "long")]
Long,
#[serde(rename = "short")]
Short,
}
impl PortfolioIsoLevPositionSide {
pub fn as_str(&self) -> &'static str {
match self {
Self::Long => "long",
Self::Short => "short",
}
}
}
impl ::std::fmt::Display for PortfolioIsoLevPositionSide {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioIsoLevPositionSide {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioCrossLevPosition {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(rename = "entryPrice")]
pub entry_price: f64,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub leverage: Option<f64>,
#[serde(rename = "liquidationPrice")]
pub liquidation_price: f64,
#[serde(rename = "markPrice")]
pub mark_price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "pnlValue")]
pub pnl_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<String>,
pub side: PortfolioCrossLevPositionSide,
pub size: f64,
#[serde(rename = "sizeValue")]
pub size_value: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub sl: Option<f64>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tp: Option<f64>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioCrossLevPositionSide {
#[default]
#[serde(rename = "long")]
Long,
#[serde(rename = "short")]
Short,
}
impl PortfolioCrossLevPositionSide {
pub fn as_str(&self) -> &'static str {
match self {
Self::Long => "long",
Self::Short => "short",
}
}
}
impl ::std::fmt::Display for PortfolioCrossLevPositionSide {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioCrossLevPositionSide {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementBorrowLend {
pub data: PortfolioPortfolioElementBorrowLendData,
pub label: PortfolioPortfolioElementLabel,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "netApy", skip_serializing_if = "Option::is_none")]
pub net_apy: Option<PortfolioNetApy>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(rename = "platformId")]
pub platform_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementLabel {
#[default]
#[serde(rename = "Wallet")]
Wallet,
#[serde(rename = "Staked")]
Staked,
#[serde(rename = "LiquidityPool")]
LiquidityPool,
#[serde(rename = "Farming")]
Farming,
#[serde(rename = "Vault")]
Vault,
#[serde(rename = "Lending")]
Lending,
#[serde(rename = "Vesting")]
Vesting,
#[serde(rename = "Deposit")]
Deposit,
#[serde(rename = "Rewards")]
Rewards,
#[serde(rename = "Airdrop")]
Airdrop,
#[serde(rename = "Margin")]
Margin,
#[serde(rename = "LimitOrder")]
LimitOrder,
#[serde(rename = "DCA")]
Dca,
#[serde(rename = "SmartDCA")]
SmartDca,
#[serde(rename = "Leverage")]
Leverage,
}
impl PortfolioPortfolioElementLabel {
pub fn as_str(&self) -> &'static str {
match self {
Self::Wallet => "Wallet",
Self::Staked => "Staked",
Self::LiquidityPool => "LiquidityPool",
Self::Farming => "Farming",
Self::Vault => "Vault",
Self::Lending => "Lending",
Self::Vesting => "Vesting",
Self::Deposit => "Deposit",
Self::Rewards => "Rewards",
Self::Airdrop => "Airdrop",
Self::Margin => "Margin",
Self::LimitOrder => "LimitOrder",
Self::Dca => "DCA",
Self::SmartDca => "SmartDCA",
Self::Leverage => "Leverage",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementLabel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementLabel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioElementBorrowLendType {
#[default]
#[serde(rename = "borrowlend")]
Borrowlend,
}
impl PortfolioPortfolioElementBorrowLendType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Borrowlend => "borrowlend",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioElementBorrowLendType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioElementBorrowLendType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementBorrowLendData {
#[serde(rename = "borrowedAssets")]
pub borrowed_assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "borrowedValue")]
pub borrowed_value: f64,
#[serde(rename = "borrowedYields")]
pub borrowed_yields: Vec<Vec<PortfolioYield>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub contract: Option<String>,
#[serde(rename = "expireOn", skip_serializing_if = "Option::is_none")]
pub expire_on: Option<f64>,
#[serde(rename = "healthRatio", skip_serializing_if = "Option::is_none")]
pub health_ratio: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "rewardAssets")]
pub reward_assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "rewardValue")]
pub reward_value: f64,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
#[serde(rename = "suppliedAssets")]
pub supplied_assets: Vec<PortfolioPortfolioAsset>,
#[serde(rename = "suppliedValue")]
pub supplied_value: f64,
#[serde(rename = "suppliedYields")]
pub supplied_yields: Vec<Vec<PortfolioYield>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unsettled: Option<PortfolioPortfolioElementBorrowLendUnsettled>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioElementBorrowLendUnsettled {
pub assets: Vec<PortfolioPortfolioAssetGeneric>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(tag = "type")]
pub enum PortfolioPortfolioAsset {
#[serde(rename = "generic")]
PortfolioPortfolioAssetGeneric(PortfolioPortfolioAssetGeneric),
#[serde(rename = "token")]
PortfolioPortfolioAssetToken(PortfolioPortfolioAssetToken),
#[serde(rename = "collectible")]
PortfolioPortfolioAssetCollectible(PortfolioPortfolioAssetCollectible),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetToken {
pub attributes: PortfolioPortfolioAssetAttributes,
pub data: PortfolioPortfolioAssetTokenData,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioAssetTokenType {
#[default]
#[serde(rename = "token")]
Token,
}
impl PortfolioPortfolioAssetTokenType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Token => "token",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioAssetTokenType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioAssetTokenType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetTokenData {
pub address: String,
pub amount: f64,
pub price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub yields: Option<Vec<PortfolioYield>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetGeneric {
pub attributes: PortfolioPortfolioAssetAttributes,
pub data: PortfolioPortfolioAssetGenericData,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
pub value: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioAssetGenericType {
#[default]
#[serde(rename = "generic")]
Generic,
}
impl PortfolioPortfolioAssetGenericType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Generic => "generic",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioAssetGenericType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioAssetGenericType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PortfolioPortfolioAssetGenericData {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub price: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetCollectible {
pub attributes: PortfolioPortfolioAssetAttributes,
pub data: PortfolioPortfolioAssetCollectibleData,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "networkId")]
pub network_id: PortfolioNetworkId,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<PortfolioRef>,
#[serde(rename = "sourceRefs", skip_serializing_if = "Option::is_none")]
pub source_refs: Option<Vec<PortfolioSourceRef>>,
pub value: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioSourceRef {
pub address: String,
pub name: PortfolioSourceRefName,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioSourceRefName {
#[default]
#[serde(rename = "Pool")]
Pool,
#[serde(rename = "Farm")]
Farm,
#[serde(rename = "Market")]
Market,
#[serde(rename = "Vault")]
Vault,
#[serde(rename = "Lending Market")]
LendingMarket,
#[serde(rename = "Strategy")]
Strategy,
#[serde(rename = "NFT Mint")]
NftMint,
#[serde(rename = "Reserve")]
Reserve,
#[serde(rename = "Proposal")]
Proposal,
#[serde(rename = "Distributor")]
Distributor,
#[serde(rename = "Locker")]
Locker,
#[serde(rename = "Custody")]
Custody,
#[serde(rename = "Pair")]
Pair,
#[serde(rename = "Borrow Token")]
BorrowToken,
#[serde(rename = "Collateral Token")]
CollateralToken,
#[serde(rename = "Elevation Group")]
ElevationGroup,
#[serde(rename = "Program")]
Program,
#[serde(rename = "Validator")]
Validator,
}
impl PortfolioSourceRefName {
pub fn as_str(&self) -> &'static str {
match self {
Self::Pool => "Pool",
Self::Farm => "Farm",
Self::Market => "Market",
Self::Vault => "Vault",
Self::LendingMarket => "Lending Market",
Self::Strategy => "Strategy",
Self::NftMint => "NFT Mint",
Self::Reserve => "Reserve",
Self::Proposal => "Proposal",
Self::Distributor => "Distributor",
Self::Locker => "Locker",
Self::Custody => "Custody",
Self::Pair => "Pair",
Self::BorrowToken => "Borrow Token",
Self::CollateralToken => "Collateral Token",
Self::ElevationGroup => "Elevation Group",
Self::Program => "Program",
Self::Validator => "Validator",
}
}
}
impl ::std::fmt::Display for PortfolioSourceRefName {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioSourceRefName {
fn as_ref(&self) -> &str {
self.as_str()
}
}
pub type PortfolioRef = String;
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioPortfolioAssetCollectibleType {
#[default]
#[serde(rename = "collectible")]
Collectible,
}
impl PortfolioPortfolioAssetCollectibleType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Collectible => "collectible",
}
}
}
impl ::std::fmt::Display for PortfolioPortfolioAssetCollectibleType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioPortfolioAssetCollectibleType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetCollectibleData {
pub address: String,
pub amount: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<Vec<PortfolioCollectibleAttribute>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub collection: Option<PortfolioCollectibleCollection>,
#[serde(rename = "dataUri", skip_serializing_if = "Option::is_none")]
pub data_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub price: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PortfolioPortfolioAssetAttributes {
#[serde(rename = "isClaimable", skip_serializing_if = "Option::is_none")]
pub is_claimable: Option<bool>,
#[serde(rename = "isDeprecated", skip_serializing_if = "Option::is_none")]
pub is_deprecated: Option<bool>,
#[serde(rename = "lockedUntil", skip_serializing_if = "Option::is_none")]
pub locked_until: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prediction: Option<PortfolioPortfolioAssetAttributesPrediction>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<PortfolioTags>,
#[serde(skip_serializing_if = "Option::is_none")]
pub validator: Option<PortfolioPortfolioAssetAttributesValidator>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetAttributesValidator {
pub address: String,
#[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
pub image_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub yields: Vec<PortfolioYield>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PortfolioYield {
#[serde(skip_serializing_if = "Option::is_none")]
pub apr: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub apy: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
pub type PortfolioTags = Vec<String>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetAttributesPrediction {
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
#[serde(rename = "feesPaidValue", skip_serializing_if = "Option::is_none")]
pub fees_paid_value: Option<f64>,
pub market: PortfolioPortfolioAssetAttributesMarket,
#[serde(
rename = "pnlAfterFeesPercent",
skip_serializing_if = "Option::is_none"
)]
pub pnl_after_fees_percent: Option<f64>,
#[serde(rename = "pnlAfterFeesValue", skip_serializing_if = "Option::is_none")]
pub pnl_after_fees_value: Option<f64>,
#[serde(rename = "pnlPercent", skip_serializing_if = "Option::is_none")]
pub pnl_percent: Option<f64>,
#[serde(rename = "pnlValue", skip_serializing_if = "Option::is_none")]
pub pnl_value: Option<f64>,
#[serde(rename = "sideName")]
pub side_name: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioPortfolioAssetAttributesMarket {
#[serde(rename = "closeTime", skip_serializing_if = "Option::is_none")]
pub close_time: Option<f64>,
#[serde(rename = "eventTitle", skip_serializing_if = "Option::is_none")]
pub event_title: Option<String>,
#[serde(rename = "marketTitle")]
pub market_title: String,
#[serde(rename = "resolveAt", skip_serializing_if = "Option::is_none")]
pub resolve_at: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioCollectibleCollection {
#[serde(rename = "floorPrice")]
pub floor_price: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PortfolioCollectibleAttribute {
#[serde(skip_serializing_if = "Option::is_none")]
pub trait_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<serde_json::Value>,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioNetworkId {
#[default]
#[serde(rename = "solana")]
Solana,
}
impl PortfolioNetworkId {
pub fn as_str(&self) -> &'static str {
match self {
Self::Solana => "solana",
}
}
}
impl ::std::fmt::Display for PortfolioNetworkId {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioNetworkId {
fn as_ref(&self) -> &str {
self.as_str()
}
}
pub type PortfolioNetApy = f64;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PortfolioFetcherReport {
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
pub id: String,
pub status: PortfolioFetcherReportStatus,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum PortfolioFetcherReportStatus {
#[default]
#[serde(rename = "succeeded")]
Succeeded,
#[serde(rename = "failed")]
Failed,
}
impl PortfolioFetcherReportStatus {
pub fn as_str(&self) -> &'static str {
match self {
Self::Succeeded => "succeeded",
Self::Failed => "failed",
}
}
}
impl ::std::fmt::Display for PortfolioFetcherReportStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for PortfolioFetcherReportStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
pub type GetPortfolioV1PlatformsResponse = Vec<GetPortfolioV1PlatformsResponseItem>;
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1PlatformsResponseItem {
#[serde(rename = "defiLlamaId", skip_serializing_if = "Option::is_none")]
pub defi_llama_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "isDeprecated", skip_serializing_if = "Option::is_none")]
pub is_deprecated: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<GetPortfolioV1PlatformsResponseLinks>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tokens: Option<Vec<String>>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetPortfolioV1PlatformsResponseLinks {
#[serde(skip_serializing_if = "Option::is_none")]
pub discord: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub documentation: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub github: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub medium: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub telegram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub twitter: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetOrderResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")]
pub error_code: Option<f64>,
#[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<String>,
#[serde(rename = "feeBps", skip_serializing_if = "Option::is_none")]
pub fee_bps: Option<f64>,
#[serde(rename = "feeMint", skip_serializing_if = "Option::is_none")]
pub fee_mint: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gasless: Option<bool>,
#[serde(rename = "inAmount", skip_serializing_if = "Option::is_none")]
pub in_amount: Option<String>,
#[serde(rename = "inUsdValue", skip_serializing_if = "Option::is_none")]
pub in_usd_value: Option<f64>,
#[serde(rename = "inputMint", skip_serializing_if = "Option::is_none")]
pub input_mint: Option<String>,
#[serde(
rename = "lastValidBlockHeight",
skip_serializing_if = "Option::is_none"
)]
pub last_valid_block_height: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub maker: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(
rename = "otherAmountThreshold",
skip_serializing_if = "Option::is_none"
)]
pub other_amount_threshold: Option<String>,
#[serde(rename = "outAmount", skip_serializing_if = "Option::is_none")]
pub out_amount: Option<String>,
#[serde(rename = "outUsdValue", skip_serializing_if = "Option::is_none")]
pub out_usd_value: Option<f64>,
#[serde(rename = "outputMint", skip_serializing_if = "Option::is_none")]
pub output_mint: Option<String>,
#[serde(rename = "platformFee", skip_serializing_if = "Option::is_none")]
pub platform_fee: Option<SwapV2PlatformFee>,
#[serde(rename = "priceImpact", skip_serializing_if = "Option::is_none")]
pub price_impact: Option<f64>,
#[serde(rename = "priceImpactPct", skip_serializing_if = "Option::is_none")]
pub price_impact_pct: Option<String>,
#[serde(
rename = "prioritizationFeeLamports",
skip_serializing_if = "Option::is_none"
)]
pub prioritization_fee_lamports: Option<f64>,
#[serde(
rename = "prioritizationFeePayer",
skip_serializing_if = "Option::is_none"
)]
pub prioritization_fee_payer: Option<String>,
#[serde(rename = "quoteId", skip_serializing_if = "Option::is_none")]
pub quote_id: Option<String>,
#[serde(rename = "referralAccount", skip_serializing_if = "Option::is_none")]
pub referral_account: Option<String>,
#[serde(rename = "rentFeeLamports", skip_serializing_if = "Option::is_none")]
pub rent_fee_lamports: Option<f64>,
#[serde(rename = "rentFeePayer", skip_serializing_if = "Option::is_none")]
pub rent_fee_payer: Option<String>,
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
#[serde(rename = "routePlan", skip_serializing_if = "Option::is_none")]
pub route_plan: Option<Vec<SwapV2RoutePlanStep>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub router: Option<GetOrderResponseRouter>,
#[serde(
rename = "signatureFeeLamports",
skip_serializing_if = "Option::is_none"
)]
pub signature_fee_lamports: Option<f64>,
#[serde(rename = "signatureFeePayer", skip_serializing_if = "Option::is_none")]
pub signature_fee_payer: Option<String>,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<f64>,
#[serde(rename = "swapMode", skip_serializing_if = "Option::is_none")]
pub swap_mode: Option<String>,
#[serde(rename = "swapType", skip_serializing_if = "Option::is_none")]
pub swap_type: Option<GetOrderResponseSwapType>,
#[serde(rename = "swapUsdValue", skip_serializing_if = "Option::is_none")]
pub swap_usd_value: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub taker: Option<String>,
#[serde(rename = "totalTime", skip_serializing_if = "Option::is_none")]
pub total_time: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct SwapV2PlatformFee {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
#[serde(rename = "feeBps", skip_serializing_if = "Option::is_none")]
pub fee_bps: Option<f64>,
#[serde(rename = "feeMint", skip_serializing_if = "Option::is_none")]
pub fee_mint: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetOrderResponseSwapType {
#[default]
#[serde(rename = "aggregator")]
Aggregator,
#[serde(rename = "rfq")]
Rfq,
#[serde(rename = "aggregator+rfq")]
AggregatorRfq,
#[serde(rename = "dflow")]
Dflow,
#[serde(rename = "okx")]
Okx,
}
impl GetOrderResponseSwapType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Aggregator => "aggregator",
Self::Rfq => "rfq",
Self::AggregatorRfq => "aggregator+rfq",
Self::Dflow => "dflow",
Self::Okx => "okx",
}
}
}
impl ::std::fmt::Display for GetOrderResponseSwapType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetOrderResponseSwapType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetOrderResponseRouter {
#[default]
#[serde(rename = "metis")]
Metis,
#[serde(rename = "jupiterz")]
Jupiterz,
#[serde(rename = "dflow")]
Dflow,
#[serde(rename = "okx")]
Okx,
}
impl GetOrderResponseRouter {
pub fn as_str(&self) -> &'static str {
match self {
Self::Metis => "metis",
Self::Jupiterz => "jupiterz",
Self::Dflow => "dflow",
Self::Okx => "okx",
}
}
}
impl ::std::fmt::Display for GetOrderResponseRouter {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetOrderResponseRouter {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetBuildResponse {
#[serde(
rename = "addressesByLookupTableAddress",
skip_serializing_if = "Option::is_none"
)]
pub addresses_by_lookup_table_address: Option<GetBuildResponseAddressesByLookupTableAddress>,
#[serde(
rename = "blockhashWithMetadata",
skip_serializing_if = "Option::is_none"
)]
pub blockhash_with_metadata: Option<GetBuildResponseBlockhashWithMetadata>,
#[serde(rename = "cleanupInstruction", skip_serializing_if = "Option::is_none")]
pub cleanup_instruction: Option<SwapV2Instruction>,
#[serde(
rename = "computeBudgetInstructions",
skip_serializing_if = "Option::is_none"
)]
pub compute_budget_instructions: Option<Vec<SwapV2Instruction>>,
#[serde(rename = "inAmount", skip_serializing_if = "Option::is_none")]
pub in_amount: Option<String>,
#[serde(rename = "inputMint", skip_serializing_if = "Option::is_none")]
pub input_mint: Option<String>,
#[serde(
rename = "otherAmountThreshold",
skip_serializing_if = "Option::is_none"
)]
pub other_amount_threshold: Option<String>,
#[serde(rename = "otherInstructions", skip_serializing_if = "Option::is_none")]
pub other_instructions: Option<Vec<SwapV2Instruction>>,
#[serde(rename = "outAmount", skip_serializing_if = "Option::is_none")]
pub out_amount: Option<String>,
#[serde(rename = "outputMint", skip_serializing_if = "Option::is_none")]
pub output_mint: Option<String>,
#[serde(rename = "routePlan", skip_serializing_if = "Option::is_none")]
pub route_plan: Option<Vec<SwapV2RoutePlanStep>>,
#[serde(rename = "setupInstructions", skip_serializing_if = "Option::is_none")]
pub setup_instructions: Option<Vec<SwapV2Instruction>>,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<f64>,
#[serde(rename = "swapInstruction", skip_serializing_if = "Option::is_none")]
pub swap_instruction: Option<SwapV2Instruction>,
#[serde(rename = "swapMode", skip_serializing_if = "Option::is_none")]
pub swap_mode: Option<String>,
#[serde(rename = "tipInstruction", skip_serializing_if = "Option::is_none")]
pub tip_instruction: Option<SwapV2Instruction>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV2RoutePlanStep {
pub bps: f64,
pub percent: f64,
#[serde(rename = "swapInfo")]
pub swap_info: SwapV2SwapInfo,
#[serde(rename = "usdValue", skip_serializing_if = "Option::is_none")]
pub usd_value: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV2SwapInfo {
#[serde(rename = "ammKey")]
pub amm_key: String,
#[serde(rename = "inAmount")]
pub in_amount: String,
#[serde(rename = "inputMint")]
pub input_mint: String,
pub label: String,
#[serde(rename = "outAmount")]
pub out_amount: String,
#[serde(rename = "outputMint")]
pub output_mint: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV2Instruction {
pub accounts: Vec<SwapV2InstructionAccountsItem>,
pub data: String,
#[serde(rename = "programId")]
pub program_id: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV2InstructionAccountsItem {
#[serde(rename = "isSigner")]
pub is_signer: bool,
#[serde(rename = "isWritable")]
pub is_writable: bool,
pub pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetBuildResponseBlockhashWithMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub blockhash: Option<Vec<f64>>,
#[serde(rename = "fetchedAt", skip_serializing_if = "Option::is_none")]
pub fetched_at: Option<String>,
#[serde(
rename = "lastValidBlockHeight",
skip_serializing_if = "Option::is_none"
)]
pub last_valid_block_height: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetBuildResponseAddressesByLookupTableAddress {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, Vec<String>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct DeletePredictionV1PositionsResponse {
pub data: Vec<DeletePredictionV1PositionsResponseDataItemUnion>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum DeletePredictionV1PositionsResponseDataItemUnion {
PredictionCreateOrderResponse(PredictionCreateOrderResponse),
PredictionClaimPositionResponse(PredictionClaimPositionResponse),
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionCreateOrderResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub execution: Option<PredictionExecution>,
#[serde(rename = "executionModel", skip_serializing_if = "Option::is_none")]
pub execution_model: Option<String>,
#[serde(rename = "externalOrderId", skip_serializing_if = "Option::is_none")]
pub external_order_id: Option<String>,
#[serde(
rename = "jupiterSwapRequestId",
skip_serializing_if = "Option::is_none"
)]
pub jupiter_swap_request_id: Option<String>,
pub order: PredictionCreateOrderResponseOrder,
#[serde(rename = "requiredSigners", skip_serializing_if = "Option::is_none")]
pub required_signers: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub settlement: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction: Option<String>,
#[serde(rename = "txMeta", skip_serializing_if = "Option::is_none")]
pub tx_meta: Option<PredictionCreateOrderResponseTxMeta>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionCreateOrderResponseTxMeta {
pub blockhash: String,
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionCreateOrderResponseOrder {
pub contracts: String,
#[serde(rename = "contractsDecimal", skip_serializing_if = "Option::is_none")]
pub contracts_decimal: Option<String>,
#[serde(rename = "contractsMicro", skip_serializing_if = "Option::is_none")]
pub contracts_micro: Option<String>,
#[serde(rename = "estimatedProtocolFeeUsd")]
pub estimated_protocol_fee_usd: String,
#[serde(rename = "estimatedTotalFeeUsd")]
pub estimated_total_fee_usd: String,
#[serde(rename = "estimatedVenueFeeUsd")]
pub estimated_venue_fee_usd: String,
#[serde(rename = "externalOrderId", skip_serializing_if = "Option::is_none")]
pub external_order_id: Option<String>,
#[serde(rename = "isBuy")]
pub is_buy: bool,
#[serde(rename = "isYes")]
pub is_yes: bool,
#[serde(rename = "marketId")]
pub market_id: String,
#[serde(rename = "marketIdHash")]
pub market_id_hash: String,
#[serde(rename = "maxBuyPriceUsd", skip_serializing_if = "Option::is_none")]
pub max_buy_price_usd: Option<String>,
#[serde(rename = "maxSlippageBps", skip_serializing_if = "Option::is_none")]
pub max_slippage_bps: Option<i64>,
#[serde(rename = "minSellPriceUsd", skip_serializing_if = "Option::is_none")]
pub min_sell_price_usd: Option<String>,
#[serde(rename = "newAvgPriceUsd")]
pub new_avg_price_usd: String,
#[serde(rename = "newContracts")]
pub new_contracts: String,
#[serde(
rename = "newContractsDecimal",
skip_serializing_if = "Option::is_none"
)]
pub new_contracts_decimal: Option<String>,
#[serde(rename = "newContractsMicro", skip_serializing_if = "Option::is_none")]
pub new_contracts_micro: Option<String>,
#[serde(rename = "newPayoutUsd")]
pub new_payout_usd: String,
#[serde(rename = "newSizeUsd")]
pub new_size_usd: String,
#[serde(rename = "orderAtaPubkey", skip_serializing_if = "Option::is_none")]
pub order_ata_pubkey: Option<String>,
#[serde(rename = "orderCostUsd")]
pub order_cost_usd: String,
#[serde(rename = "orderPubkey", skip_serializing_if = "Option::is_none")]
pub order_pubkey: Option<String>,
#[serde(rename = "payoutUsd", skip_serializing_if = "Option::is_none")]
pub payout_usd: Option<String>,
#[serde(rename = "positionPubkey")]
pub position_pubkey: String,
#[serde(rename = "slippageBps", skip_serializing_if = "Option::is_none")]
pub slippage_bps: Option<i64>,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionExecution {
pub context: PredictionExecutionContext,
pub endpoint: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionExecutionContext {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionClaimPositionResponse {
pub position: PredictionClaimPositionResponsePosition,
pub transaction: String,
#[serde(rename = "txMeta")]
pub tx_meta: PredictionClaimPositionResponseTxMeta,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionClaimPositionResponseTxMeta {
pub blockhash: String,
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: i64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionClaimPositionResponsePosition {
pub contracts: String,
#[serde(rename = "contractsDecimal", skip_serializing_if = "Option::is_none")]
pub contracts_decimal: Option<String>,
#[serde(rename = "contractsMicro", skip_serializing_if = "Option::is_none")]
pub contracts_micro: Option<String>,
#[serde(rename = "isYes")]
pub is_yes: bool,
#[serde(rename = "marketPubkey")]
pub market_pubkey: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
#[serde(rename = "payoutAmountUsd")]
pub payout_amount_usd: String,
#[serde(rename = "positionPubkey")]
pub position_pubkey: String,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct ArrayItemItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub severity: Option<GetUltraV1ShieldResponseSeverity>,
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<GetUltraV1ShieldResponseSource>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<GetUltraV1ShieldResponseType>,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1ShieldResponseType {
#[default]
#[serde(rename = "NOT_VERIFIED")]
NotVerified,
#[serde(rename = "LOW_LIQUIDITY")]
LowLiquidity,
#[serde(rename = "NOT_SELLABLE")]
NotSellable,
#[serde(rename = "LOW_ORGANIC_ACTIVITY")]
LowOrganicActivity,
#[serde(rename = "HAS_MINT_AUTHORITY")]
HasMintAuthority,
#[serde(rename = "HAS_FREEZE_AUTHORITY")]
HasFreezeAuthority,
#[serde(rename = "HAS_PERMANENT_DELEGATE")]
HasPermanentDelegate,
#[serde(rename = "NEW_LISTING")]
NewListing,
#[serde(rename = "VERY_LOW_TRADING_ACTIVITY")]
VeryLowTradingActivity,
#[serde(rename = "HIGH_SUPPLY_CONCENTRATION")]
HighSupplyConcentration,
#[serde(rename = "NON_TRANSFERABLE")]
NonTransferable,
#[serde(rename = "MUTABLE_TRANSFER_FEES")]
MutableTransferFees,
#[serde(rename = "SUSPICIOUS_DEV_ACTIVITY")]
SuspiciousDevActivity,
#[serde(rename = "SUSPICIOUS_TOP_HOLDER_ACTIVITY")]
SuspiciousTopHolderActivity,
#[serde(rename = "HIGH_SINGLE_OWNERSHIP")]
HighSingleOwnership,
#[serde(rename = "{}%_TRANSFER_FEES")]
TransferFees,
}
impl GetUltraV1ShieldResponseType {
pub fn as_str(&self) -> &'static str {
match self {
Self::NotVerified => "NOT_VERIFIED",
Self::LowLiquidity => "LOW_LIQUIDITY",
Self::NotSellable => "NOT_SELLABLE",
Self::LowOrganicActivity => "LOW_ORGANIC_ACTIVITY",
Self::HasMintAuthority => "HAS_MINT_AUTHORITY",
Self::HasFreezeAuthority => "HAS_FREEZE_AUTHORITY",
Self::HasPermanentDelegate => "HAS_PERMANENT_DELEGATE",
Self::NewListing => "NEW_LISTING",
Self::VeryLowTradingActivity => "VERY_LOW_TRADING_ACTIVITY",
Self::HighSupplyConcentration => "HIGH_SUPPLY_CONCENTRATION",
Self::NonTransferable => "NON_TRANSFERABLE",
Self::MutableTransferFees => "MUTABLE_TRANSFER_FEES",
Self::SuspiciousDevActivity => "SUSPICIOUS_DEV_ACTIVITY",
Self::SuspiciousTopHolderActivity => "SUSPICIOUS_TOP_HOLDER_ACTIVITY",
Self::HighSingleOwnership => "HIGH_SINGLE_OWNERSHIP",
Self::TransferFees => "{}%_TRANSFER_FEES",
}
}
}
impl ::std::fmt::Display for GetUltraV1ShieldResponseType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1ShieldResponseType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1ShieldResponseSource {
#[default]
#[serde(rename = "RugCheck")]
RugCheck,
}
impl GetUltraV1ShieldResponseSource {
pub fn as_str(&self) -> &'static str {
match self {
Self::RugCheck => "RugCheck",
}
}
}
impl ::std::fmt::Display for GetUltraV1ShieldResponseSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1ShieldResponseSource {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum GetUltraV1ShieldResponseSeverity {
#[default]
#[serde(rename = "info")]
Info,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "critical")]
Critical,
}
impl GetUltraV1ShieldResponseSeverity {
pub fn as_str(&self) -> &'static str {
match self {
Self::Info => "info",
Self::Warning => "warning",
Self::Critical => "critical",
}
}
}
impl ::std::fmt::Display for GetUltraV1ShieldResponseSeverity {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for GetUltraV1ShieldResponseSeverity {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetBuildResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetOrderResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1OrderbookMarketIdResponse {
pub no: Vec<Vec<f64>>,
pub no_dollars: Vec<Vec<serde_json::Value>>,
pub yes: Vec<Vec<f64>>,
pub yes_dollars: Vec<Vec<serde_json::Value>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1ProfilesOwnerPubkeyResponse {
#[serde(rename = "correctPredictions")]
pub correct_predictions: String,
#[serde(rename = "ownerPubkey")]
pub owner_pubkey: String,
#[serde(rename = "predictionsCount")]
pub predictions_count: String,
#[serde(rename = "realizedPnlUsd")]
pub realized_pnl_usd: String,
#[serde(rename = "totalActiveContracts")]
pub total_active_contracts: String,
#[serde(
rename = "totalActiveContractsDecimal",
skip_serializing_if = "Option::is_none"
)]
pub total_active_contracts_decimal: Option<String>,
#[serde(
rename = "totalActiveContractsMicro",
skip_serializing_if = "Option::is_none"
)]
pub total_active_contracts_micro: Option<String>,
#[serde(rename = "totalPositionsValueUsd")]
pub total_positions_value_usd: String,
#[serde(rename = "totalVolumeUsd")]
pub total_volume_usd: String,
#[serde(rename = "wrongPredictions")]
pub wrong_predictions: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1ProfilesOwnerPubkeyResponse404 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetPredictionV1VaultInfoResponse404 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetSendV1InviteHistoryResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetSendV1InviteHistoryResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetSendV1PendingInvitesResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetSendV1PendingInvitesResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetStudioV1DbcPoolAddressesMintResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetStudioV1DbcPoolAddressesMintResponse404 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct GetStudioV1DbcPoolAddressesMintResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
pub type GetTokensV1MarketMarketAddressMintsResponse = Vec<String>;
pub type GetTokensV1MintsTradableResponse = Vec<String>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2CategoryIntervalResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2CategoryIntervalResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2RecentResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2RecentResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2SearchResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2SearchResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2TagResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTokensV2TagResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV2VaultRegisterResponse201 {
#[serde(rename = "privyVaultId")]
pub privy_vault_id: String,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
#[serde(rename = "vaultPubkey")]
pub vault_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetTriggerV2VaultResponse {
#[serde(rename = "privyUserId", skip_serializing_if = "Option::is_none")]
pub privy_user_id: Option<String>,
#[serde(rename = "privyVaultId")]
pub privy_vault_id: String,
#[serde(rename = "userPubkey")]
pub user_pubkey: String,
#[serde(rename = "vaultPubkey")]
pub vault_pubkey: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1BalancesAddressResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1BalancesAddressResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1OrderResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1SearchResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1SearchResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1ShieldResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GetUltraV1ShieldResponse500 {
pub error: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)]
pub enum LendBorrowMarket {
#[default]
#[serde(rename = "main")]
Main,
#[serde(rename = "ethena")]
Ethena,
}
impl LendBorrowMarket {
pub fn as_str(&self) -> &'static str {
match self {
Self::Main => "main",
Self::Ethena => "ethena",
}
}
}
impl ::std::fmt::Display for LendBorrowMarket {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
f.write_str(self.as_str())
}
}
impl AsRef<str> for LendBorrowMarket {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowOperatePayload {
#[serde(rename = "colAmount")]
pub col_amount: String,
#[serde(rename = "debtAmount")]
pub debt_amount: String,
#[serde(rename = "positionId")]
pub position_id: i64,
#[serde(rename = "positionOwner", skip_serializing_if = "Option::is_none")]
pub position_owner: Option<String>,
pub signer: String,
#[serde(rename = "vaultId")]
pub vault_id: i64,
}
impl LendBorrowOperatePayload {
pub fn new(
col_amount: String,
debt_amount: String,
position_id: i64,
signer: String,
vault_id: i64,
) -> Self {
Self {
col_amount,
debt_amount,
position_id,
signer,
vault_id,
position_owner: None,
}
}
pub fn builder(
col_amount: String,
debt_amount: String,
position_id: i64,
signer: String,
vault_id: i64,
) -> LendBorrowOperatePayloadBuilder {
LendBorrowOperatePayloadBuilder::new(col_amount, debt_amount, position_id, signer, vault_id)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct LendBorrowOperatePayloadBuilder {
value: LendBorrowOperatePayload,
}
impl LendBorrowOperatePayloadBuilder {
pub fn new(
col_amount: String,
debt_amount: String,
position_id: i64,
signer: String,
vault_id: i64,
) -> Self {
Self {
value: LendBorrowOperatePayload::new(
col_amount,
debt_amount,
position_id,
signer,
vault_id,
),
}
}
#[doc = concat!("Set the optional `", "positionOwner", "` request field.")]
#[must_use]
pub fn position_owner(mut self, position_owner: String) -> Self {
self.value.position_owner = Some(position_owner);
self
}
pub fn build(self) -> LendBorrowOperatePayload {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendBorrowOperateTransactionResponse {
#[serde(rename = "nftId")]
pub nft_id: i64,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendEarnAmountRequestBody {
#[serde(default)]
pub amount: String,
#[serde(default)]
pub asset: String,
#[serde(default)]
pub signer: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendEarnSharesRequestBody {
#[serde(default)]
pub asset: String,
#[serde(default)]
pub shares: String,
#[serde(default)]
pub signer: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendTransactionResponse {
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LendUserEarningsResponse {
pub address: String,
pub earnings: f64,
#[serde(rename = "ownerAddress")]
pub owner_address: String,
pub slot: f64,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PatchTriggerV2OrdersPriceOrderIdResponse {
pub id: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostExecuteRequest {
#[serde(
rename = "lastValidBlockHeight",
skip_serializing_if = "Option::is_none"
)]
pub last_valid_block_height: Option<String>,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
impl PostExecuteRequest {
pub fn new(request_id: String, signed_transaction: String) -> Self {
Self {
request_id,
signed_transaction,
last_valid_block_height: None,
}
}
pub fn builder(request_id: String, signed_transaction: String) -> PostExecuteRequestBuilder {
PostExecuteRequestBuilder::new(request_id, signed_transaction)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostExecuteRequestBuilder {
value: PostExecuteRequest,
}
impl PostExecuteRequestBuilder {
pub fn new(request_id: String, signed_transaction: String) -> Self {
Self {
value: PostExecuteRequest::new(request_id, signed_transaction),
}
}
#[doc = concat!("Set the optional `", "lastValidBlockHeight", "` request field.")]
#[must_use]
pub fn last_valid_block_height(mut self, last_valid_block_height: String) -> Self {
self.value.last_valid_block_height = Some(last_valid_block_height);
self
}
pub fn build(self) -> PostExecuteRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostExecuteResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostExecuteResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftClawbackRequest {
#[serde(rename = "invitePDA")]
pub invite_pda: String,
pub sender: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftClawbackResponse {
pub tx: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftClawbackResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftClawbackResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftSendRequest {
pub amount: String,
#[serde(rename = "inviteSigner")]
pub invite_signer: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint: Option<String>,
pub sender: String,
}
impl PostSendV1CraftSendRequest {
pub fn new(amount: String, invite_signer: String, sender: String) -> Self {
Self {
amount,
invite_signer,
sender,
mint: None,
}
}
pub fn builder(
amount: String,
invite_signer: String,
sender: String,
) -> PostSendV1CraftSendRequestBuilder {
PostSendV1CraftSendRequestBuilder::new(amount, invite_signer, sender)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostSendV1CraftSendRequestBuilder {
value: PostSendV1CraftSendRequest,
}
impl PostSendV1CraftSendRequestBuilder {
pub fn new(amount: String, invite_signer: String, sender: String) -> Self {
Self {
value: PostSendV1CraftSendRequest::new(amount, invite_signer, sender),
}
}
#[doc = concat!("Set the optional `", "mint", "` request field.")]
#[must_use]
pub fn mint(mut self, mint: String) -> Self {
self.value.mint = Some(mint);
self
}
pub fn build(self) -> PostSendV1CraftSendRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftSendResponse {
pub expiry: String,
#[serde(rename = "totalFeeLamports")]
pub total_fee_lamports: String,
pub tx: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftSendResponse400 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostSendV1CraftSendResponse500 {
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostStudioV1DbcFeeCreateTxResponse {
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeCreateTxResponse403 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcFeeCreateTxResponse404 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostStudioV1DbcFeeRequest {
#[serde(rename = "poolAddress")]
pub pool_address: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostStudioV1DbcFeeResponse {
pub total: String,
pub unclaimed: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcPoolCreateTxResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcPoolCreateTxResponse500 {
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PostStudioV1DbcPoolSubmitResponse400 {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub errors: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrderRequest {
#[serde(rename = "computeUnitPrice", skip_serializing_if = "Option::is_none")]
pub compute_unit_price: Option<String>,
#[serde(default)]
pub maker: String,
#[serde(default)]
pub order: String,
}
impl PostTriggerV1CancelOrderRequest {
pub fn new(maker: String, order: String) -> Self {
Self {
maker,
order,
compute_unit_price: None,
}
}
pub fn builder(maker: String, order: String) -> PostTriggerV1CancelOrderRequestBuilder {
PostTriggerV1CancelOrderRequestBuilder::new(maker, order)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV1CancelOrderRequestBuilder {
value: PostTriggerV1CancelOrderRequest,
}
impl PostTriggerV1CancelOrderRequestBuilder {
pub fn new(maker: String, order: String) -> Self {
Self {
value: PostTriggerV1CancelOrderRequest::new(maker, order),
}
}
#[doc = concat!("Set the optional `", "computeUnitPrice", "` request field.")]
#[must_use]
pub fn compute_unit_price(mut self, compute_unit_price: String) -> Self {
self.value.compute_unit_price = Some(compute_unit_price);
self
}
pub fn build(self) -> PostTriggerV1CancelOrderRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrderResponse {
#[serde(rename = "requestId")]
pub request_id: String,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrdersRequest {
#[serde(rename = "computeUnitPrice", skip_serializing_if = "Option::is_none")]
pub compute_unit_price: Option<String>,
#[serde(default)]
pub maker: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub orders: Option<Vec<String>>,
}
impl PostTriggerV1CancelOrdersRequest {
pub fn new(maker: String) -> Self {
Self {
maker,
compute_unit_price: None,
orders: None,
}
}
pub fn builder(maker: String) -> PostTriggerV1CancelOrdersRequestBuilder {
PostTriggerV1CancelOrdersRequestBuilder::new(maker)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PostTriggerV1CancelOrdersRequestBuilder {
value: PostTriggerV1CancelOrdersRequest,
}
impl PostTriggerV1CancelOrdersRequestBuilder {
pub fn new(maker: String) -> Self {
Self {
value: PostTriggerV1CancelOrdersRequest::new(maker),
}
}
#[doc = concat!("Set the optional `", "computeUnitPrice", "` request field.")]
#[must_use]
pub fn compute_unit_price(mut self, compute_unit_price: String) -> Self {
self.value.compute_unit_price = Some(compute_unit_price);
self
}
#[doc = concat!("Set the optional `", "orders", "` request field.")]
#[must_use]
pub fn orders(mut self, orders: Vec<String>) -> Self {
self.value.orders = Some(orders);
self
}
pub fn build(self) -> PostTriggerV1CancelOrdersRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CancelOrdersResponse {
#[serde(rename = "requestId")]
pub request_id: String,
pub transactions: Vec<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1CreateOrderResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<String>,
#[serde(rename = "requestId")]
pub request_id: String,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV1ExecuteRequest {
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2AuthVerifyResponse {
pub token: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2DepositCraftResponse {
pub amount: String,
#[serde(rename = "inputTokenAccount", skip_serializing_if = "Option::is_none")]
pub input_token_account: Option<String>,
#[serde(rename = "jlTokenAccount", skip_serializing_if = "Option::is_none")]
pub jl_token_account: Option<String>,
pub mint: String,
#[serde(rename = "outputTokenAccount", skip_serializing_if = "Option::is_none")]
pub output_token_account: Option<String>,
#[serde(rename = "receiverAddress")]
pub receiver_address: String,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "tokenDecimals")]
pub token_decimals: f64,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersDcaCancelIdResponse {
pub id: String,
#[serde(rename = "refundAmount")]
pub refund_amount: String,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "roundsRemaining")]
pub rounds_remaining: f64,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersDcaConfirmCancelIdRequest {
#[serde(rename = "cancelRequestId")]
pub cancel_request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersPriceCancelOrderIdResponse {
pub id: String,
#[serde(rename = "requestId")]
pub request_id: String,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostTriggerV2OrdersPriceConfirmCancelOrderIdRequest {
#[serde(rename = "cancelRequestId")]
pub cancel_request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostUltraV1ExecuteRequest {
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostUltraV1ExecuteResponse400 {
pub code: f64,
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PostUltraV1ExecuteResponse500 {
pub code: f64,
pub error: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionClaimPositionRequest {
#[serde(rename = "ownerPubkey", skip_serializing_if = "Option::is_none")]
pub owner_pubkey: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionCloseAllPositionsRequest {
#[serde(rename = "minSellPriceSlippageBps")]
pub min_sell_price_slippage_bps: f64,
#[serde(rename = "ownerPubkey", skip_serializing_if = "Option::is_none")]
pub owner_pubkey: Option<String>,
}
impl PredictionCloseAllPositionsRequest {
pub fn new(min_sell_price_slippage_bps: f64) -> Self {
Self {
min_sell_price_slippage_bps,
owner_pubkey: None,
}
}
pub fn builder(min_sell_price_slippage_bps: f64) -> PredictionCloseAllPositionsRequestBuilder {
PredictionCloseAllPositionsRequestBuilder::new(min_sell_price_slippage_bps)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct PredictionCloseAllPositionsRequestBuilder {
value: PredictionCloseAllPositionsRequest,
}
impl PredictionCloseAllPositionsRequestBuilder {
pub fn new(min_sell_price_slippage_bps: f64) -> Self {
Self {
value: PredictionCloseAllPositionsRequest::new(min_sell_price_slippage_bps),
}
}
#[doc = concat!("Set the optional `", "ownerPubkey", "` request field.")]
#[must_use]
pub fn owner_pubkey(mut self, owner_pubkey: String) -> Self {
self.value.owner_pubkey = Some(owner_pubkey);
self
}
pub fn build(self) -> PredictionCloseAllPositionsRequest {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct PredictionClosePositionRequest {
#[serde(rename = "ownerPubkey", skip_serializing_if = "Option::is_none")]
pub owner_pubkey: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PredictionTradingStatusResponse {
pub trading_active: bool,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct ProgramIdToLabelGetResponse {
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringDepositPriceRecurring {
pub amount: i64,
pub order: String,
pub user: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringExecuteRecurring {
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "signedTransaction")]
pub signed_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RecurringRecurringResponse {
#[serde(rename = "requestId")]
pub request_id: String,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateClaimFeeDBCTransactionRequestBody {
#[serde(rename = "maxQuoteAmount")]
pub max_quote_amount: f64,
#[serde(rename = "ownerWallet")]
pub owner_wallet: String,
#[serde(rename = "poolAddress")]
pub pool_address: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioCreateDBCTransactionResponse {
#[serde(rename = "imagePresignedUrl")]
pub image_presigned_url: url::Url,
#[serde(rename = "imageUrl")]
pub image_url: url::Url,
#[serde(rename = "metadataPresignedUrl")]
pub metadata_presigned_url: url::Url,
pub mint: String,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct StudioSubmitDBCTransactionRequestBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(rename = "headerImage", skip_serializing_if = "Option::is_none")]
pub header_image: Option<bytes::Bytes>,
pub owner: String,
pub transaction: String,
}
impl StudioSubmitDBCTransactionRequestBody {
pub fn new(owner: String, transaction: String) -> Self {
Self {
owner,
transaction,
content: None,
header_image: None,
}
}
pub fn builder(
owner: String,
transaction: String,
) -> StudioSubmitDBCTransactionRequestBodyBuilder {
StudioSubmitDBCTransactionRequestBodyBuilder::new(owner, transaction)
}
}
#[derive(Debug, Clone)]
#[must_use]
pub struct StudioSubmitDBCTransactionRequestBodyBuilder {
value: StudioSubmitDBCTransactionRequestBody,
}
impl StudioSubmitDBCTransactionRequestBodyBuilder {
pub fn new(owner: String, transaction: String) -> Self {
Self {
value: StudioSubmitDBCTransactionRequestBody::new(owner, transaction),
}
}
#[doc = concat!("Set the optional `", "content", "` request field.")]
#[must_use]
pub fn content(mut self, content: String) -> Self {
self.value.content = Some(content);
self
}
#[doc = concat!("Set the optional `", "headerImage", "` request field.")]
#[must_use]
pub fn header_image(mut self, header_image: bytes::Bytes) -> Self {
self.value.header_image = Some(header_image);
self
}
pub fn build(self) -> StudioSubmitDBCTransactionRequestBody {
self.value
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct SwapV1SwapResponse {
#[serde(rename = "lastValidBlockHeight")]
pub last_valid_block_height: u64,
#[serde(
rename = "prioritizationFeeLamports",
skip_serializing_if = "Option::is_none"
)]
pub prioritization_fee_lamports: Option<u64>,
#[serde(rename = "swapTransaction")]
pub swap_transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV1MintIncludingDuplicates {
pub address: String,
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(skip_serializing_if = "Option::is_none")]
pub daily_volume: Option<i64>,
pub decimals: i32,
pub extensions: serde_json::Value,
#[serde(skip_serializing_if = "Option::is_none")]
pub freeze_authority: Option<String>,
#[serde(rename = "logoURI", skip_serializing_if = "Option::is_none")]
pub logo_uri: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mint_authority: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub minted_at: Option<chrono::DateTime<chrono::Utc>>,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub permanent_delegate: Option<String>,
pub symbol: String,
pub tags: Vec<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV2VerificationCheckEligibilityResponse {
#[serde(rename = "canMetadata")]
pub can_metadata: bool,
#[serde(rename = "canVerify")]
pub can_verify: bool,
#[serde(rename = "isVerified")]
pub is_verified: bool,
#[serde(rename = "metadataError", skip_serializing_if = "Option::is_none")]
pub metadata_error: Option<String>,
#[serde(rename = "tokenExists")]
pub token_exists: bool,
#[serde(rename = "verificationError", skip_serializing_if = "Option::is_none")]
pub verification_error: Option<String>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TokensV2VerificationCraftTxnResponse {
pub amount: String,
pub code: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<String>,
#[serde(rename = "feeAmount")]
pub fee_amount: f64,
#[serde(rename = "feeLamports")]
pub fee_lamports: f64,
#[serde(rename = "feeMint")]
pub fee_mint: String,
#[serde(rename = "feeTokenDecimals")]
pub fee_token_decimals: f64,
#[serde(rename = "feeUsdAmount", skip_serializing_if = "Option::is_none")]
pub fee_usd_amount: Option<f64>,
pub gasless: bool,
#[serde(rename = "inputDecimals", skip_serializing_if = "Option::is_none")]
pub input_decimals: Option<f64>,
#[serde(rename = "inputMint", skip_serializing_if = "Option::is_none")]
pub input_mint: Option<String>,
#[serde(rename = "maxInputAmount", skip_serializing_if = "Option::is_none")]
pub max_input_amount: Option<String>,
pub mint: String,
#[serde(rename = "quotedInputAmount", skip_serializing_if = "Option::is_none")]
pub quoted_input_amount: Option<String>,
#[serde(rename = "receiverAddress")]
pub receiver_address: String,
#[serde(rename = "requestId")]
pub request_id: String,
#[serde(rename = "tokenDecimals")]
pub token_decimals: f64,
#[serde(rename = "tokenUsdRate", skip_serializing_if = "Option::is_none")]
pub token_usd_rate: Option<f64>,
#[serde(rename = "totalTime")]
pub total_time: f64,
pub transaction: String,
}
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
pub struct TokensV2VerificationErrorResponse {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<f64>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TriggerV2OrderResponse {
#[serde(rename = "depositConfirmed")]
pub deposit_confirmed: bool,
pub id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "txSignature")]
pub tx_signature: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TriggerV2TxSignatureResponse {
pub id: String,
#[serde(rename = "txSignature")]
pub tx_signature: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct UltraNativeHoldingsResponse {
pub amount: String,
#[serde(rename = "uiAmount")]
pub ui_amount: f64,
#[serde(rename = "uiAmountString")]
pub ui_amount_string: String,
}