-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added dynamic feeAmount parameter to fungible and non-fungible token create with custom fee method #700
Changes from 3 commits
636edbf
a83922f
b29ece6
c540ccd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ interface ParamsProps { | |
spenderAddress?: string; | ||
withCustomFee?: boolean; | ||
accountAddress?: string; | ||
feeTokenAmount?: number; | ||
serialNumbers?: number[]; | ||
receiverAddress?: string; | ||
feeTokenAddress?: string; | ||
|
@@ -47,8 +48,8 @@ interface ParamsProps { | |
autoRenewAccount?: string; | ||
tokenAddresses?: string[]; | ||
recipientAddress?: string; | ||
associatingAddress?: string; | ||
tokenAddressToMint?: string; | ||
associatingAddress?: string; | ||
hederaTokenAddress?: string; | ||
fungibleReceivers?: string[]; | ||
nonFungibleReceivers?: string[]; | ||
|
@@ -101,6 +102,7 @@ export const handleSanitizeHederaFormInputs = ({ | |
senderAddress, | ||
withCustomFee, | ||
serialNumbers, | ||
feeTokenAmount, | ||
spenderAddress, | ||
accountAddress, | ||
tokenAddresses, | ||
|
@@ -133,6 +135,8 @@ export const handleSanitizeHederaFormInputs = ({ | |
sanitizeErr = 'Invalid denomination token ID'; | ||
} else if (!isAddress(treasury)) { | ||
sanitizeErr = 'Invalid treasury account address'; | ||
} else if (withCustomFee && Number(feeTokenAmount) <= 0) { | ||
sanitizeErr = 'Custom fee amount must be positive'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if applicable, should we also validate if the number if too big? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice input! Though I think we can address it in another PR. |
||
} | ||
// sanitize keys | ||
if (!sanitizeErr && keys) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit, should we use
feeAmount
to be consistent with the rest of the PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha I don't know why I left it as feeTokenAmount! Good catch thanks! Pushed in the fix!