Transaction Underprice
Back to All

Transaction Underprice

I want to use the safeMint method through sendTransaction, but I get a error "Transaction Underpriced" and I check the doc and find that the transaction carries not enough. However, I did not find a way to set the gas it carries. Here's my code below:

const safeMintEncoded = contractInterface.encodeFunctionData("safeMint", [config.publicKey, "ipfs://QmbUiW4nYKPzdXQB6nrpcAw4Ya7b1JmVQMekBcfCQAbRQF"])  
const signedTransact = await wallet.signTransaction({
    from: config.publicKey,
    to: config.contractAddress,
    gasLimit: 21000000,
    data: safeMintEncoded,
    value: 0,
    nonce: await wallet.getTransactionCount()
const sentTX = await (await web3.transact.sendTransaction(signedTransact)).wait();

So I wander how to solve the error "Transaction Underpriced". Thank you!