partiallySignOffchainMessageWithSigners

function partiallySignOffchainMessageWithSigners(
    offchainMessage,
    config?,
): Promise<OffchainMessageEnvelope>;

Extracts all MessageSigners inside the provided offchain message and uses them to return a signed offchain message envelope.

It first uses all MessageModifyingSigners sequentially before using all MessagePartialSigners in parallel.

If a composite signer implements both interfaces, it will be used as a MessageModifyingSigner if no other signer implements that interface. Otherwise, it will be used as a MessagePartialSigner.

Parameters

ParameterType
offchainMessageOffchainMessageWithRequiredSignatories< | Readonly<{ address: Address<string>; }> | OffchainMessageSignatorySigner> & Omit<OffchainMessage, "requiredSignatories">
config?Readonly<{ abortSignal?: AbortSignal; }>

Returns

Promise<OffchainMessageEnvelope>

Example

const signedOffchainMessageEnvelope = await partiallySignOffchainMessageWithSigners(offchainMessage);

It also accepts an optional AbortSignal that will be propagated to all signers.

const signedOffchainMessageEnvelope = await partiallySignOffchainMessageWithSigners(offchainMessage, {
    abortSignal: myAbortController.signal,
});

See

signOffchainMessageWithSigners

On this page