@rholabs/rho-sdk
Advanced tools
Comparing version 0.4.0-alpha7 to 0.4.0-alpha8
@@ -517,2 +517,16 @@ import { BrowserProvider, JsonRpcSigner, JsonRpcProvider } from "ethers"; | ||
} | ||
export interface CancelOrderRequest { | ||
userId: string; | ||
symbol: string; | ||
clientOrderId?: string; | ||
orderId?: string; | ||
} | ||
export interface CancelOrderResponse { | ||
symbol: string; | ||
processingType: string; | ||
seqId: string; | ||
trades: any; | ||
orderExecutionReports: OrderExecutionReport[]; | ||
stateUpdates: any; | ||
} | ||
export enum OrderStatus { | ||
@@ -704,2 +718,3 @@ created = 0 | ||
postOrder(requestData: CreateOrderRequest): Promise<CreateOrderResponse>; | ||
cancelOrder(requestData: CancelOrderRequest): Promise<CancelOrderResponse>; | ||
getPortfolios(userId: string): Promise<UserPortfolio[]>; | ||
@@ -706,0 +721,0 @@ getOrderBook(symbol: string, depth?: number): Promise<{ |
{ | ||
"name": "@rholabs/rho-sdk", | ||
"version": "0.4.0-alpha7", | ||
"version": "0.4.0-alpha8", | ||
"description": "Rho Protocol SDK", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
import { | ||
CancelOrderRequest, | ||
CancelOrderResponse, | ||
CreateOrderRequest, | ||
CreateOrderResponse, | ||
Market, | ||
Order, OrderBookCandle, OrderBookCandleInterval, | ||
RhoV2Config, SymbolStats, | ||
Order, | ||
OrderBookCandle, | ||
OrderBookCandleInterval, | ||
RhoV2Config, | ||
SymbolStats, | ||
UserPortfolio | ||
@@ -46,2 +51,14 @@ } from '../typings' | ||
async cancelOrder(requestData: CancelOrderRequest) { | ||
const { data } = await this.client.post<{ | ||
data: CancelOrderResponse | ||
message: string | ||
}>('/orders/cancel', requestData, { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
}) | ||
return data.data | ||
} | ||
async getPortfolios(userId: string) { | ||
@@ -48,0 +65,0 @@ const { data } = await this.client.get<{ |
@@ -67,2 +67,18 @@ export type NetworkType = 'mainnet' | 'testnet' | 'custom' | ||
export interface CancelOrderRequest { | ||
userId: string | ||
symbol: string | ||
clientOrderId?: string | ||
orderId?: string | ||
} | ||
export interface CancelOrderResponse { | ||
symbol: string | ||
processingType: string | ||
seqId: string | ||
trades: any | ||
orderExecutionReports: OrderExecutionReport[] | ||
stateUpdates: any | ||
} | ||
export enum OrderStatus { | ||
@@ -69,0 +85,0 @@ created = 0 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5705124
19213