-
e### Discord user ID No response Describe your question in detail.Asked by one of our partners who wants to create a NFT collection and sponsor the mint tx. When we use
const transaction = await aptosClient().transaction.build.simple({
withFeePayer: true,
sender: account.address,
data: {
function: `${import.meta.env.VITE_MODULE_ADDRESS}::launchpad::mint_nft`,
functionArguments: [collection.collection_id, 1],
},
options: {
maxGasAmount: 10_000,
},
}); What error, if any, are you getting?No response What have you tried or looked at? Or how can we reproduce the error?No response Which operating system are you using?Windows Which SDK or tool are you using? (if any)TypeScript SDK Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, it might be easier if I try to answer the individual questions. Not sure if the answers will make sense as I have to guess what they mean with the less precise terms used.
This feels like a general gas question. Assuming by transaction value they mean gas budget, or more precisely, max_gas_amount, then correct, only the actual used amount will be deducted from the fee payer account.
Again, assuming that by appropriate transaction size they mean max_gas_amount, then I'd say they are probably better served by transaction simulation, which can return the estimated gas cost of the transaction, which is fairly accurate most of the time. Add some headroom to that you are all set.
Not familiar with sponsored transactions, but based on this comment ("Sponsoring a transaction requires that the sponsoring account have enough funds to cover the max possible gas fee.") it seems like the minimum should be maximum_number_of_gas_units (the global limit) multiplied by gas_unit_price.
Correct. That's the same as my answer to the second question |
Beta Was this translation helpful? Give feedback.
Okay, it might be easier if I try to answer the individual questions. Not sure if the answers will make sense as I have to guess what they mean with the less precise terms used.
This feels like a general gas question. Assuming by transaction value they mean gas budget, or more precisely, max_gas_amount, then correct, only the actual used amount will be deducted from the fee payer account.
Again, assuming that by app…