Skip to content

web3 onboard vue version can't get provider value #2220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
rodweb2103 opened this issue Jun 5, 2024 · 9 comments
Closed
1 task done

web3 onboard vue version can't get provider value #2220

rodweb2103 opened this issue Jun 5, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@rodweb2103
Copy link

Current Behavior

I got that error message when trying to send transaction using ethers Uncaught (in promise) TypeError: (intermediate value).providers is undefined

Expected Behavior

I need to get provider value

Steps To Reproduce

No response

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Runtime

Package Version

2.22.0

Node Version

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
@rodweb2103 rodweb2103 added the bug Something isn't working label Jun 5, 2024
@Adamj1232
Copy link
Contributor

Hi @rodweb2103 can you provide a reproducible example?

@rodweb2103
Copy link
Author

A screenshot ?

@Adamj1232
Copy link
Contributor

@rodweb2103 no, a Minimal Reproducible example - please see link within the description above

@rodweb2103
Copy link
Author

screenshot_wallet-onboard.mov

@Adamj1232
Copy link
Contributor

@rodweb2103 this video doesnt really help - I have no idea how you have the provider setup in your codebase and cannot help with out that.

@rodweb2103
Copy link
Author

const walletConnectSDK = walletConnectModule(wcInitOptions);
const coinbase = coinbaseWalletModule({ darkMode: true })

const onboard = init({
wallets: [walletConnectSDK,metamask,coinbase,injected],
appMetadata: {
name: "Payadox", // change to your dApp name
description: "Payadox",
recommendedInjectedWallets: [
{ name: 'MetaMask', url: 'https://metamask.io' },
{ name: 'Coinbase', url: 'https://wallet.coinbase.com/' }
]
},
chains: [
{
id: '0x1',
token: 'ETH',
label: 'Ethereum Mainnet',
rpcUrl: MAINNET_RPC_URL
},
{
id: '0x2105',
token: 'ETH',
label: 'Base',
rpcUrl: 'https://mainnet.base.org'
}
]
})

const { wallets, connectWallet, disconnectConnectedWallet, connectedWallet } = useOnboard()

const connect = async () => {
const wallets = await onboard.connectWallet()
console.log(wallets)
console.log(connectedWallet);

if (wallets[0]) {
	
  const rawObject = {...wallets[0].provider};
  
  //const { wallets } = useOnboard()

  console.log(wallets);
  // create an ethers provider with the last connected wallet provider
  const ethersProvider = new ethers.providers.Web3Provider(connectedWallet.provider, 'any')
  // if using ethers v6 this is:
  // ethersProvider = new ethers.BrowserProvider(wallet.provider, 'any')

  const signer = ethersProvider.getSigner()

  // send a transaction with the ethers provider
  const txn = await signer.sendTransaction({
	to: '0x',
	value: 100000000000000
  })

  const receipt = await txn.wait()
  console.log(receipt)
}

}

@Adamj1232
Copy link
Contributor

Looks like you may need to use the return from connect to create the provider. If you could create a small project using repl or codepen I could help you debug but I am not able to without a reproducible example

@rodweb2103
Copy link
Author

ok but i used that code based on your documentation

@rodweb2103
Copy link
Author

it seems that your library is working fine only with react and is not working properly with vue 2 or vue 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants