Signatures and Nonces
Nonces
Nonce Generation
def create_orders_gateway_nonce(self, account_id: int, market_id: int, timestamp_ms: int) -> int:
"""Create a nonce for Orders Gateway orders."""
# Validate the input ranges
if market_id < 0 or market_id >= 2**32:
raise ValueError("marketId is out of range")
if account_id < 0 or account_id >= 2**128:
raise ValueError("accountId is out of range")
if timestamp_ms < 0 or timestamp_ms >= 2**64:
raise ValueError("timestamp is out of range")
hash_uint256 = (account_id << 98) | (timestamp_ms << 32) | market_id
return hash_uint256On-Chain Nonce Validation
Signatures
Domain Structure
Type Definitions for Order Creation
Order Type Inputs Encoding
Cancelling signatures
Last updated