I have a question for the createCreateMetadataAccountV2Instruction.
I'm trying to calculate the fee with Metadata.getMinimumBalanceForRentExemption
But seems it returns wrong value.
I'm getting this error from the transaction.
Transfer: insufficient lamports 2491680, need 5616720
The function returns 1600800 but should be higher.
const metadataFee = await Metadata.getMinimumBalanceForRentExemption(
{
key: Key.MetadataV1,
updateAuthority: mintAuthority,
mint: form.mintAccount?.pubkey,
data: tokenMetadata,
primarySaleHappened: true,
isMutable: true,
tokenStandard: TokenStandard.Fungible,
uses: null,
collection: null,
editionNonce: 255,
},
connection.current
)
Please tell me if the args seem wrong.
Also I tried the Metadata.biteSize and it returned 102 but it's actually 679.
https://explorer.solana.com/address/R747jBxHo56wfb7FqVymdQWYpeny16Po6WwmXiiQ9g6?cluster=devnet
How to know the true rent fee? Please let me know if you know something about this.
Thank you always. Have a good day!