Skip to content

Commit

Permalink
feat: binanceWallet (#2072)
Browse files Browse the repository at this point in the history
  • Loading branch information
magiziz authored Jul 2, 2024
1 parent b530c80 commit 72fe07d
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/loud-lobsters-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rainbow-me/rainbowkit": patch
"site": patch
---

Added Binance Web3 Wallet support with `binanceWallet` wallet connector
2 changes: 2 additions & 0 deletions packages/example/src/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type Chain, getDefaultConfig } from '@rainbow-me/rainbowkit';
import {
argentWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
bitskiWallet,
bitverseWallet,
Expand Down Expand Up @@ -179,6 +180,7 @@ export const config = getDefaultConfig({
bitverseWallet,
bloomWallet,
bybitWallet,
binanceWallet,
clvWallet,
compassWallet,
coin98Wallet,
Expand Down
17 changes: 17 additions & 0 deletions packages/rainbowkit/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,23 @@
}
},

"binance": {
"qr_code": {
"step1": {
"description": "We recommend putting Binance on your home screen for faster access to your wallet.",
"title": "Open the Binance app"
},
"step2": {
"description": "You can easily backup your wallet using our backup feature on your phone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"title": "Tap the WalletConnect button"
}
}
},

"coin98": {
"qr_code": {
"step1": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { isAndroid } from '../../../utils/isMobile';
import { DefaultWalletOptions, Wallet } from '../../Wallet';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type BinanceWalletOptions = DefaultWalletOptions;

export const binanceWallet = ({
projectId,
walletConnectParameters,
}: BinanceWalletOptions): Wallet => ({
id: 'binance',
name: 'Binance Wallet',
iconUrl: async () => (await import('./binanceWallet.svg')).default,
iconBackground: '#000000',
downloadUrls: {
android: 'https://play.google.com/store/apps/details?id=com.binance.dev',
ios: 'https://apps.apple.com/us/app/id1436799971',
mobile: 'https://www.binance.com/en/download',
qrCode: 'https://www.binance.com/en/web3wallet',
},
mobile: {
getUri: (uri: string) => {
return isAndroid()
? uri
: `bnc://app.binance.com/cedefi/wc?uri=${encodeURIComponent(uri)}`;
},
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://www.binance.com/en/web3wallet',
steps: [
{
description: 'wallet_connectors.binance.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.binance.qr_code.step1.title',
},
{
description: 'wallet_connectors.binance.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.binance.qr_code.step2.title',
},
{
description: 'wallet_connectors.binance.qr_code.step3.description',
step: 'scan',
title: 'wallet_connectors.binance.qr_code.step3.title',
},
],
},
},
createConnector: getWalletConnectConnector({
projectId,
walletConnectParameters,
}),
});
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { argentWallet } from './argentWallet/argentWallet';
import { bifrostWallet } from './bifrostWallet/bifrostWallet';
import { binanceWallet } from './binanceWallet/binanceWallet';
import { bitgetWallet } from './bitgetWallet/bitgetWallet';
import { bitskiWallet } from './bitskiWallet/bitskiWallet';
import { bitverseWallet } from './bitverseWallet/bitverseWallet';
Expand Down Expand Up @@ -63,6 +64,7 @@ export {
bloomWallet,
bybitWallet,
braveWallet,
binanceWallet,
clvWallet,
coin98Wallet,
coinbaseWallet,
Expand Down
6 changes: 6 additions & 0 deletions site/data/en-US/docs/custom-wallet-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ import { bybitWallet } from '@rainbow-me/rainbowkit/wallets';
import { braveWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Binance Web3 Wallet

```tsx
import { binanceWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Coinbase

This wallet connector supports both the Coinbase Wallet app and extension, as well as Coinbase Smart Wallet on Web.
Expand Down

0 comments on commit 72fe07d

Please sign in to comment.