web3data-js
web3data-js copied to clipboard
Unable to increase timeout
Question
How can I increase the timeout to allow slow running HTTP requests to complete?
Problem
My call to
web3Data.address.getBalance(walletAddress, { includeTokens: true, includePrice: true, currency: "usd" });
times out often but I can't find a way to increase the time.
Already Tried
I tried setting the axios default timeout to 600000 (10 minutes) but the timeout remained around 30 seconds
axios.defaults.timeout = 600000;
web3Data.address.getBalance(walletAddress, { includeTokens: true, includePrice: true, currency: "usd" });
Suggestion
It looks like axios is being used but there's no way to include override the axios configuration. Is there a way to override the axios configuration? Maybe something like
const options = { axiosRequestConfig: { timeout: 600000 } };
const web3Data = new Web3Data(apiKey, options);