Skip to content
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
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.1.6",
"version": "2.1.7-alpha.1",
"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
2 changes: 1 addition & 1 deletion packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export type GetInterfaceHelpers = {
EventEmitter: typeof EventEmitter
}

export type ChainId = string
export type ChainId = string | number

export type RpcUrl = string

Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const basePaths = Joi.array().items(basePath)

const chain = Joi.object({
namespace: Joi.string(),
id: Joi.string().required(),
id: Joi.alternatives()
.try(Joi.string().pattern(/^0x[0-9a-fA-F]+$/),
Joi.number().positive()).required,
rpcUrl: Joi.string().required(),
label: Joi.string().required(),
token: Joi.string().required(),
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.5.0",
"version": "2.6.0-alpha.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 @@ -81,7 +81,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"bignumber.js": "^9.0.0",
"bnc-sdk": "^4.4.1",
"bowser": "^2.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { validateSetChainOptions } from './validation'
import type { WalletState } from './types'

async function setChain(options: {
chainId: string
chainId: string | number
chainNamespace?: string
wallet?: WalletState['label']
}): Promise<boolean> {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ async function connect(
if (!chains.length)
throw new Error(
'At least one chain must be set before attempting to connect a wallet'
)

)
const { autoSelect } = options || {
autoSelect: { label: '', disableModals: false }
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from './store/actions'

import updateBalances from './update-balances'
import { chainIdToHex } from './utils'
import { preflightNotifications } from './preflight-notifications'

const API = {
Expand Down Expand Up @@ -89,8 +90,7 @@ function init(options: InitOptions): OnboardAPI {
} = options

initI18N(i18n)
addChains(chains)

addChains(chains.map(chainIdToHex))
const { device, svelteInstance } = configuration

// update accountCenter
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function addChains(chains: Chain[]): void {
payload: chains.map(({ namespace = 'evm', id, ...rest }) => ({
...rest,
namespace,
id: id.toLowerCase()
id: id
}))
}

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export async function copyWalletAddress(text: string): Promise<void> {
}
}

export const chainIdToHex = (chain: Chain): Chain => typeof chain.id === 'number' ? { ...chain, id: `0x${chain.id.toString(16)}` } : chain

export const chainIdToLabel: Record<string, string> = {
'0x1': 'Ethereum',
'0x3': 'Ropsten',
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import type {
PreflightNotificationsOptions
} from './types'

const chainId = Joi.string().pattern(/^0x[0-9a-fA-F]+$/)
// const chainId = Joi.string().pattern(/^0x[0-9a-fA-F]+$/)
const chainId = Joi.alternatives().
try(Joi.string().pattern(/^0x[0-9a-fA-F]+$/),
Joi.number().positive())
const chainNamespace = Joi.string().valid('evm')
const unknownObject = Joi.object().unknown()

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.0.6",
"version": "2.0.7-alpha.1",
"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": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"@ethereumjs/common": "^2.6.1",
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "demo",
"version": "2.0.5",
"version": "2.0.6",
"devDependencies": {
"assert": "^2.0.0",
"buffer": "^6.0.3",
Expand All @@ -23,7 +23,7 @@
},
"dependencies": {
"@web3-onboard/coinbase": "^2.0.8",
"@web3-onboard/core": "^2.4.1-alpha.1",
"@web3-onboard/core": "^2.6.0-alpha.1",
"@web3-onboard/dcent": "^2.0.5",
"@web3-onboard/fortmatic": "^2.0.6",
"@web3-onboard/gnosis": "^2.0.5",
Expand Down
12 changes: 7 additions & 5 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@

const coinbaseWallet = coinbaseModule()

const walletConnect = walletConnectModule()
const walletConnect = walletConnectModule({
connectFirstChainId: true
})
const portis = portisModule({
apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b'
})
Expand Down Expand Up @@ -122,19 +124,19 @@
rpcUrl: 'https://mainnet.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
},
{
id: '0x3',
id: 3,
token: 'tROP',
label: 'Ropsten',
rpcUrl: 'https://ropsten.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
},
{
id: '0x4',
id: 4,
token: 'rETH',
label: 'Rinkeby',
rpcUrl: 'https://rinkeby.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
},
{
id: '0x89',
id: 137,
token: 'MATIC',
label: 'Polygon',
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
Expand All @@ -146,7 +148,7 @@
rpcUrl: 'https://matic-mumbai.chainstacklabs.com '
},
{
id: '0xa',
id: 10,
token: 'OETH',
label: 'Optimism',
rpcUrl: 'https://mainnet.optimism.io'
Expand Down
4 changes: 2 additions & 2 deletions packages/fortmatic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/fortmatic",
"version": "2.0.8",
"version": "2.0.9-alpha.1",
"description": "Fortmatic 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 @@ -59,7 +59,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"fortmatic": "^2.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/gnosis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/gnosis",
"version": "2.0.7",
"version": "2.0.8-alpha.1",
"description": "Gnosis Safe 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 @@ -59,6 +59,6 @@
"dependencies": {
"@gnosis.pm/safe-apps-provider": "^0.9.2",
"@gnosis.pm/safe-apps-sdk": "^6.1.1",
"@web3-onboard/common": "^2.1.6"
"@web3-onboard/common": "^2.1.7-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.0.14",
"version": "2.0.15-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,7 +62,7 @@
"window": "^4.2.7"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"joi": "^17.4.2",
"lodash.uniqby": "^4.7.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/keepkey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keepkey",
"version": "2.1.6",
"version": "2.1.7-alpha.1",
"description": "KeepKey hardware 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 @@ -63,7 +63,7 @@
"@ethersproject/providers": "^5.5.0",
"@shapeshiftoss/hdwallet-core": "^1.15.2",
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"ethereumjs-util": "^7.1.3"
}
}
4 changes: 2 additions & 2 deletions packages/keystone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keystone",
"version": "2.1.7",
"version": "2.1.8-alpha.1",
"description": "Keystone hardware 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 @@ -57,6 +57,6 @@
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@keystonehq/eth-keyring": "^0.14.0-alpha.10.3",
"@web3-onboard/common": "^2.1.6"
"@web3-onboard/common": "^2.1.7-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/ledger",
"version": "2.1.6",
"version": "2.1.7-alpha.1",
"description": "Ledger hardare 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 @@ -65,7 +65,7 @@
"@ledgerhq/hw-transport-u2f": "^5.36.0-deprecated",
"@ledgerhq/hw-transport-webusb": "^6.19.0",
"@metamask/eth-sig-util": "^4.0.0",
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"buffer": "^6.0.3",
"ethereumjs-util": "^7.1.3"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/magic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/magic",
"version": "2.0.9",
"version": "2.0.10-alpha.1",
"description": "Magic 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 @@ -80,7 +80,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"joi": "^17.4.2",
"magic-sdk": "^8.1.0",
"rxjs": "^7.5.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/mew/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/mew",
"version": "2.0.6",
"version": "2.0.7-alpha.1",
"description": "MEW (My Ether 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 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 @@ -59,7 +59,7 @@
"@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"rxjs": "^7.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/portis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/portis",
"version": "2.0.6",
"version": "2.0.7-alpha.1",
"description": "Portis 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 @@ -57,6 +57,6 @@
},
"dependencies": {
"@portis/web3": "^4.0.6",
"@web3-onboard/common": "^2.1.6"
"@web3-onboard/common": "^2.1.7-alpha.1"
}
}
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/react",
"version": "2.2.4",
"version": "2.2.5-alpha.1",
"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.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,8 +62,8 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/core": "^2.5.0",
"@web3-onboard/core": "^2.6.0-alpha.1",
"@web3-onboard/common": "^2.1.7-alpha.1",
"use-sync-external-store": "1.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/torus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/torus",
"version": "2.0.7",
"version": "2.0.8-alpha.1",
"description": "Torus 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 @@ -57,6 +57,6 @@
},
"dependencies": {
"@toruslabs/torus-embed": "^1.18.3",
"@web3-onboard/common": "^2.1.6"
"@web3-onboard/common": "^2.1.7-alpha.1"
}
}
4 changes: 2 additions & 2 deletions packages/trezor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/trezor",
"version": "2.1.6",
"version": "2.1.7-alpha.1",
"description": "Trezor hardware 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 @@ -60,7 +60,7 @@
"dependencies": {
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@web3-onboard/common": "^2.1.6",
"@web3-onboard/common": "^2.1.7-alpha.1",
"buffer": "^6.0.3",
"eth-crypto": "^2.1.0",
"ethereumjs-util": "^7.1.3",
Expand Down
Loading