-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bitski extension support (#1029)
* feat(wallet): add support for the bitski wallet * chore: updated changeset * chore: added bitski to docs * fix: lint * fix: lint * fix: docs error --------- Co-authored-by: Daniel Sinclair <d@niel.nyc>
- Loading branch information
1 parent
3399df5
commit 8f01a12
Showing
6 changed files
with
77 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,27 @@ | ||
--- | ||
'@rainbow-me/rainbowkit': minor | ||
--- | ||
|
||
Bitski Support | ||
|
||
**Example usage** | ||
|
||
```ts | ||
import { | ||
getDefaultWallets, | ||
connectorsForWallets, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { bitskiWallet } from '@rainbow-me/rainbowkit/wallets'; | ||
const connectors = connectorsForWallets([ | ||
...wallets, | ||
{ | ||
groupName: 'Other', | ||
wallets: [ | ||
argentWallet({ chains }), | ||
trustWallet({ chains }), | ||
bitskiWallet({ chains }), | ||
ledgerWallet({ chains }), | ||
], | ||
}, | ||
]); | ||
``` |
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/bitskiWallet/bitskiWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
packages/rainbowkit/src/wallets/walletConnectors/bitskiWallet/bitskiWallet.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,34 @@ | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import { InjectedConnector } from 'wagmi/connectors/injected'; | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { Wallet } from '../../Wallet'; | ||
|
||
export interface BitskiWalletOptions { | ||
chains: Chain[]; | ||
shimDisconnect?: boolean; | ||
} | ||
|
||
export const bitskiWallet = ({ | ||
chains, | ||
shimDisconnect, | ||
}: BitskiWalletOptions): Wallet => ({ | ||
id: 'bitski', | ||
name: 'Bitski', | ||
installed: | ||
typeof window !== 'undefined' && | ||
typeof window.ethereum !== 'undefined' && | ||
((window.ethereum as any).isBitski === true || | ||
!!window.ethereum.providers?.find((p: any) => p.isBitski === true)), | ||
iconUrl: async () => (await import('./bitskiWallet.svg')).default, | ||
iconBackground: '#fff', | ||
downloadUrls: { | ||
browserExtension: | ||
'https://chrome.google.com/webstore/detail/bitski/feejiigddaafeojfddjjlmfkabimkell', | ||
}, | ||
createConnector: () => ({ | ||
connector: new InjectedConnector({ | ||
chains, | ||
options: { shimDisconnect }, | ||
}), | ||
}), | ||
}); |
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
8f01a12
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-rainbowdotme.vercel.app
rainbowkit-example.vercel.app
rainbowkit-example-git-main-rainbowdotme.vercel.app
8f01a12
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-site-rainbowdotme.vercel.app
rainbowkit.vercel.app
rainbowkit-site-git-main-rainbowdotme.vercel.app
rainbowkit.com
www.rainbowkit.com