I'm using HDWalletProvider with Infura API, and when I use HTTP API like
const web3 = new Web3(new HDWalletProvider(P_KEY, `https://${NETWORK}.infura.io/v3/${INFURA_API_KEY}`));
const contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);
contract.methods.transfer(ETH_ADDRESS, 12345).send(defaultOption)
.on('receipt', (res) => { ... });
This sends the transaction correctly, but crashes after with
Error: Subscriptions are not supported with the CustomProvider.
I saw "The HTTP provider is deprecated" on the web3 document, so I changed the Infura endpoint using Websocket:
const web3 = new Web3(new HDWalletProvider(P_KEY, `wss://${NETWORK}.infura.io/ws/v3/${INFURA_API_KEY}`));
This doesn't send the transaction at all and just hangs forever (no error, nothing happens).
Calling
contract.methods.transfer(ETH_ADDRESS, 12345).send(defaultOption).on('receipt', (res) => { ... });
should sent the transaction and receipt event should be triggered.
It doesn't send the transaction and receipt event doesn't get triggered.
Thanks for opening this issue! I will fix and release it asap.
what's the fix for this ? I have the same issue
@nivida any plan to release this fix with beta.49 soon?
@sydneyitguy Yes, after I've improved the transaction confirmation workflow for having better confirmations. I think this will happen this weekend or at the beginning of next week.
@sydneyitguy Yes, after I've improved the transaction confirmation workflow for having better confirmations. I think this will happen this weekend or at the beginning of next week.
but this issue must be put on Open
I have the similar problem that I can send the transaction and verify it in remix but it hangs when receiving the receipt.
Most helpful comment
Thanks for opening this issue! I will fix and release it asap.