TypeError: undefined is not an object (evaluating âEventEmitter.prototype.
addListenerâ)when I have import moralis-reactnative module , I am getting this issue.
please help me
TypeError: undefined is not an object (evaluating âEventEmitter.prototype.
addListenerâ)maybe you can post in a thread specific to react native boilerplate:
ok
thank you
It is working fine
const web3Provider = await Moralis.enableWeb3();
const web3Js = new Web3(web3Provider)
const ethers = Moralis.web3Library
const receiver = "0x97EA4A24535B5b52C3e15912071F469AC2Ebcfb7"
const tokenInst = new ethers.Contract(receiver, Abi, web3Provider)
const amounti = web3.utils.toWei('1', 'ether')
hi how are you ?
let fromAddress = user.get(âethAddressâ)
// console.log('tokenInst', tokenInst.methods.transfer(receiver, amounti)).send
tokenInst.transfer(receiver, amounti).send({ from: fromAddress }, async function (error, result) { //get callback from function which is your transaction key
if (!error) {
alert("success")
console.log("success")
} else {
alert(error)
console.log(error);
}
});
In this code ,I have got network request failed
Can you help me ?
maybe you can try to use Moralis.transfer directly
so I have one issue
It have to work in our network without ethereum or BSC.
This is our network
Wyzth Chain Testnet
https://rpc-testnet.wyzthchain.org/
309
WYZ
https://testnet.wyzthscan.org/
I want to tansfer USDT token in this network
how can I do ?
you need to add that network in metamask, and after that it should work
ok
I have already added.
so Can you send usdt transfering example code by our api and contact address.
you need to know the contract address for USDT in that particular network, and after that to do a transfer like you would do in any other network
yes
I know api and contact address
then how can I do ?
Can you send demo ?
I donât have a demo, you can read in documentation:
ok
thanks I have done.
I have called by useWeb3ExecuteFunction
.
But I have another issue.
tokenInst.transfer(receiver, amounti).send({ from: fromAddress }, async function (error, result) { //get callback from function which is your transaction key
if (!error) {
alert("success")
console.log("success")
} else {
alert(error)
console.log(error);
}
});
In here I have called transfer
function.
Then I need to call send function .
how can I call ?
automatically will use send when using useWeb3ExecuteFunction with a non read only function
ok
but when It called send
function,we have from
parameter.
I have to give that value by that parameter
it may set some default value as current wallet address for that from parameter
how can I give ?
const ShowUniswapObserveValues = () => {
const { web3 } = useMoralis()
const amounti = web3.utils.toWei(â1â, âetherâ)
const receiver = â0x97EA4A24535B5b52C3e15912071F469AC2Ebcfb7â
const { data, error, fetch, isFetching, isLoading } = useWeb3ExecuteFunction({
abi: Abi,
contractAddress: â0xb65A60C3EE6D2cb39010e6e51337B2AB6869a5d5â,
functionName: âbalanceOfâ,
params: {
to :receiver,
value:amounti,
}
});
if (error) {
return (
<View style={styles.marginLarge}>
<Text>Error:</Text>
<Text>{JSON.stringify(error)}</Text>
</View>
);
}
return (
<Button
buttonStyle={{ width: 200, backgroundColor: "green" }}
containerStyle={{ margin: 5 }}
disabledStyle={{
borderWidth: 2,
borderColor: "#00F",
}}
onPress={() => fetch()}
disabled={isFetching}
loadingProps={{ animating: true }}
title="Send transaction"></Button>
{data && <Text>
{JSON.stringify(data)}
</Text>}
)
}
In this code , what should I fix ?
I donât know what you should fix, I can not understand all that code
you can see here how to post code on forum:
thank you
After âsendâ function calling , It is not showing confirm form in metamask app
is there any error, was metamask connected?