File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,26 @@ func (rpc *NodeRPC) HeadMetadata() (head HeadMetadata, err error) {
9090 err = rpc .get ("chains/main/blocks/head/metadata" , & head )
9191 return
9292}
93+
94+ // ActiveDelegatesWithRolls -
95+ func (rpc * NodeRPC ) ActiveDelegatesWithRolls () (delegates []string , err error ) {
96+ err = rpc .get ("chains/main/blocks/head/context/raw/json/active_delegates_with_rolls" , & delegates )
97+ return
98+ }
99+
100+ // Delegates -
101+ func (rpc * NodeRPC ) Delegates (active * bool ) (delegates []string , err error ) {
102+ uri := "chains/main/blocks/head/context/delegates"
103+ if active != nil {
104+ uri = fmt .Sprintf ("%s?active=%t" , uri , * active )
105+ }
106+ err = rpc .get (uri , & delegates )
107+ return
108+ }
109+
110+ // StakingBalance -
111+ func (rpc * NodeRPC ) StakingBalance (address string ) (balance string , err error ) {
112+ uri := fmt .Sprintf ("/chains/main/blocks/head/context/delegates/%s/staking_balance" , address )
113+ err = rpc .get (uri , & balance )
114+ return
115+ }
You can’t perform that action at this time.
0 commit comments