Kit
Type aliases

NoopSigner

NoopSigner<TAddress> = MessagePartialSigner<TAddress> & TransactionPartialSigner<TAddress>

Defines a Noop (No-Operation) signer that pretends to partially sign messages and transactions.

For a given Address, a Noop Signer can be created to offer an implementation of both the MessagePartialSigner and TransactionPartialSigner interfaces such that they do not sign anything. Namely, signing a transaction or a message with a NoopSigner will return an empty SignatureDictionary.

Type Parameters

Type ParameterDefault typeDescription
TAddress extends stringstringSupply a string literal to define a Noop signer having a particular address.

Example

import { address } from '@solana/addresses';
import { createNoopSigner } from '@solana/signers';
 
const signer = createNoopSigner(address('1234..5678'));
const [messageSignatures] = await signer.signMessages([message]);
const [transactionSignatures] = await signer.signTransactions([transaction]);
// ^ Both messageSignatures and transactionSignatures are empty.

Remarks

This signer may be useful:

  • For testing purposes.
  • For indicating that a given account is a signer and taking the responsibility to provide the signature for that account ourselves. For instance, if we need to send the transaction to a server that will sign it and send it for us.

See

createNoopSigner

On this page