Skip to content

Commit 41fc2ad

Browse files
committed
Merge branch 'v2-web3-onboard' into v2-web3-onboard-develop
2 parents 4bd8b07 + cba2a65 commit 41fc2ad

37 files changed

+193
-3351
lines changed

packages/coinbase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"typescript": "^4.5.5"
2121
},
2222
"dependencies": {
23-
"@web3-onboard/common": "^2.0.0",
23+
"@web3-onboard/common": "^2.0.7",
2424
"@coinbase/wallet-sdk": "^3.0.5"
2525
}
2626
}

packages/common/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/common",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",
@@ -41,6 +41,7 @@
4141
"typescript": "^4.5.5"
4242
},
4343
"dependencies": {
44+
"@ethereumjs/common": "2.6.2",
4445
"ethers": "5.5.4",
4546
"joi": "^17.4.2",
4647
"rxjs": "^7.5.2"

packages/common/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export default {
3535
inlineSources: !production
3636
})
3737
],
38-
external: ['joi', 'rxjs', 'ethers']
38+
external: ['joi', 'rxjs', 'ethers', '@ethereumjs/common']
3939
}

packages/common/src/hdwallets.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type Common from '@ethereumjs/common'
2+
import type { CustomNetwork } from './types'
3+
4+
/**
5+
* Creates the common instance used for signing
6+
* transactions with hardware wallets
7+
* @returns the initialized common instance
8+
*/
9+
export const getCommon = async ({
10+
customNetwork,
11+
chainId
12+
}: {
13+
customNetwork?: CustomNetwork
14+
chainId: number
15+
}): Promise<Common> => {
16+
const { default: Common, Hardfork } = await import('@ethereumjs/common')
17+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
18+
// @ts-ignore
19+
const CommonConstructor: typeof Common = Common.default || Common
20+
let common: Common
21+
try {
22+
common = new CommonConstructor({
23+
chain: customNetwork || chainId,
24+
// Berlin is the minimum hardfork that will allow for EIP1559
25+
hardfork: Hardfork.Berlin,
26+
// List of supported EIPS
27+
eips: [1559]
28+
})
29+
} catch (e: any) {
30+
if (e.message && /Chain.*not supported/.test(e.message)) {
31+
common = CommonConstructor.custom({ chainId })
32+
} else {
33+
throw e
34+
}
35+
}
36+
return common
37+
}

packages/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export { createEIP1193Provider } from './eip-1193'
6262
export { default as accountSelect } from './account-select'
6363
export { entryModal } from './entry-modal'
6464
export { SofiaProLight, SofiaProRegular, SofiaProSemiBold } from './fonts'
65+
export { getCommon } from './hdwallets'
6566

6667
export type {
6768
RequestPatch,

packages/core/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,15 @@ The Onboard styles can customized via [CSS variables](https://developer.mozilla.
487487
--onboard-wallet-button-background-hover
488488
--onboard-wallet-button-color
489489
--onboard-wallet-button-border-color
490+
--onboard-wallet-button-border-radius
491+
--onboard-wallet-button-box-shadow
490492
--onboard-wallet-app-icon-border-color
491493

494+
/* CUSTOMIZE THE CONNECT MODAL */
495+
--onboard-modal-border-radius
496+
--onboard-modal-backdrop
497+
--onboard-modal-box-shadow
498+
492499
/* FONTS */
493500
--onboard-font-family-normal: Sofia Pro;
494501
--onboard-font-family-semibold: Sofia Pro Semibold;
@@ -510,6 +517,10 @@ The Onboard styles can customized via [CSS variables](https://developer.mozilla.
510517
--onboard-spacing-5: 0.5rem;
511518

512519
/* SHADOWS */
520+
--onboard-border-radius-1: 24px;
521+
522+
/* SHADOWS */
523+
--onboard-shadow-0: none;
513524
--onboard-shadow-1: 0px 4px 12px rgba(0, 0, 0, 0.1);
514525
--onboard-shadow-2: inset 0px -1px 0px rgba(0, 0, 0, 0.1);
515526

packages/core/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/core",
3-
"version": "2.2.5",
3+
"version": "2.2.6",
44
"scripts": {
55
"build": "rollup -c",
66
"dev": "rollup -c -w",
@@ -41,7 +41,7 @@
4141
"typescript": "^4.5.5"
4242
},
4343
"dependencies": {
44-
"@web3-onboard/common": "^2.0.6",
44+
"@web3-onboard/common": "^2.0.7",
4545
"bowser": "^2.11.0",
4646
"ethers": "5.5.3",
4747
"eventemitter3": "^4.0.7",
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
export default `
2-
<svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3-
<path d="M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z" fill="currentColor"/>
4-
</svg>
5-
`
1+
export default `<svg width="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z" fill="currentColor"/></svg>`

packages/core/src/icons/caret.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
export default `
2-
<svg width="100%" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3-
<path d="M7 10L12 15L17 10H7Z" fill="currentColor"/>
4-
</svg>
5-
`
1+
export default `<svg width="100%" height="24" viewBox="0 5 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 10L12 15L17 10H7Z" fill="currentColor"/></svg>`

packages/core/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ function mountApp() {
184184
--spacing-6: 0.25rem;
185185
--spacing-7: 0.125rem;
186186
187+
/* BORDER RADIUS */
188+
--border-radius-1: 24px;
189+
187190
/* SHADOWS */
191+
--shadow-0: none;
188192
--shadow-1: 0px 4px 12px rgba(0, 0, 0, 0.1);
189193
--shadow-2: inset 0px -1px 0px rgba(0, 0, 0, 0.1);
190194
--shadow-3: 0px 4px 16px rgba(179, 179, 179, 0.2);
@@ -195,6 +199,9 @@ function mountApp() {
195199
--modal-right: unset;
196200
--modal-bottom: unset;
197201
--modal-left: unset;
202+
203+
/* MODAL STYLES */
204+
--modal-backdrop: rgba(0, 0, 0, 0.6);
198205
}
199206
</style>
200207
`

0 commit comments

Comments
 (0)