-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REIT token circulating supply (#337)
* script for circulating supply * added the reit fetcher in index script * removed option as it was giving build errors --------- Co-authored-by: Nilay Saha <[email protected]>
- Loading branch information
1 parent
dbef3b4
commit af4d24b
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import axios from "axios"; | ||
|
||
import { SupplyFetcher } from "../types"; | ||
|
||
const REIT = "52d4b39c2407ce020ab4abb785d820a3ad5a2fa07600d07a205e509f"; | ||
const REIT_ASSET = `${REIT}52454954`; | ||
|
||
const fetcher: SupplyFetcher = async () => { | ||
const total = 50_000_000; | ||
|
||
const instance = axios.create({ | ||
baseURL: `https://cardano-mainnet.blockfrost.io/api/v0/`, | ||
timeout: 1000, | ||
headers: { project_id: process.env["BLOCKFROST_PROJECT_ID"] }, | ||
}); | ||
|
||
const assetInfo = await instance.get(`assets/${REIT_ASSET}`); | ||
const total_mint = assetInfo.data.quantity; | ||
|
||
return { | ||
circulating: total_mint, | ||
total: total.toString(), | ||
}; | ||
}; | ||
|
||
export default fetcher; |