NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4918 most downloaded on npm
Core types and helpers for encoding and decoding byte arrays on Solana
Last release 7 days ago
28 Sep 2026
Ships fairly regularly
a new release about every 8 days
Nearly every release is documented
notes for 39 of 39 stable releases
1 version withdrawn
withdrawn after publishing
3 years old
2267 releases · first in 2023
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
```ts const codec = addCodecSizePrefix(getBase58Codec(), getU32Codec());
#2434 31916ae Thanks @lorisleiva! - Renamed mapCodec to transformCodec
#2397 a548de2 Thanks @lorisleiva! - Added a new addCodecSizePrefix primitive
const codec = addCodecSizePrefix(getBase58Codec(), getU32Codec());
codec.encode('hello world');
// 0x0b00000068656c6c6f20776f726c64
// | └-- Our encoded base-58 string.
// └-- Our encoded u32 size prefix.
#2419 89f399d Thanks @lorisleiva! - Added new addCodecSentinel primitive
The addCodecSentinel function provides a new way of delimiting the size of a codec. It allows us to add a sentinel to the end of the encoded data and to read until that sentinel is found when decoding. It accepts any codec and a Uint8Array sentinel responsible for delimiting the encoded data.
const codec = addCodecSentinel(getUtf8Codec(), new Uint8Array([255, 255]));
codec.encode('hello');
// 0x68656c6c6fffff
// | └-- Our sentinel.
// └-- Our encoded string.
#2400 ebb03cd Thanks @lorisleiva! - Added new containsBytes and getConstantCodec helpers
The containsBytes helper checks if a Uint8Array contains another Uint8Array at a given offset.
containsBytes(new Uint8Array([1, 2, 3, 4]), new Uint8Array([2, 3]), 1); // true
containsBytes(new Uint8Array([1, 2, 3, 4]), new Uint8Array([2, 3]), 2); // false
The getConstantCodec function accepts any Uint8Array and returns a Codec<void>. When encoding, it will set the provided Uint8Array as-is. When decoding, it will assert that the next bytes contain the provided Uint8Array and move the offset forward.
const codec = getConstantCodec(new Uint8Array([1, 2, 3]));
codec.encode(undefined); // 0x010203
codec.decode(new Uint8Array([1, 2, 3])); // undefined
codec.decode(new Uint8Array([1, 2, 4])); // Throws an error.
#2383 ce1be3f Thanks @lorisleiva! - getScalarEnumCodec is now called getEnumCodec
#2382 7e86583 Thanks @lorisleiva! - getDataEnumCodec is now called getDiscriminatedUnionCodec
#2411 2e5af9f Thanks @lorisleiva! - Renamed fixCodec to fixCodecSize
Updated dependencies [9370133, 89f399d, ebb03cd, ce1be3f, 82cf07f, 2d54650, bef9604, 7e86583, 288029a, 4ae78f5, 478443f]:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →