Skip to content

Commit

Permalink
feat: bitski extension support (#1029)
Browse files Browse the repository at this point in the history
* 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
pzuraq and DanielSinclair committed Mar 10, 2023
1 parent 3399df5 commit 8f01a12
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .changeset/tasty-timers-look.md
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 }),
],
},
]);
```
2 changes: 2 additions & 0 deletions packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@rainbow-me/rainbowkit-siwe-next-auth';
import {
argentWallet,
bitskiWallet,
imTokenWallet,
ledgerWallet,
mewWallet,
Expand Down Expand Up @@ -115,6 +116,7 @@ const connectors = connectorsForWallets([
mewWallet({ chains }),
omniWallet({ chains }),
trustWallet({ chains }),
bitskiWallet({ chains }),
],
},
]);
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,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 },
}),
}),
});
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 { bitskiWallet } from './bitskiWallet/bitskiWallet';
import { braveWallet } from './braveWallet/braveWallet';
import { coinbaseWallet } from './coinbaseWallet/coinbaseWallet';
import { imTokenWallet } from './imTokenWallet/imTokenWallet';
Expand All @@ -13,6 +14,7 @@ import { walletConnectWallet } from './walletConnectWallet/walletConnectWallet';

export {
argentWallet,
bitskiWallet,
braveWallet,
coinbaseWallet,
imTokenWallet,
Expand Down
11 changes: 11 additions & 0 deletions site/data/docs/custom-wallet-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ argentWallet(options: {
});
```

#### Bitski

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

bitskiWallet(options: {
chains: Chain[];
shimDisconnect?: boolean;
});
```

#### Brave Wallet

```tsx
Expand Down

2 comments on commit 8f01a12

@vercel
Copy link

@vercel vercel bot commented on 8f01a12 Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8f01a12 Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.