Skip to content

Commit 9e520a0

Browse files
authored
1.35.5-0.0.1: [feature] Adds Tally wallet support (#749)
1 parent b58a54c commit 9e520a0

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.35.5",
3+
"version": "1.35.5-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: 3 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+
'tally',
1213
'metamask',
1314
'binance',
1415
'frame',
@@ -148,6 +149,8 @@ function getModule(name: string): Promise<{
148149
}
149150
case 'meetone':
150151
return import('./wallets/meetone')
152+
case 'tally':
153+
return import('./wallets/tally')
151154
case 'metamask':
152155
return import('./wallets/metamask')
153156
case 'portis':
1.43 KB
Loading
Loading

src/modules/select/wallets/tally.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { extensionInstallMessage, mobileWalletInstallMessage } from '../content'
2+
import { WalletModule, Helpers, CommonWalletOptions } from '../../../interfaces'
3+
4+
import tallyIcon from '../wallet-icons/icon-tally.png'
5+
import tallyIcon2x from '../wallet-icons/icon-tally@2x.png'
6+
7+
function tally(
8+
options: CommonWalletOptions & { isMobile: boolean }
9+
): WalletModule {
10+
const { preferred, label, iconSrc, svg } = options
11+
12+
return {
13+
name: label || 'Tally',
14+
iconSrc: iconSrc || tallyIcon,
15+
iconSrcSet: iconSrc || tallyIcon2x,
16+
svg,
17+
wallet: async (helpers: Helpers) => {
18+
const { getProviderName, createModernProviderInterface } = helpers
19+
20+
const provider = (window as any).ethereum || (window as any).tally
21+
22+
return {
23+
provider,
24+
interface:
25+
provider && getProviderName(provider) === 'Tally'
26+
? createModernProviderInterface(provider)
27+
: null
28+
}
29+
},
30+
type: 'injected',
31+
link: `https://tally.cash/`,
32+
installMessage: extensionInstallMessage,
33+
desktop: true,
34+
mobile: false,
35+
preferred
36+
}
37+
}
38+
39+
export default tally

src/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ export function getProviderName(provider: any): string | undefined {
309309
return 'XDEFI'
310310
}
311311

312+
if (provider.isTally) {
313+
return 'Tally'
314+
}
315+
312316
if (provider.isFrame) {
313317
return 'Frame'
314318
}

0 commit comments

Comments
 (0)