cargo add space-lib
This crate provides WebAssembly host functions and other utilities for Space Operator.
```rust use space_lib::space; use serde::{Serialize, Deserialize};
struct Input { value: usize, name: String, }
struct Output { value: usize, name: String, }
fn main(input: Input) -> Output { Output { value: input.value * 2, name: input.name.chars().rev().collect(), } } ```
```rust use space_lib::{space, Result};
fn main() -> Result
```rust use space_lib::Request;
let body = Request::get("https://www.spaceoperator.com") .call()? .into_string()?; ```
```rust use space_lib::Supabase;
let client = Supabase::new("https://hyjbiblkjrrvkzaqsyxe.supabase.co") .insertheader("apikey", "anonapi_key");
let rows = client .from("dogs") .select("name") .execute()? .into_string()?; ```
```rust use space_lib::Solana;
let client = Solana::new("https://api.devnet.solana.com"); let balance = client.getbalance("base58encoded_pubkey")?; ```