Skip to content
Complete API Reference

Rust SDK Complete API Reference

The public API of phantasma_sdk: method groups, parameters, return values and lower-level helpers. The setup and task pages cover the common flows.

When To Use These Pages

PageUse it when
RPC ClientYou need to read chain state, invoke read-only scripts, broadcast serialized transactions, or choose between similar RPC wrappers.
RPC Result ModelsYou need the fields returned by account, token, block, transaction, NFT, auction, or network RPC calls.
VM and Transaction APIsYou need keys, addresses, VM script building, transaction serialization/signing, binary helpers, or SDK error behavior.
Carbon API and Wire FormatYou need Carbon transaction builders, token/series/NFT structures, schema serialization, message payloads, fee options, or result parsers.
Public API InventoryYou need the complete list of public crate items, modules, methods, fields, and variants.

Re-exports

The crate re-exports the main user-facing APIs at the crate root. That is convenient for examples and small tools:

use phantasma_sdk::{
    Address, PhantasmaKeys, PhantasmaRpc, Result, ScriptBuilder, Transaction,
};

For larger applications, importing from the owning module keeps code easier to review because the import tells the reader whether the code is using RPC, VM, crypto, or Carbon functionality:

use phantasma_sdk::carbon::build_create_token_tx_and_sign_hex;
use phantasma_sdk::rpc::PhantasmaRpc;

Error Model

All fallible public APIs return phantasma_sdk::Result<T>, which is an alias for std::result::Result<T, PhantasmaError>. The error enum separates encoding, serialization, crypto, builder, HTTP, JSON, and JSON-RPC failures. Reference pages call out the relevant error family where it matters; normal application code can return Result<T> from its own SDK-facing functions and handle narrower variants at validation or transport boundaries.