Skip to content

Commit 0b98497

Browse files
author
Alex
authored
feat: add Steakwallet to list of available wallets (rainbow-me#364)
1 parent cf1fc11 commit 0b98497

File tree

7 files changed

+103
-0
lines changed

7 files changed

+103
-0
lines changed

.changeset/hip-clocks-serve.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@rainbow-me/rainbowkit': patch
3+
---
4+
5+
Add Steakwallet to list of available wallets
6+
7+
Example usage:
8+
9+
```tsx
10+
import { wallet } from '@rainbow-me/rainbowkit';
11+
12+
const steakwallet = wallet.steak({ chains });
13+
```

packages/example/pages/_app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const connectors = connectorsForWallets([
4747
wallets: [
4848
wallet.argent({ chains }),
4949
wallet.trust({ chains }),
50+
wallet.steak({ chains }),
5051
wallet.imToken({ chains }),
5152
wallet.ledger({ chains }),
5253
],

packages/rainbowkit/src/wallets/walletConnectors/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { injected } from './injected/injected';
55
import { ledger } from './ledger/ledger';
66
import { metaMask } from './metaMask/metaMask';
77
import { rainbow } from './rainbow/rainbow';
8+
import { steak } from './steak/steak';
89
import { trust } from './trust/trust';
910
import { walletConnect } from './walletConnect/walletConnect';
1011

@@ -16,6 +17,7 @@ export const wallet = {
1617
ledger,
1718
metaMask,
1819
rainbow,
20+
steak,
1921
trust,
2022
walletConnect,
2123
};
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* eslint-disable sort-keys-fix/sort-keys-fix */
2+
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect';
3+
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext';
4+
import { isAndroid } from '../../../utils/isMobile';
5+
import { rpcUrlsForChains } from '../../../utils/rpcUrlsForChains';
6+
import { Wallet } from '../../Wallet';
7+
8+
export interface SteakOptions {
9+
chains: Chain[];
10+
}
11+
12+
export const steak = ({ chains }: SteakOptions): Wallet => ({
13+
id: 'steak',
14+
name: 'Steakwallet',
15+
iconUrl: async () => (await import('./steak.svg')).default,
16+
iconBackground: '#000',
17+
downloadUrls: {
18+
android: 'https://play.google.com/store/apps/details?id=fi.steakwallet.app',
19+
ios: 'https://apps.apple.com/np/app/steakwallet/id1569375204',
20+
qrCode: 'https://steakwallet.fi/download',
21+
},
22+
createConnector: () => {
23+
const rpc = rpcUrlsForChains(chains);
24+
const connector = new WalletConnectConnector({
25+
chains,
26+
options: {
27+
qrcode: false,
28+
rpc,
29+
},
30+
});
31+
return {
32+
connector,
33+
mobile: {
34+
getUri: async () => {
35+
const { uri } = (await connector.getProvider()).connector;
36+
return isAndroid()
37+
? uri
38+
: `https://links.steakwallet.fi/wc?uri=${encodeURIComponent(uri)}`;
39+
},
40+
},
41+
qrCode: {
42+
getUri: async () => (await connector.getProvider()).connector.uri,
43+
instructions: {
44+
learnMoreUrl:
45+
'https://blog.steakwallet.fi/introducing-the-steakwallet-beta/',
46+
steps: [
47+
{
48+
description:
49+
'Add Steakwallet to your home screen for faster access to your wallet.',
50+
step: 'install',
51+
title: 'Open the Steakwallet app',
52+
},
53+
{
54+
description: 'Create a new wallet or import an existing one.',
55+
step: 'create',
56+
title: 'Create or Import a Wallet',
57+
},
58+
{
59+
description:
60+
'Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect.',
61+
step: 'scan',
62+
title: 'Tap the QR icon and scan',
63+
},
64+
],
65+
},
66+
},
67+
};
68+
},
69+
});

site/components/Provider/Provider.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const connectors = connectorsForWallets([
2727
wallets: [
2828
wallet.argent({ chains }),
2929
wallet.trust({ chains }),
30+
wallet.steak({ chains }),
3031
wallet.imToken({ chains }),
3132
wallet.ledger({ chains }),
3233
],

site/data/docs/custom-wallet-list.mdx

+10
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ wallet.trust(options: {
165165
});
166166
```
167167

168+
#### Steakwallet
169+
170+
```tsx
171+
import { wallet } from '@rainbow-me/rainbowkit';
172+
173+
wallet.steak(options: {
174+
chains: Chain[];
175+
});
176+
```
177+
168178
#### imToken
169179

170180
```tsx

0 commit comments

Comments
 (0)