Skip to content

Commit

Permalink
feat: support BerasigWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
thiennv-qng committed Nov 8, 2024
1 parent d3f07a1 commit 5fece2f
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 70 deletions.
4 changes: 3 additions & 1 deletion packages/rainbowkit/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},

"best": {
Expand All @@ -273,7 +274,8 @@
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
},
}
},
"bifrost": {
"qr_code": {
"step1": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
import type { Wallet } from '../../Wallet';
import type { DefaultWalletOptions, Wallet } from '../../Wallet';
import {
getInjectedConnector,
hasInjectedProvider,
} from '../../getInjectedConnector';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export const berasigWallet = (): Wallet => {
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: hasInjectedProvider({ namespace: 'berasig.ethereum' }),
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',
Expand Down Expand Up @@ -43,8 +55,13 @@ export const berasigWallet = (): Wallet => {
learnMoreUrl: 'https://berasig.com',
},
},
createConnector: getInjectedConnector({
namespace: 'berasig.ethereum',
}),
createConnector: shouldUseWalletConnect
? getWalletConnectConnector({
projectId,
walletConnectParameters,
})
: getInjectedConnector({
namespace: 'berasig.ethereum',
}),
};
};
126 changes: 63 additions & 63 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
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";
import { bitgetWallet } from "./bitgetWallet/bitgetWallet";
import { bitskiWallet } from "./bitskiWallet/bitskiWallet";
import { bitverseWallet } from "./bitverseWallet/bitverseWallet";
import { bloomWallet } from "./bloomWallet/bloomWallet";
import { braveWallet } from "./braveWallet/braveWallet";
import { bybitWallet } from "./bybitWallet/bybitWallet";
import { clvWallet } from "./clvWallet/clvWallet";
import { coin98Wallet } from "./coin98Wallet/coin98Wallet";
import { coinbaseWallet } from "./coinbaseWallet/coinbaseWallet";
import { compassWallet } from "./compassWallet/compassWallet";
import { coreWallet } from "./coreWallet/coreWallet";
import { dawnWallet } from "./dawnWallet/dawnWallet";
import { desigWallet } from "./desigWallet/desigWallet";
import { enkryptWallet } from "./enkryptWallet/enkryptWallet";
import { foxWallet } from "./foxWallet/foxWallet";
import { frameWallet } from "./frameWallet/frameWallet";
import { frontierWallet } from "./frontierWallet/frontierWallet";
import { gateWallet } from "./gateWallet/gateWallet";
import { imTokenWallet } from "./imTokenWallet/imTokenWallet";
import { injectedWallet } from "./injectedWallet/injectedWallet";
import { iopayWallet } from "./iopayWallet/iopayWallet";
import { kaiaWallet } from "./kaiaWallet/kaiaWallet";
import { kaikasWallet } from "./kaikasWallet/kaikasWallet";
import { krakenWallet } from "./krakenWallet/krakenWallet";
import { kresusWallet } from "./kresusWallet/kresusWallet";
import { ledgerWallet } from "./ledgerWallet/ledgerWallet";
import { magicEdenWallet } from "./magicEdenWallet/magicEdenWallet";
import { metaMaskWallet } from "./metaMaskWallet/metaMaskWallet";
import { mewWallet } from "./mewWallet/mewWallet";
import { nestWallet } from "./nestWallet/nestWallet";
import { oktoWallet } from "./oktoWallet/oktoWallet";
import { okxWallet } from "./okxWallet/okxWallet";
import { omniWallet } from "./omniWallet/omniWallet";
import { oneInchWallet } from "./oneInchWallet/oneInchWallet";
import { oneKeyWallet } from "./oneKeyWallet/oneKeyWallet";
import { paraSwapWallet } from "./paraSwapWallet/paraswapWallet";
import { phantomWallet } from "./phantomWallet/phantomWallet";
import { rabbyWallet } from "./rabbyWallet/rabbyWallet";
import { rainbowWallet } from "./rainbowWallet/rainbowWallet";
import { ramperWallet } from "./ramperWallet/ramperWallet";
import { roninWallet } from "./roninWallet/roninWallet";
import { safeWallet } from "./safeWallet/safeWallet";
import { safeheronWallet } from "./safeheronWallet/safeheronWallet";
import { safepalWallet } from "./safepalWallet/safepalWallet";
import { seifWallet } from "./seifWallet/seifWallet";
import { subWallet } from "./subWallet/subWallet";
import { tahoWallet } from "./tahoWallet/tahoWallet";
import { talismanWallet } from "./talismanWallet/talismanWallet";
import { tokenPocketWallet } from "./tokenPocketWallet/tokenPocketWallet";
import { tokenaryWallet } from "./tokenaryWallet/tokenaryWallet";
import { trustWallet } from "./trustWallet/trustWallet";
import { uniswapWallet } from "./uniswapWallet/uniswapWallet";
import { valoraWallet } from "./valoraWallet/valoraWallet";
import { walletConnectWallet } from "./walletConnectWallet/walletConnectWallet";
import { wigwamWallet } from "./wigwamWallet/wigwamWallet";
import { xdefiWallet } from "./xdefiWallet/xdefiWallet";
import { zealWallet } from "./zealWallet/zealWallet";
import { zerionWallet } from "./zerionWallet/zerionWallet";
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';
import { bitgetWallet } from './bitgetWallet/bitgetWallet';
import { bitskiWallet } from './bitskiWallet/bitskiWallet';
import { bitverseWallet } from './bitverseWallet/bitverseWallet';
import { bloomWallet } from './bloomWallet/bloomWallet';
import { braveWallet } from './braveWallet/braveWallet';
import { bybitWallet } from './bybitWallet/bybitWallet';
import { clvWallet } from './clvWallet/clvWallet';
import { coin98Wallet } from './coin98Wallet/coin98Wallet';
import { coinbaseWallet } from './coinbaseWallet/coinbaseWallet';
import { compassWallet } from './compassWallet/compassWallet';
import { coreWallet } from './coreWallet/coreWallet';
import { dawnWallet } from './dawnWallet/dawnWallet';
import { desigWallet } from './desigWallet/desigWallet';
import { enkryptWallet } from './enkryptWallet/enkryptWallet';
import { foxWallet } from './foxWallet/foxWallet';
import { frameWallet } from './frameWallet/frameWallet';
import { frontierWallet } from './frontierWallet/frontierWallet';
import { gateWallet } from './gateWallet/gateWallet';
import { imTokenWallet } from './imTokenWallet/imTokenWallet';
import { injectedWallet } from './injectedWallet/injectedWallet';
import { iopayWallet } from './iopayWallet/iopayWallet';
import { kaiaWallet } from './kaiaWallet/kaiaWallet';
import { kaikasWallet } from './kaikasWallet/kaikasWallet';
import { krakenWallet } from './krakenWallet/krakenWallet';
import { kresusWallet } from './kresusWallet/kresusWallet';
import { ledgerWallet } from './ledgerWallet/ledgerWallet';
import { magicEdenWallet } from './magicEdenWallet/magicEdenWallet';
import { metaMaskWallet } from './metaMaskWallet/metaMaskWallet';
import { mewWallet } from './mewWallet/mewWallet';
import { nestWallet } from './nestWallet/nestWallet';
import { oktoWallet } from './oktoWallet/oktoWallet';
import { okxWallet } from './okxWallet/okxWallet';
import { omniWallet } from './omniWallet/omniWallet';
import { oneInchWallet } from './oneInchWallet/oneInchWallet';
import { oneKeyWallet } from './oneKeyWallet/oneKeyWallet';
import { paraSwapWallet } from './paraSwapWallet/paraswapWallet';
import { phantomWallet } from './phantomWallet/phantomWallet';
import { rabbyWallet } from './rabbyWallet/rabbyWallet';
import { rainbowWallet } from './rainbowWallet/rainbowWallet';
import { ramperWallet } from './ramperWallet/ramperWallet';
import { roninWallet } from './roninWallet/roninWallet';
import { safeWallet } from './safeWallet/safeWallet';
import { safeheronWallet } from './safeheronWallet/safeheronWallet';
import { safepalWallet } from './safepalWallet/safepalWallet';
import { seifWallet } from './seifWallet/seifWallet';
import { subWallet } from './subWallet/subWallet';
import { tahoWallet } from './tahoWallet/tahoWallet';
import { talismanWallet } from './talismanWallet/talismanWallet';
import { tokenPocketWallet } from './tokenPocketWallet/tokenPocketWallet';
import { tokenaryWallet } from './tokenaryWallet/tokenaryWallet';
import { trustWallet } from './trustWallet/trustWallet';
import { uniswapWallet } from './uniswapWallet/uniswapWallet';
import { valoraWallet } from './valoraWallet/valoraWallet';
import { walletConnectWallet } from './walletConnectWallet/walletConnectWallet';
import { wigwamWallet } from './wigwamWallet/wigwamWallet';
import { xdefiWallet } from './xdefiWallet/xdefiWallet';
import { zealWallet } from './zealWallet/zealWallet';
import { zerionWallet } from './zerionWallet/zerionWallet';

export {
argentWallet,
Expand Down

0 comments on commit 5fece2f

Please sign in to comment.