1

I'm attempting to get the current total network inflation rate in my application. I thought that historically there was a method for this provided by web3.js, but that doesn't seem to be the case.

The rpc does provide a method to handle this:

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
  {"jsonrpc":"2.0","id":1, "method":"getInflationRate"}
~~
{
  jsonrpc: '2.0',
  result: {
    epoch: 403,
    foundation: 0,
    total: 0.06381484839551996,
    validator: 0.06381484839551996
  },
  id: '3f64ef5f-b8cf-4fed-beb4-d30511daddb7'
}

But how can I get this same data from web3.js? There's doesn't seem to be a getInflationRate method.

1 Answer 1

3

Was using a very old version of solana-web3.js, updated to the latest, and the getInflationRate method was available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.