diff --git a/methods/http/getSupply.md b/methods/http/getSupply.md new file mode 100644 index 0000000..52c1a96 --- /dev/null +++ b/methods/http/getSupply.md @@ -0,0 +1,11 @@ +# getSupply + +Returns supply figures calculated from the selected bank. + +## Semantics + +The optional commitment selects the bank. When excludeNonCirculatingAccountsList is true, the response still calculates nonCirculating but returns an empty nonCirculatingAccounts array. Values are lamports. + +## Implementation notes + +- [**Agave**](../../implementations/agave.md): reference implementation. See the pinned [processor](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc.rs#L1126-L1153). diff --git a/methods/http/getSupply.yaml b/methods/http/getSupply.yaml new file mode 100644 index 0000000..48b5e44 --- /dev/null +++ b/methods/http/getSupply.yaml @@ -0,0 +1,47 @@ +name: getSupply +status: standard +summary: Returns total, circulating, and non-circulating lamport supply. +params: + - name: config + required: false + summary: Commitment and account-list configuration. + schema: + type: object + properties: + commitment: { $ref: '#/components/schemas/Commitment' } + excludeNonCirculatingAccountsList: { type: boolean, default: false } +result: + name: supply + summary: Supply information in an RpcResponse envelope. + schema: + type: object + required: [context, value] + properties: + context: { $ref: '#/components/schemas/RpcResponseContext' } + value: + type: object + required: [total, circulating, nonCirculating, nonCirculatingAccounts] + properties: + total: { $ref: '#/components/schemas/U64' } + circulating: { $ref: '#/components/schemas/U64' } + nonCirculating: { $ref: '#/components/schemas/U64' } + nonCirculatingAccounts: + type: array + items: { $ref: '#/components/schemas/Pubkey' } +errors: + - $ref: '#/components/errors/ScanError' +examples: + - name: without-account-list + summary: Return supply totals without the potentially large account list. + params: + - name: config + value: { commitment: finalized, excludeNonCirculatingAccountsList: true } + result: + name: supply + value: + context: { slot: 123, apiVersion: "3.0.0" } + value: { total: 5000000000, circulating: 4000000000, nonCirculating: 1000000000, nonCirculatingAccounts: [] } +implementations: + agave: { status: full } + cloudbreak: { status: none } + superbank: { status: none } diff --git a/proposals/0037-get-supply.md b/proposals/0037-get-supply.md new file mode 100644 index 0000000..4b59973 --- /dev/null +++ b/proposals/0037-get-supply.md @@ -0,0 +1,39 @@ +--- +number: 0037 +title: Add getSupply method specification +authors: [rpcpool] +status: draft +created: 2026-09-14 +reference-implementations: + - https://github.com/anza-xyz/agave/tree/6dd9d38771e46103b9680357a855804165612602 +--- + +# Add getSupply method specification + +## Summary + +Add the public supply query. + +## Motivation + +Clients need a portable contract for this public Agave RPC method. + +## Specification + +Add the paired HTTP method files. The result is an RpcResponse envelope whose value contains lamport totals and an optional non-circulating account list. + +## Return-type impact + +Adds the result shape defined by the paired method source. + +## Compatibility + +This is additive. Agave conforms. Cloudbreak and Superbank do not serve the method. + +## Reference implementation + +- [Agave handler and processor](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc.rs#L1126-L1153) + +## Security considerations + +Requesting the account list exposes public account identities and can require a supply scan. Clients can set the exclusion flag. diff --git a/spec-info.yaml b/spec-info.yaml index 892ea85..bca4391 100644 --- a/spec-info.yaml +++ b/spec-info.yaml @@ -1,5 +1,5 @@ title: Solana JSON-RPC API -version: 0.1.0 +version: 0.2.0 license: name: MIT url: https://opensource.org/license/mit/