blocknative / web3-onboard

Client library to onboard users to web3 apps
https://onboard.blocknative.com/
MIT License
813 stars 474 forks source link

accountSelect should throw if rpcUrl is missing in chainValidation (hw-common) #2242

Open kernelwhisperer opened 2 weeks ago

kernelwhisperer commented 2 weeks ago

Current Behavior

I'm was using onboard without a rpcUrl, worked great except for the Trezor integration:

    chains: [
        {
            id: '0x1', // Chain ID in hexadecimal for Ethereum Mainnet
            token: 'ETH',
            label: 'Ethereum Mainnet'
        },
    ]

Trezor is failing silently and no error is thrown:

https://github.com/blocknative/web3-onboard/blob/develop/packages/hw-common/src/account-select.ts#L13 https://github.com/blocknative/web3-onboard/blob/develop/packages/common/src/validation.ts#L5 https://github.com/blocknative/web3-onboard/blob/develop/packages/common/src/validation.ts#L28

Expected Behavior

To throw an error, like the source code suggests.

Steps To Reproduce

No response

What package is effected by this issue?

@web3-onboard/trezor

Is this a build or a runtime issue?

Runtime

Package Version

@web3-onboard/trezor@2.4.6

Node Version

20.2.0

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

I think the validation library 'joi' might have been updated and the return value is different now.

Sanity Check