Skip to content

Commit

Permalink
feat: berasigWallet support
Browse files Browse the repository at this point in the history
feat: berasigWallet support

fix: format

revert locale files

feat: support BerasigWallet

fix: example dapp support

chore: docs
  • Loading branch information
thiennv-qng authored and DanielSinclair committed Dec 2, 2024
1 parent fe0c91c commit 192ad25
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/example/src/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Chain, getDefaultConfig } from '@rainbow-me/rainbowkit';
import {
argentWallet,
berasigWallet,
bestWallet,
bifrostWallet,
binanceWallet,
Expand Down Expand Up @@ -187,6 +188,7 @@ export const config = getDefaultConfig({
groupName: 'Other',
wallets: [
argentWallet,
berasigWallet,
bestWallet,
bifrostWallet,
binanceWallet,
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 @@ -243,6 +243,23 @@
}
},

"berasig": {
"extension": {
"step1": {
"title": "Install the BeraSig extension",
"description": "We recommend pinning BeraSig to your taskbar for easier access to your wallet."
},
"step2": {
"title": "Create a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},

"best": {
"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,67 @@
import type { DefaultWalletOptions, Wallet } from '../../Wallet';
import {
getInjectedConnector,
hasInjectedProvider,
} from '../../getInjectedConnector';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type BerasigWalletOptions = DefaultWalletOptions;

export const berasigWallet = ({
projectId,
walletConnectParameters,
}: BerasigWalletOptions): Wallet => {
const isBerasigWalletInjected = hasInjectedProvider({
namespace: 'berasig.ethereum',
});

const shouldUseWalletConnect = !isBerasigWalletInjected;
return {
id: 'berasig',
name: 'BeraSig',
iconUrl: async () => (await import('./berasigWallet.svg')).default,
iconBackground: '#ffffff',
installed: isBerasigWalletInjected,
downloadUrls: {
android: 'https://play.google.com/store/apps/details?id=io.berasig.ios',
ios: 'https://apps.apple.com/us/app/berasig-wallet-on-berachain/id6502052535',
qrCode: 'https://berasig.com',
mobile: 'https://berasig.com',
browserExtension:
'https://chromewebstore.google.com/detail/berasig/ckedkkegjbflcfblcjklibnedmfjppbj',
},
extension: {
instructions: {
steps: [
{
description:
'wallet_connectors.berasig.extension.step1.description',
step: 'install',
title: 'wallet_connectors.berasig.extension.step1.title',
},
{
description:
'wallet_connectors.berasig.extension.step2.description',
step: 'create',
title: 'wallet_connectors.berasig.extension.step2.title',
},
{
description:
'wallet_connectors.berasig.extension.step3.description',
step: 'refresh',
title: 'wallet_connectors.berasig.extension.step3.title',
},
],
learnMoreUrl: 'https://berasig.com',
},
},
createConnector: shouldUseWalletConnect
? getWalletConnectConnector({
projectId,
walletConnectParameters,
})
: getInjectedConnector({
namespace: 'berasig.ethereum',
}),
};
};
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { argentWallet } from './argentWallet/argentWallet';
import { berasigWallet } from './berasigWallet/berasigWallet';
import { bestWallet } from './bestWallet/bestWallet';
import { bifrostWallet } from './bifrostWallet/bifrostWallet';
import { binanceWallet } from './binanceWallet/binanceWallet';
Expand Down Expand Up @@ -63,6 +64,7 @@ import { zerionWallet } from './zerionWallet/zerionWallet';

export {
argentWallet,
berasigWallet,
bestWallet,
bifrostWallet,
binanceWallet,
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 @@ -110,6 +110,12 @@ import { oneInchWallet } from '@rainbow-me/rainbowkit/wallets';
import { argentWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### BeraSig

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

#### Best Wallet

```tsx
Expand Down

0 comments on commit 192ad25

Please sign in to comment.