-
Notifications
You must be signed in to change notification settings - Fork 188
/
spot.ts
94 lines (86 loc) · 2.17 KB
/
spot.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import {
OrderSide,
OrderState,
TradeDirection,
TradeExecutionType,
TradeExecutionSide,
} from '@injectivelabs/ts-types'
import { GrpcOrderType } from '../../chain/types/exchange'
import { PriceLevel } from './exchange'
import { TokenMeta } from '@injectivelabs/token-metadata'
import { InjectiveSpotExchangeRpc } from '@injectivelabs/indexer-proto-ts'
export interface SpotMarket {
marketId: string
marketStatus: string
ticker: string
baseDenom: string
quoteDenom: string
makerFeeRate: string
quoteToken: TokenMeta | undefined
baseToken: TokenMeta | undefined
takerFeeRate: string
serviceProviderFee: string
minPriceTickSize: number
minQuantityTickSize: number
}
export interface SpotLimitOrder {
orderHash: string
orderSide: OrderSide
marketId: string
subaccountId: string
price: string
state: OrderState
quantity: string
unfilledQuantity: string
triggerPrice: string
feeRecipient: string
createdAt: number
updatedAt: number
}
export interface SpotOrderHistory {
orderHash: string
marketId: string
active: boolean
subaccountId: string
executionType: string
orderType: string
price: string
triggerPrice: string
quantity: string
filledQuantity: string
state: string
createdAt: number
updatedAt: number
direction: string
}
export interface SpotTrade extends PriceLevel {
orderHash: string
subaccountId: string
marketId: string
tradeId: string
executedAt: number
tradeExecutionType: TradeExecutionType
executionSide: TradeExecutionSide
tradeDirection: TradeDirection
fee: string
feeRecipient: string
}
export interface SpotLimitOrderParams {
orderType: GrpcOrderType
triggerPrice?: string
feeRecipient: string
price: string
quantity: string
}
export interface SpotOrderCancelParams {
orderHash: string
}
export interface BatchSpotOrderCancelParams {
orderHash: string
subaccountId: string
marketId: string
}
export type GrpcSpotTrade = InjectiveSpotExchangeRpc.SpotTrade
export type GrpcSpotMarketInfo = InjectiveSpotExchangeRpc.SpotMarketInfo
export type GrpcSpotLimitOrder = InjectiveSpotExchangeRpc.SpotLimitOrder
export type GrpcSpotOrderHistory = InjectiveSpotExchangeRpc.SpotOrderHistory