Skip to content

Commit 7a2fcb4

Browse files
0xzozAdamj1232
andauthored
FEATURE: Add Tally Ho Wallet Package (#1238)
* Add Tally Ho package * Remove unneccesary code * Update references * Fix build error and bump tallyho-detect-provider package * Remove yarn.lock * Fix version and package dependency issues * Format with prettier * Revert prettier changes to sequencer package * Add CI * Revert prettier changes to wallet connect package * Add alpha tag to tallyho version * Update demo versions * Bump common pkg version in Tally package to latest Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent d091d41 commit 7a2fcb4

File tree

16 files changed

+206
-11
lines changed

16 files changed

+206
-11
lines changed

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ jobs:
303303
working_directory: ~/web3-onboard-monorepo/packages/sequence
304304
steps:
305305
- node-build-steps
306+
build-tallyho:
307+
docker:
308+
- image: cimg/node:16.13.1
309+
working_directory: ~/web3-onboard-monorepo/packages/tallyho
310+
steps:
311+
- node-build-steps
306312

307313
# Build staging/Alpha releases
308314
build-staging-core:
@@ -443,6 +449,12 @@ jobs:
443449
working_directory: ~/web3-onboard-monorepo/packages/sequence
444450
steps:
445451
- node-staging-build-steps
452+
build-staging-tallyho:
453+
docker:
454+
- image: cimg/node:16.13.1
455+
working_directory: ~/web3-onboard-monorepo/packages/tallyho
456+
steps:
457+
- node-staging-build-steps
446458

447459
workflows:
448460
version: 2
@@ -585,3 +597,9 @@ workflows:
585597
<<: *deploy_production_filters
586598
- build-staging-sequence:
587599
<<: *deploy_staging_filters
600+
tallyho:
601+
jobs:
602+
- build-tallyho:
603+
<<: *deploy_production_filters
604+
- build-staging-tallyho:
605+
<<: *deploy_staging_filters

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ For full documentation, check out the README.md for each package:
9696
- [MEW](packages/mew/README.md)
9797
- [Web3Auth](packages/web3auth/README.md)
9898
- [Sequence](packages/sequence/README.md)
99+
- [TallyHo](packages/tallyho/README.md)
99100

100101
**Hardware Wallets**
101102

packages/demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@web3-onboard/sequence": "^2.0.1",
3838
"@web3-onboard/torus": "^2.1.2",
3939
"@web3-onboard/trezor": "^2.3.0",
40+
"@web3-onboard/tallyho": "^2.0.0-alpha.1",
4041
"@web3-onboard/walletconnect": "^2.1.2",
4142
"@web3-onboard/web3auth": "^2.1.2",
4243
"vconsole": "^3.9.5"

packages/demo/src/App.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import gas from '@web3-onboard/gas'
1717
import dcentModule from '@web3-onboard/dcent'
1818
import sequenceModule from '@web3-onboard/sequence'
19+
import tallyHoModule from '@web3-onboard/tallyho'
1920
import {
2021
recoverAddress,
2122
arrayify,
@@ -84,6 +85,7 @@
8485
const keepkey = keepkeyModule()
8586
const keystone = keystoneModule()
8687
const gnosis = gnosisModule()
88+
const tallyho = tallyHoModule()
8789
8890
const trezorOptions = {
8991
email: 'test@test.com',
@@ -118,7 +120,8 @@
118120
torus,
119121
gnosis,
120122
dcent,
121-
sequence
123+
sequence,
124+
tallyho
122125
],
123126
gas,
124127
chains: [

packages/injected/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export const WALLET_NAMES: { [key: string]: string } = {
1313
meetone: 'MeetOne',
1414
frame: 'Frame',
1515
bitkeep: 'BitKeep',
16-
sequence: 'Sequence',
16+
sequence: 'Sequence'
1717
}

packages/injected/src/icons/gamestop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ export default `
44
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.52862 9.75V15.9646C7.52862 16.4706 7.91965 16.8565 8.4254 16.8565H15.7621C16.2679 16.8565 16.6589 16.4706 16.6589 15.9646V10.7524H17.625V15.9646C17.625 16.9956 16.8045 17.8125 15.7621 17.8125H8.4254C7.38304 17.8125 6.5625 16.9956 6.5625 15.9646V9.75H7.52862Z" fill="white"/>
55
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.5625 8.22251C6.5625 7.19176 7.38304 6.375 8.4254 6.375H15.9086V8.64657H16.1323C16.9727 8.64657 17.625 9.29631 17.625 10.1266V10.8949C17.625 11.7253 16.9727 12.375 16.1323 12.375H8.4254C7.38304 12.375 6.5625 11.5582 6.5625 10.5275V8.22251ZM14.9425 8.64657V7.33077H8.4254C7.91965 7.33077 7.52862 7.71661 7.52862 8.22251V10.5275C7.52862 11.0334 7.91965 11.4192 8.4254 11.4192H11.6107V8.64657H14.9425ZM12.5768 11.4192H16.1323C16.4361 11.4192 16.6589 11.2004 16.6589 10.8949V10.1266C16.6589 9.82115 16.4361 9.60235 16.1323 9.60235H12.5768V11.4192Z" fill="white"/>
66
</svg>
7-
`
7+
`

packages/injected/src/icons/mathwallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ export default `<svg width="130" height="130" viewBox="0 0 130 130" fill="none"
4444
</radialGradient>
4545
</defs>
4646
</svg>
47-
`
47+
`

packages/injected/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export enum ProviderLabel {
7777
XDEFI = 'XDEFI Wallet',
7878
OneInch = '1inch Wallet',
7979
Tokenary = 'Tokenary Wallet',
80-
Tally = 'Tally Wallet',
80+
Tally = 'Tally Ho Wallet',
8181
Rabby = 'Rabby',
8282
MathWallet = 'MathWallet',
8383
GameStop = 'GameStop Wallet',
@@ -115,7 +115,7 @@ export interface CustomWindow extends Window {
115115
xfi: {
116116
ethereum: InjectedProvider
117117
}
118-
gamestop: InjectedProvider,
118+
gamestop: InjectedProvider
119119
bitkeep: {
120120
ethereum: InjectedProvider
121121
}

packages/injected/src/wallets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ const binance: InjectedWalletModule = {
9494

9595
const provider = createEIP1193Provider(window.BinanceChain, {
9696
eth_chainId: ({ baseRequest }) =>
97-
baseRequest({ method: 'eth_chainId' }).then(id =>
98-
`0x${parseInt(id as string).toString(16)}`
97+
baseRequest({ method: 'eth_chainId' }).then(
98+
id => `0x${parseInt(id as string).toString(16)}`
9999
),
100100
// Unsupported method -- will throw error
101101
eth_selectAccounts: UNSUPPORTED_METHOD,
@@ -512,10 +512,10 @@ const bitkeep: InjectedWalletModule = {
512512
label: ProviderLabel.BitKeep,
513513
injectedNamespace: InjectedNameSpace.BitKeep,
514514
checkProviderIdentity: ({ provider }) =>
515-
!!provider && !!provider["ethereum"][ProviderIdentityFlag.BitKeep],
515+
!!provider && !!provider['ethereum'][ProviderIdentityFlag.BitKeep],
516516
getIcon: async () => (await import('./icons/bitkeep.js')).default,
517517
getInterface: async () => ({
518-
provider: window.bitkeep && window.bitkeep.ethereum,
518+
provider: window.bitkeep && window.bitkeep.ethereum
519519
}),
520520
platforms: ['all']
521521
}

packages/tallyho/README.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# @web3-onboard/tallyho
2+
3+
## Wallet module for connecting Tally Ho Wallet to web3-onboard
4+
See [Tally Ho Wallet Developer Docs](https://docs.tally.cash/tally/developers/integrating-dapps)
5+
6+
### Install
7+
8+
`npm i @web3-onboard/tallyho`
9+
10+
11+
## Usage
12+
13+
```typescript
14+
import Onboard from '@web3-onboard/core'
15+
import tallyHoWalletModule from '@web3-onboard/tallyho'
16+
17+
// initialize the module with options
18+
const talltHoWalletSdk = tallyHoWalletModule()
19+
20+
const onboard = Onboard({
21+
// ... other Onboard options
22+
wallets: [
23+
tallyHoWalletModule()
24+
//... other wallets
25+
]
26+
})
27+
28+
const connectedWallets = await onboard.connectWallet()
29+
console.log(connectedWallets)
30+
```

0 commit comments

Comments
 (0)