Skip to content

Commit 3b83b74

Browse files
Merge pull request #1266 from blocknative/release/2.11.0
Release: 2.11.0 (main)
2 parents 50833aa + 44b4b6c commit 3b83b74

26 files changed

+298
-29
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

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-monorepo",
3-
"version": "2.10.0",
3+
"version": "2.11.0",
44
"private": true,
55
"workspaces": {
66
"packages": ["./packages/*"],

packages/core/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,11 @@ The Onboard styles can customized via [CSS variables](https://developer.mozilla.
858858
--onboard-wallet-button-background
859859
--onboard-wallet-button-background-hover
860860
--onboard-wallet-button-color
861+
--onboard-wallet-button-color-hover
861862
--onboard-wallet-button-border-color
862863
--onboard-wallet-button-border-radius
863864
--onboard-wallet-button-box-shadow
865+
--onboard-wallet-button-box-shadow-hover
864866
--onboard-wallet-app-icon-border-color
865867

866868
/* CUSTOMIZE THE SHARED MODAL */

packages/core/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/core",
3-
"version": "2.8.2",
3+
"version": "2.8.3",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized 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/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ function mountApp() {
328328

329329
if (!containerElement) {
330330
throw new Error(
331-
`Element with query ${state.get().accountCenter} does not exist.`
331+
`Element with query ${containerElementQuery} does not exist.`
332332
)
333333
}
334334

packages/core/src/views/connect/Index.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
}
116116
117117
connectingErrorMessage = ''
118-
118+
scrollToTop()
119119
// change step on next event loop
120120
setTimeout(() => setStep('connectingWallet'), 1)
121121
} catch (error) {
@@ -196,8 +196,10 @@
196196
trackWallet(provider, label)
197197
updateSelectedWallet(update)
198198
setStep('connectedWallet')
199+
scrollToTop()
199200
} catch (error) {
200201
const { code } = error as { code: number; message: string }
202+
scrollToTop()
201203
202204
// user rejected account access
203205
if (code === ProviderRpcErrorCode.ACCOUNT_ACCESS_REJECTED) {

packages/core/src/views/connect/WalletButton.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
--onboard-wallet-button-background-hover,
3434
var(--onboard-primary-100, var(--primary-100))
3535
);
36+
color: var(
37+
--onboard-wallet-button-color-hover,
38+
var(--onboard-gray-700, var(--gray-700))
39+
);
3640
}
3741
3842
button.connected {
@@ -53,6 +57,10 @@
5357
);
5458
box-shadow: var(--onboard-wallet-button-box-shadow, var(--box-shadow-0));
5559
}
60+
61+
button.wallet-button-styling:hover {
62+
box-shadow: var(--onboard-wallet-button-box-shadow-hover, var(--box-shadow-0));
63+
}
5664
</style>
5765

5866
<button

