Skip to main content

aori.io python sdk

Project description

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

  1. Create a .env file in your project root.
  2. Add your Aori API key and private key to the .env file as shown in the .env.example file:
AORI_API_KEY=your_aori_api_key_here
PRIVATE_KEY=your_private_key_here
  1. Load the environment variables in your application:
from dotenv import load_dotenv
load_dotenv()
  1. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aori-sdk-py-0.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

aori_sdk_py-0.4-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file aori-sdk-py-0.4.tar.gz.

File metadata

  • Download URL: aori-sdk-py-0.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for aori-sdk-py-0.4.tar.gz
Algorithm Hash digest
SHA256 2053d48bbf4cb398b8ad90f45943f90c71dc6433e304149b9bc60aded860679d
MD5 4cd2f7e1616d8758d24ecc6b34e86c14
BLAKE2b-256 340ebd76f512f4c82193c93bc0ce8a059db62f115056e5c0fcfe51d1ebc30dd0

See more details on using hashes here.

File details

Details for the file aori_sdk_py-0.4-py3-none-any.whl.

File metadata

  • Download URL: aori_sdk_py-0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for aori_sdk_py-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4571e486467b30bd80acf0d49af60227be29136b311cb5d1ff1d1b56a2ce7e2
MD5 a65c3e63b513100fcb4dd70634614768
BLAKE2b-256 63dfe7349d7330bb05ad43e4c10d6156097ee7b266dd5f11bc3f0f3bbab383cb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page