1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! This crate provides WebAssembly host functions for Space Operator.
//! 
//! ## HTTP client
//! 
//! ```rust
//! use space_lib::Request;
//! 
//! let body = Request::get("https://www.spaceoperator.com")
//!     .call()?
//!     .into_string()?;
//! ```
//! 
//! ## Supabase
//! 
//! ```rust
//! 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
//! 
//! ```rust
//! use space_lib::Solana;
//! 
//! let client = Solana::new("https://api.devnet.solana.com");
//! let balance = client.get_balance("base58_encoded_pubkey")?;
//! ```

pub mod common;
mod error;
mod ffi;
mod http;
mod solana;
mod supabase;

pub use solana::Solana;
pub use serde_json::json;
pub use http::{Request, Response};
pub use supabase::{Supabase, Builder};
pub use error::{SpaceError, HostError};