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:
| Feature | Default | Description |
|---|---|---|
ed25519 | Yes | Ed25519 signature scheme |
secp256k1 | Yes | Secp256k1 ECDSA signatures |
secp256r1 | Yes | Secp256r1 (P-256) ECDSA signatures |
mnemonic | Yes | BIP-39 mnemonic phrase support for key derivation |
indexer | Yes | GraphQL indexer client |
faucet | Yes | Faucet integration for testnets |
bls | No | BLS12-381 signatures |
keyless | No | OIDC-based keyless authentication |
macros | No | Proc macros for type-safe contract bindings |
§Modules
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_
contract macros - Generates type-safe contract bindings from an ABI.
- movement_
contract_ file macros - Generates contract bindings from an ABI file path.
Structs§
- Movement
- The main entry point for the Movement SDK.
Derive Macros§
- Move
Struct macros - Derive macro for Move-compatible struct serialization.