Update all deprecated links and use different explorers
This commit is contained in:
@@ -101,7 +101,7 @@ export const DelegateModal: FCWithChildren<{
|
||||
status: 'success',
|
||||
message: 'Delegation can take up to one hour to process',
|
||||
transactions: [
|
||||
{ url: `${urls('MAINNET').blockExplorer}/transaction/${tx.transactionHash}`, hash: tx.transactionHash },
|
||||
{ url: `${urls('MAINNET').blockExplorer}/tx/${tx.transactionHash}`, hash: tx.transactionHash },
|
||||
],
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const TransferModal = ({ onClose }: { onClose: () => void }) => {
|
||||
setState('success');
|
||||
setTx({
|
||||
amount: `${userBalance.tokenAllocation?.spendable} ${clientDetails.display_mix_denom.toUpperCase()}`,
|
||||
url: `${urls(network).blockExplorer}/transaction/${txResponse.transaction_hash}`,
|
||||
url: `${urls(network).blockExplorer}/tx/${txResponse.transaction_hash}`,
|
||||
});
|
||||
await userBalance.refreshBalances();
|
||||
} catch (e) {
|
||||
|
||||
@@ -97,8 +97,8 @@ export const UpdateCostParametersModal = ({
|
||||
<ModalFee isLoading={isFeeLoading} fee={fee} divider />
|
||||
|
||||
<Typography fontSize="small">
|
||||
These changes will affect your node's economics and delegator rewards. Your new profit margin and operating cost
|
||||
will be applied in the next interval.
|
||||
These changes will affect your node's economics and delegator rewards. Your new profit margin and operating
|
||||
cost will be applied in the next interval.
|
||||
</Typography>
|
||||
|
||||
{/* Warning message */}
|
||||
|
||||
@@ -72,7 +72,7 @@ export const SendModal = ({ onClose, hasStorybookStyles }: { onClose: () => void
|
||||
const txResponse = await send({ amount: val, address: to, memo: memo || '', fee: fee?.fee });
|
||||
setTxDetails({
|
||||
amount: `${amount?.amount} ${clientDetails?.display_mix_denom.toUpperCase()}`,
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${txResponse.tx_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${txResponse.tx_hash}`,
|
||||
});
|
||||
} catch (e) {
|
||||
Console.error(e as string);
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
NodeConfigUpdate,
|
||||
NodeCostParams,
|
||||
TransactionExecuteResult,
|
||||
DecCoin,
|
||||
} from '@nymproject/types';
|
||||
import { isGateway, isMixnode, TUpdateBondArgs, isNymNode, TNymNodeSignatureArgs, TBondNymNodeArgs } from 'src/types';
|
||||
import { Console } from 'src/utils/console';
|
||||
@@ -82,7 +81,7 @@ export const BondingContext = createContext<TBondingContext>({
|
||||
migrateLegacyNode: async () => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
updateCostParameters: async (profitMarginPercent, intervalOperatingCost, fee) => {
|
||||
updateCostParameters: async (_profitMarginPercent, _intervalOperatingCost, _fee) => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
isVestingAccount: false,
|
||||
@@ -277,7 +276,7 @@ export const BondingContextProvider: FCWithChildren = ({ children }): JSX.Elemen
|
||||
try {
|
||||
// Validate input before proceeding
|
||||
if (!profitMarginPercent || parseFloat(profitMarginPercent) < 20 || parseFloat(profitMarginPercent) > 50) {
|
||||
throw new Error('Profit margin must be between 20% and 50%');
|
||||
throw new Error(':%');
|
||||
}
|
||||
|
||||
// Convert from percentage to decimal
|
||||
|
||||
@@ -24,9 +24,9 @@ import { toDisplay } from '../utils';
|
||||
export const urls = (networkName?: Network) =>
|
||||
networkName === 'MAINNET'
|
||||
? {
|
||||
mixnetExplorer: 'https://mixnet.explorers.guru/',
|
||||
blockExplorer: 'https://blocks.nymtech.net',
|
||||
networkExplorer: 'https://explorer.nymtech.net',
|
||||
mixnetExplorer: 'https://explorer.nym.spectredao.net/',
|
||||
blockExplorer: 'https://ping.pub/nyx',
|
||||
networkExplorer: 'https://explorer.nym.spectredao.net',
|
||||
}
|
||||
: {
|
||||
blockExplorer: `https://${networkName}-blocks.nymtech.net`,
|
||||
|
||||
@@ -82,7 +82,7 @@ export const Bonding = () => {
|
||||
setConfirmationDetails({
|
||||
status: 'success',
|
||||
title: 'Bonding successful',
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -94,7 +94,7 @@ export const Bonding = () => {
|
||||
setConfirmationDetails({
|
||||
status: 'success',
|
||||
title: 'Migration successful',
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -106,7 +106,7 @@ export const Bonding = () => {
|
||||
setConfirmationDetails({
|
||||
status: 'success',
|
||||
title: 'Migration successful',
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -133,7 +133,7 @@ export const Bonding = () => {
|
||||
setConfirmationDetails({
|
||||
status: 'success',
|
||||
title: 'Bond amount changed successfully',
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -145,7 +145,7 @@ export const Bonding = () => {
|
||||
setConfirmationDetails({
|
||||
status: 'success',
|
||||
title: 'Rewards redeemed successfully',
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,6 +39,15 @@ export const NodeSettings = () => {
|
||||
intervalOperatingCost: '',
|
||||
});
|
||||
|
||||
// Define handleError before using it
|
||||
const handleError = (error: string) => {
|
||||
setConfirmationDetails({
|
||||
status: 'error',
|
||||
title: 'An error occurred',
|
||||
subtitle: error,
|
||||
});
|
||||
};
|
||||
|
||||
const handleChange = (_: React.SyntheticEvent, tab: string) => {
|
||||
setValue(tab as NavItems);
|
||||
};
|
||||
@@ -59,7 +68,7 @@ export const NodeSettings = () => {
|
||||
status: 'success',
|
||||
title: 'Unbond successful',
|
||||
subtitle: `This operation will complete when the new epoch starts at: ${nextEpoch}`,
|
||||
txUrl: `${urls(network).blockExplorer}/transaction/${tx?.transaction_hash}`,
|
||||
txUrl: `${urls(network).blockExplorer}/tx/${tx?.transaction_hash}`,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -84,21 +93,13 @@ export const NodeSettings = () => {
|
||||
status: 'success',
|
||||
title: 'Cost Parameters Updated',
|
||||
subtitle: 'Your cost parameters have been successfully updated',
|
||||
txUrl: tx?.transaction_hash ? `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}` : undefined,
|
||||
txUrl: tx?.transaction_hash ? `${urls(network).blockExplorer}/tx/${tx.transaction_hash}` : undefined,
|
||||
});
|
||||
} catch (error) {
|
||||
handleError(String(error));
|
||||
}
|
||||
};
|
||||
|
||||
const handleError = (error: string) => {
|
||||
setConfirmationDetails({
|
||||
status: 'error',
|
||||
title: 'An error occurred',
|
||||
subtitle: error,
|
||||
});
|
||||
};
|
||||
|
||||
if (isLoading) return <LoadingModal />;
|
||||
|
||||
if (!bondedNode) {
|
||||
|
||||
@@ -55,10 +55,10 @@ export const NodeCostParametersPage = ({ bondedNode, onConfirm, onError, onUpdat
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const isOperatingCostValid = intervalOperatingCost !== '' && !isNaN(Number(intervalOperatingCost));
|
||||
const isOperatingCostValid = intervalOperatingCost !== '' && !Number.isNaN(Number(intervalOperatingCost));
|
||||
const isProfitMarginValid =
|
||||
profitMarginPercent !== '' &&
|
||||
!isNaN(Number(profitMarginPercent)) &&
|
||||
!Number.isNaN(Number(profitMarginPercent)) &&
|
||||
Number(profitMarginPercent) >= 20 &&
|
||||
Number(profitMarginPercent) <= 50;
|
||||
|
||||
@@ -95,8 +95,8 @@ export const NodeCostParametersPage = ({ bondedNode, onConfirm, onError, onUpdat
|
||||
{shouldDisplayWarning && (
|
||||
<Grid item>
|
||||
<Typography variant="body2" sx={{ color: (theme) => theme.palette.nym.text.muted }}>
|
||||
Updating cost parameters affects your node's economics in the network. Please ensure you understand
|
||||
the implications.
|
||||
Updating cost parameters affects your node's economics in the network. Please ensure you
|
||||
understand the implications.
|
||||
</Typography>
|
||||
</Grid>
|
||||
)}
|
||||
|
||||
@@ -185,7 +185,7 @@ export const Delegation: FC<{ isStorybook?: boolean }> = ({ isStorybook }) => {
|
||||
message: 'This operation can take up to one hour to process',
|
||||
...balances,
|
||||
transactions: [
|
||||
{ url: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`, hash: tx.transaction_hash },
|
||||
{ url: `${urls(network).blockExplorer}/tx/${tx.transaction_hash}`, hash: tx.transaction_hash },
|
||||
],
|
||||
});
|
||||
} catch (e) {
|
||||
@@ -236,7 +236,7 @@ export const Delegation: FC<{ isStorybook?: boolean }> = ({ isStorybook }) => {
|
||||
action: 'delegate',
|
||||
...balances,
|
||||
transactions: [
|
||||
{ url: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`, hash: tx.transaction_hash },
|
||||
{ url: `${urls(network).blockExplorer}/tx/${tx.transaction_hash}`, hash: tx.transaction_hash },
|
||||
],
|
||||
});
|
||||
} catch (e) {
|
||||
@@ -279,7 +279,7 @@ export const Delegation: FC<{ isStorybook?: boolean }> = ({ isStorybook }) => {
|
||||
...balances,
|
||||
transactions: [
|
||||
{
|
||||
url: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`,
|
||||
url: `${urls(network).blockExplorer}/tx/${tx.transaction_hash}`,
|
||||
hash: tx.transaction_hash,
|
||||
},
|
||||
],
|
||||
@@ -308,7 +308,7 @@ export const Delegation: FC<{ isStorybook?: boolean }> = ({ isStorybook }) => {
|
||||
status: 'success',
|
||||
action: 'redeem',
|
||||
transactions: txs.map((tx) => ({
|
||||
url: `${urls(network).blockExplorer}/transaction/${tx.transaction_hash}`,
|
||||
url: `${urls(network).blockExplorer}/tx/${tx.transaction_hash}`,
|
||||
hash: tx.transaction_hash,
|
||||
})),
|
||||
});
|
||||
|
||||
@@ -24,14 +24,10 @@ export const updateNymNodeConfig = async (update: NodeConfigUpdate, fee?: Fee) =
|
||||
invokeWrapper<TransactionExecuteResult>('update_nymnode_config', { update, fee });
|
||||
|
||||
export const updateNymNodeParams = async (newCosts: NodeCostParams, fee?: Fee) => {
|
||||
console.log('updateNymNodeParams called with:', { newCosts, fee });
|
||||
|
||||
const result = await invokeWrapper<TransactionExecuteResult>('update_nymnode_cost_params', {
|
||||
newCosts,
|
||||
fee,
|
||||
});
|
||||
|
||||
console.log('updateNymNodeParams result:', result);
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user