oracle: /server
api: /api/price/{coin}, coin: eth/mina
If successful, oracle will output a json:
{
data: { coin: 'mina', price: '550000' },
signature: {
r: '10730636476519697698154927189829493176097313486848153044125254446884371113696',
s: '20496522453702113028369392861557436939263437256616941983181581063576564914031'
},
publicKey: 'B62qm1uQcaZ9Ck8qXuNt46u3K5SQrZ8x7dDfurUFv4VuV8HVMBv6g6r'
}
Note: Since the source price has decimals, special processing has been done, and the actual price needs to be divided by 1,000,000 on the result
Make sure to install the dependencies:
# yarn
yarn install
# npm
npm install
# pnpm
pnpm install --shamefully-hoistStart the development server on http://localhost:3000
npm run devBuild the application for production:
npm run buildLocally preview production build:
npm run previewCheck out the deployment documentation for more information.