Skip to content

Commit

Permalink
chore: renamed feeTokenAmount to feeAmount
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node committed Mar 6, 2024
1 parent b29ece6 commit c540ccd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { TNetworkName } from '@/types/common';
*
* @param feeTokenAddress?: string
*
* @param feeTokenAmount?: number
* @param feeAmount?: number
*
* @return Promise<ISmartContractExecutionResult>
*
Expand All @@ -76,7 +76,7 @@ export const createHederaFungibleToken = async (
inputKeys: ICommonKeyObject[],
msgValue: string,
feeTokenAddress?: string,
feeTokenAmount?: number
feeAmount?: number
): Promise<ISmartContractExecutionResult> => {
// sanitize params
let sanitizeErr;
Expand Down Expand Up @@ -117,7 +117,7 @@ export const createHederaFungibleToken = async (
initialTotalSupply,
maxSupply,
decimals,
feeTokenAmount,
feeAmount,
keyRes.hederaTokenKeys,
{
value: ethers.parseEther(msgValue),
Expand Down Expand Up @@ -179,7 +179,7 @@ export const createHederaFungibleToken = async (
*
* @param feeTokenAddress?: ethers.AddressLike
*
* @param feeTokenAmount?: number
* @param feeAmount?: number
*
* @return Promise<ISmartContractExecutionResult>
*
Expand All @@ -196,7 +196,7 @@ export const createHederaNonFungibleToken = async (
inputKeys: ICommonKeyObject[],
msgValue: string,
feeTokenAddress?: ethers.AddressLike,
feeTokenAmount?: number
feeAmount?: number
): Promise<ISmartContractExecutionResult> => {
// sanitize params
let sanitizeErr;
Expand Down Expand Up @@ -231,7 +231,7 @@ export const createHederaNonFungibleToken = async (
symbol,
memo,
maxSupply,
feeTokenAmount,
feeAmount,
keyRes.hederaTokenKeys,
{
value: ethers.parseEther(msgValue),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface ParamsProps {
spenderAddress?: string;
withCustomFee?: boolean;
accountAddress?: string;
feeTokenAmount?: number;
feeAmount?: number;
serialNumbers?: number[];
receiverAddress?: string;
feeTokenAddress?: string;
Expand Down Expand Up @@ -102,7 +102,7 @@ export const handleSanitizeHederaFormInputs = ({
senderAddress,
withCustomFee,
serialNumbers,
feeTokenAmount,
feeAmount,
spenderAddress,
accountAddress,
tokenAddresses,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => {
maxSupply: '',
initSupply: '',
feeTokenAddress: '',
feeTokenAmount: '',
feeAmount: '',
freezeStatus: false,
};
const [paramValues, setParamValues] = useState<any>(initialParamValues);
Expand Down Expand Up @@ -129,7 +129,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => {
maxSupply,
initSupply,
freezeStatus,
feeTokenAmount,
feeAmount,
feeTokenAddress,
} = paramValues;

Expand All @@ -145,7 +145,7 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => {
maxSupply,
initSupply,
withCustomFee,
feeTokenAmount,
feeAmount,
feeTokenAddress,
});

Expand All @@ -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
Expand Down Expand Up @@ -337,16 +337,16 @@ const FungibleTokenCreate = ({ baseContract }: PageProps) => {
/>

<SharedFormInputField
param={'feeTokenAmount'}
param={'feeAmount'}
handleInputOnChange={handleInputOnChange}
paramValue={paramValues['feeTokenAmount']}
paramKey={(htsTokenCreateParamFields as any)['feeTokenAmount'].paramKey}
paramType={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputType}
paramSize={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputSize}
explanation={(htsTokenCreateParamFields as any)['feeTokenAmount'].explanation}
paramClassName={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputClassname}
paramPlaceholder={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputPlaceholder}
paramFocusColor={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputFocusBorderColor}
paramValue={paramValues['feeAmount']}
paramKey={(htsTokenCreateParamFields as any)['feeAmount'].paramKey}
paramType={(htsTokenCreateParamFields as any)['feeAmount'].inputType}
paramSize={(htsTokenCreateParamFields as any)['feeAmount'].inputSize}
explanation={(htsTokenCreateParamFields as any)['feeAmount'].explanation}
paramClassName={(htsTokenCreateParamFields as any)['feeAmount'].inputClassname}
paramPlaceholder={(htsTokenCreateParamFields as any)['feeAmount'].inputPlaceholder}
paramFocusColor={(htsTokenCreateParamFields as any)['feeAmount'].inputFocusBorderColor}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => {
treasury: '',
feeValue: '',
maxSupply: '',
feeTokenAmount: '',
feeAmount: '',
feeTokenAddress: '',
};
const [paramValues, setParamValues] = useState<any>(initialParamValues);
Expand Down Expand Up @@ -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({
Expand All @@ -126,7 +125,7 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => {
treasury,
maxSupply,
withCustomFee,
feeTokenAmount,
feeAmount,
feeTokenAddress,
});

Expand All @@ -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
Expand Down Expand Up @@ -267,16 +266,16 @@ const NonFungibleTokenCreate = ({ baseContract }: PageProps) => {
/>

<SharedFormInputField
param={'feeTokenAmount'}
param={'feeAmount'}
handleInputOnChange={handleInputOnChange}
paramValue={paramValues['feeTokenAmount']}
paramKey={(htsTokenCreateParamFields as any)['feeTokenAmount'].paramKey}
paramType={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputType}
paramSize={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputSize}
explanation={(htsTokenCreateParamFields as any)['feeTokenAmount'].explanation}
paramClassName={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputClassname}
paramPlaceholder={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputPlaceholder}
paramFocusColor={(htsTokenCreateParamFields as any)['feeTokenAmount'].inputFocusBorderColor}
paramValue={paramValues['feeAmount']}
paramKey={(htsTokenCreateParamFields as any)['feeAmount'].paramKey}
paramType={(htsTokenCreateParamFields as any)['feeAmount'].inputType}
paramSize={(htsTokenCreateParamFields as any)['feeAmount'].inputSize}
explanation={(htsTokenCreateParamFields as any)['feeAmount'].explanation}
paramClassName={(htsTokenCreateParamFields as any)['feeAmount'].inputClassname}
paramPlaceholder={(htsTokenCreateParamFields as any)['feeAmount'].inputPlaceholder}
paramFocusColor={(htsTokenCreateParamFields as any)['feeAmount'].inputFocusBorderColor}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit c540ccd

Please sign in to comment.