-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Safe (Gnosis) connector. * fix: amended default wallet list order * fix: linting issues * fix: renamed safe icon * fix: removed gnosis from name * fix: added Safe App manifest * fix: added manifest iconPath and favicon * fix: updated safeWallet logo * chore: added changeset * fix: cleaned up safe connector options and installed logic * fix: removed shimDisconnect in favor of options passthrough --------- Co-authored-by: Stas SUȘCOV <stas@nerd.ro>
- Loading branch information
1 parent
021c4e0
commit 9b93f56
Showing
9 changed files
with
55 additions
and
0 deletions.
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 `safeWallet` connector to support Safe Apps. dApps that rely on `getDefaultWallets` will adopt this behavior automatically. dApps that rely on the Custom Wallet List should add `safeWallet` alongside `injectedWallet`. |
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
Binary file not shown.
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 @@ | ||
{ | ||
"name": "RainbowKit Example", | ||
"description": "Test dApp deployment of RainbowKit", | ||
"iconPath": "rainbow.svg" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
6 changes: 6 additions & 0 deletions
6
packages/rainbowkit/src/wallets/walletConnectors/safeWallet/safeWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions
33
packages/rainbowkit/src/wallets/walletConnectors/safeWallet/safeWallet.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,33 @@ | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import type { SafeConnectorOptions } from 'wagmi/connectors/safe'; | ||
import { SafeConnector } from 'wagmi/connectors/safe'; | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { Wallet } from '../../Wallet'; | ||
|
||
export interface SafeWalletOptions { | ||
chains: Chain[]; | ||
} | ||
|
||
export const safeWallet = ({ | ||
chains, | ||
...options | ||
}: SafeWalletOptions & SafeConnectorOptions): Wallet => ({ | ||
id: 'safe', | ||
name: 'Safe', | ||
iconAccent: '#12ff80', | ||
iconBackground: '#fff', | ||
iconUrl: async () => (await import('./safeWallet.svg')).default, | ||
installed: | ||
// Only allowed in iframe context | ||
// borrowed from wagmi safe connector | ||
!(typeof window === 'undefined') && window?.parent !== window, | ||
downloadUrls: { | ||
// We're opting not to provide a download prompt if Safe isn't the current | ||
// browser since it's unlikely to be a desired behavior for users. It's | ||
// more of a convenience for users who are already using Brave rather than | ||
// an explicit wallet choice for users coming from other browsers. | ||
}, | ||
createConnector: () => ({ | ||
connector: new SafeConnector({ chains, options }), | ||
}), | ||
}); |
9b93f56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-site – ./
rainbowkit.vercel.app
rainbowkit.com
www.rainbowkit.com
rainbowkit-site-git-main-rainbowdotme.vercel.app
rainbowkit-site-rainbowdotme.vercel.app
9b93f56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-example – ./
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example-rainbowdotme.vercel.app
rainbowkit-example.vercel.app