Kit
Functions

getBlockhashDecoder

getBlockhashDecoder(): FixedSizeDecoder<Blockhash, 32>

Returns a decoder that you can use to convert an array of 32 bytes representing a blockhash to the base58-encoded representation of that blockhash.

Returns

FixedSizeDecoder<Blockhash, 32>

Example

import { getBlockhashDecoder } from '@solana/rpc-types';
 
const blockhashBytes = new Uint8Array([
    136, 123,  44, 249,  43,  19,  60,  14,
    144,  16, 168, 241, 121, 111,  70, 232,
    186,  26, 140, 202, 213,  64, 231,  82,
    179,  66, 103, 237,  52, 117, 217,  93
]);
const blockhashDecoder = getBlockhashDecoder();
const blockhash = blockhashDecoder.decode(blockhashBytes); // ABmPH5KDXX99u6woqFS5vfBGSNyKG42SzpvBMWWqAy48

On this page