Skip to content

Commit 8caea19

Browse files
committed
feat: manually change hp's metadata
1 parent 7af6b2d commit 8caea19

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

lib/components/TxDialog/index.vue

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,23 @@ async function initData() {
171171
if (coin.denom.length < 12)
172172
getBalanceMetadata(props.endpoint, coin.denom)
173173
.then((meta) => {
174-
if (meta.metadata)
174+
if (meta.metadata) {
175+
if (meta.metadata.base === 'ahp' && meta.metadata.denom_units.length === 1 && meta.metadata.denom_units[0].denom === 'ahp') {
176+
meta.metadata = {
177+
...meta.metadata,
178+
denom_units: [
179+
...meta.metadata.denom_units,
180+
{
181+
denom: 'hp',
182+
exponent: 18,
183+
aliases: [],
184+
}
185+
],
186+
display: 'hp'
187+
}
188+
}
175189
metadatas.value[coin.denom] = meta.metadata;
190+
}
176191
})
177192
.catch(() => { });
178193
if (coin.denom.startsWith('ibc/')) {
@@ -195,6 +210,19 @@ async function initData() {
195210
.fetchAssetsList(props.registryName.includes('testnet') && !props.registryName.startsWith('testnets/') ? `testnets/${props.registryName}` : props.registryName)
196211
.then((x) => {
197212
x.assets.forEach((a) => {
213+
if (a.base === 'ahp' && a.denom_units.length === 1 && a.denom_units[0].denom === 'ahp') {
214+
a = {
215+
...a,
216+
denom_units: [
217+
...a.denom_units,
218+
{
219+
denom: 'hp',
220+
exponent: 18,
221+
}
222+
],
223+
display: 'hp',
224+
}
225+
}
198226
metadatas.value[a.base] = a as CoinMetadata;
199227
});
200228
})

0 commit comments

Comments
 (0)