getOffchainMessageApplicationDomainDecoder

function getOffchainMessageApplicationDomainDecoder(): FixedSizeDecoder<
    OffchainMessageApplicationDomain,
    32
>;

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

Returns

FixedSizeDecoder<OffchainMessageApplicationDomain, 32>

Example

import { getOffchainMessageApplicationDomainDecoder } from '@solana/offchain-messages';
 
const offchainMessageApplicationDomainBytes = new Uint8Array([
    247, 203,  28,  80,  52, 240, 169,  19,
     21, 103, 107, 119,  91, 235,  13,  48,
    194, 169, 148, 160,  78, 105, 235,  37,
    232, 160,  49,  47,  64,  89,  18, 153,
]);
const offchainMessageApplicationDomainDecoder = getOffchainMessageApplicationDomainDecoder();
const offchainMessageApplicationDomain =
    offchainMessageApplicationDomainDecoder.decode(offchainMessageApplicationDomainBytes);
    // HgHLLXT3BVA5m7x66tEp3YNatXLth1hJwVeCva2T9RNx

On this page