Skip to content

v1.0.1

Choose a tag to compare

@ryanio ryanio released this 09 Sep 02:11
· 3 commits to main since this release

What's Changed

Fixes a gap in 1.0.0: the viem and ethers bridges accepted a Solana adapter and built a broken client instead of rejecting it.

Both bridges are typed EvmWalletAdapter, which stops a TypeScript caller. This package publishes main and types, so it does not stop anyone else, and in 1.0.0 neither bridge checked at runtime.

The viem bridge did not fail, which is worse than failing. Against a real Privy Solana wallet it returned a client whose account.address was a base58 Solana key, eth_accounts reported that key as an Ethereum address, and the first transaction died with An unknown RPC error occurred, naming neither the wallet nor the reason.

Both bridges now call requireEvmAdapter and give the same message the other EVM-only flows give:

wallet "privy-svm" signs for svm; a viem client requires an EVM wallet

The check runs before getAddress(). That order matters: viem rejects a base58 key, so a guard placed after the address lookup is unreachable and the caller sees an address error instead of a chain-type one. The ethers guard sits in the EthersAdapterSigner constructor rather than only in walletAdapterToEthersSigner, so constructing the signer directly is covered too.

A correction to the 1.0.0 notes

Those notes said the viem bridge rejected a Solana wallet. That was true of @opensea/tool-sdk's walletAdapterToClient wrapper, which does call requireEvmAdapter, and not of this package's own bridge. If you are on 1.0.0 and pass adapters from JavaScript, upgrade.

Found by driving the published 1.0.0 against a real Privy Solana wallet rather than by a type error, which is also how the end-to-end signing path got its first real exercise: message signing on both chains verified against the wallet's own public key, and a devnet transaction signed and verified over its real message bytes.

Full Changelog: v1.0.0...v1.0.1