OdinprotocolJS is a library for interacting easily with Odin network based on Stargate.
Report Bug
·
Request Feature
npm install odinprotocoljs
First you need to import the odin client and connect it to your RPC. Then you can call the methods of the client.
All methods for Odin Client are defined in the interface extension types/generated/odin/odinExtension.ts
Run the following file with:
node --es-module-specifier-resolution=node .\dataSourceTest.js
import { odinQueryClient } from "odinprotocoljs";
const config_rpc = "https://node.odin-freya-website.odinprotocol.io/mainnet/a/"
const myOdinClient = new odinQueryClient()
await myOdinClient.connect(config_rpc);
const dataSource = await myOdinClient.queryClient.oracle.getDataSourceById(14)
console.log(dataSource)