0

I'm getting this error when trying to execute a contract using temple wallet in my Dapp.

Failed to send request to https://hangzhounet.smartpy.io/chains/main/blocks/head/helpers/forge/operations. Invalid request provided or RPC node is temporarily unreachable. enter image description here

Tried changing the RPC nodes in the Temple wallet itself to https://hangzhounet.api.tez.ie/, no difference except the text change in the link in the error. Tried setting a new Tezos tool kit in the Dapp to a different RPC node, no difference either.

Using React and redux.

NPM versions:

"@taquito/beacon-wallet": "^11.0.2-beta",
"@taquito/signer": "^11.0.2-beta",
"@taquito/taquito": "^11.0.2-beta",
"@taquito/utils": "^11.0.2-beta",
"@temple-wallet/dapp": "^6.0.1",

This is the code for checking if the wallet is available:

useEffect(() => {
return TempleWallet.onAvailabilityChange((available) => {
  if (available) dispatch(setWallet(new TempleWallet(process.env.REACT_APP_NAME || 'MAVRYK')))
})
}, [dispatch])

This is where I connect to the wallet

try {
  if (!state.wallet) {
    dispatch(showToaster(ERROR, 'Temple Wallet not available', ''))
    throw new Error('Temple Wallet not available')
  } else {
    await state.wallet.wallet?.connect((process.env.REACT_APP_NETWORK || 'hangzhounet') as TempleDAppNetwork, {
      forcePermission,
    })
    const tzs = state.wallet.wallet?.toTezos()
    const accountPkh = await tzs?.wallet.pkh()

    dispatch({
      type: CONNECT,
      tezos: tzs,
      ready: Boolean(tzs),
      accountPkh: accountPkh,
    })
  }
} catch (err: any) {
  dispatch(showToaster(ERROR, 'Failed to connect TempleWallet', err.message))
  console.error(`Failed to connect TempleWallet: ${err.message}`)
}

And this is where I call the contract:

  const contract = await state.wallet.tezos?.wallet.at(delegationAddress.address)
  console.log('contract', contract)
  const transaction = await contract?.methods
    .registerAsSatellite(form.name, form.description, form.image, form.fee)
    .send()
  console.log('transaction', transaction)

Has Anyone encountered this problem / know how to address it? Thanks in advance!

1 Answer 1

0

https://rpc.hangzhounet.teztnets.xyz is working for me.

const rpc_url = 'https://rpc.hangzhounet.teztnets.xyz'; const Tezos = new TezosToolkit(rpc_url); const options = { name: 'TokenAppTest' }; const wallet = new BeaconWallet(options);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.