solana-go/rpc/getFeeCalculatorForBlockhas...

32 lines
846 B
Go
Raw Normal View History

2021-07-01 06:24:49 -07:00
package rpc
import (
"context"
"github.com/gagliardetto/solana-go"
2021-07-01 06:24:49 -07:00
)
type GetFeeCalculatorForBlockhashResult struct {
RPCContext
Value FeeCalculatorForBlockhashResult `json:"value"`
}
type FeeCalculatorForBlockhashResult struct {
FeeCalculator FeeCalculator `json:"feeCalculator"`
}
// GetFeeCalculatorForBlockhash returns the fee calculator
// associated with the query blockhash, or null if the blockhash has expired.
func (cl *Client) GetFeeCalculatorForBlockhash(
ctx context.Context,
hash solana.Hash, // query blockhash as a Base58 encoded string
commitment CommitmentType,
) (out *GetFeeCalculatorForBlockhashResult, err error) {
params := []interface{}{hash}
if commitment != "" {
params = append(params, M{"commitment": commitment})
}
err = cl.rpcClient.CallFor(&out, "getFeeCalculatorForBlockhash", params)
return
}