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"
- issuanceDescription
"EOS is issued to block producers & savings"
- source
"https://eosnetwork.com"
- 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 Issuance';
2export const version = '0.1.0';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6 const getIssuance = async () => {
7 const [currencyStats, global4, price] = await Promise.all([
8 sdk.http.post('https://eos.api.eosnation.io/v1/chain/get_currency_stats', { code: "eosio.token", symbol: "EOS" }),
9 sdk.http.post('https://eos.api.eosnation.io/v1/chain/get_table_rows', { code: "eosio", scope: "eosio", table: "global4", json: true }),
10 sdk.coinGecko.getCurrentPrice('eos'),
11 ])
12 const supply = currencyStats.EOS.supply.split(" ")[0];
13 return Number(global4.rows[0].continuous_rate) * supply / 365 * price;
14 }
15
16 const getIssuanceRate = async () => {
17 const global4 = await sdk.http.post('https://eos.api.eosnation.io/v1/chain/get_table_rows', { code: "eosio", scope: "eosio", table: "global4", json: true })
18 return Number(global4.rows[0].continuous_rate);
19 }
20
21 sdk.register({
22 id: 'eos',
23 queries: {
24 issuance7DayAvgUSD: getIssuance,
25 issuanceRateCurrent: getIssuanceRate,
26 },
27 metadata: {
28 name: 'EOS',
29 category: 'l1',
30 icon: sdk.ipfs.getDataURILoader('QmZHzJNSGrQM5CcNUjLSqr5iogcoXwgGMmsnN9VRSeQAna', 'image/svg+xml'),
31 description: 'EOS is a high-throughput smart-contract blockchain',
32 issuanceDescription: 'EOS is issued to block producers & savings',
33 source: 'https://eosnetwork.com',
34 tokenTicker: 'EOS',
35 tokenCoingecko: 'eos',
36 website: 'https://eosnetwork.com',
37 },
38 })
39}
40
It's something off?
Report it to the discussion board on Discord, we will take care of it.