Skip to content
Complete API Reference

Python SDK Complete API Reference

The public API of phantasma_py: 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 modules, classes, methods, fields, and constants under phantasma_py.

Import Policy

The package re-exports the main user-facing APIs from phantasma_py. That is convenient for examples:

from phantasma_py import PhantasmaRPC, PhantasmaKeys

For larger applications, import from the module that owns the API. It makes the code easier to review because the import tells the reader whether the code is using RPC, VM, crypto, or Carbon functionality:

from phantasma_py.crypto import PhantasmaKeys
from phantasma_py.rpc import PhantasmaRPC
from phantasma_py.carbon import build_create_token_tx_and_sign_hex

Error Model

All SDK-specific exceptions inherit from PhantasmaError. The most common subclasses are RPCError, CryptoError, EncodingError, SerializationError, and BuilderError. Reference pages call out the error family where it matters; normal application code can catch PhantasmaError at module boundaries and handle narrower subclasses in validation-heavy code paths.