• A type guard that accepts a string as input. It will both return true if the string conforms to the Signature type and will refine the type for use in your program.

    Parameters

    • putativeSignature: string

    Returns putativeSignature is Signature

    import { isSignature } from '@solana/keys';

    if (isSignature(signature)) {
    // At this point, `signature` has been refined to a
    // `Signature` that can be used with the RPC.
    const {
    value: [status],
    } = await rpc.getSignatureStatuses([signature]).send();
    setSignatureStatus(status);
    } else {
    setError(`${signature} is not a transaction signature`);
    }