AddressToScriptHash

Converts an address to scripthash.

Input Arguments

ParameterDescription

address: string

N3 account address.

Success Response

ParameterDescription

scriptHash: string

SctiptHash is the script hash of the N3 account.

Example

Request

neolineN3.AddressToScriptHash({ address: 'NQUN2zkzwpypEi6kvGYexy8cQKN2ycyJjF' })
.then(result => {
    const { scriptHash } = result;
    console.log('scriptHash' + scriptHash);
})
.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

{
    scriptHash: 'f0a33d62f32528c25e68951286f238ad24e30032'
}

最后更新于