Python utilities used to generate and sign limit and market orders on Polymarket's CLOB
Project description
python-order-utils
Python utilities used to generate and sign limit and market orders on Polymarket's CLOB
Install
pip install py-order-utils
Usage
from py_order_utils.builders import LimitOrderBuilder
from py_order_utils.signer import Signer
exchange_address = "0x...."
chain_id = 1
signer = Signer("0xMockPrivateKey")
builder = LimitOrderBuilder(exchange_address, chain_id, signer)
# Create the limit order
limit_order = builder.build_limit_order(
LimitOrderData(
maker_asset_address="0x...",
taker_asset_address="0x...",
taker_asset_id=1,
...
)
)
# Sign it
signature = builder.build_limit_order_signature(limit_order)
# Generate the Order and Signature json to be sent to the CLOB
order_and_sig = builder.build_limit_order_and_signature(limit_order, signature).json()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_order_utils-0.0.7.tar.gz
(14.3 kB
view hashes)
Built Distribution
Close
Hashes for py_order_utils-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c37d6e523b07979a2ec6b96550042070bb1920937a587c16ec5c15f2b406bf |
|
MD5 | 4e28aaa3d8a379e0c7236def7049b1a0 |
|
BLAKE2b-256 | 9dfa615820a83adb84dcc8d91f5d49c7266adf531e6c0b8a60d641be1813feb3 |