Skip to main content
The Python SDK supports EVM and Substrate transactions. These pages document version 0.2.1. The current release on PyPI is 1.0.1, which has an async, options-based API that these examples do not cover. Pin 0.2.1 to run the examples as written. The examples also read their keys and URLs from a .env file with python-dotenv:
For DID, Storage, and RBAC, the SDK can either return an unsigned transaction object for you to submit, or sign and send the transaction itself when you give it a private key (EVM) or mnemonic seed (Substrate). Transfers always sign and send, so they need the key or seed. The modules are Decentralized Identifiers (DID), Storage, RBAC (Role-Based Access Control), and Transfers. Before you start, decide whether you are building for EVM or Substrate, and whether the SDK should sign and send transactions or only prepare them. The response blocks on these pages show each return value’s fields. Write calls return a WrittenTransactionResult (message, receipt) when the SDK signs, or a BuiltEvmTransactionResult (message, tx) / BuiltCallTransactionResult (message, call) when it only builds the transaction. did.read returns a ReadDidResult and the RBAC fetch calls return dataclasses such as FetchResponseData. Read them as attributes, for example response.tx or role.name. Only storage.get_item returns a plain dict. On Substrate, the public fields of receipt are extrinsic_hash, block_hash, block_number, and finalized. For events, success, and fees, look the extrinsic up by extrinsic_hash on Subscan, or wrap it in substrate-interface’s ExtrinsicReceipt and read is_success, triggered_events, and total_fee_amount.

create_instance(base_url, chain_type, seed)

Initializes the SDK and returns an instance ready to interact with the network.