-
Notifications
You must be signed in to change notification settings - Fork 188
/
account.ts
63 lines (55 loc) · 1.57 KB
/
account.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
import { InjectiveAccountRpc } from '@injectivelabs/indexer-proto-ts'
import { Coin } from '@injectivelabs/ts-types'
export enum TransferType {
Internal = 'internal',
External = 'external',
Withdraw = 'withdraw',
Deposit = 'deposit',
}
export interface SubaccountTransfer {
transferType: TransferType
srcSubaccountId: string
srcSubaccountAddress: string
dstSubaccountId: string
dstSubaccountAddress: string
amount?: Coin
executedAt: number
}
export interface SubaccountDeposit {
totalBalance: string
availableBalance: string
}
export interface SubaccountBalance {
subaccountId: string
accountAddress: string
denom: string
deposit?: SubaccountDeposit
}
export interface SubaccountPortfolio {
subaccountId: string
availableBalance: string
lockedBalance: string
unrealizedPnl: string
}
export interface AccountPortfolio {
portfolioValue: string
availableBalance: string
lockedBalance: string
unrealizedPnl: string
subaccountsList: Array<SubaccountPortfolio>
}
export interface TradingReward {
accountAddress: string
rewards: {
amount: string
denom: string
}[]
distributedAt: number
}
export type GrpcTradingReward = InjectiveAccountRpc.Reward
export type GrpcAccountPortfolio = InjectiveAccountRpc.AccountPortfolio
export type GrpcSubaccountDeposit = InjectiveAccountRpc.SubaccountDeposit
export type GrpcSubaccountBalance = InjectiveAccountRpc.SubaccountBalance
export type GrpcSubaccountPortfolio = InjectiveAccountRpc.SubaccountPortfolio
export type GrpcSubaccountBalanceTransfer =
InjectiveAccountRpc.SubaccountBalanceTransfer