Skip to main content

SandboxNetwork

Trait SandboxNetwork 

Source
pub trait SandboxNetwork {
    // Required methods
    fn rpc_url(&self) -> &str;
    fn root_account_id(&self) -> &str;
    fn root_secret_key(&self) -> &str;
}
Expand description

Trait for sandbox network configuration.

Implement this trait for your sandbox type to enable ergonomic integration with the Near client via Near::sandbox().

§Example

use near_sandbox::Sandbox;

let sandbox = Sandbox::start_sandbox().await?;
let near = Near::sandbox(&sandbox).build();

// The root account credentials are automatically configured
near.transfer("alice.sandbox", "10 NEAR").await?;

Required Methods§

Source

fn rpc_url(&self) -> &str

The RPC URL for the sandbox (e.g., http://127.0.0.1:3030).

Source

fn root_account_id(&self) -> &str

The root account ID (e.g., "sandbox").

Source

fn root_secret_key(&self) -> &str

The root account’s secret key.

Implementors§