Moniker
|
@@ -145,6 +148,8 @@ export default function ValidatorList({
key={validator.operator_address}
className="bg-[#FFFFFFCC] dark:bg-[#FFFFFF0F] hover:bg-[#FFFFFF66] dark:hover:bg-[#FFFFFF1A] text-black dark:text-white rounded-lg cursor-pointer"
onClick={() => handleRowClick(validator)}
+ role="row"
+ aria-label={`Validator ${validator.description.moniker}`}
>
diff --git a/components/admins/modals/__tests__/updateStakingParamsModal.test.tsx b/components/admins/modals/__tests__/updateStakingParamsModal.test.tsx
index 207da39c..9e90916f 100644
--- a/components/admins/modals/__tests__/updateStakingParamsModal.test.tsx
+++ b/components/admins/modals/__tests__/updateStakingParamsModal.test.tsx
@@ -4,7 +4,7 @@ import { screen, fireEvent, cleanup } from '@testing-library/react';
import { UpdateStakingParamsModal } from '@/components/admins/modals/updateStakingParamsModal';
import matchers from '@testing-library/jest-dom/matchers';
import { renderWithChainProvider } from '@/tests/render';
-import { DurationSDKType } from '@chalabi/manifestjs/src/codegen/google/protobuf/duration';
+import { DurationSDKType } from '@liftedinit/manifestjs/src/codegen/google/protobuf/duration';
expect.extend(matchers);
diff --git a/components/admins/modals/updateStakingParamsModal.tsx b/components/admins/modals/updateStakingParamsModal.tsx
index e13b145f..b0b5c3d8 100644
--- a/components/admins/modals/updateStakingParamsModal.tsx
+++ b/components/admins/modals/updateStakingParamsModal.tsx
@@ -1,9 +1,9 @@
import { chainName } from '@/config';
import { useFeeEstimation, useTx } from '@/hooks';
-import { strangelove_ventures, cosmos, manifest } from '@chalabi/manifestjs';
-import { ParamsSDKType } from '@chalabi/manifestjs/dist/codegen/cosmos/staking/v1beta1/staking';
-import { MsgUpdateStakingParams } from '@chalabi/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
-import { Any } from '@chalabi/manifestjs/dist/codegen/google/protobuf/any';
+import { strangelove_ventures, cosmos } from '@liftedinit/manifestjs';
+import { ParamsSDKType } from '@liftedinit/manifestjs/dist/codegen/cosmos/staking/v1beta1/staking';
+import { MsgUpdateStakingParams } from '@liftedinit/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
+import { Any } from '@liftedinit/manifestjs/dist/codegen/google/protobuf/any';
import React, { useState, useEffect } from 'react';
interface UpdateStakingParamsModalProps {
diff --git a/components/admins/modals/validatorModal.tsx b/components/admins/modals/validatorModal.tsx
index b3d062d9..2f55fc57 100644
--- a/components/admins/modals/validatorModal.tsx
+++ b/components/admins/modals/validatorModal.tsx
@@ -6,11 +6,11 @@ import { BsThreeDots } from 'react-icons/bs';
import { DescriptionModal } from './descriptionModal';
import { chainName } from '@/config';
import { useTx, useFeeEstimation } from '@/hooks';
-import { strangelove_ventures } from '@chalabi/manifestjs';
+import { strangelove_ventures } from '@liftedinit/manifestjs';
import { useChain } from '@cosmos-kit/react';
-import { cosmos } from '@chalabi/manifestjs';
-import { Any } from '@chalabi/manifestjs/dist/codegen/google/protobuf/any';
-import { MsgSetPower } from '@chalabi/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
+import { cosmos } from '@liftedinit/manifestjs';
+import { Any } from '@liftedinit/manifestjs/dist/codegen/google/protobuf/any';
+import { MsgSetPower } from '@liftedinit/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
import { Formik, Form, Field, ErrorMessage, FieldProps } from 'formik';
import * as Yup from 'yup';
import { calculateIsUnsafe } from '@/utils/maths';
diff --git a/components/admins/modals/warningModal.tsx b/components/admins/modals/warningModal.tsx
index 4aeff8f7..53731a9c 100644
--- a/components/admins/modals/warningModal.tsx
+++ b/components/admins/modals/warningModal.tsx
@@ -1,8 +1,8 @@
import { chainName } from '@/config';
import { useFeeEstimation, useTx } from '@/hooks';
-import { cosmos, strangelove_ventures } from '@chalabi/manifestjs';
-import { Any } from '@chalabi/manifestjs/dist/codegen/google/protobuf/any';
-import { MsgRemoveValidator } from '@chalabi/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
+import { cosmos, strangelove_ventures } from '@liftedinit/manifestjs';
+import { Any } from '@liftedinit/manifestjs/dist/codegen/google/protobuf/any';
+import { MsgRemoveValidator } from '@liftedinit/manifestjs/dist/codegen/strangelove_ventures/poa/v1/tx';
import { useChain } from '@cosmos-kit/react';
import React, { useState } from 'react';
import { PiWarning } from 'react-icons/pi';
diff --git a/components/bank/components/sendBox.tsx b/components/bank/components/sendBox.tsx
index 84509e1c..a29f9898 100644
--- a/components/bank/components/sendBox.tsx
+++ b/components/bank/components/sendBox.tsx
@@ -3,7 +3,7 @@ import SendForm from '../forms/sendForm';
import IbcSendForm from '../forms/ibcSendForm';
import { PiCaretDownBold } from 'react-icons/pi';
import Image from 'next/image';
-import { CoinSDKType } from '@chalabi/manifestjs/dist/codegen/cosmos/base/v1beta1/coin';
+import { CoinSDKType } from '@liftedinit/manifestjs/dist/codegen/cosmos/base/v1beta1/coin';
import { CombinedBalanceInfo } from '@/utils/types';
export interface IbcChain {
diff --git a/components/bank/forms/ibcSendForm.tsx b/components/bank/forms/ibcSendForm.tsx
index 376bc57d..0bbf9fa8 100644
--- a/components/bank/forms/ibcSendForm.tsx
+++ b/components/bank/forms/ibcSendForm.tsx
@@ -1,7 +1,7 @@
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect, useMemo } from 'react';
import { chainName } from '@/config';
import { useFeeEstimation, useTx } from '@/hooks';
-import { ibc } from '@chalabi/manifestjs';
+import { ibc } from '@liftedinit/manifestjs';
import { getIbcInfo } from '@/utils';
import { PiCaretDownBold } from 'react-icons/pi';
import { MdContacts } from 'react-icons/md';
@@ -16,7 +16,9 @@ import { shiftDigits, truncateString } from '@/utils';
import { SearchIcon } from '@/components/icons';
import { MFX_TOKEN_DATA } from '@/utils/constants'; // Import MFX_TOKEN_DATA
import { TailwindModal } from '@/components/react/modal';
+import { formatTokenDisplayName } from '@/utils';
+//TODO: use formatTokenDisplayName instead of repeating format
export default function IbcSendForm({
address,
destinationChain,
@@ -51,10 +53,14 @@ export default function IbcSendForm({
const [isContactsOpen, setIsContactsOpen] = useState(false);
// Adjusted filter logic to handle undefined metadata
- const filteredBalances = balances?.filter(token => {
- const displayName = token.metadata?.display ?? token.denom;
- return displayName.toLowerCase().includes(searchTerm.toLowerCase());
- });
+ const filteredBalances = useMemo(
+ () =>
+ balances?.filter(token => {
+ const displayName = token.metadata?.display ?? token.denom;
+ return displayName.toLowerCase().includes(searchTerm.toLowerCase());
+ }),
+ [balances, searchTerm]
+ );
// Set initialSelectedToken to 'mfx' if available
const initialSelectedToken =
@@ -78,20 +84,14 @@ export default function IbcSendForm({
const balance = parseFloat(selectedToken.amount) / Math.pow(10, exponent);
return value <= balance;
})
- .test('leave-for-fees', '', function (value) {
+ .test('leave-for-fees', 'Insufficient balance for fees', function (value) {
const { selectedToken } = this.parent;
if (!selectedToken || !value || selectedToken.denom !== 'umfx') return true;
const exponent = selectedToken.metadata?.denom_units[1]?.exponent ?? 6;
const balance = parseFloat(selectedToken.amount) / Math.pow(10, exponent);
- if (value > balance - 0.09) {
- setFeeWarning('Remember to leave tokens for fees!');
- } else {
- setFeeWarning('');
- }
-
- return true;
+ return value <= balance - 0.09;
}),
selectedToken: Yup.object().required('Please select a token'),
memo: Yup.string().max(255, 'Memo must be less than 255 characters'),
@@ -181,6 +181,10 @@ export default function IbcSendForm({
|