Skip to content

Commit be9328c

Browse files
authored
Release 2.26.1 (#2222)
* Coinbase module bump to sdk v4 and support smart wallet creation * working through CD switch chain issues * CB wallet working as expected * Clarify smart wallet within docs * Update handler of chainId within eth_chainId * remove chainId patch in CB provider * Revert version bump * Yarn docs * FIX - Coinbase SDK build - Updates to fix build (#2219) * Updates to fix build * Type cleanup * Bump main version for release * Update versions to all be on the same common version
1 parent 1748b20 commit be9328c

File tree

59 files changed

+408
-367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+408
-367
lines changed

docs/src/routes/docs/[...4]wallets/[...6]coinbase/+page.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,29 @@ npm install @web3-onboard/coinbase
2929

3030
```typescript
3131
type CoinbaseWalletOptions = {
32-
/** @optional Use dark theme */
32+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
3333
darkMode?: boolean
34-
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
34+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
3535
enableMobileWalletLink?: boolean
36-
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
36+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
3737
reloadOnDisconnect?: boolean
38+
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
39+
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
3840
}
3941
```
4042
43+
## Smart Wallet
44+
45+
Starting at `@web3-onboard/coinbase` version 2.3.0 smart wallet support has been added. A smart wallet lives in your browser, no extensions or app installs needed. Use passkeys for signing, with enterprise-grade security without complex seed phrases. One wallet, one address, works universally across major L2s and onchain apps. [More info on Coinbase smart wallets](https://www.coinbase.com/wallet/smart-wallet).
46+
4147
## Usage
4248
4349
```typescript
4450
import Onboard from '@web3-onboard/core'
4551
import coinbaseWalletModule from '@web3-onboard/coinbase'
4652

4753
// initialize the module with options
48-
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
54+
const coinbaseWalletSdk = coinbaseWalletModule()
4955

5056
// can also initialize with no options...
5157
// const coinbaseWalletSdk = coinbaseWalletSdk()

docs/yarn.lock

Lines changed: 188 additions & 196 deletions
Large diffs are not rendered by default.

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.26.0",
3+
"version": "2.26.1",
44
"private": true,
55
"workspaces": {
66
"packages": [

packages/arcana-auth/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/arcana-auth",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"license": "MIT",
55
"description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.",
66
"private": false,
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"@arcana/auth": "^1.0.10",
17-
"@web3-onboard/common": "2.4.0"
17+
"@web3-onboard/common": "^2.4.1"
1818
},
1919
"devDependencies": {
2020
"typescript": "^5.4.5"

packages/bitget/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/bitget",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "bitget-wallet SDK wallet module for connecting to Web3-Onboard. 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",
@@ -62,6 +62,6 @@
6262
},
6363
"dependencies": {
6464
"@bitget-wallet/web3-sdk": "^0.0.8",
65-
"@web3-onboard/common": "^2.4.0"
65+
"@web3-onboard/common": "^2.4.1"
6666
}
6767
}

packages/bitkeep/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/bitkeep",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Bitkeep Wallet SDK wallet module for connecting to Web3-Onboard. 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",
@@ -62,6 +62,6 @@
6262
},
6363
"dependencies": {
6464
"@bitget-wallet/web3-sdk": "^0.0.8",
65-
"@web3-onboard/common": "^2.4.0"
65+
"@web3-onboard/common": "^2.4.1"
6666
}
6767
}

packages/blocto/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/blocto",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Blocto SDK wallet module for connecting 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",
@@ -64,7 +64,7 @@
6464
"window": "^4.2.7"
6565
},
6666
"dependencies": {
67-
"@web3-onboard/common": "^2.4.0",
67+
"@web3-onboard/common": "^2.4.1",
6868
"@blocto/sdk": "^0.9.1"
6969
}
7070
}

packages/capsule/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/capsule",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Capsule SDK wallet module for connecting 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
"module": "dist/index.js",
66
"browser": "dist/index.js",
@@ -60,7 +60,7 @@
6060
"@usecapsule/react-sdk": "^2.3.1",
6161
"@usecapsule/wagmi-v2-integration": "^1.7.1",
6262
"@wagmi/chains": "^1.8.0",
63-
"@web3-onboard/common": "^2.4.0",
63+
"@web3-onboard/common": "^2.4.1",
6464
"react-dom": "^18.2.0",
6565
"viem": "2.9.15",
6666
"wagmi": "2.5.19"

packages/cede-store/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/cede-store",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "cede.store SDK wallet module for connecting 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",
@@ -70,6 +70,6 @@
7070
},
7171
"dependencies": {
7272
"@cedelabs/providers": "^1.5.0",
73-
"@web3-onboard/common": "^2.4.0"
73+
"@web3-onboard/common": "^2.4.1"
7474
}
7575
}

packages/coinbase/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# @web3-onboard/coinbase
22

33
## Wallet module for connecting Coinbase Wallet SDK to web3-onboard
4+
45
See [Coinbase Wallet Developer Docs](https://docs.cloud.coinbase.com/wallet-sdk/docs)
56

67
### Install
@@ -11,23 +12,29 @@ See [Coinbase Wallet Developer Docs](https://docs.cloud.coinbase.com/wallet-sdk/
1112

1213
```typescript
1314
type CoinbaseWalletOptions = {
14-
/** @optional Use dark theme */
15+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
1516
darkMode?: boolean
16-
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
17+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
1718
enableMobileWalletLink?: boolean
18-
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
19+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
1920
reloadOnDisconnect?: boolean
21+
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
22+
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
2023
}
2124
```
2225
26+
## Smart Wallet
27+
28+
Starting at `@web3-onboard/coinbase` version 2.3.0 smart wallet support has been added. A smart wallet lives in your browser, no extensions or app installs needed. Use passkeys for signing, with enterprise-grade security without complex seed phrases. One wallet, one address, works universally across major L2s and onchain apps. [More info on Coinbase smart wallets](https://www.coinbase.com/wallet/smart-wallet).
29+
2330
## Usage
2431
2532
```typescript
2633
import Onboard from '@web3-onboard/core'
2734
import coinbaseWalletModule from '@web3-onboard/coinbase'
2835

2936
// initialize the module with options
30-
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
37+
const coinbaseWalletSdk = coinbaseWalletModule()
3138

3239
// can also initialize with no options...
3340
// const coinbaseWalletSdk = coinbaseWalletModule()

packages/coinbase/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/coinbase",
3-
"version": "2.3.0",
3+
"version": "2.4.1",
44
"description": "Coinbase SDK wallet module for connecting 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",
@@ -31,7 +31,8 @@
3131
"confirmed",
3232
"Injected Wallet",
3333
"Crypto",
34-
"Crypto Wallet"
34+
"Crypto Wallet",
35+
"Smart Wallet"
3536
],
3637
"repository": {
3738
"type": "git",
@@ -58,7 +59,7 @@
5859
"typescript": "^5.4.5"
5960
},
6061
"dependencies": {
61-
"@coinbase/wallet-sdk": "3.9.2",
62-
"@web3-onboard/common": "^2.4.0"
62+
"@coinbase/wallet-sdk": "4.0.3",
63+
"@web3-onboard/common": "^2.4.1"
6364
}
6465
}

packages/coinbase/src/index.ts

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
1-
import { WalletInit } from '@web3-onboard/common'
1+
import type { WalletInit, WalletInterface } from '@web3-onboard/common'
22

33
function coinbaseWallet({
4+
supportedWalletType = 'all',
45
darkMode = false,
56
enableMobileWalletLink = false,
67
reloadOnDisconnect = true
78
}: {
8-
/** @optional Use dark theme */
9+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
910
darkMode?: boolean
10-
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
11+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
1112
enableMobileWalletLink?: boolean
12-
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
13+
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
1314
reloadOnDisconnect?: boolean
15+
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
16+
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
1417
} = {}): WalletInit {
1518
return () => {
1619
return {
1720
label: 'Coinbase Wallet',
1821
getIcon: async () => (await import('./icon.js')).default,
19-
getInterface: async ({ chains, appMetadata }) => {
20-
const [chain] = chains
22+
getInterface: async ({
23+
chains,
24+
appMetadata
25+
}): Promise<WalletInterface> => {
26+
if (enableMobileWalletLink || reloadOnDisconnect || darkMode) {
27+
console.warn(
28+
'darkMode, enableMobileWalletLink and reloadOnDisconnect init props are deprecated after version 2.2.7 of @web3-onboard/coinbase'
29+
)
30+
}
2131
const { name, icon } = appMetadata || {}
2232

2333
// according to https://github.com/wagmi-dev/wagmi/issues/383
@@ -31,29 +41,43 @@ function coinbaseWallet({
3141
? (CoinbaseWalletSDK as any).default
3242
: CoinbaseWalletSDK
3343
) as typeof CoinbaseWalletSDK
44+
const { isHex, toHex, createEIP1193Provider, fromHex } = await import(
45+
'@web3-onboard/common'
46+
)
3447

3548
const base64 = window.btoa(icon || '')
3649
const appLogoUrl = `data:image/svg+xml;base64,${base64}`
3750

51+
const appChainIds = chains.map(({ id }) =>
52+
fromHex(id as `0x${string}`, 'number')
53+
)
54+
3855
const instance = new CoinbaseWalletSDKConstructor({
3956
appName: name || '',
4057
appLogoUrl,
41-
darkMode,
42-
enableMobileWalletLink,
43-
reloadOnDisconnect
58+
appChainIds
4459
})
4560

46-
const coinbaseWalletProvider = instance.makeWeb3Provider(
47-
chain.rpcUrl,
48-
parseInt(chain.id)
49-
)
61+
const coinbaseWalletProvider = instance.makeWeb3Provider({
62+
options: supportedWalletType
63+
})
5064

5165
// patch the chainChanged event
5266
const on = coinbaseWalletProvider.on.bind(coinbaseWalletProvider)
67+
5368
coinbaseWalletProvider.on = (event, listener) => {
69+
// @ts-ignore
5470
on(event, val => {
5571
if (event === 'chainChanged') {
56-
listener(`0x${(val as number).toString(16)}`)
72+
let hexVal: string
73+
if (isHex(val)) {
74+
hexVal = val
75+
} else {
76+
hexVal = toHex(val)
77+
}
78+
79+
// @ts-ignore
80+
listener(hexVal)
5781
return
5882
}
5983

@@ -62,9 +86,11 @@ function coinbaseWallet({
6286

6387
return coinbaseWalletProvider
6488
}
89+
const provider = createEIP1193Provider(coinbaseWalletProvider)
90+
provider.removeListener = (event, func) => {}
6591

6692
return {
67-
provider: coinbaseWalletProvider,
93+
provider,
6894
instance
6995
}
7096
}

packages/common/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/common",
3-
"version": "2.4.0",
3+
"version": "2.4.2",
44
"description": "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/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export {
1313

1414
export * from './types.js'
1515
export * from './validation.js'
16+
export { parseEther, isHex, toHex, fromHex } from 'viem'

packages/common/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { ConnectionInfo } from 'ethers/lib/utils'
22
import EventEmitter from 'eventemitter3'
33
import type { TypedData as EIP712TypedData } from 'eip-712'
4+
import type { Address } from 'viem'
5+
export type { Address } from 'viem'
46
export type { TypedData as EIP712TypedData } from 'eip-712'
57

68
/**
@@ -300,7 +302,6 @@ export interface EthSignTransactionRequest {
300302
params: [TransactionObject]
301303
}
302304

303-
export type Address = `0x${string}`
304305
type Message = string
305306
export interface EthSignMessageRequest {
306307
method: 'eth_sign'

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.22.0",
3+
"version": "2.22.1",
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",
@@ -87,7 +87,7 @@
8787
"typescript": "^5.4.5"
8888
},
8989
"dependencies": {
90-
"@web3-onboard/common": "2.4.0",
90+
"@web3-onboard/common": "^2.4.1",
9191
"bnc-sdk": "^4.6.7",
9292
"bowser": "^2.11.0",
9393
"eventemitter3": "^4.0.7",

packages/dcent/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/dcent",
3-
"version": "2.2.9",
3+
"version": "2.2.10",
44
"description": "D'CENT wallet module for connecting 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",
@@ -56,7 +56,7 @@
5656
"typescript": "^5.4.5"
5757
},
5858
"dependencies": {
59-
"@web3-onboard/common": "^2.4.0",
59+
"@web3-onboard/common": "^2.4.1",
6060
"@web3-onboard/hw-common": "^2.3.2",
6161
"@ethereumjs/tx": "^3.4.0",
6262
"@ethersproject/providers": "^5.5.0",

0 commit comments

Comments
 (0)