Files

2.0 KiB

Nonces

Rate limits

  • 1200 requests/min or 20 requests/sec per IP address. (weight = 2)

{% hint style="info" %} See more details in API Rate limits {% endhint %}

Request

{% tabs %} {% tab title="Websocket" %} Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message

{
  "type": "nonces",
  "address": "0x0000000000000000000000000000000000000000"
}

{% endtab %}

{% tab title="REST (GET)" %} GGET [GATEWAY_REST_ENDPOINT]/query?type=nonces&address={address} {% endtab %}

{% tab title="REST (POST)" %} POST [GATEWAY_REST_ENDPOINT]/query

Body

{
  "type": "nonces",
  "address": "0x0000000000000000000000000000000000000000"
}

{% endtab %} {% endtabs %}

Request Parameters

ParameterTypeRequiredDescription
addressstringYesA bytes20 sent as a hex string representing the wallet address.

Response

{
  "status":"success",
  "data":{
    "tx_nonce": 0,
    "order_nonce": 1753048133299863552
  },
  "request_type": "query_nonces",
}

{% hint style="info" %} Note: when doing any execute that is not place_orders, i.e. withdraw_collateral, liquidate_subaccount, you want to use tx_nonce as the nonce. tx_nonce increments by one each time a successful execute goes through. order_nonce is a historical artifact for the frontend, and simply returns the current timestamp in milliseconds plus 100000 multiplied by 2**20. {% endhint %}