Skip to content

Commit

Permalink
fix: update rainbow kit
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangVD2 committed Mar 13, 2024
1 parent 6419dc0 commit 53aae36
Showing 1 changed file with 19 additions and 32 deletions.
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],
},
],
{
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

0 comments on commit 53aae36

Please sign in to comment.