Skip to content

Display real-time prices of stocks, forex, crypto and indices using Chainlink's decentralized on-chain smart-contracts.

Notifications You must be signed in to change notification settings

dorianbayart/PriceLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PriceLink - PWA

Chainlink
Realtime
Prices
Decentralized
OnChain

What is it ?

Display real-time prices of stocks, forex, crypto or indices using Chainlink's decentralized on-chain smart-contracts.
PriceLink is installable as a Progressive Web Application (PWA).

Why ?

To understand how Chainlink oracle works - Just for fun !

How ?

Using simple Javascript and web3.js library


Some code

Get list of all supported networks

fetch('https://raw.githubusercontent.com/smartcontractkit/documentation/main/src/features/feeds/data/chains.ts')
.then((resp) => resp.text())
.then((text) => text.split('CHAINS: Chain[] =').slice(-2)[0].split('export')[0]) // keep useful data
.then((str) => ('{ data:'+str+'}').replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/g, '"$2": ').replaceAll('https": ','https:').replace(/\,(?!\s*?[\{\[\"\'\w])/g, ''))
.then(JSON.parse).then(console.log)

Returns an array of pages, each page containing an array of networks