Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix events #3841

Merged
merged 6 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export default class WalletSendPreviewStepContainer extends Component<Props> {

if (signRequest == null) throw new Error('Unexpected missing active signing request');

const amount = signRequest.totalInput();
const { numberOfDecimals } = this.props.getTokenInfo(amount.getDefaultEntry()).Metadata;
ampli.sendSummarySubmitted({
ada_amount: signRequest.totalInput().getDefault().toNumber(),
ada_amount: amount.getDefault().shiftedBy(-numberOfDecimals).toNumber(),
asset_count: signRequest.totalInput().nonDefaultEntries().length,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ export default class CardanoStakingPage extends Component<AllProps, State> {
if (delegationTx != null && selectedPoolId != null && showSignDialog) {
// may happen for a split second before backend query starts
if (selectedPoolInfo == null) return null;

const { numberOfDecimals } = genLookupOrFail(this.props.stores.tokenInfoStore.tokenInfo)(
delegationTx.totalAmountToDelegate.getDefaultEntry()
).Metadata;

return (
<DelegationTxDialog
staleTx={delegationTransaction.isStale}
Expand All @@ -401,7 +406,8 @@ export default class CardanoStakingPage extends Component<AllProps, State> {
dialog: DelegationSuccessDialog,
});
ampli.stakingCenterDelegationSubmitted({
ada_amount: delegationTx.totalAmountToDelegate.getDefault().toNumber(),
ada_amount:
delegationTx.totalAmountToDelegate.getDefault().shiftedBy(-numberOfDecimals).toNumber(),
staking_pool: selectedPoolId,
});
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,15 @@ export default class WithdrawRewardsDialog extends Component<{| ...StoresProps,
onError: () => {},
});
}

const { numberOfDecimals } = genLookupOrFail(stores.tokenInfoStore.tokenInfo)({
identifier: selected.defaultTokenId,
networkId: selected.networkId,
}).Metadata;

ampli.claimAdaTransactionSubmitted({
reward_amount: signRequest.withdrawals()[0]?.amount.getDefaultEntry().amount.toNumber()
reward_amount: signRequest.withdrawals()[0]?.amount.getDefaultEntry().amount
.shiftedBy(-numberOfDecimals).toNumber()
});
};

Expand Down
Loading