Skip to Content
Assetera Docs
Distribution partnersAssetera Wallet

Quick start

Install @asseteragmbh/wallet-connector, open the Assetera Wallet onboarding from a click, get the address, ask for a signature if you need one, close the pop-up.

This page builds the onboarding button. One click opens the wallet pop-up. The client creates a wallet or gets the wallet they already have. Your page gets the address. It can ask the client to sign a message in the same pop-up. Then it closes the pop-up.

Preview

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

If you sell instruments through Assetera

Register the wallet with Assetera the same way as any other wallet. Use signMessage to sign the ownership challenge in the open pop-up. The steps are in Register a client's wallet. This page does not repeat them.

Before you start

You needWhere it comes from
Your site origin on the wallet's partner listAssetera, see Get your site listed
The wallet URLAssetera, when it lists your origin

Install

npm install @asseteragmbh/wallet-connector

The onboarding flow on this page needs version 0.2.0 or later. In that version the pop-up stays open after onboarding, so that the client can sign a message in it.

The onboarding button

Open the onboarding inside the click

Call openAsseteraOnboarding first in the click handler. Do not await anything before it. Browsers block a pop-up that opens after an asynchronous step.

onboarding-button.ts (browser)
import { OnboardingError, openAsseteraOnboarding } from "@asseteragmbh/wallet-connector";

button.addEventListener("click", async () => {
  try {
    // No await before this call: it opens the pop-up and must run inside the click.
    const wallet = await openAsseteraOnboarding({
      walletUrl: process.env.NEXT_PUBLIC_ASSETERA_WALLET_URL!,
      chain: "eip155:80002",          // CAIP-2 chain id
      locale: "en",                   // "en" or "de"
      partnerName: "Your Bank",       // shown in the overlay text only
    });
    try {
      showWallet(wallet.address, wallet.chain, wallet.created);
      await proveOwnership(wallet);    // optional, next step
    } finally {
      wallet.close();                  // always close the pop-up
    }
  } catch (error) {
    if (error instanceof OnboardingError) showError(error.code);
  }
});

showWallet and showError are your own functions.

Ask for a signature in the open pop-up (optional)

The promise resolves when the client has a wallet. The pop-up stays open. If you need a signature, pass the message to wallet.signMessage. The client confirms it in the pop-up. You can use this for example to prove ownership of the address to your own backend.

prove-ownership.ts (browser)
import type { OnboardingResult } from "@asseteragmbh/wallet-connector";

async function proveOwnership(wallet: OnboardingResult) {
  const message = await getMessageFromYourBackend(wallet.address);

  // EIP-191 personal_sign. Rejects with OnboardingError("cancelled") if the client declines.
  const signature = await wallet.signMessage(message);

  await sendSignatureToYourBackend(wallet.address, message, signature);
}

getMessageFromYourBackend and sendSignatureToYourBackend stand for your own calls. Show the message to the client unchanged. Skip this step if you need only the address.

Close the pop-up

Call wallet.close() when you are done, also after an error. It closes the pop-up and removes the overlay.

Options

OptionRequiredMeaning
walletUrlyesThe wallet URL that Assetera gave you.
chainyesThe CAIP-2 chain id for the wallet, for example eip155:80002.
localenoThe wizard language, "en" or "de".
partnerNamenoYour name, used only in the overlay text.
overlaynotrue (default) shows a dimming overlay on your page. false hides it. An object { title, body, focus, cancel, blocked } replaces its text.
addWalletnotrue asks for one more wallet, even when the client already has one.
popupFeaturesnoThe window.open feature string. The default is a centred pop-up.

The result

FieldMeaning
addressThe wallet address.
chainThe CAIP-2 chain id.
createdtrue when the wallet was created in this run. false when the client already had it.
signMessage(message)Asks the client to sign message in the open pop-up (EIP-191 personal_sign). Returns the signature.
close()Closes the pop-up and removes the overlay. You can call it more than once.

If you do not need a signature, call close() at once.

Errors

openAsseteraOnboarding and signMessage reject with an OnboardingError. Use its code.

codeWhat happenedWhat to show the client
popup_blockedThe browser blocked the pop-up. No overlay is shown.Allow pop-ups for this site and try again.
closedThe client closed the pop-up before the end, or signMessage was called after the pop-up was gone.The wallet window was closed. Start again at any time.
cancelledThe client cancelled in the wizard or in the overlay, or declined the signature.You stopped the setup. Start again at any time.
refusedThe wallet refused the onboarding.The wallet could not be set up. Contact support.
failedAnother error in the wallet. message has the detail.The wallet could not be set up. Try again later.
invalid_optionsThe chain is not a CAIP-2 EVM id, or the wallet URL is not valid.A configuration error on your side. Log it.

More symptoms and fixes are in Troubleshooting.

On this page