Choose Address

By using the chooseAddress() method, you are asking the user to select one of their addresses to provide to your website. This can be used for example to find out which address your app should send funds to.

Note: This method should not be used as a login or authentication mechanism, as it does not provide any security that the user actually owns the provided address!

Table of Contents

  1. Request
  2. Options
  3. Result

Request

Result: -

const options = {
  appName: 'Hub API Docs',
};

// All client requests are async and return a promise
const addressInfo = await hubApi.chooseAddress(options);

Options

The appName is the only parameter for this request.

(On mobile, scroll right to see the whole table.)

Option Type Required? Description
appName string yes The name of your app, should be as short as possible.

Result

The request’s result contains an address string as address and a label:

interface Address {
    address: string;  // Human-readable address
    label: string;    // The address's label (name)
}