CHAIN_MISMATCH
What CHAIN_MISMATCH means, why WalletError throws it, what to show users and how to fix it in ensforge. Also covers retry safety and the actions that throw it.
WalletErrorNot retryable
@ensforge/sdk
What happened
The wallet is on chain ?, expected ?.
What to show users
| Title | Message | Action |
|---|---|---|
| Wrong network | Your wallet is connected to a different network. | Switch networks in your wallet. |
How to fix
Switch the wallet's network, then retry.
Retry safety
Retrying the same call fails the same way until the cause is fixed (retryable: false).
Actions that throw it
| Action | When |
|---|---|
approval.setDelegate | when the wallet is on another chain or has no account to sign with. |
approval.setOperator | when the wallet is on another chain or has no account to sign with. |
approval.setToken | when the wallet is on another chain or has no account to sign with. |
dns.claim | when the wallet is on another chain or has no account to sign with. |
dns.setRecords | when the wallet is on another chain or has no account to sign with. |
migration.migrate | when the wallet is on another chain or has no account to sign with. |
name.reclaim | when the wallet is on another chain or has no account to sign with. |
name.setManager | when the wallet is on another chain or has no account to sign with. |
name.setTtl | when the wallet is on another chain or has no account to sign with. |
name.transfer | when the wallet is on another chain or has no account to sign with. |
permission.setRecordAccess | when the wallet is on another chain or has no account to sign with. |
plan.send | when the wallet is on another chain or has no account to sign with. |
primaryName.set | when the wallet is on another chain or has no account to sign with. |
primaryName.signClaim | when the wallet is on another chain or has no account to sign with. |
record.set | when the wallet is on another chain or has no account to sign with. |
registration.commit | when the wallet is on another chain or has no account to sign with. |
registration.register | when the wallet is on another chain or has no account to sign with. |
registration.renew | when the wallet is on another chain or has no account to sign with. |
registry.attach | when the wallet is on another chain or has no account to sign with. |
registry.deploy | when the wallet is on another chain or has no account to sign with. |
registry.setUri | when the wallet is on another chain or has no account to sign with. |
registry.upgrade | when the wallet is on another chain or has no account to sign with. |
resolver.create | when the wallet is on another chain or has no account to sign with. |
resolver.link | when the wallet is on another chain or has no account to sign with. |
resolver.set | when the wallet is on another chain or has no account to sign with. |
resolver.upgrade | when the wallet is on another chain or has no account to sign with. |
role.grant | when the wallet is on another chain or has no account to sign with. |
role.revoke | when the wallet is on another chain or has no account to sign with. |
subname.create | when the wallet is on another chain or has no account to sign with. |
subname.remove | when the wallet is on another chain or has no account to sign with. |
subname.update | when the wallet is on another chain or has no account to sign with. |
wrapper.setChildFuses | when the wallet is on another chain or has no account to sign with. |
wrapper.setFuses | when the wallet is on another chain or has no account to sign with. |
wrapper.unwrap | when the wallet is on another chain or has no account to sign with. |
wrapper.wrap | when the wallet is on another chain or has no account to sign with. |
Any write can fail with WalletError: it is part of Errors.WriteError.
Catch it
Errors.hasCode("CHAIN_MISMATCH") narrows to this error. See Handle errors.
Was this page helpful?