#sdk #api-client #staking #api-bindings #kiln #kilnfi

kilnfi_connect_rs

A Rust API Client for the Kiln Connect API

3 releases

0.1.2 Feb 3, 2025
0.1.1 Feb 3, 2025
0.1.0 Feb 2, 2025

#1710 in Web programming

Download history 69/week @ 2025-01-27 269/week @ 2025-02-03

338 downloads per month

BUSL-1.1

26KB
639 lines

[!NOTE] follows current stable API version

Description

Kiln connect API Rust client

Installation

You can install the Rust SDK with cargo:

cargo add kilnfi_connect_rs

you may need to use the uuid crate

cargo add uuid --features v4,serde

Requirements

Example

// required for uuid
use kilnfi_connect_rs::Kiln;
use std::str::FromStr;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_token: String = std::env::var("KILN_API_TOKEN")
        .expect("KILN_API_TOKEN is not set in the environment. It is required.");

    let kiln: Kiln = Kiln::builder()
        .api_token(api_token)
        // no trailing slash, or else it will break
        .base_url("https://api.kiln.fi/v1")
        .seal()
        .build()?;

    let uuid = uuid::Uuid::from_str("9e1a6784-9657-4757-b463-8454a34c92b4").unwrap();

    let _data = kiln.accounts().get_by_uuid(uuid);

    Ok(())
}

Find complete examples in the examples directory.

License

This package is source available software licensed under the BUSL-1.1 license.

Sponsoring

Send some love ❤️ : 0xc58f55f299dF3A26992a2a0823e5A8f073E3C812

Dependencies

~14–24MB
~434K SLoC