01.xyz Python SDK
Python SDK to interface with the 01 Solana program.
Installation
$ pip install zo-sdk
General Usage
from zo import Zo
# Create the client. By default, this loads the local payer
# and initializes a margin account for the payer if there
# isn't already one.
zo = await Zo.new(cluster='devnet')
# View market and collateral info.
print(zo.collaterals["BTC"])
print(zo.markets["BTC-PERP"])
# Deposit and withdraw collateral.
await zo.deposit(1, "SOL")
await zo.withdraw(1, "SOL")
# Place and cancel orders.
await zo.place_order(1., 100., 'bid',
symbol="SOL-PERP", order_type="limit", client_id=1)
await zo.cancel_order_by_client_id(1, symbol="SOL-PERP")
# Refresh loaded accounts to see updates,
# such as change in collateral after deposits.
await zo.refresh()
# View own balance, positions and orders.
print(zo.balance["BTC"])
print(zo.position["BTC-PERP"])
print(zo.orders["BTC-PERP"])
# Dispatch multiple instructions in a single transaction,
# using the `_ix` variant.
await zo.send(
zo.cancel_order_by_client_id_ix(1, symbol="SOL-PERP"),
zo.place_order_ix(1., 100., 'bid',
symbol="SOL-PERP", order_type="limit", client_id=1),
)
Metadata
Release files for zo-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| zo-sdk-0.2.0.tar.gz | 22.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zo_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.0 kB
Release files / zo-sdk-0.2.0.tar.gz
| Download URL | zo-sdk-0.2.0.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bddbf5df85c87d01e2646ea0f462ed07138415130b37ba54a941874120dbbec1
|
|
BLAKE2b-256 checksum How to use checksums |
345d5f40b4a7ea09a6899acba5024d3227057bcbaf4cae486ee58be20038c483
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.18.15-arch1-1
|
Release files / zo_sdk-0.2.0-py3-none-any.whl
| Download URL | zo_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09e11f975008ea4ec8afde8aa0ad9af37125bb8cd4b3b10bc8336b6a220c34be
|
|
BLAKE2b-256 checksum How to use checksums |
251fe5c8d89fbfcd40306b5641f3b54cc4c0a5677bccd0e6e9eb1e99d5037c34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.10.5 Linux/5.18.15-arch1-1
|
Security for zo-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.