-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: lint * chore: changeset * feat: berasigWallet support feat: berasigWallet support fix: format revert locale files feat: support BerasigWallet fix: example dapp support chore: docs --------- Co-authored-by: thiennv-qng <[email protected]>
- Loading branch information
1 parent
f1ab60e
commit 9dd23d9
Showing
8 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rainbow-me/rainbowkit": patch | ||
--- | ||
|
||
Added BeraSig support with `berasigWallet` wallet connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/rainbowkit/src/wallets/walletConnectors/berasigWallet/berasigWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions
67
packages/rainbowkit/src/wallets/walletConnectors/berasigWallet/berasigWallet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters