Add RPC/getFeeRateGovernor

This commit is contained in:
Slavomir 2021-07-01 15:33:32 +02:00
parent 70ce94c209
commit d46cafb7e0
1 changed files with 29 additions and 0 deletions

29
rpc/getFeeRateGovernor.go Normal file
View File

@ -0,0 +1,29 @@
package rpc
import (
"context"
bin "github.com/dfuse-io/binary"
)
type GetFeeRateGovernorResult struct {
RPCContext
Value FeeRateGovernorResult `json:"value"`
}
type FeeRateGovernorResult struct {
FeeRateGovernor FeeRateGovernor `json:"feeRateGovernor"`
}
type FeeRateGovernor struct {
BurnPercent uint8 `json:"burnPercent"` // Percentage of fees collected to be destroyed
MaxLamportsPerSignature bin.Uint64 `json:"maxLamportsPerSignature"` // Largest value lamportsPerSignature can attain for the next slot
MinLamportsPerSignature bin.Uint64 `json:"minLamportsPerSignature"` // Smallest value lamportsPerSignature can attain for the next slot
TargetLamportsPerSignature bin.Uint64 `json:"targetLamportsPerSignature"` // Desired fee rate for the cluster
TargetSignaturesPerSlot bin.Uint64 `json:"targetSignaturesPerSlot"` // Desired signature rate for the cluster
}
// GetFeeRateGovernor returns the fee rate governor information from the root bank.
func (cl *Client) GetFeeRateGovernor(ctx context.Context) (out *GetFeeRateGovernorResult, err error) {
params := []interface{}{}
err = cl.rpcClient.CallFor(&out, "getFeeRateGovernor", params...)
return
}