Interface OkexV3


  • @Path("/api")
    @Produces("application/json")
    public interface OkexV3
    • Method Detail

      • fundingAccountInformation

        @GET
        @Path("/account/v3/wallet")
        List<OkexFundingAccountRecord> fundingAccountInformation​(@HeaderParam("OK-ACCESS-KEY")
                                                                 String apiKey,
                                                                 @HeaderParam("OK-ACCESS-SIGN")
                                                                 si.mazi.rescu.ParamsDigest signature,
                                                                 @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                                 String timestamp,
                                                                 @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                                 String passphrase)
                                                          throws IOException,
                                                                 OkexException
        Funding Account API *********************************
        Throws:
        IOException
        OkexException
      • fundsTransfer

        @POST
        @Path("/account/v3/transfer")
        @Consumes("application/json")
        FundsTransferResponse fundsTransfer​(@HeaderParam("OK-ACCESS-KEY")
                                            String apiKey,
                                            @HeaderParam("OK-ACCESS-SIGN")
                                            si.mazi.rescu.ParamsDigest signature,
                                            @HeaderParam("OK-ACCESS-TIMESTAMP")
                                            String timestamp,
                                            @HeaderParam("OK-ACCESS-PASSPHRASE")
                                            String passphrase,
                                            FundsTransferRequest req)
                                     throws IOException,
                                            OkexException
        Parameters:
        currency - required, Token
        amount - required, Transfer amount
        from - required, the remitting account (0: sub account 1: spot 3: futures 4:C2C 5: margin 6: Funding Account 8:PiggyBank 9:swap)
        to - required, the beneficiary account(0: sub account 1:spot 3: futures 4:C2C 5: margin 6: Funding Account 8:PiggyBank 9 :swap)
        subAccount - optional, sub account name
        instrumentid - optional, margin token pair ID, for supported pairs only
        Returns:
        Throws:
        IOException
        OkexException
      • spotTradingAccount

        @GET
        @Path("/spot/v3/accounts")
        List<OkexSpotAccountRecord> spotTradingAccount​(@HeaderParam("OK-ACCESS-KEY")
                                                       String apiKey,
                                                       @HeaderParam("OK-ACCESS-SIGN")
                                                       si.mazi.rescu.ParamsDigest signature,
                                                       @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                       String timestamp,
                                                       @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                       String passphrase)
                                                throws IOException,
                                                       OkexException
        Spot Token Trading API *********************************
        Throws:
        IOException
        OkexException
      • getSpotOrderList

        @GET
        @Path("/spot/v3/orders")
        List<OkexOpenOrder> getSpotOrderList​(@HeaderParam("OK-ACCESS-KEY")
                                             String apiKey,
                                             @HeaderParam("OK-ACCESS-SIGN")
                                             si.mazi.rescu.ParamsDigest signature,
                                             @HeaderParam("OK-ACCESS-TIMESTAMP")
                                             String timestamp,
                                             @HeaderParam("OK-ACCESS-PASSPHRASE")
                                             String passphrase,
                                             @QueryParam("instrument_id")
                                             String instrumentId,
                                             @QueryParam("from")
                                             String from,
                                             @QueryParam("to")
                                             String to,
                                             @QueryParam("limit")
                                             Integer limit,
                                             @QueryParam("state")
                                             String state)
                                      throws IOException,
                                             OkexException
        Parameters:
        instrumentId - [required] list the orders of specific trading pairs
        from - [optional] request page after this id (latest information) (eg. 1, 2, 3, 4, 5. There is only a 5 "from 4", while there are 1, 2, 3 "to 4")
        to - [optional] request page after (newer) this id.
        limit - [optional] number of results per request. Maximum 100. (default 100)
        state - [required ] Order Status("-2":Failed,"-1":Cancelled,"0":Open ,"1":Partially Filled, "2":Fully Filled,"3":Submitting,"4":Cancelling,"6": Incomplete(open+partially filled),"7":Complete(cancelled+fully filled))
        Returns:
        Throws:
        IOException
        OkexException
      • getSpotOrderDetails

        @GET
        @Path("/spot/v3/orders/{order_id}")
        OkexOpenOrder getSpotOrderDetails​(@HeaderParam("OK-ACCESS-KEY")
                                          String apiKey,
                                          @HeaderParam("OK-ACCESS-SIGN")
                                          si.mazi.rescu.ParamsDigest signature,
                                          @HeaderParam("OK-ACCESS-TIMESTAMP")
                                          String timestamp,
                                          @HeaderParam("OK-ACCESS-PASSPHRASE")
                                          String passphrase,
                                          @PathParam("order_id")
                                          String orderId,
                                          @QueryParam("instrument_id")
                                          String instrumentId)
                                   throws IOException,
                                          OkexException
        Throws:
        IOException
        OkexException
      • getSpotTransactionDetails

        @GET
        @Path("/spot/v3/fills")
        List<OkexTransaction> getSpotTransactionDetails​(@HeaderParam("OK-ACCESS-KEY")
                                                        String apiKey,
                                                        @HeaderParam("OK-ACCESS-SIGN")
                                                        si.mazi.rescu.ParamsDigest signature,
                                                        @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                        String timestamp,
                                                        @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                        String passphrase,
                                                        @QueryParam("order_id")
                                                        String orderId,
                                                        @QueryParam("instrument_id")
                                                        String instrumentId,
                                                        @QueryParam("from")
                                                        String from,
                                                        @QueryParam("to")
                                                        String to,
                                                        @QueryParam("limit")
                                                        Integer limit)
                                                 throws IOException,
                                                        OkexException
        Parameters:
        orderId - required, order ID
        instrumentId - required, trading pair
        from - optional, Request page before (older) this pagination id,the parameter are order_id, ledger_id or trade_id of the endpoint, etc.
        to - optional, Request page after (newer) this pagination id,the parameter are order_id, ledger_id or trade_id of the endpoint, etc.
        limit - optional, Number of results per request. Maximum 100. (default 100)
        Returns:
        Throws:
        IOException
        OkexException
      • getFuturesBills

        @GET
        @Path("/futures/v3/accounts/{underlying}/ledger")
        List<FuturesBillsResponse> getFuturesBills​(@HeaderParam("OK-ACCESS-KEY")
                                                   String apiKey,
                                                   @HeaderParam("OK-ACCESS-SIGN")
                                                   si.mazi.rescu.ParamsDigest signature,
                                                   @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                   String timestamp,
                                                   @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                   String passphrase,
                                                   @PathParam("underlying")
                                                   String underlying,
                                                   @QueryParam("after")
                                                   String after,
                                                   @QueryParam("before")
                                                   String before,
                                                   @QueryParam("limit")
                                                   Integer limit,
                                                   @QueryParam("type")
                                                   BillType type)
                                            throws IOException,
                                                   OkexException
        Retrieve the bills of the futures account. The bill refers to all the records that results in changing the balance of an account. This API can retrieve data in the last 2 days.
        Parameters:
        underlying - - requierd,eg:BTC-USD BTC-USDT
        after - - optional, Pagination of data to return records earlier than the requested ledger_id
        before - - optional, Pagination of data to return records newer than the requested ledger_id
        limit - - optional, Number of results per request. The maximum is 100; the default is 100
        type - - optional, 1:Open Long 2:Open Short 3:Close Long 4:Close Short 5:Transaction Fee 6:Transfer In, 7:Transfer Out 8:Settled RPL 13: Full Liquidation of Long 14: Full Liquidation of Short 15: Delivery Long 16: Delivery Short 17:Settled UPL Long 18:Settled UPL Short 20:Partial Liquidation of Short 21:Partial Liquidation of Long
        Throws:
        IOException
        OkexException
      • getFuturesOrderList

        @GET
        @Path("/futures/v3/orders/{instrument_id}")
        FuturesOpenOrdersResponse getFuturesOrderList​(@HeaderParam("OK-ACCESS-KEY")
                                                      String apiKey,
                                                      @HeaderParam("OK-ACCESS-SIGN")
                                                      si.mazi.rescu.ParamsDigest signature,
                                                      @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                      String timestamp,
                                                      @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                      String passphrase,
                                                      @PathParam("instrument_id")
                                                      String instrumentId,
                                                      @QueryParam("from")
                                                      String from,
                                                      @QueryParam("to")
                                                      String to,
                                                      @QueryParam("limit")
                                                      Integer limit,
                                                      @QueryParam("state")
                                                      String state)
                                               throws IOException,
                                                      OkexException
        Parameters:
        instrumentId -
        from -
        to -
        limit -
        state - Order Status("-2":Failed,"-1":Cancelled,"0":Open ,"1":Partially Filled, "2":Fully Filled,"3":Submitting,"4":Cancelling,"6": Incomplete(open+partially filled),"7":Complete(cancelled+fully filled))
        Returns:
        Throws:
        IOException
        OkexException
      • futuresCancelOrder

        @POST
        @Path("/futures/v3/cancel_order/{instrument_id}/{order_id}")
        @Consumes("application/json")
        OrderCancellationResponse futuresCancelOrder​(@HeaderParam("OK-ACCESS-KEY")
                                                     String apiKey,
                                                     @HeaderParam("OK-ACCESS-SIGN")
                                                     si.mazi.rescu.ParamsDigest signature,
                                                     @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                     String timestamp,
                                                     @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                     String passphrase,
                                                     @PathParam("instrument_id")
                                                     String instrumentId,
                                                     @PathParam("order_id")
                                                     String orderId)
                                              throws IOException,
                                                     OkexException
        Throws:
        IOException
        OkexException
      • getSwapOrderList

        @GET
        @Path("/swap/v3/orders/{instrument_id}")
        SwapOpenOrdersResponse getSwapOrderList​(@HeaderParam("OK-ACCESS-KEY")
                                                String apiKey,
                                                @HeaderParam("OK-ACCESS-SIGN")
                                                si.mazi.rescu.ParamsDigest signature,
                                                @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                String timestamp,
                                                @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                String passphrase,
                                                @PathParam("instrument_id")
                                                String instrumentId,
                                                @QueryParam("from")
                                                String from,
                                                @QueryParam("to")
                                                String to,
                                                @QueryParam("limit")
                                                Integer limit,
                                                @QueryParam("state")
                                                String state)
                                         throws IOException,
                                                OkexException
        Parameters:
        instrumentId -
        from -
        to -
        limit -
        state - Yes Order Status("-2":Failed,"-1":Cancelled,"0":Open ,"1":Partially Filled, "2":Fully Filled,"3":Submitting,"4":Cancelling,"6": Incomplete(open+partially filled),"7":Complete(cancelled+fully filled))
        Returns:
        Throws:
        IOException
        OkexException
      • swapCancelOrder

        @POST
        @Path("/swap/v3/cancel_order/{instrument_id}/{order_id}")
        @Consumes("application/json")
        OrderCancellationResponse swapCancelOrder​(@HeaderParam("OK-ACCESS-KEY")
                                                  String apiKey,
                                                  @HeaderParam("OK-ACCESS-SIGN")
                                                  si.mazi.rescu.ParamsDigest signature,
                                                  @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                  String timestamp,
                                                  @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                  String passphrase,
                                                  @PathParam("instrument_id")
                                                  String instrumentId,
                                                  @PathParam("order_id")
                                                  String orderId)
                                           throws IOException,
                                                  OkexException
        Throws:
        IOException
        OkexException
      • getSwapTransactionDetails

        @GET
        @Path("/swap/v3/fills")
        List<OkexSwapTransaction> getSwapTransactionDetails​(@HeaderParam("OK-ACCESS-KEY")
                                                            String apiKey,
                                                            @HeaderParam("OK-ACCESS-SIGN")
                                                            si.mazi.rescu.ParamsDigest signature,
                                                            @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                            String timestamp,
                                                            @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                            String passphrase,
                                                            @QueryParam("order_id")
                                                            String orderId,
                                                            @QueryParam("instrument_id")
                                                            String instrumentId,
                                                            @QueryParam("from")
                                                            String from,
                                                            @QueryParam("to")
                                                            String to,
                                                            @QueryParam("limit")
                                                            Integer limit)
                                                     throws IOException,
                                                            OkexException
        Throws:
        IOException
        OkexException
      • marginAccounts

        @GET
        @Path("/margin/v3/accounts")
        MarginAccountResponse[] marginAccounts​(@HeaderParam("OK-ACCESS-KEY")
                                               String apiKey,
                                               @HeaderParam("OK-ACCESS-SIGN")
                                               si.mazi.rescu.ParamsDigest signature,
                                               @HeaderParam("OK-ACCESS-TIMESTAMP")
                                               String timestamp,
                                               @HeaderParam("OK-ACCESS-PASSPHRASE")
                                               String passphrase)
                                        throws IOException,
                                               OkexException
        Margin Trading API *********************************
        Throws:
        IOException
        OkexException
      • marginCancelOrder

        @POST
        @Path("/margin/v3/cancel_order/{instrument_id}/{order_id}")
        @Consumes("application/json")
        OrderCancellationResponse marginCancelOrder​(@HeaderParam("OK-ACCESS-KEY")
                                                    String apiKey,
                                                    @HeaderParam("OK-ACCESS-SIGN")
                                                    si.mazi.rescu.ParamsDigest signature,
                                                    @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                    String timestamp,
                                                    @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                    String passphrase,
                                                    @PathParam("instrument_id")
                                                    String instrumentId,
                                                    @PathParam("order_id")
                                                    String orderId)
                                             throws IOException,
                                                    OkexException
        Throws:
        IOException
        OkexException
      • getMarginOrderList

        @GET
        @Path("/margin/v3/orders")
        List<OkexOpenOrder> getMarginOrderList​(@HeaderParam("OK-ACCESS-KEY")
                                               String apiKey,
                                               @HeaderParam("OK-ACCESS-SIGN")
                                               si.mazi.rescu.ParamsDigest signature,
                                               @HeaderParam("OK-ACCESS-TIMESTAMP")
                                               String timestamp,
                                               @HeaderParam("OK-ACCESS-PASSPHRASE")
                                               String passphrase,
                                               @QueryParam("instrument_id")
                                               String instrumentId,
                                               @QueryParam("from")
                                               String from,
                                               @QueryParam("to")
                                               String to,
                                               @QueryParam("limit")
                                               Integer limit,
                                               @QueryParam("state")
                                               String state)
                                        throws IOException,
                                               OkexException
        Parameters:
        instrumentId - [required] list the orders of specific trading pairs
        from - [optional] request page after this id (latest information) (eg. 1, 2, 3, 4, 5. There is only a 5 "from 4", while there are 1, 2, 3 "to 4")
        to - [optional] request page after (newer) this id.
        limit - [optional] number of results per request. Maximum 100. (default 100)
        state - [required ] Order Status("-2":Failed,"-1":Cancelled,"0":Open ,"1":Partially Filled, "2":Fully Filled,"3":Submitting,"4":Cancelling,"6": Incomplete(open+partially filled),"7":Complete(cancelled+fully filled))
        Returns:
        Throws:
        IOException
        OkexException
      • getMarginTransactionDetails

        @GET
        @Path("/margin/v3/fills")
        List<OkexTransaction> getMarginTransactionDetails​(@HeaderParam("OK-ACCESS-KEY")
                                                          String apiKey,
                                                          @HeaderParam("OK-ACCESS-SIGN")
                                                          si.mazi.rescu.ParamsDigest signature,
                                                          @HeaderParam("OK-ACCESS-TIMESTAMP")
                                                          String timestamp,
                                                          @HeaderParam("OK-ACCESS-PASSPHRASE")
                                                          String passphrase,
                                                          @QueryParam("order_id")
                                                          String orderId,
                                                          @QueryParam("instrument_id")
                                                          String instrumentId,
                                                          @QueryParam("from")
                                                          String from,
                                                          @QueryParam("to")
                                                          String to,
                                                          @QueryParam("limit")
                                                          Integer limit)
                                                   throws IOException,
                                                          OkexException
        Parameters:
        orderId - required, order ID
        instrumentId - required, trading pair
        from - optional, Request page before (older) this pagination id,the parameter are order_id, ledger_id or trade_id of the endpoint, etc.
        to - optional, Request page after (newer) this pagination id,the parameter are order_id, ledger_id or trade_id of the endpoint, etc.
        limit - optional, Number of results per request. Maximum 100. (default 100)
        Returns:
        Throws:
        IOException
        OkexException