signMessages
signMessages(
config,messages):Promise<SignMessageResponse[]>
Signs multiple messages in a single request. Supports ECDSA and BIP322 protocols.
WARNING
signMessages is currently supported only by the Xverse connector. If the active connector does not support signMessages, the core implementation falls back to signing each message individually using signMessage.
Import
ts
import { signMessages } from "@midl/core";Example
ts
const signatures = await signMessages(config, [
{ address: "bc1q...", message: "Hello, world!" },
{ address: "bc1q...", message: "Second message" },
]);
console.log(signatures);Parameters
| Name | Type | Description |
|---|---|---|
| config | Config | The configuration object |
| messages | SignMessageParams[] | The messages to sign |
SignMessageParams
| Name | Type | Description |
|---|---|---|
| address | string | The address to sign the message with |
| message | string | The message to sign |
| protocol | SignMessageProtocol | The protocol to use for signing (optional) |
SignMessageProtocol (enum)
| Name | Value |
|---|---|
Ecdsa | "ECDSA" |
Bip322 | "BIP322" |
Returns
Promise<SignMessageResponse[]>
The signature responses
SignMessageResponse
| Name | Type | Description |
|---|---|---|
| signature | string | Base64 encoded signature |
| address | string | The address that signed the message |
| protocol | string | The protocol used to sign the message |
| messageHash? | string | The message hash |