Skip to content

Commit

Permalink
Crypto contract constructor for Contract type
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-fairthorne committed May 19, 2024
1 parent a7bff8a commit e8b183d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ impl Contract {
}
}

/// Creates Crypto contract from specified symbol
pub fn crypto(symbol: &str) -> Contract {
Contract {
symbol: symbol.to_string(),
security_type: SecurityType::Crypto,
currency: "USD".to_string(),
exchange: "PAXOS".to_string(),
..Default::default()
}
}

/// Is Bag request
pub fn is_bag(&self) -> bool {
self.security_type == SecurityType::Spread
Expand Down

0 comments on commit e8b183d

Please sign in to comment.