-
Notifications
You must be signed in to change notification settings - Fork 188
/
staking.ts
95 lines (85 loc) · 2.42 KB
/
staking.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
95
import { CosmosStakingV1Beta1Staking } from '@injectivelabs/core-proto-ts'
export interface StakingModuleParams
extends Omit<GrpcStakingParams, 'unbondingTime'> {
unbondingTime: number
}
export interface Delegation {
delegation: {
delegatorAddress: string
validatorAddress: string
shares: string // BigNumberInWei
}
balance: {
denom: string
amount: string // BigNumberInBase
}
}
export interface ReDelegation {
delegation: {
delegatorAddress: string
sourceValidatorAddress: string
completionTime: number
destinationValidatorAddress: string
}
balance: string // BigNumberInBase
}
export interface UnBondingDelegation {
delegatorAddress: string
validatorAddress: string
creationHeight: number
completionTime: number
initialBalance: string // BigNumberInWei
balance: string // BigNumberInWei
}
export interface Pool {
notBondedTokens: string
bondedTokens: string
}
export enum BondStatus {
UnBonded = 'UnBonded',
UnBonding = 'UnBonding',
Bonded = 'Bonded',
}
export interface ValidatorDescription {
moniker: string
identity: string
website: string
securityContact: string
details: string
}
export interface ValidatorCommission {
commissionRates: {
rate: string
maxRate: string
maxChangeRate: string
}
updateTime: Date
}
export interface Validator {
operatorAddress: string
consensusPubKey?: string
jailed: boolean
status: BondStatus
tokens: string
delegatorShares: string
description: ValidatorDescription
unbondingHeight: number
unbondingTime: any
commission: ValidatorCommission
minSelfDelegation: string
}
export type GrpcValidator = CosmosStakingV1Beta1Staking.Validator
export type GrpcDelegation = CosmosStakingV1Beta1Staking.Delegation
export type GrpcValidatorDescription = CosmosStakingV1Beta1Staking.Description
export type GrpcValidatorCommission = CosmosStakingV1Beta1Staking.Commission
export type GrpcValidatorCommissionRates =
CosmosStakingV1Beta1Staking.CommissionRates
export type GrpcUnbondingDelegation =
CosmosStakingV1Beta1Staking.UnbondingDelegation
export type GrpcReDelegation = CosmosStakingV1Beta1Staking.Redelegation
export type GrpcDelegationResponse =
CosmosStakingV1Beta1Staking.DelegationResponse
export type GrpcReDelegationResponse =
CosmosStakingV1Beta1Staking.RedelegationResponse
export type GrpcStakingParams = CosmosStakingV1Beta1Staking.Params
export type GrpcPool = CosmosStakingV1Beta1Staking.Pool