Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrating to 2.0

2.0 changes five things that can break a 1.x integration. Everything else is additive: session events, ensureReady, restore, the EIP-1193 provider, the wagmi connector and the modal.

viem is a peer dependency

Install it yourself, 2.20 or newer:

npm install viem

1.x pinned its own copy, so apps that also used viem shipped two.

signMessage is removed

wallets.signMessage, useWallet().signMessage and the SignMessageOptions, SignMessageConvenienceOptions and SignMessageResult types are gone.

createWithPasskey takes no userId

// 1.x
await aligned.wallets.createWithPasskey({ userId: user.id, userName: email });
// 2.0
await aligned.wallets.createWithPasskey({ userName: email });

The SDK registers the passkey under the signed-in user's id, the handle every later add-device and recovery passkey shares. userName is optional and defaults to the email. Most apps can replace every step after sign-in with ensureReady:

const result = await aligned.wallets.ensureReady({ chainIds: [84532] });
// result.status: 'ready' | 'needs_device' | 'no_supported_chain' | 'cancelled'

Cancelled prompts throw UserRejectedError

A dismissed passkey prompt (NotAllowedError, AbortError) and a closed Google popup now reject with UserRejectedError, with the browser's error as cause. isUserRejection(e) matches both the new error and the browser's.

Transaction failures are typed

sendTransaction and execute reject with:

  • TransactionRevertedError: mined and reverted. txHash names it.

  • TransactionTimeoutError: sent, not mined before the backend stopped waiting. txHash names it and it may still land.

Both extend ApiError, so instanceof ApiError and .code checks keep working. A call that would revert is rejected before it is sent, as an ApiError with code simulation_reverted.

ExecuteResult.status is always 1: a revert is an error, not a result.

Last updated

Was this helpful?