Skip to Content
Assetera Docs
Distribution partnersAssetera Wallet

Connect an existing wallet

Connect a client's Assetera Wallet with the wagmi connector, the RainbowKit entry or the raw EIP-1193 provider. Supported methods, error codes and pop-up rules.

A client who already has an Assetera Wallet connects it like any other wallet. The package @asseteragmbh/wallet-connector gives you a wagmi connector, a RainbowKit wallet entry with the id assetera-wallet, and a raw EIP-1193 provider. All three talk to the same wallet pop-up.

Preview

The Assetera Wallet integration is in preview and available in a test environment only. Production availability follows.

Choose an entry point

Entry pointImportUse it when
wagmi connectorasseteraWallet from @asseteragmbh/wallet-connector/wagmiYour app uses wagmi v2.
RainbowKit walletasseteraRainbowWallet from @asseteragmbh/wallet-connector/rainbowkitYour app uses the RainbowKit connect dialog.
EIP-1193 providercreateAsseteraWalletProvider from @asseteragmbh/wallet-connectorYou use another library, or no library.

@wagmi/core, viem and @rainbow-me/rainbowkit are optional peer dependencies. Install the ones your app uses.

import { createConfig, http } from "wagmi";
import { polygonAmoy, sepolia } from "wagmi/chains";
import { asseteraWallet } from "@asseteragmbh/wallet-connector/wagmi";

const walletUrl = process.env.NEXT_PUBLIC_ASSETERA_WALLET_URL!;

export const config = createConfig({
  chains: [polygonAmoy, sepolia],
  connectors: [asseteraWallet({ walletUrl })],
  transports: { [polygonAmoy.id]: http(), [sepolia.id]: http() },
});

To ask a connected client for a message signature, use personal_sign. The client confirms it in the pop-up. If you sell instruments through Assetera, register the wallet the same way as any other wallet. See Register a client's wallet.

Supported methods

The pop-up answers these EIP-1193 methods. Any other method rejects with 4200. Read-only chain calls, for example eth_call or eth_getBalance, go through your own RPC transport.

MethodOpens the pop-upNotes
eth_requestAccountsyesStarts the connection. Call it from a click.
eth_accountsnoAnswered locally from the last connection.
eth_chainIdnoAnswered locally.
wallet_switchEthereumChainyesRejects with 4902 for a chain the wallet does not offer.
personal_signyesThe client confirms the message in the pop-up.
eth_signTypedData_v4yesThe client confirms the typed data in the pop-up.
eth_sendTransactionyesThe client confirms the transaction in the pop-up.

Error codes

A rejected request throws a ProviderRpcError with an EIP-1193 code.

CodeMeaning
4001The client rejected the request in the pop-up.
4100Not connected. Call eth_requestAccounts first.
4200The method is not supported.
4900The pop-up was blocked or closed, or the wallet session ended.
4902The wallet does not offer the requested chain.
-32602The parameters are not valid.
-32603An unexpected error in the wallet.

Pop-up rules

  • Open it from a click. The pop-up opens synchronously inside request. Browsers allow that only during a user action. A blocked pop-up rejects with 4900.
  • It stays open. The pop-up stays open while the client uses the wallet. Sign requests go to the same window and bring it to the front.
  • No automatic reconnect. The wagmi connector returns false from isAuthorized() on purpose. After a page load, the client connects again from a click.
  • After the client closes it, your next request needs a new click. If a request was waiting, you get a disconnect event.
  • On mobile it is a tab. The pop-up opens as a normal browser tab. The client switches back to your page when done.

Your site origin must be listed by Assetera. See Get your site listed.

On this page