ScriptHashToAddress

Converts a scripthash to address.

Input Arguments

ParameterDescription

scriptHash: string

SctiptHash is the script hash of the N3 account.

Success Response

ParameterDescription

address: string

N3 account address.

Example

Request

neolineN3.ScriptHashToAddress({ scriptHash: 'f0a33d62f32528c25e68951286f238ad24e30032' })
.then(result => {
    const { address } = result;
    console.log('address' + address);
})
.catch((error) => {
    const {type, description, data} = error;
    switch(type) {
        case 'NO_PROVIDER':
            console.log('No provider available.');
            break;
        case 'MALFORMED_INPUT':
            console.log('Please check your input');
            break;
        default:
            // Not an expected error object.  Just write the error to the console.
            console.error(error);
            break;
    }
});

Response

{
    address: 'NQUN2zkzwpypEi6kvGYexy8cQKN2ycyJjF'
}

最后更新于