Skip to content
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

Release 2.23.2 (develop) #1767

Merged
merged 9 commits into from
Jun 9, 2023
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
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"@web3-onboard/cede-store": "^2.0.2",
"@web3-onboard/coinbase": "^2.2.4",
"@web3-onboard/core": "^2.20.0-alpha.1",
"@web3-onboard/core": "^2.20.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.4",
"@web3-onboard/fortmatic": "^2.0.19",
Expand All @@ -60,7 +60,7 @@
"@web3-onboard/gas": "^2.1.8",
"@web3-onboard/gnosis": "^2.1.10",
"@web3-onboard/infinity-wallet": "^2.0.4",
"@web3-onboard/injected-wallets": "^2.9.0",
"@web3-onboard/injected-wallets": "^2.10.0",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.4.6",
Expand All @@ -76,7 +76,7 @@
"@web3-onboard/trust": "^2.0.4",
"@web3-onboard/uauth": "^2.0.5",
"@web3-onboard/venly": "^2.0.0-alpha.1",
"@web3-onboard/walletconnect": "^2.3.8",
"@web3-onboard/walletconnect": "^2.3.9",
"@web3-onboard/web3auth": "^2.2.3",
"@web3-onboard/xdefi": "^2.0.4",
"@web3-onboard/zeal": "^2.0.4",
Expand Down
11 changes: 7 additions & 4 deletions docs/src/routes/docs/[...4]wallets/[...24]walletconnect/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ type WalletConnectOptions = {
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: string

/**
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
*/
Expand All @@ -67,9 +66,9 @@ type WalletConnectOptions = {
*/
requiredChains?: number[] | undefined
/**
* `undefined` by default, see https://docs.walletconnect.com/2.0/web3modal/options
* `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
qrModalOptions?: Web3ModalConfig
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
}
)
```
Expand Down Expand Up @@ -97,7 +96,11 @@ const wcV2InitOptions = {
/**
* Optional function to handle WalletConnect URI when it becomes available
*/
handleUri: (uri) => console.log(uri)
handleUri: (uri) => console.log(uri),
/**
* Chains required to be supported by all wallets connecting to your DApp
*/
requiredChains: [1, 56]
}

// initialize the module with options
Expand Down
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.23.1",
"version": "2.23.2",
"private": true,
"workspaces": {
"packages": [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.20.1-alpha.2",
"version": "2.20.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
6 changes: 3 additions & 3 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@web3-onboard/cede-store": "^2.0.2",
"@web3-onboard/coinbase": "^2.2.3",
"@web3-onboard/core": "^2.20.1-alpha.2",
"@web3-onboard/core": "^2.20.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.3",
"@web3-onboard/fortmatic": "^2.0.18",
Expand All @@ -35,7 +35,7 @@
"@web3-onboard/gas": "^2.1.7",
"@web3-onboard/gnosis": "^2.1.9",
"@web3-onboard/infinity-wallet": "^2.0.3",
"@web3-onboard/injected-wallets": "^2.10.0-alpha.1",
"@web3-onboard/injected-wallets": "^2.10.0",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.4.5",
Expand All @@ -51,7 +51,7 @@
"@web3-onboard/trust": "^2.0.3",
"@web3-onboard/uauth": "^2.0.4",
"@web3-onboard/venly": "^2.0.0",
"@web3-onboard/walletconnect": "^2.3.9-alpha.1",
"@web3-onboard/walletconnect": "^2.3.9-alpha.2",
"@web3-onboard/web3auth": "^2.2.2",
"@web3-onboard/xdefi": "^2.0.3",
"@web3-onboard/zeal": "^2.0.3",
Expand Down
53 changes: 27 additions & 26 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
'imtoken',
'pillar'
]
}
},
requiredChains:[1, 56]
})
const portis = portisModule({
apiKey: 'b2b7586f-2b1e-4c30-a7fb-c2d1533b153b'
Expand Down Expand Up @@ -651,31 +652,31 @@
}}>Send Success Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom DApp success notification to use however you want',
autoDismiss: 0,
type: 'pending'
})}>Send Pending Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
type: 'error',
message:
'This is a custom DApp Error notification to use however you want',
autoDismiss: 0
})}>Send Error Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom non-descript DApp notification to use however you want',
autoDismiss: 0
})}>Send DApp Notification</button
>
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom DApp success notification to use however you want',
autoDismiss: 0,
type: 'pending'
})}>Send Pending Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
type: 'error',
message:
'This is a custom DApp Error notification to use however you want',
autoDismiss: 0
})}>Send Error Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom non-descript DApp notification to use however you want',
autoDismiss: 0
})}>Send DApp Notification</button
>
</div>
<div class="switch-chain-container">
<button on:click={() => onboard.setChain({ chainId: '0x1' })}
Expand Down
2 changes: 1 addition & 1 deletion 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.10.0-alpha.1",
"version": "2.10.0",
"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
4 changes: 2 additions & 2 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.8.6-alpha.2",
"version": "2.8.6",
"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 @@ -63,7 +63,7 @@
},
"dependencies": {
"@web3-onboard/common": "^2.3.3",
"@web3-onboard/core": "^2.20.1-alpha.2",
"@web3-onboard/core": "^2.20.1",
"use-sync-external-store": "1.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/vue",
"version": "2.7.5-alpha.2",
"version": "2.7.5",
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. 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, 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 @@
"@vueuse/core": "^8.4.2",
"@vueuse/rxjs": "^8.2.0",
"@web3-onboard/common": "^2.3.3",
"@web3-onboard/core": "^2.20.1-alpha.2",
"@web3-onboard/core": "^2.20.1",
"vue-demi": "^0.12.4"
},
"peerDependencies": {
Expand Down
11 changes: 7 additions & 4 deletions packages/walletconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type WalletConnectOptions = {
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: string

/**
* Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
*/
Expand All @@ -48,9 +47,9 @@ type WalletConnectOptions = {
*/
requiredChains?: number[] | undefined
/**
* `undefined` by default, see https://docs.walletconnect.com/2.0/web3modal/options
* `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
qrModalOptions?: Web3ModalConfig
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
}
)
```
Expand All @@ -74,7 +73,11 @@ const wcV2InitOptions = {
/**
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
*/
projectId: 'abc123...'
projectId: 'abc123...',
/**
* Chains required to be supported by all wallets connecting to your DApp
*/
requiredChains: [1, 56]
}

// initialize the module with options
Expand Down
9 changes: 4 additions & 5 deletions packages/walletconnect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/walletconnect",
"version": "2.3.9-alpha.1",
"version": "2.3.9",
"description": "WalletConnect SDK 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,16 +56,15 @@
"license": "MIT",
"devDependencies": {
"typescript": "^4.5.5",
"@walletconnect/types": "^2.7.0",
"@web3modal/standalone": "2.4.3"
"@walletconnect/types": "^2.7.0"
},
"dependencies": {
"@ethersproject/providers": "5.5.0",
"@walletconnect/ethereum-provider": "2.7.8",
"@walletconnect/client": "^1.8.0",
"@walletconnect/ethereum-provider": "2.8.0",
"@walletconnect/modal":"2.4.3",
"@walletconnect/qrcode-modal": "^1.8.0",
"@web3-onboard/common": "^2.3.3",
"@web3modal/standalone":"2.4.3",
"rxjs": "^7.5.2"
}
}
20 changes: 3 additions & 17 deletions packages/walletconnect/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WalletInit } from '@web3-onboard/common'
import type { Web3ModalConfig } from '@web3modal/standalone'
import { EthereumProviderOptions } from '@walletconnect/ethereum-provider/dist/types/EthereumProvider'
import v1 from './v1.js'
import v2 from './v2.js'

