Crate delta_base_sdk

Crate delta_base_sdk 

Source
Expand description

§delta base SDK

This crate provides the primary interface for building applications on the delta network, including tools for communication with base layer providers, account and vault management, transaction processing, and event subscription.

§Overview

This SDK provides access to the base layer functionality, allowing applications to:

§Quick Start

Most interactions within delta begin with establishing a connection to base layer via the BaseRpcClient:

use crate::delta_base_sdk::{
    crypto,
    crypto::Hash256,
    rpc::BaseRpcClient,
    transactions::builder::TransactionBuilder,
    vaults::ReadableNativeBalance,
};
use std::error::Error;

async fn start() -> Result<(), Box<dyn Error>> {
    // Connect to base layer
    let client = BaseRpcClient::new("http://localhost:50051").await?;

    // Generate a new keypair for signing transactions
    let keypair = crypto::ed25519::PrivKey::generate();
    let pubkey = keypair.pub_key();

    // Query vault state
    let vault = client.get_base_vault(pubkey.owner()).await?;
    println!("Vault balance: {}", vault.balance());
    Ok(())
}

§Other examples

This example provides a more extended code sample.

Modules§

core
Fundamental type definitions used in delta.
crypto
Cryptographic Utilities for delta
events
Base Layer Events
parse
Parsing utilities for common types
rpc
RPC Communication with the delta Base Layer
sdl
State Diff List (SDL)
transactions
Types and utilities for creating, and signing transactions.
vaults
delta’s Vaults