diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0f46c8f2..ed9aa1af3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// - wallet: new delegation and rewards UI - wallet: show version in nav bar - wallet: contract admin route put back -- waller: staking_supply field to StateParams +- wallet: staking_supply field to StateParams +- wallet: show transaction hash for redeeming or compounding rewards - network-statistics: a new mixnet service that aggregates and exposes anonymized data about mixnet services ([#1328]) ### Fixed diff --git a/nym-wallet/src/context/delegations.tsx b/nym-wallet/src/context/delegations.tsx index b19b617476..328e7eec30 100644 --- a/nym-wallet/src/context/delegations.tsx +++ b/nym-wallet/src/context/delegations.tsx @@ -32,8 +32,8 @@ export type TDelegationContext = { tokenPool: TPoolOption, ) => Promise; undelegate: (identity: string, proxy: string | null) => Promise; - redeemRewards: (identity: string, proxy: string | null) => Promise; - compoundRewards: (identity: string, proxy: string | null) => Promise; + redeemRewards: (identity: string, proxy: string | null) => Promise; + compoundRewards: (identity: string, proxy: string | null) => Promise; }; export type TDelegationTransaction = { @@ -100,10 +100,10 @@ export const DelegationContextProvider: FC<{ try { if ((proxy || '').trim().length === 0) { // the owner of the delegation is main account (the owner of the vesting account), so it is delegation with unlocked tokens - await claimDelegatorRewards(identity); + return claimDelegatorRewards(identity); } else { // the delegation is with locked tokens, so use the vesting contract - await vestingClaimDelegatorRewards(identity); + return vestingClaimDelegatorRewards(identity); } } catch (e) { throw new Error(e as string); @@ -114,10 +114,10 @@ export const DelegationContextProvider: FC<{ try { if ((proxy || '').trim().length === 0) { // the owner of the delegation is main account (the owner of the vesting account), so it is delegation with unlocked tokens - await compoundDelegatorRewards(identity); + return compoundDelegatorRewards(identity); } else { // the delegation is with locked tokens, so use the vesting contract - await vestingCompoundDelegatorRewards(identity); + return vestingCompoundDelegatorRewards(identity); } } catch (e) { throw new Error(e as string); diff --git a/nym-wallet/src/pages/delegation/index.tsx b/nym-wallet/src/pages/delegation/index.tsx index 078e95b3cb..bf544fe948 100644 --- a/nym-wallet/src/pages/delegation/index.tsx +++ b/nym-wallet/src/pages/delegation/index.tsx @@ -196,12 +196,13 @@ export const Delegation: FC = () => { setCurrentDelegationListActionItem(undefined); try { - await redeemRewards(identityKey, proxy); + const tx = await redeemRewards(identityKey, proxy); const bal = await userBalance(); setConfirmationModalProps({ status: 'success', action: 'redeem', balance: bal?.printable_balance || '-', + transactionUrl: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`, }); } catch (e) { setConfirmationModalProps({ @@ -221,12 +222,13 @@ export const Delegation: FC = () => { setCurrentDelegationListActionItem(undefined); try { - await compoundRewards(identityKey, proxy); + const tx = await compoundRewards(identityKey, proxy); const bal = await userBalance(); setConfirmationModalProps({ status: 'success', action: 'compound', balance: bal?.printable_balance || '-', + transactionUrl: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`, }); } catch (e) { setConfirmationModalProps({