Struct fractal_api::ClientV1
[−]
[src]
pub struct ClientV1 { // some fields omitted }
The client struct.
This struct will be in charge of connections to the Fractal Global Credits API.
Methods
impl ClientV1
[src]
fn new() -> ClientV1
Creates a new Fractal Global Credits API client.
fn new_with_url<S: AsRef<str>>(url: S) -> ClientV1
Creates a new Fractal Global Credits API client.
fn new_dev() -> ClientV1
Creates a new Fractal Global Credits API development client.
fn set_read_timeout(&mut self, timeout: Option<Duration>)
Sets the read timeout for requests.
fn set_write_timeout(&mut self, timeout: Option<Duration>)
Sets the write timeout for requests.
fn token<S: AsRef<str>>(&mut self, app_id: S, secret: S) -> Result<AccessToken>
Gets a token from the API.
fn get_all_users(&self, access_token: AccessToken) -> Result<Vec<User>>
Gets all users from the database.
fn get_all_transactions(&self, access_token: AccessToken, first_transaction: u64) -> Result<Vec<Transaction>>
Gets all the transactions since the given transaction
fn generate_transaction(&self, access_token: AccessToken, receiver_wallet: WalletAddress, receiver_id: u64, amount: Amount) -> Result<()>
Generates a transaction
fn login<S: AsRef<str>>(&self, access_token: AccessToken, username: S, password: S) -> Result<AccessToken>
Logs the user in