Skip to content

Commit c6ef997

Browse files
authored
feat: add Talisman injected wallet (#1717)
1 parent 0c876df commit c6ef997

File tree

8 files changed

+41
-7
lines changed

8 files changed

+41
-7
lines changed

docs/src/routes/docs/[...4]wallets/[...9]injected/+page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ const injected = injectedModule({
318318
- ApexWallet - _Desktop_
319319
- BifrostWallet - _Desktop & Mobile_
320320
- Safeheron - _Desktop_
321+
- Talisman - _Desktop_
321322

322323
## Build Environments
323324

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@web3-onboard/keystone": "^2.3.7-alpha.1",
3838
"@web3-onboard/ledger": "^2.4.5",
3939
"@web3-onboard/infinity-wallet": "^2.0.3",
40-
"@web3-onboard/injected-wallets": "^2.8.5",
40+
"@web3-onboard/injected-wallets": "^2.9.0-alpha.1",
4141
"@web3-onboard/magic": "^2.1.6",
4242
"@web3-onboard/phantom": "^2.0.1",
4343
"@web3-onboard/portis": "^2.1.6",

packages/injected/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const connectedWallets = await onboard.connectWallet()
3333

3434
console.log(connectedWallets)
3535
```
36+
3637
### Injected Wallets Supported Natively
3738

3839
- Metamask - _Desktop & Mobile_
@@ -82,6 +83,7 @@ console.log(connectedWallets)
8283
- ApexWallet - _Desktop_
8384
- BifrostWallet - _Desktop & Mobile_
8485
- Safeheron - _Desktop_
86+
- Talisman - _Desktop_
8587

8688
## Filtering Wallets
8789

packages/injected/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/injected-wallets",
3-
"version": "2.8.7-alpha.1",
3+
"version": "2.9.0-alpha.1",
44
"description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/injected/src/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
2525
zerion: 'Zerion',
2626
rainbow: 'Rainbow',
2727
defiwallet: 'DeFi Wallet',
28-
safeheron: 'Safeheron'
28+
safeheron: 'Safeheron',
29+
talismanEth: 'Talisman'
2930
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default `
2+
<svg width="100%" height="100%" viewBox="0 0 82 82" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<rect width="82" height="82" rx="12" fill="#d5ff5c"/>
4+
<path fill-rule="evenodd" clip-rule="evenodd" d="M59.117 44.663c.608 1.325 2.398 1.792 3.428.762l1.89-1.89a5 5 0 0 1 7.072 7.071L56.234 65.879C52.565 70.233 47.07 73 40.932 73c-6.403 0-12.102-3.008-15.763-7.689L10.464 50.607a5 5 0 0 1 7.071-7.071l1.861 1.86c1.008 1.009 2.759.555 3.354-.74a1.94 1.94 0 0 0 .182-.813V21a5 5 0 0 1 10 0v11.557c0 .994 1.018 1.669 1.966 1.37.6-.19 1.034-.737 1.034-1.366V14a5 5 0 0 1 10 0v18.561c0 .63.433 1.176 1.033 1.365.948.3 1.966-.375 1.966-1.37V21a5 5 0 1 1 10 0v22.835c0 .287.066.567.186.828z" fill="#fd4848"/>
5+
<path d="M56.933 55s-7.164 10-16 10c-8.837 0-16-10-16-10s7.163-10 16-10c8.836 0 16 10 16 10z" fill="#d5ff5c"/>
6+
<path d="M48.43 55a7.499 7.499 0 1 1-14.996 0 7.499 7.499 0 0 1 14.997 0z" stroke="#fd4848" stroke-width="1.003"/>
7+
<path d="M45.43 55a4.499 4.499 0 1 1-8.997 0 4.499 4.499 0 0 1 8.998 0z" stroke="#fd4848" stroke-width="1.003"/>
8+
<path d="M51.431 55c0 5.798-4.7 10.498-10.498 10.498-5.799 0-10.5-4.7-10.5-10.498 0-5.798 4.701-10.499 10.5-10.499 5.798 0 10.498 4.7 10.498 10.499z" stroke="#fd4848" stroke-width="1.003"/>
9+
<path d="M54.43 55c0 7.455-6.043 13.498-13.498 13.498-7.455 0-13.498-6.043-13.498-13.498 0-7.456 6.043-13.499 13.498-13.499 7.455 0 13.499 6.044 13.499 13.499z" stroke="#fd4848" stroke-width="1.003"/>
10+
<path d="M42.431 55a1.499 1.499 0 1 1-2.997 0 1.499 1.499 0 0 1 2.997 0z" fill="#fd4848" stroke="#fd4848" stroke-width="1.003"/>
11+
<path d="M25.653 55.121A26.748 26.748 0 0 1 25.56 55l.094-.122a33.186 33.186 0 0 1 4.293-4.499c2.866-2.473 6.75-4.878 10.987-4.878 4.236 0 8.12 2.405 10.986 4.878a33.196 33.196 0 0 1 4.293 4.5l.094.12a28.888 28.888 0 0 1-1.01 1.235 33.186 33.186 0 0 1-3.377 3.386c-2.865 2.474-6.75 4.878-10.986 4.878-4.237 0-8.121-2.404-10.986-4.878a33.196 33.196 0 0 1-4.294-4.499z" stroke="#d5ff5c" stroke-width="1.003"/>
12+
</svg>
13+
`

packages/injected/src/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export enum ProviderIdentityFlag {
6161
Rainbow = 'isRainbow',
6262
SafePal = 'isSafePal',
6363
DeFiWallet = 'isDeficonnectProvider',
64-
Safeheron = 'isSafeheron'
64+
Safeheron = 'isSafeheron',
65+
Talisman = 'isTalisman'
6566
}
6667

6768
export enum ProviderLabel {
@@ -113,7 +114,8 @@ export enum ProviderLabel {
113114
Rainbow = 'Rainbow',
114115
SafePal = 'SafePal',
115116
DeFiWallet = 'DeFi Wallet',
116-
Safeheron = 'Safeheron'
117+
Safeheron = 'Safeheron',
118+
Talisman = 'Talisman'
117119
}
118120

119121
export interface MeetOneProvider extends ExternalProvider {
@@ -144,7 +146,8 @@ export enum InjectedNameSpace {
144146
Trust = 'trustwallet',
145147
Frontier = 'frontier',
146148
DeFiConnectProvider = 'deficonnectProvider',
147-
Safeheron = 'safeheron'
149+
Safeheron = 'safeheron',
150+
Talisman = 'talismanEth'
148151
}
149152

150153
export interface CustomWindow extends Window {
@@ -180,6 +183,7 @@ export interface CustomWindow extends Window {
180183
trustwallet: InjectedProvider
181184
deficonnectProvider: InjectedProvider
182185
safeheron: InjectedProvider
186+
talismanEth: InjectedProvider
183187
}
184188

185189
export type InjectedProvider = ExternalProvider &

packages/injected/src/wallets.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,18 @@ const safeheron: InjectedWalletModule = {
765765
platforms: ['desktop', 'Chrome', 'Chromium', 'Microsoft Edge']
766766
}
767767

768+
const talisman: InjectedWalletModule = {
769+
label: ProviderLabel.Talisman,
770+
injectedNamespace: InjectedNameSpace.Talisman,
771+
checkProviderIdentity: ({ provider }) =>
772+
!!provider && !!provider[ProviderIdentityFlag.Talisman],
773+
getIcon: async () => (await import('./icons/talisman.js')).default,
774+
getInterface: async () => ({
775+
provider: createEIP1193Provider(window.talismanEth)
776+
}),
777+
platforms: ['desktop']
778+
}
779+
768780
const wallets = [
769781
zeal,
770782
exodus,
@@ -812,7 +824,8 @@ const wallets = [
812824
safepal,
813825
defiwallet,
814826
infinitywallet,
815-
safeheron
827+
safeheron,
828+
talisman
816829
]
817830

818831
export default wallets

0 commit comments

Comments
 (0)