Type aliases
MessageModifyingSigner
MessageModifyingSigner<
TAddress
> =Readonly
<{address
:Address
<TAddress
>;modifyAndSignMessages
:Promise
<readonlyReadonly
<{content
:Uint8Array
;signatures
:SignatureDictionary
; }>[]>; }>
A signer interface that potentially modifies the content of the provided SignableMessages before signing them.
For instance, this enables wallets to prefix or suffix nonces to the messages they sign. For each message, instead of returning a SignatureDirectory, the MessageModifyingSigner#modifyAndSignMessages | modifyAndSignMessages function returns an updated SignableMessage with a potentially modified content and signature dictionary.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
TAddress extends string | string | Supply a string literal to define a signer having a particular address. |
Example
Remarks
Here are the main characteristics of this signer interface:
- Sequential. Contrary to partial signers, these cannot be executed in parallel as each call can modify the content of the message.
- First signers. For a given message, a modifying signer must always be used before a partial signer as the former will likely modify the message and thus impact the outcome of the latter.
- Potential conflicts. If more than one modifying signer is provided, the second signer may invalidate the signature of the first one. However, modifying signers may decide not to modify a message based on the existence of signatures for that message.