I keep on getting error when trying to interact with a smart contract index.ts:140 WebSocket connection to 'wss://s.bridge.walletconnect.org/?env=browser&host=localhost%3A3000&protocol=wc&version=1' failed:
I am not entirely sure but is that an RPC url from walletconnect?
No, the is error on my app.
I only get it when I try communicating with my smart contract.
Also when running a transaction in web3, the βfromβ attribute is provided so I want to know if moralis automatically handled that for any transaction once a user is authenticated
Moralis will not autocomplete that from address for normal web3 transactions from what I know, only for web3api functions that start with Moralis.Web3API.account
maybe it is provided by walletconnect
import { useMoralis, useWeb3ExecuteFunction } from "react-moralis";
const { isAuthenticated, isWeb3Enabled, enableWeb3, Moralis } = useMoralis();
const contractProcessor = useWeb3ExecuteFunction();
let lockDelayInSec,
voteDelayInSec,
votePeriodInSec,
voteThresholdInSec,
proposalThresholdInSec,
mainTransactionValue;
const {
image,
lockDelay,
voteDelay,
votePeriod,
voteThreshold,
proposalThreshold,
name,
transactionValue,
} = props.values;
lockDelayInSec = Number(lockDelay) * 24 * 60 * 60;
voteDelayInSec = Number(voteDelay) * 24 * 60 * 60;
votePeriodInSec = Number(votePeriod) * 24 * 60 * 60;
voteThresholdInSec = Number(voteThreshold) * 24 * 60 * 60;
proposalThresholdInSec = Number(lockDelay) * 24 * 60 * 60;
mainTransactionValue = transactionValue ? transactionValue : 0;
async function createGovernance() {
let options = {
contractAddress: "0xbf7fccda9a43c5e2a24db53f22056d387895d5f4",
functionName: "createGovernor",
abi: [
{
inputs: [
{
internalType: "string",
name: "_governorName",
type: "string",
},
{
internalType: "uint256",
name: "_timelockDelay",
type: "uint256",
},
{
internalType: "uint256",
name: "_votingDelay",
type: "uint256",
},
{
internalType: "uint256",
name: "_votingPeriod",
type: "uint256",
},
{
internalType: "uint256",
name: "_proposalThreshold",
type: "uint256",
},
{
internalType: "uint256",
name: "_votingThreshold",
type: "uint256",
},
],
name: "createGovernor",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "payable",
type: "function",
},
],
params: {
_governorName: name,
_timelockDelay: lockDelayInSec,
_votingDelay: voteDelayInSec,
_votingPeriod: votePeriodInSec,
_proposalThreshold: proposalThresholdInSec,
_votingThreshold: voteThresholdInSec,
},
msgValue: Moralis.Units.ETH(0.1),
};
await contractProcessor.fetch({
params: options,
onSuccess: () => {
setLoading(false);
console.log("success");
},
onError: (err) => {
setLoading(false);
console.log(err);
},
});
}
useEffect(() => {
if (!isWeb3Enabled && isAuthenticated) {
enableWeb3({ provider: "walletconnect" });
//console.log("web3 activated");
}
}, [isWeb3Enabled, isAuthenticated, enableWeb3]);
please help me check this, I get no response