Sub-Adapters 1
Preview and test each sub adapter.
xDai (xdai)
Metadata
- ID
- xdai
- name
"xDai"
- icon
- category
"l1"
- description
"xDai is an Ethereum sidechain that uses Dai as the base asset."
- feeDescription
"Transaction fees are paid by users to validators."
- blockchain
"xDai"
- source
"Blockscout"
- adapter
"xdai"
- website
"https://xdaichain.com"
- tokenTicker
"STAKE"
- tokenCoingecko
"xdai-stake"
- protocolLaunch
"2020-06-03"
Queries
Adapter Code
Check the entire code written for the Adapter.
Source code
Showing TS source.
1export const name = 'xDai Fees';
2export const version = '0.0.2';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6 async function getxDaiData(date: string): Promise<number> {
7 const json = await sdk.http.get(
8 `https://blockscout.com/xdai/mainnet/api?module=stats&action=totalfees&date=${date}`
9 );
10
11 return json.result && json.result / 1e18;
12 }
13
14 sdk.register({
15 id: 'xdai',
16 queries: {
17 oneDayTotalFees: getxDaiData,
18 },
19 metadata: {
20 name: 'xDai',
21 icon: sdk.ipfs.getDataURILoader('QmPFzLaw3G3SDvsHoebWGn52H1n8dpfEmmvSznkKDkPuC4', 'image/svg+xml'),
22 category: 'l1',
23 description: 'xDai is an Ethereum sidechain that uses Dai as the base asset.',
24 feeDescription: 'Transaction fees are paid by users to validators.',
25 blockchain: 'xDai',
26 source: 'Blockscout',
27 adapter: 'xdai',
28 website: 'https://xdaichain.com',
29 tokenTicker: 'STAKE',
30 tokenCoingecko: 'xdai-stake',
31 protocolLaunch: '2020-06-03',
32 },
33 })
34}
35
It's something off?
Report it to the discussion board on Discord, we will take care of it.