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 5 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 @@ -25,7 +25,7 @@ import SidebarContainer from '../SidebarContainer';
import AddWalletPageRevamp from './AddWalletPageRevamp';
import type { RestoreModeType } from '../../stores/toplevel/WalletRestoreStore';
import type { StoresProps } from '../../stores';
import { ampli } from '../../../ampli/index'
import { ampli } from '../../../ampli/index';

@observer
export default class AddWalletPage extends Component<StoresProps> {
Expand Down Expand Up @@ -64,6 +64,7 @@ export default class AddWalletPage extends Component<StoresProps> {
});
// <TODO:HW_REFACTOR>
stores.substores.ada.trezorConnect.init();
ampli.connectWalletCheckPageViewed();
};
const openLedgerConnectDialog = () => {
if (selectedNetwork === undefined) {
Expand All @@ -74,6 +75,7 @@ export default class AddWalletPage extends Component<StoresProps> {
});
// <TODO:HW_REFACTOR>
stores.substores.ada.ledgerConnect.init();
ampli.connectWalletCheckPageViewed();
};

let activeDialog = null;
Expand Down Expand Up @@ -173,7 +175,6 @@ export default class AddWalletPage extends Component<StoresProps> {
<AddWalletPageRevamp
onHardwareConnect={() => {
this.openDialogWrapper(WalletConnectHWOptionDialog);
ampli.connectWalletCheckPageViewed();
}}
onCreate={() => goToRoute({ route: ROUTES.WALLETS.CREATE_NEW_WALLET })}
onRestore={() => goToRoute({ route: ROUTES.WALLETS.RESTORE_WALLET })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type LocalProps = {|

@observer
export default class WalletLedgerConnectDialogContainer extends Component<{| ...StoresProps, ...LocalProps |}> {

getSelectedNetwork: void => $ReadOnly<NetworkRow> = () => {
const { selectedNetwork } = this.props.stores.profile;
if (selectedNetwork === undefined) {
Expand Down Expand Up @@ -66,7 +65,10 @@ export default class WalletLedgerConnectDialogContainer extends Component<{| ...
isActionProcessing={ledgerConnectStore.isActionProcessing}
error={ledgerConnectStore.error}
onExternalLinkClick={handleExternalLinkClick}
goBack={ledgerConnectStore.goBackToCheck}
goBack={()=> {
ledgerConnectStore.goBackToCheck();
ampli.connectWalletCheckPageViewed();
}}
submit={ledgerConnectStore.submitConnect}
cancel={this.cancel}
/>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export default class WalletTrezorConnectDialogContainer extends Component<{| ...
isActionProcessing={trezorConnectStore.isActionProcessing}
error={trezorConnectStore.error}
onExternalLinkClick={handleExternalLinkClick}
goBack={trezorConnectStore.goBackToCheck}
goBack={()=>{
trezorConnectStore.goBackToCheck();
ampli.connectWalletCheckPageViewed();
}}
submit={trezorConnectStore.submitConnect}
cancel={this.cancel}
/>);
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