Kit
Functions

getAddressDecoder

getAddressDecoder(): FixedSizeDecoder<Address<string>, 32>

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

Returns

FixedSizeDecoder<Address<string>, 32>

Example

import { getAddressDecoder } from '@solana/addresses';
 
const addressBytes = new Uint8Array([
    150, 183, 190,  48, 171,   8, 39, 156,
    122, 213, 172, 108, 193,  95, 26, 158,
    149, 243, 115, 254,  20, 200, 36,  30,
    248, 179, 178, 232, 220,  89, 53, 127
]);
const addressDecoder = getAddressDecoder();
const address = addressDecoder.decode(addressBytes); // B9Lf9z5BfNPT4d5KMeaBFx8x1G4CULZYR1jA2kmxRDka

On this page