Aori Python SDK
The Aori Python SDK provides a convenient interface for interacting with the Aori API, allowing developers to easily integrate Aori's functionalities into their Python applications.
Features
- Authentication with API keys
- Operations for orders: create, take, cancel
- Viewing and subscribing to orderbook updates
- Requesting quotes for potential orders
Installation
To install the Aori Python SDK, run the following command:
pip install your_package_name
Replace your_package_name with the actual name of your package.
Configuration
Before using the SDK, you need to configure it with your Aori API key and private key. There are two ways to do this:
Using Environment Variables
- Create a
.envfile in your project root. - Add your Aori API key and private key to the
.envfile as shown in the.env.examplefile:
AORI_API_KEY=your_aori_api_key_here
PRIVATE_KEY=your_private_key_here
- Load the environment variables in your application:
from dotenv import load_dotenv
load_dotenv()
- Initialize the SDK:
from aori_sdk import AoriSDK
sdk = AoriSDK()
Passing Directly
Alternatively, you can pass your API key and private key directly when creating an instance of the SDK:
from aori_sdk import AoriSDK
sdk = AoriSDK(api_key='your_aori_api_key_here', private_key='your_private_key_here')
Usage
Here are some examples of how to use the Aori Python SDK:
Test Connectivity
connectivity_response = sdk.test_connectivity()
print(connectivity_response)
Create a New Order
from aori_sdk import AoriOrder
new_order = AoriOrder(
offerer="0x...",
inputToken="0x...",
inputAmount="1000000000000000000", # 1 Token in Wei
inputChainId=1,
inputZone="0x...",
outputToken="0x...",
outputAmount="500000000000000000", # 0.5 Token in Wei
outputChainId=1,
outputZone="0x...",
startTime="1622548800",
endTime="1625130800",
salt="123456789",
counter=0,
toWithdraw=False,
signature="0x...",
isPublic=True
)
order_response = sdk.make_order(new_order)
print(order_response)
Subscribe to Orderbook Updates
sdk.subscribe_orderbook()
Contributing
Contributions are welcome! Please feel free to submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for aori-sdk-py 0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aori-sdk-py-0.6.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aori_sdk_py-0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / aori-sdk-py-0.6.tar.gz
| Download URL | aori-sdk-py-0.6.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af94ef0e5d2f6f45b82498e57a100501a1378ca5a719b5b2f4626afcc5e41171
|
|
BLAKE2b-256 checksum How to use checksums |
ffa6fd757fd0ad5c8be8dd0db00b115e5b863d4485e7c4c98373e6e8a6ef3478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Release files / aori_sdk_py-0.6-py3-none-any.whl
| Download URL | aori_sdk_py-0.6-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b83a138de687e2605d7758c716357b99be822a7e4bcd28bf663bbf2c1663890
|
|
BLAKE2b-256 checksum How to use checksums |
58e78bc144dc3cd4046af062fc5d2192a33ad406af8a677cfcb2483110ab201f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|