docs: [widgets] update to include built-in wallet connection flow#407
Merged
kristiehuang merged 22 commits intoUniswap:mainfrom Aug 9, 2022
Merged
Conversation
…ality / web3 in a box. WIP
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
akarys92
reviewed
Jun 28, 2022
JFrankfurt
reviewed
Jun 28, 2022
JFrankfurt
reviewed
Jun 28, 2022
JFrankfurt
reviewed
Jun 28, 2022
JFrankfurt
reviewed
Jun 29, 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. | |
Contributor
There was a problem hiding this comment.
removing this prop is a breaking change--should make sure to bump the major version when we release
3 tasks
JFrankfurt
approved these changes
Aug 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
onConnectWalletprop changed toonClickConnectWalletjsonRpcEndpointprop changed tojsonRpcUrlMapOther changes:
defaultChainIdoptional prophideConnectionUIoptional prop