Skip to content

Commit 4487744

Browse files
committed
Add status wallet
1 parent 821d337 commit 4487744

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

src/modules/select/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const defaultWalletNames = [
88
'trust',
99
'authereum',
1010
'opera',
11-
'operaTouch'
11+
'operaTouch',
12+
'status'
1213
]
1314

1415
function select(
@@ -67,6 +68,8 @@ function getModule(name: string): Promise<any> | undefined {
6768
return import('./wallets/opera')
6869
case 'operaTouch':
6970
return import('./wallets/opera-touch')
71+
case 'status':
72+
return import('./wallets/status')
7073
default:
7174
return
7275
}

src/modules/select/wallets/status.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { extensionInstallMessage } from '../content'
2+
import { WalletModule, Helpers } from '../../../interfaces'
3+
4+
const statusIcon = `
5+
<svg width="109" height="109" viewBox="0 0 109 109" fill="none" xmlns="http://www.w3.org/2000/svg">
6+
<path fill-rule="evenodd" clip-rule="evenodd" d="M54.7 0C24.7 0 0.400024 24.3 0.400024 54.3C0.400024 84.3 24.7 108.6 54.7 108.6C84.7 108.6 109 84.3 109 54.3C108.9 24.3 84.6 0 54.7 0ZM47.3 77.6C40.4 78 33.4 74 33.1 67.5C32.7 61.1 37.9 56.8 46.5 56.4C49.7 56.2 52.3 56.5 54.8 56.7C57.4 57 60 57.2 63.1 57C64.6 56.9 66.2 56.7 67.8 56.4C67 67.4 58.6 77 47.3 77.6ZM65.3 52.3C61.9 52.5 59.2 52.2 56.5 51.9C53.8 51.6 51 51.3 47.7 51.5C46.1 51.6 44.4 51.8 42.8 52.2C43.8 40.2 52.6 29.7 64.5 29.1C71.8 28.7 79.1 33.1 79.5 40.2C79.9 47.2 74.4 51.8 65.3 52.3Z" fill="#4360DF"/>
7+
</svg>
8+
`
9+
10+
function status(
11+
options: {
12+
preferred?: boolean
13+
label?: string
14+
iconSrc?: string
15+
svg?: string
16+
} = {}
17+
): WalletModule {
18+
const { preferred, label, iconSrc, svg } = options
19+
20+
return {
21+
name: label || 'Status',
22+
iconSrc: iconSrc,
23+
iconSrcSet: iconSrc,
24+
svg: svg || statusIcon,
25+
wallet: async (helpers: Helpers) => {
26+
const { getProviderName, createModernProviderInterface } = helpers
27+
28+
const provider = (window as any).ethereum
29+
30+
return {
31+
provider,
32+
interface:
33+
provider && getProviderName(provider) === 'Status'
34+
? createModernProviderInterface(provider)
35+
: null
36+
}
37+
},
38+
link: 'https://status.im/',
39+
installMessage: extensionInstallMessage,
40+
mobile: true,
41+
preferred
42+
}
43+
}
44+
45+
export default status

src/stores.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function createWalletStateSliceStore(options: {
147147
get()
148148
.then(set)
149149
.catch((err: any) => {
150-
throw new Error(
150+
console.warn(
151151
`Error getting ${parameter} from state syncer: ${err}`
152152
)
153153
})

0 commit comments

Comments
 (0)