Expand Down Expand Up @@ -37,23 +37,9 @@ export type WalletConnectOptions = {
*/
requiredChains?: number[] | undefined
/**
* `undefined` by default, see https://docs.walletconnect.com/2.0/web3modal/options
* `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
*/
qrModalOptions?: Pick<
Web3ModalConfig,
| 'themeMode'
| 'themeVariables'
| 'chainImages'
| 'desktopWallets'
| 'enableExplorer'
| 'explorerRecommendedWalletIds'
| 'explorerExcludedWalletIds'
| 'mobileWallets'
| 'privacyPolicyUrl'
| 'termsOfServiceUrl'
| 'tokenImages'
| 'walletImages'
>
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
}
)

Expand Down
8 changes: 4 additions & 4 deletions packages/walletconnect/src/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@ function walletConnect(options?: WalletConnectOptions): WalletInit {
}

// default to mainnet
const requiredChainsParsed =
const requiredChainsParsed: number[] =
Array.isArray(requiredChains) &&
requiredChains.length &&
requiredChains.every(num => !isNaN(num))
? // @ts-ignore
// Required as WC package does not support hex numbers
requiredChains.map(chainID => parseInt(chainID))
: [...chains.map(({ id }) => parseInt(id, 16))]
: [1]

const connector = await EthereumProvider.init({
projectId,
chains: requiredChainsParsed, // default to mainnet
metadata: getMetaData(),
showQrModal: true,
optionalChains: chains.map(({ id }) => parseInt(id, 16)),
optionalMethods: methods,
showQrModal: true,
rpcMap: chains
.map(({ id, rpcUrl }) => ({ id, rpcUrl }))
.reduce((rpcMap: Record<number, string>, { id, rpcUrl }) => {
rpcMap[parseInt(id, 16)] = rpcUrl || ''
return rpcMap
}, {}),
metadata: getMetaData(),
qrModalOptions: qrModalOptions
})

Expand Down
Loading