Rust Client for Pow.co HTTP & Websockets APIs
Authentication is done via ecdsa key pairs, where some API calls require small payments of Bitcoin
``` let keys = powco::Keys::generate();
println!("identifier: {}", keys.identifier); println!("secret: {}", keys.secret);
```
Any valid Bitcoin private key (not HD) and address will work as secret and identifier
``` use std::env;
let keys = powco::Keys { identifier: env::var("POWCOCLIENTID"), identifier: env::var("POWCOCLIENTSECRET"), }
let client = powco::Client { keys: keys }
if !client.hasvalidkeys() { panic!("Invalid API Key Pair") }
```
This call does not require payment
let jobs: Vec{powco::Job} = client.list_available_jobs();
This call does require payment. Getting a job will allow your boost miner to provide work for the job and claim the coins contained therein.
``` let job: powco::Job = client.get_job(&job.uid);
```