stellar / js-stellar-sdk

Main Stellar client library for the JavaScript language.
https://stellar.github.io/js-stellar-sdk/
Apache License 2.0
615 stars 296 forks source link

Support `getFeeStats` in the RPC client (`rpc.Server`) #998

Open Shaptic opened 6 days ago

Shaptic commented 6 days ago

The getFeeStats method was introduced in https://github.com/stellar/soroban-rpc/pull/172 with the following response schema:

interface Response {
    sorobanInclusionFee: FeeDistribution;
    inclusionFee: FeeDistribution;
    latestLedger: number; // uint32
}

interface FeeDistribution {
    max: string;    // uint64
    min: string;    // uint64
    mode: string;   // uint64
    p10: string;    // uint64
    p20: string;    // uint64
    p30: string;    // uint64
    p40: string;    // uint64
    p50: string;    // uint64
    p60: string;    // uint64
    p70: string;    // uint64
    p80: string;    // uint64
    p90: string;    // uint64
    p95: string;    // uint64
    p99: string;    // uint64
    transactionCount: string; // uint32
    ledgerCount: number; // uint32
}

Note that the pNN values are just string-ified 64-bit integers.