packages/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@web3-onboard/fortmatic": "^2.0.13",
2929
"@web3-onboard/gas": "^2.1.2",
3030
"@web3-onboard/gnosis": "^2.1.2",
31-
"@web3-onboard/injected-wallets": "^2.2.1",
31+
"@web3-onboard/injected-wallets": "^2.2.2",
3232
"@web3-onboard/keepkey": "^2.3.0",
3333
"@web3-onboard/keystone": "^2.3.0",
3434
"@web3-onboard/ledger": "^2.3.0",
@@ -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",
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: 5 additions & 2 deletions
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',
@@ -104,21 +106,22 @@
104106
105107
const onboard = Onboard({
106108
wallets: [
109+
injected,
107110
web3auth,
108111
ledger,
109112
trezor,
110113
walletConnect,
111114
keepkey,
112115
keystone,
113116
coinbaseWallet,
114-
injected,
115117
magic,
116118
fortmatic,
117119
portis,
118120
torus,
119121
gnosis,
120122
dcent,
121-
sequence
123+
sequence,
124+
tallyho
122125
],
123126
gas,
124127
chains: [

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.2.1",
3+
"version": "2.2.2",
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export const WALLET_NAMES: { [key: string]: string } = {
1414
frame: 'Frame',
1515
bitkeep: 'BitKeep',
1616
sequence: 'Sequence',
17+
core: 'Core'
1718
}

packages/injected/src/icons/core.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default `<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
2+
<rect width="256" height="256" rx="128" fill="black"/>
3+
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.6477 203.403C66.6922 203.403 47.0213 198.931 30 191.095L99.2514 127.885C89.6861 120.038 83.5836 108.126 83.5836 94.7884C83.5836 81.2079 89.9104 69.1052 99.7773 61.2668V52.0015H126.08C126.177 52.0008 126.274 52.0005 126.372 52.0005C137.068 52.0005 146.848 55.9254 154.349 62.4136C161.85 55.926 171.629 52.0015 182.325 52.0015H182.389L182.39 52L182.392 52.0015H208.919V61.2679C218.786 69.1062 225.113 81.209 225.113 94.7894C225.113 111.867 215.108 126.608 200.64 133.47C195.467 148.743 185.737 162.479 172.714 173.652V193.398H139.977C124.227 199.801 106.455 203.403 87.6477 203.403ZM126.371 127.703C134.16 127.703 141.317 124.998 146.954 120.475L154.282 136.976L161.645 120.397C167.296 124.967 174.491 127.703 182.325 127.703C200.502 127.703 215.238 112.967 215.238 94.7895C215.238 76.6117 200.502 61.8757 182.325 61.8757C170.513 61.8757 160.155 68.0975 154.348 77.4425C148.541 68.0975 138.183 61.8757 126.371 61.8757C108.193 61.8757 93.4575 76.6117 93.4575 94.7895C93.4575 112.967 108.193 127.703 126.371 127.703ZM126.371 117.829C139.096 117.829 149.411 107.514 149.411 94.7893C149.411 82.0648 139.096 71.7496 126.371 71.7496C113.647 71.7496 103.331 82.0648 103.331 94.7893C103.331 107.514 113.647 117.829 126.371 117.829ZM126.371 107.955C133.642 107.955 139.537 102.06 139.537 94.7893C139.537 87.5182 133.642 81.6238 126.371 81.6238C119.1 81.6238 113.206 87.5182 113.206 94.7893C113.206 102.06 119.1 107.955 126.371 107.955ZM205.364 94.7893C205.364 107.514 195.049 117.829 182.324 117.829C169.6 117.829 159.285 107.514 159.285 94.7893C159.285 82.0648 169.6 71.7496 182.324 71.7496C195.049 71.7496 205.364 82.0648 205.364 94.7893ZM195.49 94.7893C195.49 102.06 189.596 107.955 182.324 107.955C175.053 107.955 169.159 102.06 169.159 94.7893C169.159 87.5182 175.053 81.6238 182.324 81.6238C189.596 81.6238 195.49 87.5182 195.49 94.7893Z" fill="white"/>
4+
</svg>`

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: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export enum ProviderIdentityFlag {
4545
MathWallet = 'isMathWallet',
4646
GameStop = 'isGamestop',
4747
BitKeep = 'isBitKeep',
48-
Sequence = 'isSequence'
48+
Sequence = 'isSequence',
49+
Core = 'isAvalanche'
4950
}
5051

5152
export enum ProviderLabel {
@@ -77,12 +78,13 @@ export enum ProviderLabel {
7778
XDEFI = 'XDEFI Wallet',
7879
OneInch = '1inch Wallet',
7980
Tokenary = 'Tokenary Wallet',
80-
Tally = 'Tally Wallet',
81+
Tally = 'Tally Ho Wallet',
8182
Rabby = 'Rabby',
8283
MathWallet = 'MathWallet',
8384
GameStop = 'GameStop Wallet',
8485
BitKeep = 'BitKeep',
85-
Sequence = 'Sequence'
86+
Sequence = 'Sequence',
87+
Core = 'Core'
8688
}
8789

8890
export interface MeetOneProvider extends ExternalProvider {
@@ -103,7 +105,8 @@ export enum InjectedNameSpace {
103105
Arbitrum = 'arbitrum',
104106
XFI = 'xfi',
105107
GameStop = 'gamestop',
106-
BitKeep = 'bitkeep'
108+
BitKeep = 'bitkeep',
109+
Avalanche = 'avalanche'
107110
}
108111

109112
export interface CustomWindow extends Window {
@@ -115,10 +118,11 @@ export interface CustomWindow extends Window {
115118
xfi: {
116119
ethereum: InjectedProvider
117120
}
118-
gamestop: InjectedProvider,
121+
gamestop: InjectedProvider
119122
bitkeep: {
120123
ethereum: InjectedProvider
121124
}
125+
avalanche: InjectedProvider
122126
}
123127

124128
export type InjectedProvider = ExternalProvider &

packages/injected/src/wallets.ts

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,45 @@ declare const window: CustomWindow
2323
const UNSUPPORTED_METHOD = null
2424

2525
function getInjectedInterface(
26-
identity: string
26+
identity: string,
27+
checkOtherProviderFlags?: boolean
2728
): () => Promise<{ provider: EIP1193Provider }> {
2829
return async () => ({
2930
provider: (window.ethereum.providers &&
3031
Array.isArray(window.ethereum.providers)
31-
? window.ethereum.providers.find(provider => !!provider[identity])
32+
? getInterfaceFromProvidersArray(identity, checkOtherProviderFlags)
3233
: window.ethereum) as EIP1193Provider
3334
})
3435
}
3536

37+
function getInterfaceFromProvidersArray(
38+
identity: string,
39+
checkOtherProviderFlags?: boolean
40+
) {
41+
return window.ethereum.providers.find(provider => {
42+
return checkOtherProviderFlags
43+
? !!provider[identity] &&
44+
!otherProviderFlagsExist(identity, provider)
45+
: !!provider[identity]
46+
})
47+
}
48+
49+
function otherProviderFlagsExist(identity: string, provider: any): boolean {
50+
const otherProviderFlags = Object.values(ProviderIdentityFlag).filter(
51+
id => id !== identity && id !== ProviderIdentityFlag.Detected
52+
)
53+
return otherProviderFlags.some(id => !!provider[id])
54+
}
55+
3656
const metamask: InjectedWalletModule = {
3757
label: ProviderLabel.MetaMask,
3858
injectedNamespace: InjectedNameSpace.Ethereum,
3959
checkProviderIdentity: ({ provider }) =>
40-
!!provider && !!provider[ProviderIdentityFlag.MetaMask],
60+
!!provider &&
61+
!!provider[ProviderIdentityFlag.MetaMask] &&
62+
!otherProviderFlagsExist(ProviderIdentityFlag.MetaMask, provider),
4163
getIcon: async () => (await import('./icons/metamask.js')).default,
42-
getInterface: getInjectedInterface(ProviderIdentityFlag.MetaMask),
64+
getInterface: getInjectedInterface(ProviderIdentityFlag.MetaMask, true),
4365
platforms: ['all']
4466
}
4567

@@ -94,8 +116,8 @@ const binance: InjectedWalletModule = {
94116

95117
const provider = createEIP1193Provider(window.BinanceChain, {
96118
eth_chainId: ({ baseRequest }) =>
97-
baseRequest({ method: 'eth_chainId' }).then(id =>
98-
`0x${parseInt(id as string).toString(16)}`
119+
baseRequest({ method: 'eth_chainId' }).then(
120+
id => `0x${parseInt(id as string).toString(16)}`
99121
),
100122
// Unsupported method -- will throw error
101123
eth_selectAccounts: UNSUPPORTED_METHOD,
@@ -512,10 +534,10 @@ const bitkeep: InjectedWalletModule = {
512534
label: ProviderLabel.BitKeep,
513535
injectedNamespace: InjectedNameSpace.BitKeep,
514536
checkProviderIdentity: ({ provider }) =>
515-
!!provider && !!provider["ethereum"][ProviderIdentityFlag.BitKeep],
537+
!!provider && !!provider['ethereum'][ProviderIdentityFlag.BitKeep],
516538
getIcon: async () => (await import('./icons/bitkeep.js')).default,
517539
getInterface: async () => ({
518-
provider: window.bitkeep && window.bitkeep.ethereum,
540+
provider: window.bitkeep && window.bitkeep.ethereum
519541
}),
520542
platforms: ['all']
521543
}
@@ -532,6 +554,17 @@ const sequence: InjectedWalletModule = {
532554
platforms: ['all']
533555
}
534556

557+
const core: InjectedWalletModule = {
558+
label: ProviderLabel.Core,
559+
injectedNamespace: InjectedNameSpace.Avalanche,
560+
checkProviderIdentity: ({ provider }) =>
561+
!!provider && !!provider[ProviderIdentityFlag.Core],
562+
getIcon: async () => (await import('./icons/core.js')).default,
563+
getInterface: getInjectedInterface(ProviderIdentityFlag.Core),
564+
// Core wallet is only tested in chrome or chromium browser
565+
platforms: ['desktop', 'Chrome', 'Chromium', 'Microsoft Edge']
566+
}
567+
535568
const wallets = [
536569
exodus,
537570
metamask,
@@ -564,7 +597,8 @@ const wallets = [
564597
mathwallet,
565598
gamestop,
566599
bitkeep,
567-
sequence
600+
sequence,
601+
core
568602
]
569603

570604
export default wallets

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. 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, 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",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.8.2",
65+
"@web3-onboard/core": "^2.8.3",
6666
"@web3-onboard/common": "^2.2.2",
6767
"use-sync-external-store": "1.0.0"
6868
},

0 commit comments

Comments
 (0)