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

revert: update libbraties integration #13

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 19 additions & 32 deletions developers/rainbowkit-xdefi-integration.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# RainbowKit XDEFI Integration

### Built-in XDEFI Wallet

You can import individual wallets from `'@rainbow-me/rainbowkit/wallets'` along with the `connectorsForWallets` function to build your own list of wallets with their necessary connectors. This way you have full control over which wallets to display, and in which order.

For example, you can choose to only show Rainbow along with generic fallback wallets.

```javascript
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import {
rainbowWallet,
walletConnectWallet,
xdefiWallet,
// other wallets
} from "@rainbow-me/rainbowkit/wallets";

const connectors = connectorsForWallets(
[
{
groupName: "Recommended",
wallets: [rainbowWallet, walletConnectWallet],
wallets: [xdefiWallet],
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

@zdeadex

},
],
{
Expand Down Expand Up @@ -51,70 +53,55 @@ const App = () => (
);
```

### Built-in XDEFI Wallets

First, you need to install the `@rainbow-me/rainbowkit/wallets` package and then import the dApp:

```javascript
import { xdefiWallet } from "@rainbow-me/rainbowkit/wallets";
```

### Examples

Here are examples: Show Rainbow, MetaMask, Coinbase and XDEFI along with generic fallback wallets.
Here are examples: Show XDEFI Wallet along with generic fallback wallets.

```javascript
import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import {
rainbowWallet,
xdefiWallet
metaMaskWallet,
coinbaseWallet,
walletConnectWallet,
} from '@rainbow-me/rainbowkit/wallets';
xdefiWallet,
// other wallets
} from "@rainbow-me/rainbowkit/wallets";

const connectors = connectorsForWallets(
[
{
groupName: 'Suggested',
groupName: "Suggested",
wallets: [
rainbowWallet,
xdefiWallet,
metaMaskWallet,
coinbaseWallet,
walletConnectWallet,
// other wallets
],
},
],
{ appName: 'RainbowKit App', projectId: 'YOUR_PROJECT_ID' },
{ appName: "RainbowKit App", projectId: "YOUR_PROJECT_ID" },
);
```

> Reminder: The order of the wallets array defines the order in which wallets will be displayed in the UI.

You also can use the `groupName` key to name different wallet groups. This is useful if you want to communicate to your users which wallets you recommend, as well as other possible wallets.

Recommend Rainbow and MetaMask, but also offer Coinbase along with generic fallback wallets.
Recommend XDEFI Wallet along with other wallets in a separate group

```javascript
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import {
rainbowWallet,
xdefiWallet,
metaMaskWallet,
coinbaseWallet,
walletConnectWallet,
// other wallets
} from "@rainbow-me/rainbowkit/wallets";

const connectors = connectorsForWallets(
[
{
groupName: "Recommended",
wallets: [rainbowWallet, metaMaskWallet],
wallets: [xdefiWallet],
},
{
groupName: "Others",
wallets: [xdefiWallet, coinbaseWallet, walletConnectWallet],
wallets: [
// other wallets
],
},
],
{ appName: "RainbowKit App", projectId: "YOUR_PROJECT_ID" },
Expand Down
Loading
Loading