From 8ecf6813619ea61723747c444871c6b42f462d45 Mon Sep 17 00:00:00 2001 From: poomthiti Date: Wed, 17 May 2023 09:38:54 +0700 Subject: [PATCH 1/3] refactor: address type length from example addresses instead of hardcode --- src/lib/app-provider/hooks/useAddress.ts | 107 +++++++++++------- .../modal/UnsupportedTokensModal.tsx | 7 +- src/lib/hooks/useSingleMessageProps.ts | 75 +++++++----- .../table/code/PublicProjectCodeRow.tsx | 10 +- .../contract/PublicProjectContractRow.tsx | 10 +- 5 files changed, 123 insertions(+), 86 deletions(-) diff --git a/src/lib/app-provider/hooks/useAddress.ts b/src/lib/app-provider/hooks/useAddress.ts index 3f3ffbeac..319bee68a 100644 --- a/src/lib/app-provider/hooks/useAddress.ts +++ b/src/lib/app-provider/hooks/useAddress.ts @@ -1,8 +1,9 @@ import { fromBech32 } from "@cosmjs/encoding"; import type { ChainRecord } from "@cosmos-kit/core"; import { useWallet } from "@cosmos-kit/react"; -import { useCallback } from "react"; +import { useCallback, useMemo } from "react"; +import { useCelatoneApp } from "../contexts"; import type { Option } from "lib/types"; export type AddressReturnType = @@ -11,38 +12,35 @@ export type AddressReturnType = | "validator_address" | "invalid_address"; -const addressLengthMap: { - [key: string]: { [length: number]: AddressReturnType }; -} = { - osmosis: { - 43: "user_address", - 50: "validator_address", - 63: "contract_address", - }, - osmosistestnet: { - 43: "user_address", - 50: "validator_address", - 63: "contract_address", - }, - terra2: { - 44: "user_address", - 51: "validator_address", - 64: "contract_address", - }, - terra2testnet: { - 44: "user_address", - 51: "validator_address", - 64: "contract_address", - }, +export const useGetAddressTypeByLength = () => { + const { + chainConfig: { exampleAddresses }, + } = useCelatoneApp(); + const addressLengthMap = useMemo( + () => + Object.entries(exampleAddresses).reduce<{ + [key: number]: AddressReturnType; + }>( + (acc, curr) => ({ + ...acc, + [curr[1].length]: `${curr[0]}_address` as AddressReturnType, + }), + {} + ), + [exampleAddresses] + ); + return useCallback( + (address: Option): AddressReturnType => + address + ? addressLengthMap[address.length] ?? "invalid_address" + : "invalid_address", + [addressLengthMap] + ); }; -export const getAddressTypeByLength = ( - chainName: string, - address: Option -): AddressReturnType => - address - ? addressLengthMap[chainName]?.[address.length] ?? "invalid_address" - : "invalid_address"; +export type GetAddressTypeByLengthFn = ReturnType< + typeof useGetAddressTypeByLength +>; const getPrefix = (basePrefix: string, addressType: AddressReturnType) => { if (addressType === "validator_address") return `${basePrefix}valoper`; @@ -52,7 +50,8 @@ const getPrefix = (basePrefix: string, addressType: AddressReturnType) => { const validateAddress = ( currentChainRecord: ChainRecord | undefined, address: string, - addressType: AddressReturnType + addressType: AddressReturnType, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { if (!currentChainRecord) return "Invalid network"; @@ -61,7 +60,7 @@ const validateAddress = ( if (!address.startsWith(prefix)) return `Invalid prefix (expected "${prefix}")`; - if (getAddressTypeByLength(currentChainRecord.name, address) !== addressType) + if (getAddressTypeByLength(address) !== addressType) return "Invalid address length"; try { @@ -73,41 +72,63 @@ const validateAddress = ( }; export const useGetAddressType = () => { - const { currentChainName, currentChainRecord } = useWallet(); + const { currentChainRecord } = useWallet(); + const getAddressTypeByLength = useGetAddressTypeByLength(); return useCallback( (address: Option): AddressReturnType => { - const addressType = getAddressTypeByLength(currentChainName, address); + const addressType = getAddressTypeByLength(address); if ( !address || addressType === "invalid_address" || - validateAddress(currentChainRecord, address, addressType) + validateAddress( + currentChainRecord, + address, + addressType, + getAddressTypeByLength + ) ) return "invalid_address"; return addressType; }, - [currentChainName, currentChainRecord] + [currentChainRecord, getAddressTypeByLength] ); }; // TODO: refactor export const useValidateAddress = () => { const { currentChainRecord } = useWallet(); + const getAddressTypeByLength = useGetAddressTypeByLength(); return { validateContractAddress: useCallback( (address: string) => - validateAddress(currentChainRecord, address, "contract_address"), - [currentChainRecord] + validateAddress( + currentChainRecord, + address, + "contract_address", + getAddressTypeByLength + ), + [currentChainRecord, getAddressTypeByLength] ), validateUserAddress: useCallback( (address: string) => - validateAddress(currentChainRecord, address, "user_address"), - [currentChainRecord] + validateAddress( + currentChainRecord, + address, + "user_address", + getAddressTypeByLength + ), + [currentChainRecord, getAddressTypeByLength] ), validateValidatorAddress: useCallback( (address: string) => - validateAddress(currentChainRecord, address, "validator_address"), - [currentChainRecord] + validateAddress( + currentChainRecord, + address, + "validator_address", + getAddressTypeByLength + ), + [currentChainRecord, getAddressTypeByLength] ), }; }; diff --git a/src/lib/components/modal/UnsupportedTokensModal.tsx b/src/lib/components/modal/UnsupportedTokensModal.tsx index fe0555419..0996159d5 100644 --- a/src/lib/components/modal/UnsupportedTokensModal.tsx +++ b/src/lib/components/modal/UnsupportedTokensModal.tsx @@ -13,13 +13,12 @@ import { Heading, Tooltip, } from "@chakra-ui/react"; -import { useWallet } from "@cosmos-kit/react"; import { useMemo } from "react"; import { ExplorerLink } from "../ExplorerLink"; import type { IconKeys } from "../icon"; import { CustomIcon } from "../icon"; -import { useGetAddressType, getAddressTypeByLength } from "lib/app-provider"; +import { useGetAddressType, useGetAddressTypeByLength } from "lib/app-provider"; import type { AddressReturnType } from "lib/app-provider"; import { Copier } from "lib/components/copy"; import { AmpTrackUnsupportedToken } from "lib/services/amplitude"; @@ -152,12 +151,12 @@ export const UnsupportedTokensModal = ({ buttonProps, amptrackSection, }: UnsupportedTokensModalProps) => { - const { currentChainName } = useWallet(); const { isOpen, onOpen, onClose } = useDisclosure(); + const getAddressTypeByLength = useGetAddressTypeByLength(); if (unsupportedAssets.length === 0) return null; - const addressType = getAddressTypeByLength(currentChainName, address); + const addressType = getAddressTypeByLength(address); const content = unsupportedTokensContent(addressType); return ( diff --git a/src/lib/hooks/useSingleMessageProps.ts b/src/lib/hooks/useSingleMessageProps.ts index 821066399..4697633bc 100644 --- a/src/lib/hooks/useSingleMessageProps.ts +++ b/src/lib/hooks/useSingleMessageProps.ts @@ -1,7 +1,8 @@ import { useWallet } from "@cosmos-kit/react"; import router from "next/router"; -import { getAddressTypeByLength } from "lib/app-provider"; +import type { GetAddressTypeByLengthFn } from "lib/app-provider"; +import { useGetAddressTypeByLength } from "lib/app-provider"; import type { SingleMsgProps } from "lib/components/action-msg/SingleMsg"; import type { LinkType } from "lib/components/ExplorerLink"; import { useContractStore } from "lib/providers/store"; @@ -48,7 +49,8 @@ const instantiateSingleMsgProps = ( getContractLocalInfo: ( contractAddress: ContractAddr ) => Option, - isInstantiate2: boolean + isInstantiate2: boolean, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailInstantiate; // TODO - revisit, instantiate detail response when query from contract transaction table doesn't contain contract addr @@ -79,7 +81,7 @@ const instantiateSingleMsgProps = ( type, text1: "contract", link1: { - type: getAddressTypeByLength(chainName, contractAddress), + type: getAddressTypeByLength(contractAddress), value: contractLocalInfo?.name || contractAddress, copyValue: contractAddress, }, @@ -128,7 +130,8 @@ const executeSingleMsgProps = ( singleMsg: Option, getContractLocalInfo: ( contractAddress: ContractAddr - ) => Option + ) => Option, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailExecute; const contractLocalInfo = getContractLocalInfo(detail.contract); @@ -160,7 +163,7 @@ const executeSingleMsgProps = ( length: messages.length, text2: "messages on", link2: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -171,7 +174,7 @@ const executeSingleMsgProps = ( length: messages.length, text2: "messages on", link2: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -184,7 +187,7 @@ const executeSingleMsgProps = ( tags: getExecuteMsgTags(messages, singleMsg ? 1 : 2), text2: "on", link2: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -193,7 +196,7 @@ const executeSingleMsgProps = ( type: "Failed", text1: "to execute message from", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -229,7 +232,8 @@ const sendSingleMsgProps = ( assetInfos: Option>, getContractLocalInfo: ( contractAddress: ContractAddr - ) => Option + ) => Option, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailSend; const contractLocalInfo = getContractLocalInfo( @@ -272,7 +276,7 @@ const sendSingleMsgProps = ( type: "Send", text1: "assets to", link2: { - type: getAddressTypeByLength(chainName, detail.toAddress), + type: getAddressTypeByLength(detail.toAddress), value: contractLocalInfo?.name || detail.toAddress, copyValue: detail.toAddress, }, @@ -281,7 +285,7 @@ const sendSingleMsgProps = ( type: "Failed", text1: "to send assets to", link2: { - type: getAddressTypeByLength(chainName, detail.toAddress), + type: getAddressTypeByLength(detail.toAddress), value: contractLocalInfo?.name || detail.toAddress, copyValue: detail.toAddress, }, @@ -293,7 +297,7 @@ const sendSingleMsgProps = ( tokens, text2: "to", link1: { - type: getAddressTypeByLength(chainName, detail.toAddress), + type: getAddressTypeByLength(detail.toAddress), value: detail.toAddress, }, } @@ -301,7 +305,7 @@ const sendSingleMsgProps = ( type: "Failed", text1: "to send assets to", link1: { - type: getAddressTypeByLength(chainName, detail.toAddress), + type: getAddressTypeByLength(detail.toAddress), value: detail.toAddress, }, }; @@ -330,7 +334,8 @@ const migrateSingleMsgProps = ( chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr - ) => Option + ) => Option, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailMigrate; const contractLocalInfo = getContractLocalInfo(detail.contract); @@ -353,7 +358,7 @@ const migrateSingleMsgProps = ( ? { type: "Migrate", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -397,7 +402,8 @@ const updateAdminSingleMsgProps = ( chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr - ) => Option + ) => Option, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailUpdateAdmin; const contractLocalInfo = getContractLocalInfo(detail.contract); @@ -422,13 +428,13 @@ const updateAdminSingleMsgProps = ( type: "Update admin", text1: "on", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, text3: "to", link2: { - type: getAddressTypeByLength(chainName, detail.newAdmin), + type: getAddressTypeByLength(detail.newAdmin), value: adminLocalInfo?.name || detail.newAdmin, }, } @@ -436,13 +442,13 @@ const updateAdminSingleMsgProps = ( type: "Failed", text1: "to update admin on", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, text3: "to", link2: { - type: getAddressTypeByLength(chainName, detail.newAdmin), + type: getAddressTypeByLength(detail.newAdmin), value: adminLocalInfo?.name || detail.newAdmin, }, }; @@ -471,7 +477,8 @@ const clearAdminSingleMsgProps = ( chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr - ) => Option + ) => Option, + getAddressTypeByLength: GetAddressTypeByLengthFn ) => { const detail = messages[0].detail as DetailClearAdmin; const contractLocalInfo = getContractLocalInfo(detail.contract); @@ -496,7 +503,7 @@ const clearAdminSingleMsgProps = ( type: "Clear admin", text1: "on", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -505,7 +512,7 @@ const clearAdminSingleMsgProps = ( type: "Failed", text1: "to clear admin on", link1: { - type: getAddressTypeByLength(chainName, detail.contract), + type: getAddressTypeByLength(detail.contract), value: contractLocalInfo?.name || detail.contract, copyValue: detail.contract, }, @@ -600,6 +607,7 @@ export const useSingleActionMsgProps = ( const { currentChainName } = useWallet(); const { getContractLocalInfo } = useContractStore(); const { assetInfos } = useAssetInfos(); + const getAddressTypeByLength = useGetAddressTypeByLength(); switch (type) { case "MsgExecuteContract": @@ -608,7 +616,8 @@ export const useSingleActionMsgProps = ( messages, currentChainName, singleMsg, - getContractLocalInfo + getContractLocalInfo, + getAddressTypeByLength ); case "MsgSend": return sendSingleMsgProps( @@ -616,14 +625,16 @@ export const useSingleActionMsgProps = ( messages, currentChainName, assetInfos, - getContractLocalInfo + getContractLocalInfo, + getAddressTypeByLength ); case "MsgMigrateContract": return migrateSingleMsgProps( isSuccess, messages, currentChainName, - getContractLocalInfo + getContractLocalInfo, + getAddressTypeByLength ); case "MsgInstantiateContract": return instantiateSingleMsgProps( @@ -631,7 +642,8 @@ export const useSingleActionMsgProps = ( messages, currentChainName, getContractLocalInfo, - false + false, + getAddressTypeByLength ); case "MsgInstantiateContract2": return instantiateSingleMsgProps( @@ -639,21 +651,24 @@ export const useSingleActionMsgProps = ( messages, currentChainName, getContractLocalInfo, - true + true, + getAddressTypeByLength ); case "MsgUpdateAdmin": return updateAdminSingleMsgProps( isSuccess, messages, currentChainName, - getContractLocalInfo + getContractLocalInfo, + getAddressTypeByLength ); case "MsgClearAdmin": return clearAdminSingleMsgProps( isSuccess, messages, currentChainName, - getContractLocalInfo + getContractLocalInfo, + getAddressTypeByLength ); case "MsgStoreCode": return storeCodeSingleMsgProps(isSuccess, messages); diff --git a/src/lib/pages/public-project/components/table/code/PublicProjectCodeRow.tsx b/src/lib/pages/public-project/components/table/code/PublicProjectCodeRow.tsx index d5d33e32a..5cdd42329 100644 --- a/src/lib/pages/public-project/components/table/code/PublicProjectCodeRow.tsx +++ b/src/lib/pages/public-project/components/table/code/PublicProjectCodeRow.tsx @@ -1,7 +1,9 @@ import { HStack, Grid, Text } from "@chakra-ui/react"; -import { useWallet } from "@cosmos-kit/react"; -import { useInternalNavigate, getAddressTypeByLength } from "lib/app-provider"; +import { + useInternalNavigate, + useGetAddressTypeByLength, +} from "lib/app-provider"; import { InstantiateButton } from "lib/components/button"; import { ExplorerLink } from "lib/components/ExplorerLink"; import { SaveOrRemoveCodeModal } from "lib/components/modal"; @@ -21,7 +23,7 @@ export const PublicProjectCodeRow = ({ templateColumns, }: CodeTableRowProps) => { const navigate = useInternalNavigate(); - const { currentChainName } = useWallet(); + const getAddressTypeByLength = useGetAddressTypeByLength(); const goToCodeDetails = () => { navigate({ pathname: `/code/${publicInfo.id}`, @@ -64,7 +66,7 @@ export const PublicProjectCodeRow = ({ diff --git a/src/lib/pages/public-project/components/table/contract/PublicProjectContractRow.tsx b/src/lib/pages/public-project/components/table/contract/PublicProjectContractRow.tsx index 38330ede3..aaa9b16c9 100644 --- a/src/lib/pages/public-project/components/table/contract/PublicProjectContractRow.tsx +++ b/src/lib/pages/public-project/components/table/contract/PublicProjectContractRow.tsx @@ -8,9 +8,11 @@ import { Flex, Tooltip, } from "@chakra-ui/react"; -import { useWallet } from "@cosmos-kit/react"; -import { useInternalNavigate, getAddressTypeByLength } from "lib/app-provider"; +import { + useInternalNavigate, + useGetAddressTypeByLength, +} from "lib/app-provider"; import { AppLink } from "lib/components/AppLink"; import { ExplorerLink } from "lib/components/ExplorerLink"; import { CustomIcon } from "lib/components/icon"; @@ -42,7 +44,7 @@ export const PublicProjectContractRow = ({ templateColumns, }: ContractTableRowProps) => { const navigate = useInternalNavigate(); - const { currentChainName } = useWallet(); + const getAddressTypeByLength = useGetAddressTypeByLength(); const goToContractDetails = () => { navigate({ @@ -63,7 +65,6 @@ export const PublicProjectContractRow = ({ Date: Wed, 17 May 2023 09:41:11 +0700 Subject: [PATCH 2/3] chore: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd8114b1a..9831f0cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Improvements +- [#336](https://github.com/alleslabs/celatone-frontend/pull/336) Get address type length from example addresses instead of hardcode - [#304](https://github.com/alleslabs/celatone-frontend/pull/304) Remove suffix for token card - [#282](https://github.com/alleslabs/celatone-frontend/pull/282) Change details page top section explorer link to copy link - [#293](https://github.com/alleslabs/celatone-frontend/pull/293) Add comma separator to pagination and total blocks From c38a7b52183d4ab995d5b50a47895f9a964c4fab Mon Sep 17 00:00:00 2001 From: poomthiti Date: Wed, 24 May 2023 18:45:20 +0700 Subject: [PATCH 3/3] refactor: removed unused chain name var --- src/lib/hooks/useSingleMessageProps.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/lib/hooks/useSingleMessageProps.ts b/src/lib/hooks/useSingleMessageProps.ts index 4697633bc..1a1f25f8f 100644 --- a/src/lib/hooks/useSingleMessageProps.ts +++ b/src/lib/hooks/useSingleMessageProps.ts @@ -1,4 +1,3 @@ -import { useWallet } from "@cosmos-kit/react"; import router from "next/router"; import type { GetAddressTypeByLengthFn } from "lib/app-provider"; @@ -35,7 +34,6 @@ import { getFirstQueryParam, getExecuteMsgTags } from "lib/utils"; * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param getContractLocalInfo - contract local info * @param isInstantiate2 - boolean of whether the message is instantiate2 or not * @@ -45,7 +43,6 @@ import { getFirstQueryParam, getExecuteMsgTags } from "lib/utils"; const instantiateSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr ) => Option, @@ -116,7 +113,6 @@ const instantiateSingleMsgProps = ( * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param singleMsg - true when use in accordion * @param getContractLocalInfo - contract local info * @@ -126,7 +122,6 @@ const instantiateSingleMsgProps = ( const executeSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, singleMsg: Option, getContractLocalInfo: ( contractAddress: ContractAddr @@ -218,7 +213,6 @@ const executeSingleMsgProps = ( * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param assetInfos - information of assets * @param getContractLocalInfo - contract local info * @@ -228,7 +222,6 @@ const executeSingleMsgProps = ( const sendSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, assetInfos: Option>, getContractLocalInfo: ( contractAddress: ContractAddr @@ -322,7 +315,6 @@ const sendSingleMsgProps = ( * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param getContractLocalInfo - contract local info * * @returns msgProps use in @@ -331,7 +323,6 @@ const sendSingleMsgProps = ( const migrateSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr ) => Option, @@ -390,7 +381,6 @@ const migrateSingleMsgProps = ( * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param getContractLocalInfo - contract local info * * @returns msgProps use in @@ -399,7 +389,6 @@ const migrateSingleMsgProps = ( const updateAdminSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr ) => Option, @@ -465,7 +454,6 @@ const updateAdminSingleMsgProps = ( * * @param isSuccess - boolean of whether tx is succeed or not * @param messages - list of messages - * @param chainName - chain name * @param getContractLocalInfo - contract local info * * @returns msgProps use in @@ -474,7 +462,6 @@ const updateAdminSingleMsgProps = ( const clearAdminSingleMsgProps = ( isSuccess: boolean, messages: Message[], - chainName: string, getContractLocalInfo: ( contractAddress: ContractAddr ) => Option, @@ -604,7 +591,6 @@ export const useSingleActionMsgProps = ( messages: Message[], singleMsg: Option ): SingleMsgProps => { - const { currentChainName } = useWallet(); const { getContractLocalInfo } = useContractStore(); const { assetInfos } = useAssetInfos(); const getAddressTypeByLength = useGetAddressTypeByLength(); @@ -614,7 +600,6 @@ export const useSingleActionMsgProps = ( return executeSingleMsgProps( isSuccess, messages, - currentChainName, singleMsg, getContractLocalInfo, getAddressTypeByLength @@ -623,7 +608,6 @@ export const useSingleActionMsgProps = ( return sendSingleMsgProps( isSuccess, messages, - currentChainName, assetInfos, getContractLocalInfo, getAddressTypeByLength @@ -632,7 +616,6 @@ export const useSingleActionMsgProps = ( return migrateSingleMsgProps( isSuccess, messages, - currentChainName, getContractLocalInfo, getAddressTypeByLength ); @@ -640,7 +623,6 @@ export const useSingleActionMsgProps = ( return instantiateSingleMsgProps( isSuccess, messages, - currentChainName, getContractLocalInfo, false, getAddressTypeByLength @@ -649,7 +631,6 @@ export const useSingleActionMsgProps = ( return instantiateSingleMsgProps( isSuccess, messages, - currentChainName, getContractLocalInfo, true, getAddressTypeByLength @@ -658,7 +639,6 @@ export const useSingleActionMsgProps = ( return updateAdminSingleMsgProps( isSuccess, messages, - currentChainName, getContractLocalInfo, getAddressTypeByLength ); @@ -666,7 +646,6 @@ export const useSingleActionMsgProps = ( return clearAdminSingleMsgProps( isSuccess, messages, - currentChainName, getContractLocalInfo, getAddressTypeByLength );