Build Order
Usage
from opinion_clob_sdk.chain.py_order_utils.model.sides import BUY, SELL
from opinion_clob_sdk.chain.py_order_utils.model.order_type import LIMIT_ORDER, MARKET_ORDER
build_result = builder.build_order_for_signing(
market_id=123,
token_id="outcome_token_id",
user_wallet_address="0xSafeAddress...", # Maker (Safe wallet)
side=BUY,
order_type=LIMIT_ORDER,
amount=10.0,
price="0.5",
signer_address="0xUserEOAAddress...", # Signer (EOA)
)
print(build_result["order"]) # Order struct dict
print(build_result["struct_hash"]) # Hash for the user to sign
print(build_result["typed_data"]) # Full EIP-712 typed data (for reference)Parameters
Parameter
Type
Required
Description