Skip to content

Commit 4decb17

Browse files
authored
1.37.2-0.0.1 : [feature] - Add Tokenary Wallet (#805)
* Add Tokenary * Fix icon name * Update tokenary.ts
1 parent fe23133 commit 4decb17

File tree

6 files changed

+47
-1
lines changed

6 files changed

+47
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.37.2",
3+
"version": "1.37.2-0.0.1",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",

src/modules/select/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getProviderName } from '../../utilities'
99
// wallets that qualify for default wallets need to have no
1010
// init parameters that are required for full functionality
1111
const desktopDefaultWalletNames = [
12+
'tokenary',
1213
'tally',
1314
'metamask',
1415
'binance',
@@ -21,6 +22,7 @@ const desktopDefaultWalletNames = [
2122
]
2223

2324
const mobileDefaultWalletNames = [
25+
'tokenary',
2426
'1inch',
2527
'metamask',
2628
'coinbase',
@@ -154,6 +156,8 @@ function getModule(name: string): Promise<{
154156
return import('./wallets/meetone')
155157
case 'tally':
156158
return import('./wallets/tally')
159+
case 'tokenary':
160+
return import('./wallets/tokenary')
157161
case 'metamask':
158162
return import('./wallets/metamask')
159163
case 'portis':
784 Bytes
Loading
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { extensionInstallMessage } from '../content'
2+
import { WalletModule, Helpers, CommonWalletOptions } from '../../../interfaces'
3+
4+
import tokenaryIcon from '../wallet-icons/icon-tokenary.png'
5+
import tokenaryIcon2x from '../wallet-icons/icon-tokenary@2x.png'
6+
7+
function tokenary(options: CommonWalletOptions): WalletModule {
8+
const { preferred, label, iconSrc, svg } = options
9+
10+
return {
11+
name: label || 'Tokenary',
12+
iconSrc: iconSrc || tokenaryIcon,
13+
iconSrcSet: iconSrc || tokenaryIcon2x,
14+
svg,
15+
wallet: async (helpers: Helpers) => {
16+
const { getProviderName, createModernProviderInterface } = helpers
17+
const windowAsAny = window as any
18+
const provider = windowAsAny.ethereum || windowAsAny.web3.currentProvider
19+
20+
return {
21+
provider,
22+
interface:
23+
provider && getProviderName(provider) === 'Tokenary'
24+
? createModernProviderInterface(provider)
25+
: null
26+
}
27+
},
28+
type: 'injected',
29+
link: `https://tokenary.io/get`,
30+
installMessage: extensionInstallMessage,
31+
desktop: true,
32+
mobile: true,
33+
preferred,
34+
osExclusions: ['Android']
35+
}
36+
}
37+
38+
export default tokenary

src/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ export function getProviderName(provider: any): string | undefined {
317317
return 'Tally'
318318
}
319319

320+
if (provider.isTokenary) {
321+
return 'Tokenary'
322+
}
323+
320324
if (provider.isFrame) {
321325
return 'Frame'
322326
}

0 commit comments

Comments
 (0)