Skip to content

Release 2.26.1 #2222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/src/routes/docs/[...4]wallets/[...6]coinbase/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,29 @@ npm install @web3-onboard/coinbase

```typescript
type CoinbaseWalletOptions = {
/** @optional Use dark theme */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
darkMode?: boolean
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
enableMobileWalletLink?: boolean
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
reloadOnDisconnect?: boolean
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
}
```

## Smart Wallet

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).

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import coinbaseWalletModule from '@web3-onboard/coinbase'

// initialize the module with options
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
const coinbaseWalletSdk = coinbaseWalletModule()

// can also initialize with no options...
// const coinbaseWalletSdk = coinbaseWalletSdk()
Expand Down
384 changes: 188 additions & 196 deletions docs/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-onboard-monorepo",
"version": "2.26.0",
"version": "2.26.1",
"private": true,
"workspaces": {
"packages": [
Expand Down
4 changes: 2 additions & 2 deletions packages/arcana-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/arcana-auth",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"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.",
"private": false,
Expand All @@ -14,7 +14,7 @@
},
"dependencies": {
"@arcana/auth": "^1.0.10",
"@web3-onboard/common": "2.4.0"
"@web3-onboard/common": "^2.4.1"
},
"devDependencies": {
"typescript": "^5.4.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/bitget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/bitget",
"version": "2.1.0",
"version": "2.1.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,6 +62,6 @@
},
"dependencies": {
"@bitget-wallet/web3-sdk": "^0.0.8",
"@web3-onboard/common": "^2.4.0"
"@web3-onboard/common": "^2.4.1"
}
}
4 changes: 2 additions & 2 deletions packages/bitkeep/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/bitkeep",
"version": "2.1.0",
"version": "2.1.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,6 +62,6 @@
},
"dependencies": {
"@bitget-wallet/web3-sdk": "^0.0.8",
"@web3-onboard/common": "^2.4.0"
"@web3-onboard/common": "^2.4.1"
}
}
4 changes: 2 additions & 2 deletions packages/blocto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/blocto",
"version": "2.1.0",
"version": "2.1.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -64,7 +64,7 @@
"window": "^4.2.7"
},
"dependencies": {
"@web3-onboard/common": "^2.4.0",
"@web3-onboard/common": "^2.4.1",
"@blocto/sdk": "^0.9.1"
}
}
4 changes: 2 additions & 2 deletions packages/capsule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/capsule",
"version": "2.1.0",
"version": "2.1.1",
"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.",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand Down Expand Up @@ -60,7 +60,7 @@
"@usecapsule/react-sdk": "^2.3.1",
"@usecapsule/wagmi-v2-integration": "^1.7.1",
"@wagmi/chains": "^1.8.0",
"@web3-onboard/common": "^2.4.0",
"@web3-onboard/common": "^2.4.1",
"react-dom": "^18.2.0",
"viem": "2.9.15",
"wagmi": "2.5.19"
Expand Down
4 changes: 2 additions & 2 deletions packages/cede-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/cede-store",
"version": "2.3.0",
"version": "2.3.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -70,6 +70,6 @@
},
"dependencies": {
"@cedelabs/providers": "^1.5.0",
"@web3-onboard/common": "^2.4.0"
"@web3-onboard/common": "^2.4.1"
}
}
15 changes: 11 additions & 4 deletions packages/coinbase/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @web3-onboard/coinbase

## Wallet module for connecting Coinbase Wallet SDK to web3-onboard

See [Coinbase Wallet Developer Docs](https://docs.cloud.coinbase.com/wallet-sdk/docs)

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

```typescript
type CoinbaseWalletOptions = {
/** @optional Use dark theme */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
darkMode?: boolean
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
enableMobileWalletLink?: boolean
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
reloadOnDisconnect?: boolean
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
}
```

## Smart Wallet

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).

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import coinbaseWalletModule from '@web3-onboard/coinbase'

// initialize the module with options
const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true })
const coinbaseWalletSdk = coinbaseWalletModule()

// can also initialize with no options...
// const coinbaseWalletSdk = coinbaseWalletModule()
Expand Down
9 changes: 5 additions & 4 deletions packages/coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/coinbase",
"version": "2.3.0",
"version": "2.4.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -31,7 +31,8 @@
"confirmed",
"Injected Wallet",
"Crypto",
"Crypto Wallet"
"Crypto Wallet",
"Smart Wallet"
],
"repository": {
"type": "git",
Expand All @@ -58,7 +59,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@coinbase/wallet-sdk": "3.9.2",
"@web3-onboard/common": "^2.4.0"
"@coinbase/wallet-sdk": "4.0.3",
"@web3-onboard/common": "^2.4.1"
}
}
56 changes: 41 additions & 15 deletions packages/coinbase/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
import { WalletInit } from '@web3-onboard/common'
import type { WalletInit, WalletInterface } from '@web3-onboard/common'

