Skip to main content

Python utilities used to generate and sign limit and market orders on Polymarket's CLOB

Project description

python-order-utils

PyPI

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 and sign the limit order
limit_order = builder.create_limit_order(
    LimitOrderData(
        maker_asset_address="0x...",
        taker_asset_address="0x...",
        taker_asset_id=1,
        ...
    )
)

# Generate the Order and Signature json to be sent to the CLOB
d = json.dumps(limit_order.dict())

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

py_order_utils-0.0.15.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

py_order_utils-0.0.15-py3-none-any.whl (20.9 kB view hashes)

Uploaded Python 3

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