Skip to main content

Crate movement_sdk

Crate movement_sdk 

Source
Expand description

§Movement Rust SDK v2

A user-friendly, idiomatic Rust SDK for the Movement blockchain.

This SDK provides a complete interface for interacting with the Movement blockchain, including account management, transaction building and signing, and API clients for both the fullnode REST API and the indexer GraphQL API.

§Quick Start

use movement_sdk::{Movement, MovementConfig};
use movement_sdk::account::{Account, Ed25519Account};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Connect to testnet
    let movement = Movement::new(MovementConfig::testnet())?;

    // Create a new account
    let account = Ed25519Account::generate();
    println!("Address: {}", account.address());

    // Get balance (after funding)
    let balance = movement.get_balance(account.address()).await?;
    println!("Balance: {} octas", balance);

    Ok(())
}

§Feature Flags

The SDK uses feature flags to allow you to include only the functionality you need:

FeatureDefaultDescription
ed25519YesEd25519 signature scheme
secp256k1YesSecp256k1 ECDSA signatures
secp256r1YesSecp256r1 (P-256) ECDSA signatures
mnemonicYesBIP-39 mnemonic phrase support for key derivation
indexerYesGraphQL indexer client
faucetYesFaucet integration for testnets
blsNoBLS12-381 signatures
keylessNoOIDC-based keyless authentication
macrosNoProc macros for type-safe contract bindings

§Modules

  • account - Account management and key generation
  • crypto - Cryptographic primitives and signature schemes
  • transaction - Transaction building and signing
  • api - REST and GraphQL API clients
  • types - Core Movement types
  • codegen - Code generation from Move ABIs

Re-exports§

pub use config::MovementConfig;
pub use error::MovementError;
pub use error::MovementResult;
pub use types::AccountAddress;
pub use types::ChainId;
pub use types::HashValue;

Modules§

account
Account management for the Movement SDK.
api
API clients for the Movement blockchain.
codegen
Code generation for Move modules.
config
Network configuration for the Movement SDK.
crypto
Cryptographic primitives for the Movement SDK.
error
Error types for the Movement SDK.
retry
Automatic retry with exponential backoff.
transaction
Transaction building and signing.
types
Core Movement types.

Macros§

movement_contractmacros
Generates type-safe contract bindings from an ABI.
movement_contract_filemacros
Generates contract bindings from an ABI file path.

Structs§

Movement
The main entry point for the Movement SDK.

Derive Macros§

MoveStructmacros
Derive macro for Move-compatible struct serialization.