pickAddress

Returns the NEO N3 account selected by the user.

Input Arguments

None

Success Response

Parameter
Description

label: string

A label the users has set to identify their wallet

address: string

The NEO N3 account address selected by the user

Example

Request

neolineN3.pickAddress()
.then(result => {
    const { label, address } = result;
    console.log('label:' + label);
    console.log('address' + address);
})
.catch((error) => {
    const {type, description, data} = error;
    switch(type) {
        case 'NO_PROVIDER':
            console.log('No provider available.');
            break;
        case 'CANCELED':
            console.log('The user cancels, or refuses the dapps request');
            break;
        default:
            // Not an expected error object.  Just write the error to the console.
            console.error(error);
            break;
    }
});

Response

{
    label: 'N3-Name',
    address: 'NfuwpaQ1A2xaeVbxWe8FRtaRgaMa8yF3YM'
}

最后更新于