signMessageWithoutSalt

Signs a provided messaged with an account selected by user. The specific string 010001f0 0000 is added to the hexString before signed. For the complete signing process, please go to Testbed.

Input Arguments

Parameter
Description

message: string

The message to sign

isJsonObject?: boolean

Whether message is a json object

Success Response

Parameter
Description

publicKey: string

Public key of account that signed message

data: string

Original message signed

message: string

Signed message

Error Response

Parameter
Description

type: string

The type of error which has occured

description: string

A description of the error which has occured

data: string

Any raw data associated with the error

Example

Request

neolineN3.signMessageWithoutSalt({
  message: 'Hello world'
})
.then(signedMessage => {
  const {
    publicKey,
    message,
    data
  } = signedMessage;

  console.log('Public key used to sign:', publicKey);
  console.log('Original message:', message);
  console.log('Signed data:', data);
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case 'UNKNOWN_ERROR':
        console.log(description);
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});

Response

{
  publicKey: '"02f9667a14b62a551f25a1b1ec4562e1c963ec6334d1ef5e088f3b5febddf4e648"',
  data: '"81bab889bb63fa1225cf4dd98f32e89575908b2510377f58c89bf84f4a71c5a6e8ee7a81f857ad9ee4fb30f1c7a97a2a33a597460186c3a854ec2c7f8b8901b0"',
  message: 'Hello world'
}

最后更新于