diff --git a/explorer/src/components/Delegations/DelegateModal.tsx b/explorer/src/components/Delegations/DelegateModal.tsx index f5c27adccb..3bafd1888f 100644 --- a/explorer/src/components/Delegations/DelegateModal.tsx +++ b/explorer/src/components/Delegations/DelegateModal.tsx @@ -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) { diff --git a/nym-wallet/src/components/Balance/modals/TransferModal.tsx b/nym-wallet/src/components/Balance/modals/TransferModal.tsx index 1d3713b184..22c83cd68b 100644 --- a/nym-wallet/src/components/Balance/modals/TransferModal.tsx +++ b/nym-wallet/src/components/Balance/modals/TransferModal.tsx @@ -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) { diff --git a/nym-wallet/src/components/Bonding/modals/NodeCostParametersModals.tsx b/nym-wallet/src/components/Bonding/modals/NodeCostParametersModals.tsx index f10be19b7b..e520ea673a 100644 --- a/nym-wallet/src/components/Bonding/modals/NodeCostParametersModals.tsx +++ b/nym-wallet/src/components/Bonding/modals/NodeCostParametersModals.tsx @@ -97,8 +97,8 @@ export const UpdateCostParametersModal = ({ - 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. {/* Warning message */} diff --git a/nym-wallet/src/components/Send/SendModal.tsx b/nym-wallet/src/components/Send/SendModal.tsx index b8c1ca5eeb..77aeb7dd6b 100644 --- a/nym-wallet/src/components/Send/SendModal.tsx +++ b/nym-wallet/src/components/Send/SendModal.tsx @@ -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); diff --git a/nym-wallet/src/context/bonding.tsx b/nym-wallet/src/context/bonding.tsx index a2422c9279..24705e91b9 100644 --- a/nym-wallet/src/context/bonding.tsx +++ b/nym-wallet/src/context/bonding.tsx @@ -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({ 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 diff --git a/nym-wallet/src/context/main.tsx b/nym-wallet/src/context/main.tsx index 24970ca3b6..7ae2750478 100644 --- a/nym-wallet/src/context/main.tsx +++ b/nym-wallet/src/context/main.tsx @@ -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`, diff --git a/nym-wallet/src/pages/bonding/Bonding.tsx b/nym-wallet/src/pages/bonding/Bonding.tsx index 57dc05bbe4..a5b2d9f5c5 100644 --- a/nym-wallet/src/pages/bonding/Bonding.tsx +++ b/nym-wallet/src/pages/bonding/Bonding.tsx @@ -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}`, }); } }; diff --git a/nym-wallet/src/pages/bonding/node-settings/NodeSettings.tsx b/nym-wallet/src/pages/bonding/node-settings/NodeSettings.tsx index 6fd5e3bd9f..47cab83333 100644 --- a/nym-wallet/src/pages/bonding/node-settings/NodeSettings.tsx +++ b/nym-wallet/src/pages/bonding/node-settings/NodeSettings.tsx @@ -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 ; if (!bondedNode) { diff --git a/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeCostParameters.tsx b/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeCostParameters.tsx index 2b600d435b..6f71f3442a 100644 --- a/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeCostParameters.tsx +++ b/nym-wallet/src/pages/bonding/node-settings/settings-pages/NodeCostParameters.tsx @@ -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 && ( 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. )} diff --git a/nym-wallet/src/pages/delegation/index.tsx b/nym-wallet/src/pages/delegation/index.tsx index b51ebcf60f..7329d6f838 100644 --- a/nym-wallet/src/pages/delegation/index.tsx +++ b/nym-wallet/src/pages/delegation/index.tsx @@ -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, })), }); diff --git a/nym-wallet/src/requests/actions.ts b/nym-wallet/src/requests/actions.ts index 55e56ee78d..d34060e314 100644 --- a/nym-wallet/src/requests/actions.ts +++ b/nym-wallet/src/requests/actions.ts @@ -24,14 +24,10 @@ export const updateNymNodeConfig = async (update: NodeConfigUpdate, fee?: Fee) = invokeWrapper('update_nymnode_config', { update, fee }); export const updateNymNodeParams = async (newCosts: NodeCostParams, fee?: Fee) => { - console.log('updateNymNodeParams called with:', { newCosts, fee }); - const result = await invokeWrapper('update_nymnode_cost_params', { newCosts, fee, }); - - console.log('updateNymNodeParams result:', result); return result; };