|
| 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 | +}); |
0 commit comments