• This helper combines asserting that a bigint represents a Unix timestamp with coercing it to the UnixTimestamp type. It's best used with untrusted input.

    Parameters

    • putativeTimestamp: bigint

    Returns UnixTimestamp

    import { unixTimestamp } from '@solana/rpc-types';

    const timestamp = unixTimestamp(-42n); // Wednesday, December 31, 1969 3:59:18 PM GMT-08:00