Crate space_lib

source ·
Expand description

This crate provides WebAssembly host functions for Space Operator.

HTTP client

use space_lib::Request;
 
let body = Request::get("https://www.spaceoperator.com")
    .call()?
    .into_string()?;

Supabase

use space_lib::Supabase;
 
let client = Supabase::new("https://hyjbiblkjrrvkzaqsyxe.supabase.co")
    .insert_header("apikey", "anon_api_key");
 
let rows = client
    .from("dogs")
    .select("name")
    .execute()?
    .into_string()?;

Solana

use space_lib::Solana;
 
let client = Solana::new("https://api.devnet.solana.com");
let balance = client.get_balance("base58_encoded_pubkey")?;

Result

use space_lib::Result;
 
#[no_mangle]
fn main() -> Result<u64> {
    Ok("123".parse()?)
}

Modules

Macros

  • Construct a serde_json::Value from a JSON literal.

Structs

Enums

Type Definitions