add injective
This commit is contained in:
parent
a3ad4a56bc
commit
6d37cf4df5
@ -25,6 +25,7 @@
|
||||
"omniflix": "OmniFlix",
|
||||
"likecoin": "LikeCoin",
|
||||
"stargaze": "Stargaze",
|
||||
"injective": "Injective Protocal",
|
||||
|
||||
"staking": "Staking",
|
||||
"governance": "Governance",
|
||||
|
@ -300,7 +300,11 @@ export function getUnitAmount(amount, denom) {
|
||||
|
||||
export function formatTokenAmount(tokenAmount, fraction = 2, denom = 'uatom') {
|
||||
let amount
|
||||
if (denom.startsWith('rowan')) {
|
||||
if (denom.startsWith('inj')) {
|
||||
// eslint-disable-next-line no-undef
|
||||
amount = Number(BigInt(Number(tokenAmount)) / 1000000000000000000n)
|
||||
// }
|
||||
} else if (denom.startsWith('rowan')) {
|
||||
// eslint-disable-next-line no-undef
|
||||
amount = Number(BigInt(Number(tokenAmount)) / 1000000000000000000n)
|
||||
// }
|
||||
|
@ -49,10 +49,19 @@ export default class ChainFetch {
|
||||
}
|
||||
|
||||
async getLatestBlock(config = null) {
|
||||
const conf = config || this.getSelectedConfig()
|
||||
console.log('config: ', conf)
|
||||
if (conf.chain_name === 'injective') {
|
||||
return ChainFetch.fetch('https://tm.injective.network', '/block').then(data => Block.create(commonProcess(data)))
|
||||
}
|
||||
return this.get('/blocks/latest', config).then(data => Block.create(data))
|
||||
}
|
||||
|
||||
async getBlockByHeight(height, config = null) {
|
||||
const conf = config || this.getSelectedConfig()
|
||||
if (conf.chain_name === 'injective') {
|
||||
return ChainFetch.fetch('https://tm.injective.network', `/block?height=${height}`).then(data => Block.create(commonProcess(data)))
|
||||
}
|
||||
return this.get(`/blocks/${height}`, config).then(data => Block.create(data))
|
||||
}
|
||||
|
||||
|
8
src/store/chains/injective.json
Normal file
8
src/store/chains/injective.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"chain_name": "injective",
|
||||
"api": "https://lcd.injective.network",
|
||||
"sdk_version": "0.42.4",
|
||||
"addr_prefix": "inj",
|
||||
"excludes": "",
|
||||
"logo": "https://dl.airtable.com/.attachments/e024faae112ae873d301f9e1e17a921c/3f3671f7/9pOKAlQ5_400x400.jpg"
|
||||
}
|
Loading…
Reference in New Issue
Block a user