Skip to main content

Crate tndrly

Crate tndrly 

Source
Expand description

§tndrly

Unofficial Rust client for the Tenderly API.

Provides access to:

  • Simulation API - Simulate transactions without broadcasting
  • Virtual TestNets API - Create isolated blockchain environments
  • Alerts API - Monitor on-chain activity with notifications
  • Contract API - Manage and verify smart contracts
  • Web3 Actions API - Deploy serverless functions
  • Wallets API - Track and monitor wallet addresses

§Quick Start

use tndrly::{Client, Config};
use tndrly::simulation::SimulationRequest;

#[tokio::main]
async fn main() -> Result<(), tndrly::Error> {
    // Create client from environment variables
    // Requires: TENDERLY_ACCESS_KEY, TENDERLY_ACCOUNT, TENDERLY_PROJECT
    let client = Client::from_env()?;

    // Or configure manually
    let client = Client::new(Config::new(
        "your-access-key",
        "your-account",
        "your-project"
    ))?;

    // Simulate a transaction
    let request = SimulationRequest::new(
        "0x0000000000000000000000000000000000000000",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
    );

    let result = client.simulation().simulate(&request).await?;
    println!("Gas used: {}", result.simulation.gas_used);

    Ok(())
}

§Environment Variables

The client can be configured via environment variables:

  • TENDERLY_ACCESS_KEY - Your Tenderly API access key
  • TENDERLY_ACCOUNT - Your account slug (username or organization)
  • TENDERLY_PROJECT - Your project slug

§API Modules

All API modules are always available:

Re-exports§

pub use actions::ActionTrigger;
pub use actions::CreateActionRequest;
pub use alerts::AlertType;
pub use alerts::CreateAlertRequest;
pub use contracts::AddContractRequest;
pub use contracts::Contract;
pub use simulation::SimulationRequest;
pub use simulation::SimulationResponse;
pub use simulation::SimulationType;
pub use vnets::CreateVNetRequest;
pub use vnets::VNet;
pub use wallets::AddWalletRequest;
pub use wallets::AddWalletResponse;
pub use wallets::WalletOnNetwork;

Modules§

actions
Web3 Actions API
alerts
Alerts API
contracts
Contract API
delivery_channels
Delivery Channels API
networks
Networks API
simulation
Transaction simulation API
utils
Utility functions for tndrly
vnets
Virtual TestNets API
wallets
Wallet API

Structs§

Client
The main Tenderly API client
Config
Configuration for the Tenderly client
RetryConfig
Configuration for retry behavior
RetryError
Error wrapper that includes retry information

Constants§

API_BASE_URL
Base URL for the Tenderly API

Traits§

RetryableError
Determines if an error should be retried

Functions§

with_retry
Execute an async operation with retries
with_simple_retry
Simple retry wrapper for operations that return Result with any error type

Type Aliases§

Error
Error type for Tenderly API operations
Result
Result type for Tenderly API operations