List Trigger Orders
Gets cancelled, pending or executed trigger orders for the provided subaccount and products.
Request
Request Parameters
Note: max_update_time
It's the time that the trigger order last changed state. For example, if a trigger order is placed & pending, the update time = time of placement. If the trigger order is cancelled, then the update time = time of cancellation.
Parameter | Type | Required | Description |
---|---|---|---|
tx | object | Yes | List trigger orders transaction object. See Signing section for details on the transaction fields. |
tx.sender | string | Yes | Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. |
tx.recvTime | string | Yes | Encoded time in milliseconds after which the list trigger orders transaction will be ignored. cannot be more than 100 seconds from the time it is received by the server. |
signature | string | Yes | Signed transaction. See Signing section for more details. |
product_id | number | No | If provided, returns all trigger orders for the given product; otherwise, returns trigger orders for all products. |
pending | boolean | Yes | If set to true, returns all pending trigger orders; otherwise, returns all executed and cancelled orders. |
max_update_time | number | No | If provided, returns all trigger orders that were last updated up to |
max_digest | string | No | If provided, returns all trigger orders up to the given order digest (exclusive). This can be used for pagination. |
digests | string[] | No | If provided, only returns the trigger orders for the associated digests. Note: all other filters are ignored when |
limit | number | No | If provided, returns the most recently updated trigger orders up to |
Signing
See more details and and examples in our signing page.
The solidity typed data struct that needs to be signed is:
sender
: a bytes32
sent as a hex string; includes the address and the subaccount identifier
recvTime
: the time in milliseconds (a recv_time
) after which the transaction should be ignored by the trigger service. cannot be more than 100 seconds from the time it is received by the server.
Note: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: recvTime
should be an uint64
for Signing but should be sent as a string
in the final payload.
Response
Success
Note: trigger orders can have the following statuses:
pending: initial state. trigger criteria has not been met nor has it been cancelled.
triggered: trigger criteria was met, and order was submitted for execution.
cancelled: trigger order was cancelled due to any of the following: user requested via cancel trigger order, order expired, account becomes unhealthy if order is triggered.
Failure
Last updated