Skip to main content

Crate blueprint_client_tangle

Crate blueprint_client_tangle 

Source
Expand description

Tangle Client for Blueprint SDK

This crate provides connectivity to Tangle EVM contracts for blueprint operators.

§Overview

The Tangle client allows blueprints to:

  • Query blueprints, services, and operators from the Tangle contract
  • Monitor events (job submissions, service lifecycle)
  • Submit job results
  • Interact with the restaking system

§Usage

use blueprint_client_tangle::{TangleClient, TangleEvent};
use blueprint_runner::config::BlueprintEnvironment;

async fn example(config: BlueprintEnvironment) -> Result<(), Box<dyn std::error::Error>> {
    // Create client
    let client = TangleClient::new(config).await?;

    // Query blueprint
    let blueprint = client.get_blueprint(1).await?;
    println!("Blueprint owner: {:?}", blueprint.owner);

    // Monitor events
    while let Some(event) = client.next_event().await {
        println!("Block {}: {} logs", event.block_number, event.logs.len());
    }

    Ok(())
}

§Contract Interfaces

The crate provides bindings for:

  • ITangle - Core Tangle protocol (blueprints, services, jobs, slashing)
  • IMultiAssetDelegation - Restaking and delegation
  • IOperatorStatusRegistry - Operator heartbeats and status

§Features

  • std (default) - Standard library support
  • web - WebAssembly support

Re-exports§

pub use blueprint_metadata::ConfidentialityPolicy;
pub use blueprint_metadata::ExecutionProfile;
pub use blueprint_metadata::ExecutionProfileError;
pub use blueprint_metadata::GpuPolicy;
pub use blueprint_metadata::GpuRequirements;
pub use blueprint_metadata::extract_job_profiles_blob;
pub use blueprint_metadata::inject_execution_profile;
pub use blueprint_metadata::resolve_confidentiality_policy;
pub use blueprint_metadata::resolve_execution_profile;
pub use blueprint_metadata::resolve_execution_profile_from_profiling_data;
pub use blueprint_metadata::resolve_gpu_requirements;
pub use client::AggregationConfig;
pub use client::AssetInfo;
pub use client::AssetKind;
pub use client::BlueprintSelectionMode;
pub use client::DelegationInfo;
pub use client::DelegationMode;
pub use client::DelegationRecord;
pub use client::DepositInfo;
pub use client::EcdsaPublicKey;
pub use client::JobSubmissionResult;
pub use client::LockInfo;
pub use client::LockMultiplier;
pub use client::OperatorMetadata;
pub use client::OperatorStatusSnapshot;
pub use client::PendingUnstake;
pub use client::PendingWithdrawal;
pub use client::RestakingMetadata;
pub use client::RestakingStatus;
pub use client::TangleClient;
pub use client::TangleEvent;
pub use client::ThresholdType;
pub use client::TransactionResult;
pub use config::TangleClientConfig;
pub use config::TangleSettings;
pub use error::Error;
pub use error::Result;
pub use services::BlueprintConfig;
pub use services::BlueprintInfo;
pub use services::MembershipModel;
pub use services::OperatorSecurityCommitment;
pub use services::PricingModel;
pub use services::ServiceInfo;
pub use services::ServiceRequestInfo;
pub use services::ServiceRequestParams;
pub use services::ServiceStatus;

Modules§

IBlueprintServiceManager
Generated by the following Solidity interface…
IMultiAssetDelegation
Generated by the following Solidity interface…
IOperatorStatusRegistry
Generated by the following Solidity interface…
ITangle
Generated by the following Solidity interface…
blueprint_metadata
Helpers for reading and writing blueprint execution metadata.
client
Tangle Client
config
Tangle Client Configuration
contracts
Re-exported TNT Core contract bindings.
error
Error types for the Tangle EVM client
services
Tangle Services Client

Traits§

EventsClient
Trait for clients that provide events