jellyfishsdk icon indicating copy to clipboard operation
jellyfishsdk copied to clipboard

`/apps/legacy-api` - Remaps old stats API

Open joeldavidw opened this issue 4 years ago • 4 comments

What would you like to be added:

Implementation of legacy-api to remap the legacy stats API (https://api.defichain.com/v1/*).

Legacy API Endpoints

  • [x] gettoken
  • [x] listtokens
  • [x] getpoolpair
  • [x] listpoolpairs
  • [x] getblockcount
  • [x] validateAddress #1090
  • [x] getgov #1090
  • [x] listyieldfarming #1115
  • [x] listswaps #1102
  • [ ] getswaptransaction
  • [x] getsubgraphswaps WIP -> #1119
  • [ ] gettotalvolumestats
  • [ ] getliquiditytotalvolumedata
  • [x] stats #1100
  • [ ] stats/tickers

Low Priority

  • [ ] getanchorlist
  • [ ] getaccount
  • [ ] getcustomtx
  • [ ] listaccounthistory
  • [ ] gettokenrichlist
  • [ ] getblockactivity
  • [ ] getpoolpairlplist

Notes

  • http://json2ts.com/ will be helpful - copy the response from https://api.defichain.com/v1/* and paste it in, generating typescript interface that will greatly reduce the burden to figure out the correct json shape and types (especially for large ones)

/sig ecosystem /area apps /triage accepted

joeldavidw avatar Feb 04 '22 05:02 joeldavidw

Since #1011 is merged, need your help to update all the endpoints. What's missing, what's done. What can't be done, etc.

fuxingloh avatar Feb 14 '22 10:02 fuxingloh

I assume we can ignore:

  • getanchorlist
  • getaccount
  • getcustomtx
  • listaccounthistory
  • gettokenrichlist
  • getblockactivity
  • getpoolpairlplist

fuxingloh avatar Feb 15 '22 07:02 fuxingloh

We need to prioritize all pool related API.

fuxingloh avatar Feb 15 '22 07:02 fuxingloh

Just wanna check - are we maintaining the types too?

E.g. https://api.defichain.com/v1/stats

{
  // ...
  "burnInfo": {
    "address": "8defichainBurnAddressXXXXXXXdRQkSm",
    "amount": "156002224.91060823", // ------------- string
    "tokens": [
      "7260.95539278@DFI",
      "6550.00000000@ETH",
      "2476.86380002@BTC",
      "14032000.00000000@USDT",
      "16820000.00000000@DOGE",
      "19051.00000000@LTC",
      "3131.00000000@BCH",
      "4850000.00000000@USDC"
    ],
    "feeburn": 231159, // -------------------------- number
    "auctionburn": 374375.30150853, // ------------- number
    "paybackburn": "25066964.72917669", // --------- string
    "dexfeetokens": [
      "7.00001122@BTC",
      "174522.90958767@DUSD"
    ],
    "dfipaybackfee": 248965.40114938, // ----------- number
    "dfipaybacktokens": [
      "84040905.83804874@DUSD"
    ],
    "emissionburn": "76084370.29591077" // --------- string
  }
}

eli-lim avatar Feb 24 '22 07:02 eli-lim