function coinbaseWallet({
supportedWalletType = 'all',
darkMode = false,
enableMobileWalletLink = false,
reloadOnDisconnect = true
}: {
/** @optional Use dark theme */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase Use dark theme */
darkMode?: boolean
/** @optional whether to connect mobile web app via WalletLink, defaults to false */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether to connect mobile web app via WalletLink, defaults to false */
enableMobileWalletLink?: boolean
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */
/** @deprecated Deprecated after version 2.2.7 of @web3-onboard/coinbase whether or not to reload dapp automatically after disconnect, defaults to true */
reloadOnDisconnect?: boolean
/** Type of Coinbase wallets to support - options : 'all' | 'smartWalletOnly' | 'eoaOnly' - Default to `all` */
supportedWalletType?: 'all' | 'smartWalletOnly' | 'eoaOnly'
} = {}): WalletInit {
return () => {
return {
label: 'Coinbase Wallet',
getIcon: async () => (await import('./icon.js')).default,
getInterface: async ({ chains, appMetadata }) => {
const [chain] = chains
getInterface: async ({
chains,
appMetadata
}): Promise<WalletInterface> => {
if (enableMobileWalletLink || reloadOnDisconnect || darkMode) {
console.warn(
'darkMode, enableMobileWalletLink and reloadOnDisconnect init props are deprecated after version 2.2.7 of @web3-onboard/coinbase'
)
}
const { name, icon } = appMetadata || {}

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

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

const appChainIds = chains.map(({ id }) =>
fromHex(id as `0x${string}`, 'number')
)

const instance = new CoinbaseWalletSDKConstructor({
appName: name || '',
appLogoUrl,
darkMode,
enableMobileWalletLink,
reloadOnDisconnect
appChainIds
})

const coinbaseWalletProvider = instance.makeWeb3Provider(
chain.rpcUrl,
parseInt(chain.id)
)
const coinbaseWalletProvider = instance.makeWeb3Provider({
options: supportedWalletType
})

// patch the chainChanged event
const on = coinbaseWalletProvider.on.bind(coinbaseWalletProvider)

coinbaseWalletProvider.on = (event, listener) => {
// @ts-ignore
on(event, val => {
if (event === 'chainChanged') {
listener(`0x${(val as number).toString(16)}`)
let hexVal: string
if (isHex(val)) {
hexVal = val
} else {
hexVal = toHex(val)
}

// @ts-ignore
listener(hexVal)
return
}

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

return coinbaseWalletProvider
}
const provider = createEIP1193Provider(coinbaseWalletProvider)
provider.removeListener = (event, func) => {}

return {
provider: coinbaseWalletProvider,
provider,
instance
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/common",
"version": "2.4.0",
"version": "2.4.2",
"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.",
"keywords": [
"Ethereum",
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export {

export * from './types.js'
export * from './validation.js'
export { parseEther, isHex, toHex, fromHex } from 'viem'
3 changes: 2 additions & 1 deletion packages/common/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { ConnectionInfo } from 'ethers/lib/utils'
import EventEmitter from 'eventemitter3'
import type { TypedData as EIP712TypedData } from 'eip-712'
import type { Address } from 'viem'
export type { Address } from 'viem'
export type { TypedData as EIP712TypedData } from 'eip-712'

/**
Expand Down Expand Up @@ -300,7 +302,6 @@ export interface EthSignTransactionRequest {
params: [TransactionObject]
}

export type Address = `0x${string}`
type Message = string
export interface EthSignMessageRequest {
method: 'eth_sign'
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.22.0",
"version": "2.22.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -87,7 +87,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@web3-onboard/common": "2.4.0",
"@web3-onboard/common": "^2.4.1",
"bnc-sdk": "^4.6.7",
"bowser": "^2.11.0",
"eventemitter3": "^4.0.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/dcent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/dcent",
"version": "2.2.9",
"version": "2.2.10",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -56,7 +56,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@web3-onboard/common": "^2.4.0",
"@web3-onboard/common": "^2.4.1",
"@web3-onboard/hw-common": "^2.3.2",
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
Expand Down
Loading
Loading