Expand description
§Midgard
Consumer information relating to swaps, pools, and volume. Midgard returns time-series information regarding the THORChain
network, such as volume, pool information, users, liquidity providers and more. It also proxies to THORNode
to reduce burden on the network. Runs on every node.
§midgard-rs
This crate aims to provide fully typed client for the THORChain
Midgard API.
- By default it references the
https://midgard.thorswap.net/v2/
base url but this can be changed by creating a newConfiguration
object and passing it to theMidgard::with_config()
method. - The client is rate limited to 1 request per second by default but this can be changed by creating a new
Configuration
object and passing it to theMidgard::with_config()
method.
§Basic Usage
use midgard_rs::Midgard;
let mut midgard = Midgard::new();
let address = "thor102y0m3uptg0vvudeyh00r2fnz70wq7d8y7mu2g";
let balance = midgard.get_balance(address, None, None).await.unwrap();
assert!(*balance.get_height() > 0);
§Configuration
use midgard_rs::Midgard;
use midgard_rs::Configuration;
let config = Configuration::new("https://midgard.ninerealms.com/v2/".to_string(), 1000); // base_url, rate_limit_ms
let mut midgard = Midgard::with_config(config);
let address = "thor102y0m3uptg0vvudeyh00r2fnz70wq7d8y7mu2g";
let balance = midgard.get_balance(address, None, None).await.unwrap(); // address, timestamp, height
assert!(*balance.get_height() > 0);
Structs§
- Action
- Action
In - Action
Ins - Action
List - Action
Metadata - Action
Metadata AddLiquidity - Action
Metadata Refund - Action
Metadata Swap - Action
Metadata Swap Streaming Swap Meta - Action
Metadata Withdraw - Action
Out - Action
Outs - Actions
- Asset
Amount - Asset
Amounts - Balance
- Borrowers
Details - Borrowers
List - Borrowers
Pool - Borrowers
Pools - Churns
List - Configuration
- Depth
History - Depth
History Interval - Depth
History Intervals - Depth
History Meta - Earnings
History - Earnings
Interval - Earnings
Intervals - Earnings
Meta - Earnings
Pool - Earnings
Pools - GetAction
List - Global
Stats - Health
Info - Height
Date - Height
Hash - Height
Stamp - Known
Pool List - Liquidity
Change History - Liquidity
Change Interval - Liquidity
Change Intervals - Liquidity
Change Meta - Member
Details - Member
List - Member
Pool - Member
Pools - Midgard
- Network
Block Rewards - Network
Bond Metrics - Network
Data - Node
- Node
List - Page
Tokens - Pool
- Pool
List - Pool
Statistics - Savers
Details - Savers
History - Savers
History Interval - Savers
History Intervals - Savers
History Meta - Savers
Pool - Savers
Pools - Swap
History - Swap
Interval - Swap
Intervals - Swap
Meta - TVLHistory
- TVLInterval
- TVLIntervals
- TVLMeta
- TVLPool
Depth - TVLPool
Depths - Thorname
Details - Thorname
Entries - Thorname
Entry - Thorname
Owner - Thorname
Reverse Lookup