magic-js
magic-js copied to clipboard
Blockchain Erc20 transfer function is not returning response or error in React-Native
✅ Prerequisites
- [ ] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
- [x] Are you running the latest SDK version?
- [x] Are you reporting to the correct repository (
magic-sdk)?
🐛 Description
when i try to transfer token to other wallet, transfer function is not returning an error or response.
🧩 Steps to Reproduce
- include magic sdk, web3.
- add transfer function to code. (function is given in Code Sample).
- pass parameter (toaddress, amount, fromaddress).
- run function.
- check getting response or error or not
🤔 Expected behavior
I expect that the function should return error or response.
😮 Actual behavior
currently the function is not returning response or error.
💻 Code Sample
const transferAnyErc20 = async (userAddress, amount, toAddress) => {
try {
var Contract = new web3.eth.Contract(erc20Abi, TokenAddress);
const tx = await Contract.methods.transfer(toAddress, web3.utils.toWei(amount)).send({ from: userAddress });
return tx;
} catch (err) {
throw new Error(" :fish_cake: err from depositToken ", err);
}
};
as shown in above transfer function we pass every required value " toaddress, amount, fromaddress " but not getting response or error.
🌎 Environment
| Software | Version(s) |
|---|---|
magic-sdk |
"^8.2.0" |
web3 |
"^1.6.1" |
React Native |
"^0.66.0" |
| Browser | |
yarn |
|
| Operating System | ubuntu & android |