partiallySignOffchainMessageEnvelope

function partiallySignOffchainMessageEnvelope<TOffchainMessageEnvelope>(
    keyPairs,
    offchainMessageEnvelope,
): Promise<TOffchainMessageEnvelope>;

Given an array of CryptoKey objects which are private keys pertaining to addresses that are required to sign an offchain message, this method will return a new signed offchain message envelope of type OffchainMessageEnvelope.

Though the resulting message might be signed by all required signers, this function will not assert that it is. A partially signed message is not complete, but can be serialized and deserialized.

Type Parameters

Type Parameter
TOffchainMessageEnvelope extends OffchainMessageEnvelope

Parameters

ParameterType
keyPairsCryptoKeyPair[]
offchainMessageEnvelopeTOffchainMessageEnvelope

Returns

Promise<TOffchainMessageEnvelope>

Example

import { generateKeyPair } from '@solana/keys';
import { partiallySignOffchainMessageEnvelope } from '@solana/offchain-messages';
 
const partiallySignedOffchainMessage = await partiallySignOffchainMessageEnvelope(
    [myPrivateKey],
    offchainMessageEnvelope,
);

See

signOffchainMessageEnvelope if you want to assert that the message is signed by all its required signers after signing.

On this page