TrueFiEng / useDApp

Framework for rapid Dapp development. Simple. Robust. Extendable. Testable
https://usedapp.io
MIT License
1.58k stars 368 forks source link

Doubt with installation documentation - Binance - Testnet #442

Open damianlluch opened 2 years ago

damianlluch commented 2 years ago

Hi, in the documentation you have this example for the setup with Infura for Ethereum. I need the project to work with Binance, I am not clear what data would go here:

const config: Config = {
  readOnlyChainId: { Mainnet.chainID,
  readOnlyUrls: {
    [Mainnet.chainID]: 'https://mainnet.infura.io/v3/62687d1a985d4508b2b7a24827551934',
  },
}

The binance / testnet RPC?

thanks

damianlluch commented 2 years ago

I have followed the example in the documentation, adding a simple button to call the function to connect the wallet and I don't get any error, but I do get this warning

any suggestions?

isLocalChain is deprecated, can call with Chain directly

my code:

src/index.tsx


  readOnlyChainId: BSCTestnet.chainId,
  readOnlyUrls: {
    [BSCTestnet.chainId]: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
  },
}

ReactDOM.render(
  <React.StrictMode>
    <DAppProvider config={config}>
      <App />
    </DAppProvider>
  </React.StrictMode>,
  document.getElementById('root')
)`

my component:

const SelectWallet:React.FC<RadioType> = ({ selected, setSelected}) =>  {
  const { activateBrowserWallet, account } = useEthers()
return (
  <div>
    <button
            type="button"
            onClick={() => activateBrowserWallet()}
          >Connect
          </button>
    </div>
    )`
mcgingras commented 2 years ago

I have the same issue, although it does work when it is deployed, which is weird.