fastnear / fastnear-api-server-rs

23 stars 4 forks source link

Introduce Top FT holders API #7

Closed evgenykuzyakov closed 6 months ago

evgenykuzyakov commented 6 months ago

Token ID to top 100 accounts by balance (for FT contracts).

Returns the list of account IDs for a given fungible tokens (FT) contract ordered by decreasing FT balance. Each account result includes the following:

Notes:

GET /v1/ft/{token_id}/top

Example: https://api.fastnear.com/v1/ft/first.tkn.near/top

curl https://api.fastnear.com/v1/ft/first.tkn.near/top

Result:

{
  "token_id": "first.tkn.near",
  "accounts": [
    {
      "account_id": "mob.near",
      "balance": "979894691374420631019486155"
    },
    {
      "account_id": "lucky-bastard.near",
      "balance": "10319841074196024761995069"
    },
    {
      "account_id": "mattlock.near",
      "balance": "9775084808910328058513245"
    },
    {
      "account_id": "ref-finance.near",
      "balance": "10290906529190035816723"
    },
    {
      "account_id": "zilulagg.near",
      "balance": "91835943826124178808"
    },
    {
      "account_id": "kotleta.near",
      "balance": "10000"
    },
    {
      "account_id": "ryanmehta.near",
      "balance": "0"
    }
  ]
}