Sub-Adapters 1
Preview and test each sub adapter.
EOS (eos)
Metadata
- ID
- eos
- name
"EOS"
- category
"l1"
- icon
- description
"EOS is a high-throughput smart-contract blockchain"
- feeDescription
"EOS fees are paid to REX stakers"
- source
"EOS Nation"
- protocolLaunch
"2018-06-08"
- tokenTicker
"EOS"
- tokenCoingecko
"eos"
- website
"https://eosnetwork.com"
Queries
Adapter Code
Check the entire code written for the Adapter.
Source code
Showing TS source.
1export const name = 'EOS Fees';
2export const version = '0.1.3';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6 const getFees = async (date: string) => {
7 const [data, price] = await Promise.all([
8 sdk.http.get(`https://cryptostats.eosnation.io/api/eos/fees?date=${date}`),
9 sdk.coinGecko.getHistoricalPrice('eos', date)
10 ])
11 // data => {"fees": "365.4881 EOS"}
12 const fees = Number(data.fees.split(" ")[0]);
13 return fees * price;
14 }
15
16 sdk.register({
17 id: 'eos',
18 queries: {
19 oneDayTotalFees: getFees,
20 networkFeesByDayUSD: getFees,
21 },
22 metadata: {
23 name: 'EOS',
24 category: 'l1',
25 icon: sdk.ipfs.getDataURILoader('QmZHzJNSGrQM5CcNUjLSqr5iogcoXwgGMmsnN9VRSeQAna', 'image/svg+xml'),
26 description: 'EOS is a high-throughput smart-contract blockchain',
27 feeDescription: 'EOS fees are paid to REX stakers',
28 source: 'EOS Nation',
29 protocolLaunch: '2018-06-08',
30 tokenTicker: 'EOS',
31 tokenCoingecko: 'eos',
32 website: 'https://eosnetwork.com'
33 },
34 })
35}
36
It's something off?
Report it to the discussion board on Discord, we will take care of it.