Type Alias MessagePartialSigner<TAddress>

MessagePartialSigner<TAddress>: Readonly<{
    address: Address<TAddress>;
    signMessages(messages: readonly Readonly<{
        content: Uint8Array;
        signatures: SignatureDictionary;
    }>[], config?: Readonly<{
        abortSignal?: AbortSignal;
    }>): Promise<readonly Readonly<Record<Address, SignatureBytes>>[]>;
}>

A signer interface that signs an array of SignableMessage | SignableMessages without modifying their content.

It defines a MessagePartialSigner#signMessages | signMessages function that returns a SignatureDictionary for each provided message. Such signature dictionaries are expected to be merged with the existing ones if any.

Type Parameters

  • TAddress extends string = string

    Supply a string literal to define a signer having a particular address.

const signer: MessagePartialSigner<'1234..5678'> = {
address: address('1234..5678'),
signMessages: async (
messages: SignableMessage[]
): Promise<SignatureDictionary[]> => {
// My custom signing logic.
},
};

Here are the main characteristics of this signer interface:

  • Parallel. When multiple signers sign the same message, we can perform this operation in parallel to obtain all their signatures.
  • Flexible order. The order in which we use these signers for a given message doesn’t matter.