Skip to content
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

Property 'jsonRpcEndpoint' does not exist on type 'IntrinsicAttributes & SwapProps & WidgetProps'. #629

Open
code-bajju opened this issue May 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@code-bajju
Copy link

Bug Description
When user specify the token user get an error message
Type '{ jsonRpcEndpoint: string; tokenList: string; provider: Web3Provider | undefined; onConnectWallet: () => void; defaultInputTokenAddress: string; defaultInputAmount: string; defaultOutputTokenAddress: string; }' is not assignable to type 'IntrinsicAttributes & SwapProps & WidgetProps'. Property 'jsonRpcEndpoint' does not exist on type 'IntrinsicAttributes & SwapProps & WidgetProps'.

Screenshot 2024-05-05 at 10 49 15 AM
@code-bajju code-bajju added the bug Something isn't working label May 5, 2024
@zohaibadnan137
Copy link

You should be able to use the jsonRpcUrlMap property instead. Here's the example that Uniswap includes in their documentation:

import { SwapWidget } from '@uniswap/widgets'
import '@uniswap/widgets/fonts.css'

// We recommend you pass a web3 provider.
import { provider } from './your/provider'

// We recommend you pass your own JSON-RPC endpoints.
const jsonRpcUrlMap = {
  1: ['https://mainnet.infura.io/v3/<YOUR_INFURA_PROJECT_ID>'],
  3: ['https://ropsten.infura.io/v3/<YOUR_INFURA_PROJECT_ID>']
}

function App() {
  <div className="Uniswap">
    <SwapWidget provider={provider} jsonRpcUrlMap={jsonRpcUrlMap} />
  </div>
}

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

2 participants