tpluspy EVM extra adds on-chain capabilities on top of the core Python SDK: reading the T+ asset registry, interacting with vault contracts, and constructing signed settlement orders. It is built on the Ape Framework and uses T+‘s own contract-defined signing scheme — not generic Ethereum tooling.
Installation
The EVM extra is not included in the defaultpip install tpluspy. You must install it explicitly:
tplus-core, the core install is sufficient — you do not need [evm].
Ape Console Setup
The EVM extra integrates with theape console REPL. Start a console connected to the Sepolia testnet:
You can use any Ape-compatible provider, not just Alchemy. Point
--network at any supported provider or a raw RPC URL:tpluspy pre-loads contract instances (vault, registry) into the namespace via the Ape console extras in ape_console_extras.py. You can call contract methods directly without any further import:
Registry Operations
The registry contract tracks all assets registered with T+. Import the pre-configured instance fromtplus.evm.contracts:
registry.getAssets()
Returns a list of named tuples, each containing:
| Field | Type | Description |
|---|---|---|
assetAddress | HexBytes | The token contract address |
chainId | int | The EVM chain ID where the asset lives |
maxDeposits | int | Maximum deposits allowed for this asset |
registry.admin()
Returns the Ethereum address of the current registry admin.
Vault Operations
The vault contract manages deposit nonces and settlement state. Import the pre-configured vault instance:vault.getDepositNonce(address)
Returns the current nonce for the given Ethereum address. This nonce is required when constructing settlement Order objects — it prevents replay attacks on signed settlement messages.
Settlement Signatures
To authorise a settlement, you construct a typedOrder object and sign it with your Ethereum account using T+‘s own structured-message signing scheme. The resulting signature is submitted alongside the settlement request.
Here is a complete example:
Load your Ethereum account
Use
accounts.load("name") to load a keyfile stored in Ape’s account manager. This is your on-chain identity for interacting with T+ contracts.Load your T+ user
UserManager.load("my_user").public_key returns your Ed25519 public key, which acts as the userId binding the settlement to your T+ account.Fetch the nonce
vault.getDepositNonce(address) returns the current nonce from the contract. Always fetch it fresh — using a stale nonce will cause the settlement to be rejected.Construct the Order
Build an
Order from tplus.utils.domain with the token addresses, amounts (in wei), your user ID, nonce, and a validUntil timestamp.Supported Networks
T+ contracts are currently deployed on Ethereum Sepolia (chain ID11155111). You can connect via any Ape-compatible provider that supports Sepolia:
Mainnet deployment details will be published when available. For now, all on-chain interactions should target Sepolia.