Adapter

Helium

Powered by the Helium Blockchain, The People’s Network represents a paradigm shift for decentralized wireless infrastructure.

Sub-Adapters 1

Preview and test each sub adapter.

Helium (helium)

Metadata

ID
helium
name

"Helium"

icon
category

"Network Protocol"

subcategory

"Bandwidth"

description

"Powered by the Helium Blockchain, The People’s Network represents a paradigm shift for decentralized wireless infrastructure."

feeDescription

"Users burn HNT to acquire Data Credits, the proprietary payment currency for sending data on the Helium network."

blockchain

"Helium"

source

"Helium API"

website

"https://www.helium.com/"

protocolLaunch

"2018-06-01"

tokenTicker

"HNT"

tokenCoingecko

"helium"

events

[]

Queries

Adapter Code

Check the entire code written for the Adapter.

Source code

Showing TS source.
1export const name = 'Helium';
2export const version = '0.0.1';
3export const license = 'MIT';
4
5export function setup(sdk: Context) {
6  const getFees = async (startDate: string, endDate: string): Promise<number> => {
7
8    const startTime = (new Date(startDate).getTime() / 1000);
9    const endTime = (new Date(endDate).getTime() / 1000);
10  
11    const query = `query {
12      dateRangeTotalUsdFees(
13        name: "helium"
14        startTime: ${startTime}
15        endTime: ${endTime} 
16      )
17    }`;
18
19    const data = await sdk.graph.query('https://api.d4.xyz/graphql', query);
20    const fees = parseFloat(data.dateRangeTotalUsdFees);
21
22    return fees;
23  }
24
25  const getOneDayFees = (date: string) => {
26    const nextDay = sdk.date.offsetDaysFormatted(date, 1);
27    return getFees(date, nextDay);
28  }  
29
30  sdk.register({
31    id: 'helium',
32    queries: {
33      oneDayTotalFees: getOneDayFees,
34      dateRangeTotalFees: getFees,
35    },
36    metadata: {
37      name: 'Helium',
38      icon: sdk.ipfs.getDataURILoader('QmSWtQ2rWZ6V4DfMMMVTHCMxyyhdcQWBZMepDwbPMDqkcB', 'image/png'),
39      category: 'Network Protocol',
40      subcategory: 'Bandwidth',
41      description: 'Powered by the Helium Blockchain, The People’s Network represents a paradigm shift for decentralized wireless infrastructure.',
42      feeDescription: 'Users burn HNT to acquire Data Credits, the proprietary payment currency for sending data on the Helium network.',
43      blockchain: 'Helium',
44      source: 'Helium API',
45      website: 'https://www.helium.com/',
46      protocolLaunch: '2018-06-01', 
47      tokenTicker: 'HNT',
48      tokenCoingecko: 'helium', 
49      events: [
50      ],
51    },
52  })
53}
54

It's something off?

Report it to the discussion board on Discord, we will take care of it.

Adapter Info

Version

0.0.1

License

MIT

IPFS CID

QmXz7YvUiHfmGtA19Fks1MjHN5MN1fnKWoKiApeGTPEXPe

CID (source)

QmYH8Ln7Z3KeH38kXvqaTcdXNMfrvmYgUkAvV8NwVQoUBE

Collections

Author

0x1a171a91B4Aa1A669e2397D6670746DDcDd4fbBe