Skip to content

Commit

Permalink
Merge pull request #3 from oraichain/feat/delegate
Browse files Browse the repository at this point in the history
update: fix error when delegate and unbond token
  • Loading branch information
ninhxuanhuan authored Oct 17, 2024
2 parents 92f8764 + 8e3833f commit c14d551
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/TxDialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async function initData() {
metadatas.value = {};
view.value = 'input';
p.value = JSON.parse(props.params || '{}');
memo.value = props.type?.toLowerCase() === 'send' ? '' : 'ping.pub';
memo.value = props.type?.toLowerCase() === 'send' ? '' : 'Oraichain';
feeAmount.value = Number(p.value?.fees?.amount || 2000);
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/TxDialog/messages/Unbond.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const isValid = computed(() => {
ok = false;
error = 'Sender is empty';
}
if (!params.value.validatorAddress) {
if (!params.value.validator_address) {
ok = false;
error = 'Validator is empty';
}
Expand Down
19 changes: 19 additions & 0 deletions lib/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,25 @@ export async function getBalanceMetadata(
): Promise<{ metadata: Metadata }> {
// const url = `${endpoint}/cosmos/bank/v1beta1/denoms_metadata/${denom}`;
// return get(url);
if (denom === 'orai')
return {
metadata: {
description: 'The native token of Osmosis',
denomUnits: [
{
denom: 'orai',
exponent: 6,
aliases: [],
},
],
base: 'orai',
display: 'orai',
name: '',
symbol: '',
uri: '',
uriHash: '',
},
};
const queryClient = createQueryClient(endpoint);
const res = await queryClient.bank.denomMetadata(denom);
return { metadata: res };
Expand Down

0 comments on commit c14d551

Please sign in to comment.