Skip to content

docs: [widgets] update to include built-in wallet connection flow#407

Merged
kristiehuang merged 22 commits intoUniswap:mainfrom
kristiehuang:kh-widgets/connect-wallet-flow-docs
Aug 9, 2022
Merged

docs: [widgets] update to include built-in wallet connection flow#407
kristiehuang merged 22 commits intoUniswap:mainfrom
kristiehuang:kh-widgets/connect-wallet-flow-docs

Conversation

@kristiehuang
Copy link
Contributor

@kristiehuang kristiehuang commented Jun 8, 2022

New incoming changes to widgets allows integrators to integrate widget in one line of code: <SwapWidget />, no provider or jsonRpcEndpoint required. Updating docs to reflect these changes.

Breaking changes:

  • onConnectWallet prop changed to onClickConnectWallet
  • jsonRpcEndpoint prop changed to jsonRpcUrlMap
    Other changes:
  • new defaultChainId optional prop
  • new hideConnectionUI optional prop

@vercel
Copy link

vercel bot commented Jun 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
docs ✅ Ready (Inspect) Visit Preview Aug 9, 2022 at 10:05PM (UTC)

@kristiehuang kristiehuang changed the title WIP // docs: update widgets doc to describe built-in web3-in-a-box wallet connection functionality docs: [widgets] one-liner wallet connection flow Jun 28, 2022
@kristiehuang kristiehuang marked this pull request as ready for review June 28, 2022 17:46
@kristiehuang kristiehuang changed the title docs: [widgets] one-liner wallet connection flow docs: [widgets] update to include built-in wallet connection flow Jun 28, 2022
| `defaultOutputTokenAddress` | `{[chainId: number]: string}` | `string` or `undefined` | Address of the token to be selected by default in the input field (e.g. USDC) for each network chain ID. None if left empty. Any addresses provided in this parameter must be included in the `tokenList`. |
| `defaultOutputTokenAmount` | `number` | `0` | Default amount for the input field (e.g. 100 USDC). This value will respect the decimals of the `defaultOutputTokenAddress`. This parameter is mutually exclusive with `defaultInputTokenAmount`, so you may set only one `of defaultInputTokenAmount and` `defaultOutputTokenAmount`. |
| `locale` | `SupportedLocale` | `en-US` | Specifies an explicit locale to use for the widget interface. This can be set to one of the values exported by the library in [`SUPPORTED_LOCALES`](https://github.com/Uniswap/widgets/blob/main/src/constants/locales.ts). |
| `onConnectWallet` | `() => void` | `undefined` | If passed, the Connect your wallet message will be clickable, and clicking it will trigger this handler function. This can be used to trigger your own wallet connection flow from the widget. |
Copy link
Contributor

@JFrankfurt JFrankfurt Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this prop is a breaking change--should make sure to bump the major version when we release

@kristiehuang kristiehuang merged commit feac8e6 into Uniswap:main Aug 9, 2022
@kristiehuang kristiehuang deleted the kh-widgets/connect-wallet-flow-docs branch August 9, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants