@xchainjs/xchain-midgard
Midgard Module for XChainJS Clients
Midgard module has been created using openapi-generator-cli auto-generation reading from "https://midgard.thorchain.info/v2/swagger.json" This library exposes all the midgard api functions defined in the swagger doc "https://midgard.thorchain.info/v2/swagger.json"
yarn add @xchainjs/xchain-midgard
Request data from midgardApi
import { MidgardApi } from '@xchainjs/xchain-midgard'
const midgardApi = new MidgardApi()
const data = midgardApi.getPool('BTC.BTC')
Midgard Thorchain endpoint
Midgard NineRelms endpoint
If you plan on using the publically accessible endpoints provided by Nine Realms(listed below), ensure that you add a valid 'x-client-id' to all requests
Example
import cosmosclient from '@cosmos-client/core'
import axios from 'axios'
import { register9Rheader } from '@xchainjs/xchain-util'
register9Rheader(axios)
register9Rheader(cosmosclient.config.globalAxios)
For a complete example please see this test
Generated using TypeDoc