jellyfishsdk
jellyfishsdk copied to clipboard
`/apps/legacy-api` - Remaps old stats API
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]
getsubgraphswapsWIP -> #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
Since #1011 is merged, need your help to update all the endpoints. What's missing, what's done. What can't be done, etc.
I assume we can ignore:
- getanchorlist
- getaccount
- getcustomtx
- listaccounthistory
- gettokenrichlist
- getblockactivity
- getpoolpairlplist
We need to prioritize all pool related API.
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
}
}