Logo

Orderbook Endpoints

getUserOrders

Gets the users orders.

Method: query
isSigned: true


Response

Returns: [ImmutableOrder]

  where ImmutableOrder is defined as:

  public type ImmutableOrder = {
    id : OrderID;
    eventId : EventID;
    user : Principal;
    createdAt : Time.Time;
    marketId : MarketID;
    side : OrderSide;
    premium : Premium;
    initialContracts : Nat; // in E8S so 100_000_000 = 1 contract
    currentContracts : Nat; // in E8S so 100_000_000 = 1 contract
    status : OrderStatus;
  };
  public type OrderID = Text;
    public type EventID = Nat;
    public type MarketID = Nat;
      public type OrderSide = {
    #buy;
    #sell;
  };
  public type Premium = Nat;
  public type OrderStatus = {
    #open;
    #cancelled;
    #filled;
  };
Previous
getOrderBooks