From c540ccd56581bb00fd766e87c0b6a749ca565349 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Wed, 6 Mar 2024 15:05:43 -0500 Subject: [PATCH] chore: renamed feeTokenAmount to feeAmount Signed-off-by: Logan Nguyen --- .../tokenCreateCustom-interactions/index.ts | 12 ++++----- .../methods/handleSanitizeFormInputs.tsx | 6 ++--- .../methods/FungibleTokenCreate/index.tsx | 26 +++++++++--------- .../methods/NonFungibleTokenCreate/index.tsx | 27 +++++++++---------- .../HTS/token-create-custom/constant.ts | 4 +-- 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts b/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts index 90edc4681..e5e63db9c 100644 --- a/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts +++ b/system-contract-dapp-playground/src/api/hedera/hts-interactions/tokenCreateCustom-interactions/index.ts @@ -56,7 +56,7 @@ import { TNetworkName } from '@/types/common'; * * @param feeTokenAddress?: string * - * @param feeTokenAmount?: number + * @param feeAmount?: number * * @return Promise * @@ -76,7 +76,7 @@ export const createHederaFungibleToken = async ( inputKeys: ICommonKeyObject[], msgValue: string, feeTokenAddress?: string, - feeTokenAmount?: number + feeAmount?: number ): Promise => { // sanitize params let sanitizeErr; @@ -117,7 +117,7 @@ export const createHederaFungibleToken = async ( initialTotalSupply, maxSupply, decimals, - feeTokenAmount, + feeAmount, keyRes.hederaTokenKeys, { value: ethers.parseEther(msgValue), @@ -179,7 +179,7 @@ export const createHederaFungibleToken = async ( * * @param feeTokenAddress?: ethers.AddressLike * - * @param feeTokenAmount?: number + * @param feeAmount?: number * * @return Promise * @@ -196,7 +196,7 @@ export const createHederaNonFungibleToken = async ( inputKeys: ICommonKeyObject[], msgValue: string, feeTokenAddress?: ethers.AddressLike, - feeTokenAmount?: number + feeAmount?: number ): Promise => { // sanitize params let sanitizeErr; @@ -231,7 +231,7 @@ export const createHederaNonFungibleToken = async ( symbol, memo, maxSupply, - feeTokenAmount, + feeAmount, keyRes.hederaTokenKeys, { value: ethers.parseEther(msgValue), diff --git a/system-contract-dapp-playground/src/components/common/methods/handleSanitizeFormInputs.tsx b/system-contract-dapp-playground/src/components/common/methods/handleSanitizeFormInputs.tsx index 1e834e263..17e1c13a2 100644 --- a/system-contract-dapp-playground/src/components/common/methods/handleSanitizeFormInputs.tsx +++ b/system-contract-dapp-playground/src/components/common/methods/handleSanitizeFormInputs.tsx @@ -39,7 +39,7 @@ interface ParamsProps { spenderAddress?: string; withCustomFee?: boolean; accountAddress?: string; - feeTokenAmount?: number; + feeAmount?: number; serialNumbers?: number[]; receiverAddress?: string; feeTokenAddress?: string; @@ -102,7 +102,7 @@ export const handleSanitizeHederaFormInputs = ({ senderAddress, withCustomFee, serialNumbers, - feeTokenAmount, + feeAmount, spenderAddress, accountAddress, tokenAddresses, @@ -135,7 +135,7 @@ export const handleSanitizeHederaFormInputs = ({ sanitizeErr = 'Invalid denomination token ID'; } else if (!isAddress(treasury)) { sanitizeErr = 'Invalid treasury account address'; - } else if (withCustomFee && Number(feeTokenAmount) <= 0) { + } else if (withCustomFee && Number(feeAmount) <= 0) { sanitizeErr = 'Custom fee amount must be positive'; } // sanitize keys diff --git a/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/FungibleTokenCreate/index.tsx b/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/FungibleTokenCreate/index.tsx index ed56787e2..bff11015a 100644 --- a/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/FungibleTokenCreate/index.tsx +++ b/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/FungibleTokenCreate/index.tsx @@ -84,7 +84,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => { maxSupply: '', initSupply: '', feeTokenAddress: '', - feeTokenAmount: '', + feeAmount: '', freezeStatus: false, }; const [paramValues, setParamValues] = useState(initialParamValues); @@ -129,7 +129,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => { maxSupply, initSupply, freezeStatus, - feeTokenAmount, + feeAmount, feeTokenAddress, } = paramValues; @@ -145,7 +145,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => { maxSupply, initSupply, withCustomFee, - feeTokenAmount, + feeAmount, feeTokenAddress, }); @@ -172,7 +172,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => { keys, feeValue, withCustomFee ? feeTokenAddress : undefined, - withCustomFee ? Number(feeTokenAmount) : undefined + withCustomFee ? Number(feeAmount) : undefined ); // turn is loading off @@ -337,16 +337,16 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => { /> )} diff --git a/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/NonFungibleTokenCreate/index.tsx b/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/NonFungibleTokenCreate/index.tsx index 15f763101..624c02f4f 100644 --- a/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/NonFungibleTokenCreate/index.tsx +++ b/system-contract-dapp-playground/src/components/contract-interaction/hts/token-create-custom/methods/NonFungibleTokenCreate/index.tsx @@ -78,7 +78,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => { treasury: '', feeValue: '', maxSupply: '', - feeTokenAmount: '', + feeAmount: '', feeTokenAddress: '', }; const [paramValues, setParamValues] = useState(initialParamValues); @@ -113,8 +113,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => { /** @dev handle invoking the API to interact with smart contract and create non fungible token */ const handleCreatingNonFungibleToken = async () => { - const { name, symbol, memo, maxSupply, treasury, feeTokenAddress, feeValue, feeTokenAmount } = - paramValues; + const { name, symbol, memo, maxSupply, treasury, feeTokenAddress, feeValue, feeAmount } = paramValues; // sanitize params const sanitizeErr = handleSanitizeHederaFormInputs({ @@ -126,7 +125,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => { treasury, maxSupply, withCustomFee, - feeTokenAmount, + feeAmount, feeTokenAddress, }); @@ -150,7 +149,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => { keys, feeValue, withCustomFee ? feeTokenAddress : undefined, - withCustomFee ? Number(feeTokenAmount) : undefined + withCustomFee ? Number(feeAmount) : undefined ); // turn is loading off @@ -267,16 +266,16 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => { /> )} diff --git a/system-contract-dapp-playground/src/utils/contract-interactions/HTS/token-create-custom/constant.ts b/system-contract-dapp-playground/src/utils/contract-interactions/HTS/token-create-custom/constant.ts index af7ed1899..bcb69af41 100644 --- a/system-contract-dapp-playground/src/utils/contract-interactions/HTS/token-create-custom/constant.ts +++ b/system-contract-dapp-playground/src/utils/contract-interactions/HTS/token-create-custom/constant.ts @@ -107,10 +107,10 @@ export const htsTokenCreateParamFields = { inputPlaceholder: 'The denomination token ID...', explanation: 'represents the ID of token that is used for fixed fee denomination', }, - feeTokenAmount: { + feeAmount: { ...HEDERA_SHARED_PARAM_INPUT_FIELDS, inputType: 'number', - paramKey: 'feeTokenAmount', + paramKey: 'feeAmount', inputPlaceholder: 'The fee amount...', explanation: 'represents the number of units to assess as a fee', },