Skip to content

Commit

Permalink
update deploy result for transfers and add refetch time for the singl…
Browse files Browse the repository at this point in the history
…e deploy
  • Loading branch information
ost-ptk committed Sep 17, 2024
1 parent 3111d1f commit c6908a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ export const DeployDetailsResult = ({ deploy }: DeployDetailsResultProps) => {
key={id}
callerAccountInfo={action.callerAccountInfo}
recipientAccountInfo={action.recipientAccountInfo}
toPublicKey={action.recipientKey}
fromPublicKey={action.callerPublicKey}
toPublicKey={
action.recipientKey || action.recipientAccountInfo?.accountHash!
}
fromPublicKey={
action.callerPublicKey || action.callerAccountInfo?.accountHash!
}
fiatAmount={action.fiatAmount}
/>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const ACCOUNT_DEPLOY_REFRESH_RATE = 30 * SECOND;
export const ACCOUNT_CASPER_ACTIVITY_REFRESH_RATE = 30 * SECOND;
export const ERC20_TOKEN_ACTIVITY_REFRESH_RATE = 30 * SECOND;
export const VALIDATORS_REFRESH_RATE = 30 * SECOND;
export const PENDING_DEPLOY_REFETCH_INTERVAL = 5 * SECOND;
export const DEPLOY_DETAILS_REFRESH_RATE = 30 * SECOND;

export const LOGIN_RETRY_ATTEMPTS_LIMIT = 5;
export const ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED = 1;
Expand All @@ -27,8 +29,6 @@ export const STAKE_COST_MOTES = '2500000000'; // 2.5 CSPR
export const DELEGATION_MIN_AMOUNT_MOTES = '500000000000'; // 500 CSPR
export const MAX_DELEGATORS = 1200;

export const PENDING_DEPLOY_REFETCH_INTERVAL = 5 * 1000;

export const getBlockExplorerAccountUrl = (
casperLiveUrl: string,
publicKey: string
Expand Down
6 changes: 5 additions & 1 deletion src/libs/services/deploys/use-fetch-single-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useQuery } from '@tanstack/react-query';
import { CasperNetwork } from 'casper-wallet-core/src/domain/common/common';
import { useSelector } from 'react-redux';

import { DEPLOY_DETAILS_REFRESH_RATE } from '@src/constants';

import { selectActiveNetworkSetting } from '@background/redux/settings/selectors';
import { selectVaultActiveAccount } from '@background/redux/vault/selectors';
import { deploysRepository } from '@background/wallet-repositories';
Expand All @@ -17,7 +19,9 @@ export const useFetchSingleDeploy = (deployHash?: string) => {
deployHash: deployHash ?? '',
activePublicKey: activeAccount?.publicKey ?? '',
network: network.toLowerCase() as CasperNetwork
})
}),
refetchInterval: DEPLOY_DETAILS_REFRESH_RATE,
staleTime: DEPLOY_DETAILS_REFRESH_RATE
});

return {
Expand Down

0 comments on commit c6908a5

Please sign in to comment.