Sub-Adapters 1
Preview and test each sub adapter.
Solana (solana)
Metadata
- ID
- solana
- name
"Solana"
- icon
- category
"l1"
- description
"Solana is a high-throughput smart-contract blockchain"
- feeDescription
"Transaction fees are paid to validators"
- source
"Solana.FM"
- tokenTicker
"SOL"
- tokenCoingecko
"solana"
- website
"https://solana.com"
- protocolLaunch
"2020-12-15"
Queries
Adapter Code
Check the entire code written for the Adapter.
Source code
Showing TS source.
1export const name = 'Solana Fees';
2export const version = '0.1.1';
3export const license = 'MIT';
4export const description = 'Pull fee data from Solana.FM via the CryptoStats proxy';
5
6export function setup(sdk: Context) {
7 const getSolanaFee = async (date: string): Promise<number> => {
8 const data = await sdk.http.get(`https://cryptostats-api-proxy.vercel.app/api/v1/solana-daily-fees/${date}`);
9
10 const solPrice = await sdk.coinGecko.getHistoricalPrice('solana', date);
11
12 return data.value * solPrice;
13 }
14
15 sdk.register({
16 id: 'solana',
17 queries: {
18 oneDayTotalFees: getSolanaFee,
19 },
20 metadata: {
21 name: 'Solana',
22 icon: sdk.ipfs.getDataURILoader('QmXcXaQ5GGBBQb7cgrn6SySZVWoiniwYkc3DrjgUKVt5ky', 'image/svg+xml'),
23 category: 'l1',
24 description: 'Solana is a high-throughput smart-contract blockchain',
25 feeDescription: 'Transaction fees are paid to validators',
26 source: 'Solana.FM',
27 tokenTicker: 'SOL',
28 tokenCoingecko: 'solana',
29 website: 'https://solana.com',
30 protocolLaunch: '2020-12-15',
31 },
32 });
33}
34
It's something off?
Report it to the discussion board on Discord, we will take care of it.