Skip to main content

Sign Message

To sign a message, you can use the signMessage method.


signMessage

Parameters

params

NameTypeDescription
paramsSignMessageParamsSign Message Parameters

SignMessageParams

NameTypeDescription
messagestringMessage to sign
fromstringAddress to sign message with

Returns

  • Promise<{ signature: string }> - Returns a promise that resolves to signature of the message

The signMessage function returns the signature property from the response object wrapped in a Promise. This means that when you call this function, you'll receive a Promise that, when resolved, will provide the message signature as a string.

Example

const message = "test message";
const res = await torus?.signMessage({
message,
from: "xrpl address",
});