solana-go/rpc/getSlotLeader.go

21 lines
443 B
Go

package rpc
import (
"context"
"github.com/gagliardetto/solana-go"
)
// GetSlotLeader returns the current slot leader.
func (cl *Client) GetSlotLeader(
ctx context.Context,
commitment CommitmentType, // optional
) (out solana.PublicKey, err error) {
params := []interface{}{}
if commitment != "" {
params = append(params, M{"commitment": commitment})
}
err = cl.rpcClient.CallForInto(ctx, &out, "getSlotLeader", params)
return
}