User object that holds a keypair; the private key never leaves your machine. tpluspy signs each order, cancel, replace, and transfer request automatically via User.sign() before it is sent over the wire.
Creating a User
You have two options: an ephemeral user (keypair lives in memory only) or a stored user (keypair is saved to disk and reloaded between sessions).Managing Stored Users
Stored users live under~/.tplus/users/ as password-encrypted keyfiles. You can manage them with the UserManager class or the tplus accounts CLI commands.
Python API
CLI Commands
Generate a new keypair
~/.tplus/users/alice (prompts for an encryption password).Import an existing private key
--private-key to be prompted securely.Keyfile Storage
All keyfiles are stored at~/.tplus/users/<alias>. The directory is created automatically on first use. Each file contains the Ed25519 private key encrypted with a password you supply at generation time.
Back up your
~/.tplus/users/ directory to avoid losing access to your T+ identity. The private key cannot be recovered if the keyfile is lost.Signing Model
T+ uses its own signing scheme across all request types: Ed25519 over compact JSON (no spaces, sorted keys). Every order, cancel, replace, transfer, and settlement request carries this signature. tpluspy handles all of this automatically — you never callUser.sign() directly during normal order flow; just pass the User object to OrderBookClient and the client takes care of signing.
Sub-accounts
T+ supports sub-accounts for inventory isolation within a single signing identity. Sub-accounts are identified by an integer index (starting at0 for the default account). They are useful when you want to segregate positions or run multiple strategies under one keypair without creating separate users.
You specify the sub-account index when placing orders or querying state:
Automation: the TPLUS_PASSWORD Environment Variable
When running tpluspy in CI or unattended scripts, set the TPLUS_PASSWORD environment variable to supply the keyfile decryption password without an interactive prompt: