0

So i'm using the opensea SDK and its fulfillOrder method, but its giving me the following error message: The method eth_sendTransaction does not exist/is not available

Yes, I'm using Infura and I know that is why this is happening, but how would I fix this? I know that I need to sign the transaction by myself, but how would I do that?

const nonce = await web3.eth.getTransactionCount(USER_ADDRESS, "latest");
const tx = {
  from: USER_ADDRESS,
  to: ???,
  nonce,
  gas: 500000
};

web3.eth.accounts.signTransaction(tx, PRIVATE_KEY).then((signedTx) => {
    web3.eth.sendSignedTransaction(signedTx.rawTransaction, (error, hash) => {
      ...
    }
});

Is this approach correct? Which address should I use on "to" key?

1 Answer 1

0

replace web3.providers to HDWalletProvider https://www.cnblogs.com/chris2021/p/15894496.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.