15 releases (7 breaking)

0.8.1 Jan 22, 2024
0.8.0 Dec 5, 2023
0.7.2 Oct 20, 2023
0.3.0 May 26, 2023

#2258 in Magic Beans

44 downloads per month
Used in lightspark-remote-signing

Apache-2.0

760KB
14K SLoC

Lightspark Rust SDK - v0.8.1

The Lightspark Rust SDK provides a convenient way to interact with the Lightspark services from applications written in the Rust language.

WARNING: This SDK is in version 0.8.1 (active development). It means that its APIs may not be fully stable. Please expect that changes to the APIs may happen until we move to v1.0.0.

Documentation

The documentation for this SDK (installation, usage, etc.) is available at https://docs.lightspark.com/lightspark-sdk/getting-started?language=Rust

Sample code

For your convenience, we included an example that shows you how to use the SDK. Open the file example/example.rs and make sure to update the variables at the top of the page with your information, then run it using cargo:

cargo run --example example

lib.rs:

Lightspark Rust SDK is a thin wrapper around the GraphQL API that provides an easy way to integrate with the Lightspark systems in a Rust environment.

Getting Started

After obtain an API token, a client can be initiate.

use lightspark::request::auth_provider::AccountAuthProvider;
use lightspark::client::LightsparkClient;
use lightspark::key::RSASigningKey;

let api_id = "<your api token id>";
let api_token = "<your api token secret>";
let auth_provider = AccountAuthProvider::new(api_id.to_string(), api_token.to_string());
let client = match LightsparkClient::<RSASigningKey>::new(auth_provider) {
   Ok(value) => value,
   Err(err) => {
      println!("{}", err);
      return;
   }
};

You are now ready to use the Lightspark SDK!

See more examples in examples/example.rs

Dependencies

~15–32MB
~425K SLoC