AddressToScriptHash

Converts an address to scripthash.

Input Arguments

Parameter
Description

address: string

N3 account address.

Success Response

Parameter
Description

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'
}

最后更新于