Skip to content

Commit

Permalink
Merge pull request #71 from KiFoundation/fix/divers
Browse files Browse the repository at this point in the history
Fix/divers
  • Loading branch information
TarekAwwad authored Mar 14, 2023
2 parents 5fe14c1 + 789e24e commit 9d708e9
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ki-desktop-wallet",
"description": "The KiChain wallet",
"version": "0.5.0",
"version": "0.5.1",
"private": true,
"main": "build/main/main.js",
"email": "contact@foundation.ki",
Expand Down
2 changes: 1 addition & 1 deletion src/main/static/splashscreen.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</main>

<footer>
<span> 0.5.0 </span>
<span> 0.5.1 </span>
</footer>
</body>
</html>
2 changes: 1 addition & 1 deletion src/renderer/components/transfer/modals/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down
53 changes: 29 additions & 24 deletions src/renderer/store/wallets/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,36 @@ export const actions = {
case 'withdraw': {
let amount = 0;
const denom = config.kichain.token;

let withdraw_msg = tx.logs[0].events.filter((e) => {
return e.type.includes('withdraw_rewards');
});

if (withdraw_msg.length > 0 && withdraw_msg[0].attributes) {
const amountWithDenomMatch = String(withdraw_msg[0].attributes[0].value).match(
new RegExp(/(\d+)(\w+)/)
);
const [_, withdrawAmount, withdrawDenom] = amountWithDenomMatch;
amount += withdrawAmount;

if (tx.logs.length == 0) {
continue;
}

transactions.push([
tx.txhash,
'withdraw',
'',
tokenUtil.formatShort(amount),
fee,
tx.timestamp,
tx.tx.body.messages[0].validator_address,
denom,
]);
break;
}
else{
let withdraw_msg = tx.logs[0].events.filter((e) => {
return e.type.includes('withdraw_rewards');
});

if (withdraw_msg.length > 0 && withdraw_msg[0].attributes) {
const amountWithDenomMatch = String(withdraw_msg[0].attributes[0].value).match(
new RegExp(/(\d+)(\w+)/)
);
const [_, withdrawAmount, withdrawDenom] = amountWithDenomMatch;
amount += withdrawAmount;
}

transactions.push([
tx.txhash,
'withdraw',
'',
tokenUtil.formatShort(amount),
fee,
tx.timestamp,
tx.tx.body.messages[0].validator_address,
denom,
]);
}
break;
}

default:
transactions.push([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/views/wallet/sign/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default {
this.sign.summary = this.parseMessage(this.sign.file_content);
},
getDenomFormatted(denom: string) {
if (denom === this.globalData.kichain.denom) {
if (denom === this.globalData.kichain.udenom) {
return this.globalData.kichain.denom;
}
return 'usdc';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default {
'a',
{
attrs: {
href: this.explorer + 'transactions/' + res.data.tx_response.txhash,
href: this.explorer + 'ki-chain/txs/' + res.data.tx_response.txhash,
target: '_blank',
},
},
Expand Down

0 comments on commit 9d708e9

Please sign in to comment.