Expand description
§VoidNote — Official Rust SDK
Zero-knowledge self-destructing notes and live encrypted streams. The key lives in the link. We never see it.
§Quick start
use voidnote::{read, create, CreateOptions};
#[tokio::main]
async fn main() -> voidnote::Result<()> {
// Create a note
let note = create("my secret message", CreateOptions {
api_key: "vn_...".into(),
max_views: Some(1),
..Default::default()
}).await?;
println!("share: {}", note.url);
// Read it back
let result = read(¬e.url).await?;
println!("{}", result.content);
Ok(())
}Re-exports§
pub use self::stream::StreamHandle;
Modules§
- blocking
- Synchronous wrapper around the async API.
Requires a Tokio runtime to be available (or use
tokio::runtime::Runtime). - stream
Structs§
- Create
Options - Options for creating a note.
- Create
Result - Result of creating a note.
- Crypto
Order - A cryptocurrency payment order returned by the API.
- Crypto
Order Options - Options for creating a cryptocurrency payment order.
- Read
Result - Decrypted contents of a VoidNote.
- Stream
Options - Options for creating a Void Stream.
- Submit
Payment Options - Options for submitting a cryptocurrency transaction for an existing order.
- Submit
Payment Result - Result of submitting a cryptocurrency payment transaction.
Enums§
- Error
- All errors this SDK can produce.
Functions§
- create
- Create and encrypt a VoidNote client-side. Requires an API key. The server never sees the plaintext.
- create_
crypto_ order - Create a cryptocurrency payment order to purchase credits.
- create_
stream - Create a new Void Stream. Requires an API key. Costs 1 credit.
- read
- Read and decrypt a VoidNote.
- read_
from - Like
readbut allows overriding the API base URL. - submit_
crypto_ payment - Submit an on-chain transaction hash for an existing crypto payment order.
Type Aliases§
- Result
- SDK result type.