Skip to main content

Crate voidnote

Crate voidnote 

Source
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(&note.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§

CreateOptions
Options for creating a note.
CreateResult
Result of creating a note.
CryptoOrder
A cryptocurrency payment order returned by the API.
CryptoOrderOptions
Options for creating a cryptocurrency payment order.
ReadResult
Decrypted contents of a VoidNote.
StreamOptions
Options for creating a Void Stream.
SubmitPaymentOptions
Options for submitting a cryptocurrency transaction for an existing order.
SubmitPaymentResult
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 read but 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.