Socket
Socket
Sign inDemoInstall

@solana/codecs-data-structures

Package Overview
Dependencies
Maintainers
14
Versions
1046
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/codecs-data-structures - npm Package Compare versions

Comparing version 2.0.0-experimental.32b59a5 to 2.0.0-experimental.3690b65

190

dist/index.browser.js

@@ -73,6 +73,6 @@ import { mergeBytes, combineCodec, assertByteArrayHasEnoughBytesForCodec, assertFixedSizeCodec, assertByteArrayIsNotEmptyForCodec, fixEncoder, fixDecoder, fixBytes } from '@solana/codecs-core';

}
function getArrayEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getArrayEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
encode: (value) => {

@@ -86,6 +86,6 @@ if (typeof size === "number") {

}
function getArrayDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getArrayDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -107,11 +107,11 @@ if (typeof size === "object" && bytes.slice(offset).length === 0) {

}
function getArrayCodec(item, options = {}) {
return combineCodec(getArrayEncoder(item, options), getArrayDecoder(item, options));
function getArrayCodec(item, config = {}) {
return combineCodec(getArrayEncoder(item, config), getArrayDecoder(item, config));
}
var getBitArrayEncoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayEncoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";
return {
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
encode(value) {

@@ -137,5 +137,5 @@ const bytes = [];

};
var getBitArrayDecoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayDecoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";

@@ -161,3 +161,3 @@ return {

},
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
fixedSize: size,

@@ -167,8 +167,8 @@ maxSize: size

};
var getBitArrayCodec = (size, options = {}) => combineCodec(getBitArrayEncoder(size, options), getBitArrayDecoder(size, options));
function getBooleanEncoder(options = {}) {
const size = options.size ?? getU8Encoder();
var getBitArrayCodec = (size, config = {}) => combineCodec(getBitArrayEncoder(size, config), getBitArrayDecoder(size, config));
function getBooleanEncoder(config = {}) {
const size = config.size ?? getU8Encoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
return {
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
encode: (value) => size.encode(value ? 1 : 0),

@@ -179,4 +179,4 @@ fixedSize: size.fixedSize,

}
function getBooleanDecoder(options = {}) {
const size = options.size ?? getU8Decoder();
function getBooleanDecoder(config = {}) {
const size = config.size ?? getU8Decoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");

@@ -189,3 +189,3 @@ return {

},
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
fixedSize: size.fixedSize,

@@ -195,9 +195,9 @@ maxSize: size.fixedSize

}
function getBooleanCodec(options = {}) {
return combineCodec(getBooleanEncoder(options), getBooleanDecoder(options));
function getBooleanCodec(config = {}) {
return combineCodec(getBooleanEncoder(config), getBooleanDecoder(config));
}
function getBytesEncoder(options = {}) {
const size = options.size ?? "variable";
function getBytesEncoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteEncoder = {

@@ -224,6 +224,6 @@ description,

}
function getBytesDecoder(options = {}) {
const size = options.size ?? "variable";
function getBytesDecoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteDecoder = {

@@ -259,4 +259,4 @@ decode: (bytes, offset = 0) => {

}
function getBytesCodec(options = {}) {
return combineCodec(getBytesEncoder(options), getBytesDecoder(options));
function getBytesCodec(config = {}) {
return combineCodec(getBytesEncoder(config), getBytesDecoder(config));
}

@@ -274,6 +274,6 @@ function dataEnumCodecHelper(variants, prefix, description) {

}
function getDataEnumEncoder(variants, options = {}) {
const prefix = options.size ?? getU8Encoder();
function getDataEnumEncoder(variants, config = {}) {
const prefix = config.size ?? getU8Encoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
encode: (variant) => {

@@ -293,6 +293,6 @@ const discriminator = variants.findIndex(([key]) => variant.__kind === key);

}
function getDataEnumDecoder(variants, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getDataEnumDecoder(variants, config = {}) {
const prefix = config.size ?? getU8Decoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
decode: (bytes, offset = 0) => {

@@ -314,4 +314,4 @@ assertByteArrayIsNotEmptyForCodec("dataEnum", bytes, offset);

}
function getDataEnumCodec(variants, options = {}) {
return combineCodec(getDataEnumEncoder(variants, options), getDataEnumDecoder(variants, options));
function getDataEnumCodec(variants, config = {}) {
return combineCodec(getDataEnumEncoder(variants, config), getDataEnumDecoder(variants, config));
}

@@ -328,6 +328,6 @@ function mapCodecHelper(key, value, size, description) {

}
function getMapEncoder(key, value, options = {}) {
const size = options.size ?? getU32Encoder();
function getMapEncoder(key, value, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
encode: (map) => {

@@ -342,6 +342,6 @@ if (typeof size === "number") {

}
function getMapDecoder(key, value, options = {}) {
const size = options.size ?? getU32Decoder();
function getMapDecoder(key, value, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
decode: (bytes, offset = 0) => {

@@ -370,4 +370,4 @@ const map = /* @__PURE__ */ new Map();

}
function getMapCodec(key, value, options = {}) {
return combineCodec(getMapEncoder(key, value, options), getMapDecoder(key, value, options));
function getMapCodec(key, value, config = {}) {
return combineCodec(getMapEncoder(key, value, config), getMapDecoder(key, value, config));
}

@@ -389,7 +389,7 @@ function nullableCodecHelper(item, prefix, fixed, description) {

}
function getNullableEncoder(item, options = {}) {
const prefix = options.prefix ?? getU8Encoder();
const fixed = options.fixed ?? false;
function getNullableEncoder(item, config = {}) {
const prefix = config.prefix ?? getU8Encoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
encode: (option) => {

@@ -403,7 +403,7 @@ const prefixByte = prefix.encode(Number(option !== null));

}
function getNullableDecoder(item, options = {}) {
const prefix = options.prefix ?? getU8Decoder();
const fixed = options.fixed ?? false;
function getNullableDecoder(item, config = {}) {
const prefix = config.prefix ?? getU8Decoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
decode: (bytes, offset = 0) => {

@@ -425,4 +425,4 @@ if (bytes.length - offset <= 0) {

}
function getNullableCodec(item, options = {}) {
return combineCodec(getNullableEncoder(item, options), getNullableDecoder(item, options));
function getNullableCodec(item, config = {}) {
return combineCodec(getNullableEncoder(item, config), getNullableDecoder(item, config));
}

@@ -449,5 +449,5 @@ function scalarEnumCoderHelper(constructor, prefix, description) {

}
function getScalarEnumEncoder(constructor, options = {}) {
const prefix = options.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, options.description);
function getScalarEnumEncoder(constructor, config = {}) {
const prefix = config.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, config.description);
return {

@@ -474,8 +474,8 @@ description,

}
function getScalarEnumDecoder(constructor, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getScalarEnumDecoder(constructor, config = {}) {
const prefix = config.size ?? getU8Decoder();
const { description, fixedSize, maxSize, minRange, maxRange, isNumericEnum, enumValues } = scalarEnumCoderHelper(
constructor,
prefix,
options.description
config.description
);

@@ -500,4 +500,4 @@ return {

}
function getScalarEnumCodec(constructor, options = {}) {
return combineCodec(getScalarEnumEncoder(constructor, options), getScalarEnumDecoder(constructor, options));
function getScalarEnumCodec(constructor, config = {}) {
return combineCodec(getScalarEnumEncoder(constructor, config), getScalarEnumDecoder(constructor, config));
}

@@ -514,6 +514,6 @@ function setCodecHelper(item, size, description) {

}
function getSetEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getSetEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
encode: (set) => {

@@ -528,6 +528,6 @@ if (typeof size === "number" && set.size !== size) {

}
function getSetDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getSetDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -549,4 +549,4 @@ const set = /* @__PURE__ */ new Set();

}
function getSetCodec(item, options = {}) {
return combineCodec(getSetEncoder(item, options), getSetDecoder(item, options));
function getSetCodec(item, config = {}) {
return combineCodec(getSetEncoder(item, config), getSetDecoder(item, config));
}

@@ -561,5 +561,5 @@ function structCodecHelper(fields, description) {

}
function getStructEncoder(fields, options = {}) {
function getStructEncoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
encode: (struct) => {

@@ -571,5 +571,5 @@ const fieldBytes = fields.map(([key, codec]) => codec.encode(struct[key]));

}
function getStructDecoder(fields, options = {}) {
function getStructDecoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
decode: (bytes, offset = 0) => {

@@ -586,4 +586,4 @@ const struct = {};

}
function getStructCodec(fields, options = {}) {
return combineCodec(getStructEncoder(fields, options), getStructDecoder(fields, options));
function getStructCodec(fields, config = {}) {
return combineCodec(getStructEncoder(fields, config), getStructDecoder(fields, config));
}

@@ -598,5 +598,5 @@ function tupleCodecHelper(items, description) {

}
function getTupleEncoder(items, options = {}) {
function getTupleEncoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
encode: (value) => {

@@ -608,5 +608,5 @@ assertValidNumberOfItemsForCodec("tuple", items.length, value.length);

}
function getTupleDecoder(items, options = {}) {
function getTupleDecoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
decode: (bytes, offset = 0) => {

@@ -623,11 +623,11 @@ const values = [];

}
function getTupleCodec(items, options = {}) {
function getTupleCodec(items, config = {}) {
return combineCodec(
getTupleEncoder(items, options),
getTupleDecoder(items, options)
getTupleEncoder(items, config),
getTupleDecoder(items, config)
);
}
function getUnitEncoder(options = {}) {
function getUnitEncoder(config = {}) {
return {
description: options.description ?? "unit",
description: config.description ?? "unit",
encode: () => new Uint8Array(),

@@ -638,6 +638,6 @@ fixedSize: 0,

}
function getUnitDecoder(options = {}) {
function getUnitDecoder(config = {}) {
return {
decode: (_bytes, offset = 0) => [void 0, offset],
description: options.description ?? "unit",
description: config.description ?? "unit",
fixedSize: 0,

@@ -647,8 +647,6 @@ maxSize: 0

}
function getUnitCodec(options = {}) {
return combineCodec(getUnitEncoder(options), getUnitDecoder(options));
function getUnitCodec(config = {}) {
return combineCodec(getUnitEncoder(config), getUnitDecoder(config));
}
export { assertValidNumberOfItemsForCodec, decodeArrayLikeCodecSize, getArrayCodec, getArrayDecoder, getArrayEncoder, getArrayLikeCodecSizeDescription, getArrayLikeCodecSizeFromChildren, getArrayLikeCodecSizePrefix, getBitArrayCodec, getBitArrayDecoder, getBitArrayEncoder, getBooleanCodec, getBooleanDecoder, getBooleanEncoder, getBytesCodec, getBytesDecoder, getBytesEncoder, getDataEnumCodec, getDataEnumDecoder, getDataEnumEncoder, getMapCodec, getMapDecoder, getMapEncoder, getNullableCodec, getNullableDecoder, getNullableEncoder, getScalarEnumCodec, getScalarEnumDecoder, getScalarEnumEncoder, getSetCodec, getSetDecoder, getSetEncoder, getStructCodec, getStructDecoder, getStructEncoder, getTupleCodec, getTupleDecoder, getTupleEncoder, getUnitCodec, getUnitDecoder, getUnitEncoder };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map

@@ -113,7 +113,7 @@ this.globalThis = this.globalThis || {};

if (input.size > 1) {
littleEndian = !("endian" in input.options) || input.options.endian === 0;
littleEndian = !("endian" in input.config) || input.config.endian === 0;
defaultDescription += littleEndian ? "(le)" : "(be)";
}
return {
description: input.options.description ?? defaultDescription,
description: input.config.description ?? defaultDescription,
fixedSize: input.size,

@@ -159,5 +159,5 @@ littleEndian,

}
var getU32Encoder = (options = {}) => numberEncoderFactory({
var getU32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u32",
options,
range: [0, Number("0xffffffff")],

@@ -167,11 +167,11 @@ set: (view, value, le) => view.setUint32(0, value, le),

});
var getU32Decoder = (options = {}) => numberDecoderFactory({
var getU32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getUint32(0, le),
name: "u32",
options,
size: 4
});
var getU8Encoder = (options = {}) => numberEncoderFactory({
var getU8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u8",
options,
range: [0, Number("0xff")],

@@ -181,6 +181,6 @@ set: (view, value) => view.setUint8(0, value),

});
var getU8Decoder = (options = {}) => numberDecoderFactory({
var getU8Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view) => view.getUint8(0),
name: "u8",
options,
size: 1

@@ -256,6 +256,6 @@ });

}
function getArrayEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getArrayEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
encode: (value) => {

@@ -269,6 +269,6 @@ if (typeof size === "number") {

}
function getArrayDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getArrayDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -290,13 +290,13 @@ if (typeof size === "object" && bytes.slice(offset).length === 0) {

}
function getArrayCodec(item, options = {}) {
return combineCodec(getArrayEncoder(item, options), getArrayDecoder(item, options));
function getArrayCodec(item, config = {}) {
return combineCodec(getArrayEncoder(item, config), getArrayDecoder(item, config));
}
// src/bit-array.ts
var getBitArrayEncoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayEncoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";
return {
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
encode(value) {

@@ -322,5 +322,5 @@ const bytes = [];

};
var getBitArrayDecoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayDecoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";

@@ -346,3 +346,3 @@ return {

},
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
fixedSize: size,

@@ -352,10 +352,10 @@ maxSize: size

};
var getBitArrayCodec = (size, options = {}) => combineCodec(getBitArrayEncoder(size, options), getBitArrayDecoder(size, options));
var getBitArrayCodec = (size, config = {}) => combineCodec(getBitArrayEncoder(size, config), getBitArrayDecoder(size, config));
// src/boolean.ts
function getBooleanEncoder(options = {}) {
const size = options.size ?? getU8Encoder();
function getBooleanEncoder(config = {}) {
const size = config.size ?? getU8Encoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
return {
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
encode: (value) => size.encode(value ? 1 : 0),

@@ -366,4 +366,4 @@ fixedSize: size.fixedSize,

}
function getBooleanDecoder(options = {}) {
const size = options.size ?? getU8Decoder();
function getBooleanDecoder(config = {}) {
const size = config.size ?? getU8Decoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");

@@ -376,3 +376,3 @@ return {

},
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
fixedSize: size.fixedSize,

@@ -382,11 +382,11 @@ maxSize: size.fixedSize

}
function getBooleanCodec(options = {}) {
return combineCodec(getBooleanEncoder(options), getBooleanDecoder(options));
function getBooleanCodec(config = {}) {
return combineCodec(getBooleanEncoder(config), getBooleanDecoder(config));
}
// src/bytes.ts
function getBytesEncoder(options = {}) {
const size = options.size ?? "variable";
function getBytesEncoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteEncoder = {

@@ -413,6 +413,6 @@ description,

}
function getBytesDecoder(options = {}) {
const size = options.size ?? "variable";
function getBytesDecoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteDecoder = {

@@ -448,4 +448,4 @@ decode: (bytes, offset = 0) => {

}
function getBytesCodec(options = {}) {
return combineCodec(getBytesEncoder(options), getBytesDecoder(options));
function getBytesCodec(config = {}) {
return combineCodec(getBytesEncoder(config), getBytesDecoder(config));
}

@@ -465,6 +465,6 @@

}
function getDataEnumEncoder(variants, options = {}) {
const prefix = options.size ?? getU8Encoder();
function getDataEnumEncoder(variants, config = {}) {
const prefix = config.size ?? getU8Encoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
encode: (variant) => {

@@ -484,6 +484,6 @@ const discriminator = variants.findIndex(([key]) => variant.__kind === key);

}
function getDataEnumDecoder(variants, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getDataEnumDecoder(variants, config = {}) {
const prefix = config.size ?? getU8Decoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
decode: (bytes, offset = 0) => {

@@ -505,4 +505,4 @@ assertByteArrayIsNotEmptyForCodec("dataEnum", bytes, offset);

}
function getDataEnumCodec(variants, options = {}) {
return combineCodec(getDataEnumEncoder(variants, options), getDataEnumDecoder(variants, options));
function getDataEnumCodec(variants, config = {}) {
return combineCodec(getDataEnumEncoder(variants, config), getDataEnumDecoder(variants, config));
}

@@ -521,6 +521,6 @@

}
function getMapEncoder(key, value, options = {}) {
const size = options.size ?? getU32Encoder();
function getMapEncoder(key, value, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
encode: (map) => {

@@ -535,6 +535,6 @@ if (typeof size === "number") {

}
function getMapDecoder(key, value, options = {}) {
const size = options.size ?? getU32Decoder();
function getMapDecoder(key, value, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
decode: (bytes, offset = 0) => {

@@ -563,4 +563,4 @@ const map = /* @__PURE__ */ new Map();

}
function getMapCodec(key, value, options = {}) {
return combineCodec(getMapEncoder(key, value, options), getMapDecoder(key, value, options));
function getMapCodec(key, value, config = {}) {
return combineCodec(getMapEncoder(key, value, config), getMapDecoder(key, value, config));
}

@@ -584,7 +584,7 @@

}
function getNullableEncoder(item, options = {}) {
const prefix = options.prefix ?? getU8Encoder();
const fixed = options.fixed ?? false;
function getNullableEncoder(item, config = {}) {
const prefix = config.prefix ?? getU8Encoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
encode: (option) => {

@@ -598,7 +598,7 @@ const prefixByte = prefix.encode(Number(option !== null));

}
function getNullableDecoder(item, options = {}) {
const prefix = options.prefix ?? getU8Decoder();
const fixed = options.fixed ?? false;
function getNullableDecoder(item, config = {}) {
const prefix = config.prefix ?? getU8Decoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
decode: (bytes, offset = 0) => {

@@ -620,4 +620,4 @@ if (bytes.length - offset <= 0) {

}
function getNullableCodec(item, options = {}) {
return combineCodec(getNullableEncoder(item, options), getNullableDecoder(item, options));
function getNullableCodec(item, config = {}) {
return combineCodec(getNullableEncoder(item, config), getNullableDecoder(item, config));
}

@@ -646,5 +646,5 @@

}
function getScalarEnumEncoder(constructor, options = {}) {
const prefix = options.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, options.description);
function getScalarEnumEncoder(constructor, config = {}) {
const prefix = config.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, config.description);
return {

@@ -671,8 +671,8 @@ description,

}
function getScalarEnumDecoder(constructor, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getScalarEnumDecoder(constructor, config = {}) {
const prefix = config.size ?? getU8Decoder();
const { description, fixedSize, maxSize, minRange, maxRange, isNumericEnum, enumValues } = scalarEnumCoderHelper(
constructor,
prefix,
options.description
config.description
);

@@ -697,4 +697,4 @@ return {

}
function getScalarEnumCodec(constructor, options = {}) {
return combineCodec(getScalarEnumEncoder(constructor, options), getScalarEnumDecoder(constructor, options));
function getScalarEnumCodec(constructor, config = {}) {
return combineCodec(getScalarEnumEncoder(constructor, config), getScalarEnumDecoder(constructor, config));
}

@@ -713,6 +713,6 @@

}
function getSetEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getSetEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
encode: (set) => {

@@ -727,6 +727,6 @@ if (typeof size === "number" && set.size !== size) {

}
function getSetDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getSetDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -748,4 +748,4 @@ const set = /* @__PURE__ */ new Set();

}
function getSetCodec(item, options = {}) {
return combineCodec(getSetEncoder(item, options), getSetDecoder(item, options));
function getSetCodec(item, config = {}) {
return combineCodec(getSetEncoder(item, config), getSetDecoder(item, config));
}

@@ -762,5 +762,5 @@

}
function getStructEncoder(fields, options = {}) {
function getStructEncoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
encode: (struct) => {

@@ -772,5 +772,5 @@ const fieldBytes = fields.map(([key, codec]) => codec.encode(struct[key]));

}
function getStructDecoder(fields, options = {}) {
function getStructDecoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
decode: (bytes, offset = 0) => {

@@ -787,4 +787,4 @@ const struct = {};

}
function getStructCodec(fields, options = {}) {
return combineCodec(getStructEncoder(fields, options), getStructDecoder(fields, options));
function getStructCodec(fields, config = {}) {
return combineCodec(getStructEncoder(fields, config), getStructDecoder(fields, config));
}

@@ -801,5 +801,5 @@

}
function getTupleEncoder(items, options = {}) {
function getTupleEncoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
encode: (value) => {

@@ -811,5 +811,5 @@ assertValidNumberOfItemsForCodec("tuple", items.length, value.length);

}
function getTupleDecoder(items, options = {}) {
function getTupleDecoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
decode: (bytes, offset = 0) => {

@@ -826,6 +826,6 @@ const values = [];

}
function getTupleCodec(items, options = {}) {
function getTupleCodec(items, config = {}) {
return combineCodec(
getTupleEncoder(items, options),
getTupleDecoder(items, options)
getTupleEncoder(items, config),
getTupleDecoder(items, config)
);

@@ -835,5 +835,5 @@ }

// src/unit.ts
function getUnitEncoder(options = {}) {
function getUnitEncoder(config = {}) {
return {
description: options.description ?? "unit",
description: config.description ?? "unit",
encode: () => new Uint8Array(),

@@ -844,6 +844,6 @@ fixedSize: 0,

}
function getUnitDecoder(options = {}) {
function getUnitDecoder(config = {}) {
return {
decode: (_bytes, offset = 0) => [void 0, offset],
description: options.description ?? "unit",
description: config.description ?? "unit",
fixedSize: 0,

@@ -853,4 +853,4 @@ maxSize: 0

}
function getUnitCodec(options = {}) {
return combineCodec(getUnitEncoder(options), getUnitDecoder(options));
function getUnitCodec(config = {}) {
return combineCodec(getUnitEncoder(config), getUnitDecoder(config));
}

@@ -857,0 +857,0 @@

@@ -73,6 +73,6 @@ import { mergeBytes, combineCodec, assertByteArrayHasEnoughBytesForCodec, assertFixedSizeCodec, assertByteArrayIsNotEmptyForCodec, fixEncoder, fixDecoder, fixBytes } from '@solana/codecs-core';

}
function getArrayEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getArrayEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
encode: (value) => {

@@ -86,6 +86,6 @@ if (typeof size === "number") {

}
function getArrayDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getArrayDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -107,11 +107,11 @@ if (typeof size === "object" && bytes.slice(offset).length === 0) {

}
function getArrayCodec(item, options = {}) {
return combineCodec(getArrayEncoder(item, options), getArrayDecoder(item, options));
function getArrayCodec(item, config = {}) {
return combineCodec(getArrayEncoder(item, config), getArrayDecoder(item, config));
}
var getBitArrayEncoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayEncoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";
return {
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
encode(value) {

@@ -137,5 +137,5 @@ const bytes = [];

};
var getBitArrayDecoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayDecoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";

@@ -161,3 +161,3 @@ return {

},
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
fixedSize: size,

@@ -167,8 +167,8 @@ maxSize: size

};
var getBitArrayCodec = (size, options = {}) => combineCodec(getBitArrayEncoder(size, options), getBitArrayDecoder(size, options));
function getBooleanEncoder(options = {}) {
const size = options.size ?? getU8Encoder();
var getBitArrayCodec = (size, config = {}) => combineCodec(getBitArrayEncoder(size, config), getBitArrayDecoder(size, config));
function getBooleanEncoder(config = {}) {
const size = config.size ?? getU8Encoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
return {
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
encode: (value) => size.encode(value ? 1 : 0),

@@ -179,4 +179,4 @@ fixedSize: size.fixedSize,

}
function getBooleanDecoder(options = {}) {
const size = options.size ?? getU8Decoder();
function getBooleanDecoder(config = {}) {
const size = config.size ?? getU8Decoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");

@@ -189,3 +189,3 @@ return {

},
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
fixedSize: size.fixedSize,

@@ -195,9 +195,9 @@ maxSize: size.fixedSize

}
function getBooleanCodec(options = {}) {
return combineCodec(getBooleanEncoder(options), getBooleanDecoder(options));
function getBooleanCodec(config = {}) {
return combineCodec(getBooleanEncoder(config), getBooleanDecoder(config));
}
function getBytesEncoder(options = {}) {
const size = options.size ?? "variable";
function getBytesEncoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteEncoder = {

@@ -224,6 +224,6 @@ description,

}
function getBytesDecoder(options = {}) {
const size = options.size ?? "variable";
function getBytesDecoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteDecoder = {

@@ -259,4 +259,4 @@ decode: (bytes, offset = 0) => {

}
function getBytesCodec(options = {}) {
return combineCodec(getBytesEncoder(options), getBytesDecoder(options));
function getBytesCodec(config = {}) {
return combineCodec(getBytesEncoder(config), getBytesDecoder(config));
}

@@ -274,6 +274,6 @@ function dataEnumCodecHelper(variants, prefix, description) {

}
function getDataEnumEncoder(variants, options = {}) {
const prefix = options.size ?? getU8Encoder();
function getDataEnumEncoder(variants, config = {}) {
const prefix = config.size ?? getU8Encoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
encode: (variant) => {

@@ -293,6 +293,6 @@ const discriminator = variants.findIndex(([key]) => variant.__kind === key);

}
function getDataEnumDecoder(variants, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getDataEnumDecoder(variants, config = {}) {
const prefix = config.size ?? getU8Decoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
decode: (bytes, offset = 0) => {

@@ -314,4 +314,4 @@ assertByteArrayIsNotEmptyForCodec("dataEnum", bytes, offset);

}
function getDataEnumCodec(variants, options = {}) {
return combineCodec(getDataEnumEncoder(variants, options), getDataEnumDecoder(variants, options));
function getDataEnumCodec(variants, config = {}) {
return combineCodec(getDataEnumEncoder(variants, config), getDataEnumDecoder(variants, config));
}

@@ -328,6 +328,6 @@ function mapCodecHelper(key, value, size, description) {

}
function getMapEncoder(key, value, options = {}) {
const size = options.size ?? getU32Encoder();
function getMapEncoder(key, value, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
encode: (map) => {

@@ -342,6 +342,6 @@ if (typeof size === "number") {

}
function getMapDecoder(key, value, options = {}) {
const size = options.size ?? getU32Decoder();
function getMapDecoder(key, value, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
decode: (bytes, offset = 0) => {

@@ -370,4 +370,4 @@ const map = /* @__PURE__ */ new Map();

}
function getMapCodec(key, value, options = {}) {
return combineCodec(getMapEncoder(key, value, options), getMapDecoder(key, value, options));
function getMapCodec(key, value, config = {}) {
return combineCodec(getMapEncoder(key, value, config), getMapDecoder(key, value, config));
}

@@ -389,7 +389,7 @@ function nullableCodecHelper(item, prefix, fixed, description) {

}
function getNullableEncoder(item, options = {}) {
const prefix = options.prefix ?? getU8Encoder();
const fixed = options.fixed ?? false;
function getNullableEncoder(item, config = {}) {
const prefix = config.prefix ?? getU8Encoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
encode: (option) => {

@@ -403,7 +403,7 @@ const prefixByte = prefix.encode(Number(option !== null));

}
function getNullableDecoder(item, options = {}) {
const prefix = options.prefix ?? getU8Decoder();
const fixed = options.fixed ?? false;
function getNullableDecoder(item, config = {}) {
const prefix = config.prefix ?? getU8Decoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
decode: (bytes, offset = 0) => {

@@ -425,4 +425,4 @@ if (bytes.length - offset <= 0) {

}
function getNullableCodec(item, options = {}) {
return combineCodec(getNullableEncoder(item, options), getNullableDecoder(item, options));
function getNullableCodec(item, config = {}) {
return combineCodec(getNullableEncoder(item, config), getNullableDecoder(item, config));
}

@@ -449,5 +449,5 @@ function scalarEnumCoderHelper(constructor, prefix, description) {

}
function getScalarEnumEncoder(constructor, options = {}) {
const prefix = options.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, options.description);
function getScalarEnumEncoder(constructor, config = {}) {
const prefix = config.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, config.description);
return {

@@ -474,8 +474,8 @@ description,

}
function getScalarEnumDecoder(constructor, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getScalarEnumDecoder(constructor, config = {}) {
const prefix = config.size ?? getU8Decoder();
const { description, fixedSize, maxSize, minRange, maxRange, isNumericEnum, enumValues } = scalarEnumCoderHelper(
constructor,
prefix,
options.description
config.description
);

@@ -500,4 +500,4 @@ return {

}
function getScalarEnumCodec(constructor, options = {}) {
return combineCodec(getScalarEnumEncoder(constructor, options), getScalarEnumDecoder(constructor, options));
function getScalarEnumCodec(constructor, config = {}) {
return combineCodec(getScalarEnumEncoder(constructor, config), getScalarEnumDecoder(constructor, config));
}

@@ -514,6 +514,6 @@ function setCodecHelper(item, size, description) {

}
function getSetEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getSetEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
encode: (set) => {

@@ -528,6 +528,6 @@ if (typeof size === "number" && set.size !== size) {

}
function getSetDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getSetDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -549,4 +549,4 @@ const set = /* @__PURE__ */ new Set();

}
function getSetCodec(item, options = {}) {
return combineCodec(getSetEncoder(item, options), getSetDecoder(item, options));
function getSetCodec(item, config = {}) {
return combineCodec(getSetEncoder(item, config), getSetDecoder(item, config));
}

@@ -561,5 +561,5 @@ function structCodecHelper(fields, description) {

}
function getStructEncoder(fields, options = {}) {
function getStructEncoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
encode: (struct) => {

@@ -571,5 +571,5 @@ const fieldBytes = fields.map(([key, codec]) => codec.encode(struct[key]));

}
function getStructDecoder(fields, options = {}) {
function getStructDecoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
decode: (bytes, offset = 0) => {

@@ -586,4 +586,4 @@ const struct = {};

}
function getStructCodec(fields, options = {}) {
return combineCodec(getStructEncoder(fields, options), getStructDecoder(fields, options));
function getStructCodec(fields, config = {}) {
return combineCodec(getStructEncoder(fields, config), getStructDecoder(fields, config));
}

@@ -598,5 +598,5 @@ function tupleCodecHelper(items, description) {

}
function getTupleEncoder(items, options = {}) {
function getTupleEncoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
encode: (value) => {

@@ -608,5 +608,5 @@ assertValidNumberOfItemsForCodec("tuple", items.length, value.length);

}
function getTupleDecoder(items, options = {}) {
function getTupleDecoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
decode: (bytes, offset = 0) => {

@@ -623,11 +623,11 @@ const values = [];

}
function getTupleCodec(items, options = {}) {
function getTupleCodec(items, config = {}) {
return combineCodec(
getTupleEncoder(items, options),
getTupleDecoder(items, options)
getTupleEncoder(items, config),
getTupleDecoder(items, config)
);
}
function getUnitEncoder(options = {}) {
function getUnitEncoder(config = {}) {
return {
description: options.description ?? "unit",
description: config.description ?? "unit",
encode: () => new Uint8Array(),

@@ -638,6 +638,6 @@ fixedSize: 0,

}
function getUnitDecoder(options = {}) {
function getUnitDecoder(config = {}) {
return {
decode: (_bytes, offset = 0) => [void 0, offset],
description: options.description ?? "unit",
description: config.description ?? "unit",
fixedSize: 0,

@@ -647,6 +647,8 @@ maxSize: 0

}
function getUnitCodec(options = {}) {
return combineCodec(getUnitEncoder(options), getUnitDecoder(options));
function getUnitCodec(config = {}) {
return combineCodec(getUnitEncoder(config), getUnitDecoder(config));
}
export { assertValidNumberOfItemsForCodec, decodeArrayLikeCodecSize, getArrayCodec, getArrayDecoder, getArrayEncoder, getArrayLikeCodecSizeDescription, getArrayLikeCodecSizeFromChildren, getArrayLikeCodecSizePrefix, getBitArrayCodec, getBitArrayDecoder, getBitArrayEncoder, getBooleanCodec, getBooleanDecoder, getBooleanEncoder, getBytesCodec, getBytesDecoder, getBytesEncoder, getDataEnumCodec, getDataEnumDecoder, getDataEnumEncoder, getMapCodec, getMapDecoder, getMapEncoder, getNullableCodec, getNullableDecoder, getNullableEncoder, getScalarEnumCodec, getScalarEnumDecoder, getScalarEnumEncoder, getSetCodec, getSetDecoder, getSetEncoder, getStructCodec, getStructDecoder, getStructEncoder, getTupleCodec, getTupleDecoder, getTupleEncoder, getUnitCodec, getUnitDecoder, getUnitEncoder };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

@@ -73,6 +73,6 @@ import { mergeBytes, combineCodec, assertByteArrayHasEnoughBytesForCodec, assertFixedSizeCodec, assertByteArrayIsNotEmptyForCodec, fixEncoder, fixDecoder, fixBytes } from '@solana/codecs-core';

}
function getArrayEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getArrayEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
encode: (value) => {

@@ -86,6 +86,6 @@ if (typeof size === "number") {

}
function getArrayDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getArrayDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...arrayCodecHelper(item, size, options.description),
...arrayCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -107,11 +107,11 @@ if (typeof size === "object" && bytes.slice(offset).length === 0) {

}
function getArrayCodec(item, options = {}) {
return combineCodec(getArrayEncoder(item, options), getArrayDecoder(item, options));
function getArrayCodec(item, config = {}) {
return combineCodec(getArrayEncoder(item, config), getArrayDecoder(item, config));
}
var getBitArrayEncoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayEncoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";
return {
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
encode(value) {

@@ -137,5 +137,5 @@ const bytes = [];

};
var getBitArrayDecoder = (size, options = {}) => {
const parsedOptions = typeof options === "boolean" ? { backward: options } : options;
const backward = parsedOptions.backward ?? false;
var getBitArrayDecoder = (size, config = {}) => {
const parsedConfig = typeof config === "boolean" ? { backward: config } : config;
const backward = parsedConfig.backward ?? false;
const backwardSuffix = backward ? "; backward" : "";

@@ -161,3 +161,3 @@ return {

},
description: parsedOptions.description ?? `bitArray(${size}${backwardSuffix})`,
description: parsedConfig.description ?? `bitArray(${size}${backwardSuffix})`,
fixedSize: size,

@@ -167,8 +167,8 @@ maxSize: size

};
var getBitArrayCodec = (size, options = {}) => combineCodec(getBitArrayEncoder(size, options), getBitArrayDecoder(size, options));
function getBooleanEncoder(options = {}) {
const size = options.size ?? getU8Encoder();
var getBitArrayCodec = (size, config = {}) => combineCodec(getBitArrayEncoder(size, config), getBitArrayDecoder(size, config));
function getBooleanEncoder(config = {}) {
const size = config.size ?? getU8Encoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");
return {
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
encode: (value) => size.encode(value ? 1 : 0),

@@ -179,4 +179,4 @@ fixedSize: size.fixedSize,

}
function getBooleanDecoder(options = {}) {
const size = options.size ?? getU8Decoder();
function getBooleanDecoder(config = {}) {
const size = config.size ?? getU8Decoder();
assertFixedSizeCodec(size, "Codec [bool] requires a fixed size.");

@@ -189,3 +189,3 @@ return {

},
description: options.description ?? `bool(${size.description})`,
description: config.description ?? `bool(${size.description})`,
fixedSize: size.fixedSize,

@@ -195,9 +195,9 @@ maxSize: size.fixedSize

}
function getBooleanCodec(options = {}) {
return combineCodec(getBooleanEncoder(options), getBooleanDecoder(options));
function getBooleanCodec(config = {}) {
return combineCodec(getBooleanEncoder(config), getBooleanDecoder(config));
}
function getBytesEncoder(options = {}) {
const size = options.size ?? "variable";
function getBytesEncoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteEncoder = {

@@ -224,6 +224,6 @@ description,

}
function getBytesDecoder(options = {}) {
const size = options.size ?? "variable";
function getBytesDecoder(config = {}) {
const size = config.size ?? "variable";
const sizeDescription = typeof size === "object" ? size.description : `${size}`;
const description = options.description ?? `bytes(${sizeDescription})`;
const description = config.description ?? `bytes(${sizeDescription})`;
const byteDecoder = {

@@ -259,4 +259,4 @@ decode: (bytes, offset = 0) => {

}
function getBytesCodec(options = {}) {
return combineCodec(getBytesEncoder(options), getBytesDecoder(options));
function getBytesCodec(config = {}) {
return combineCodec(getBytesEncoder(config), getBytesDecoder(config));
}

@@ -274,6 +274,6 @@ function dataEnumCodecHelper(variants, prefix, description) {

}
function getDataEnumEncoder(variants, options = {}) {
const prefix = options.size ?? getU8Encoder();
function getDataEnumEncoder(variants, config = {}) {
const prefix = config.size ?? getU8Encoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
encode: (variant) => {

@@ -293,6 +293,6 @@ const discriminator = variants.findIndex(([key]) => variant.__kind === key);

}
function getDataEnumDecoder(variants, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getDataEnumDecoder(variants, config = {}) {
const prefix = config.size ?? getU8Decoder();
return {
...dataEnumCodecHelper(variants, prefix, options.description),
...dataEnumCodecHelper(variants, prefix, config.description),
decode: (bytes, offset = 0) => {

@@ -314,4 +314,4 @@ assertByteArrayIsNotEmptyForCodec("dataEnum", bytes, offset);

}
function getDataEnumCodec(variants, options = {}) {
return combineCodec(getDataEnumEncoder(variants, options), getDataEnumDecoder(variants, options));
function getDataEnumCodec(variants, config = {}) {
return combineCodec(getDataEnumEncoder(variants, config), getDataEnumDecoder(variants, config));
}

@@ -328,6 +328,6 @@ function mapCodecHelper(key, value, size, description) {

}
function getMapEncoder(key, value, options = {}) {
const size = options.size ?? getU32Encoder();
function getMapEncoder(key, value, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
encode: (map) => {

@@ -342,6 +342,6 @@ if (typeof size === "number") {

}
function getMapDecoder(key, value, options = {}) {
const size = options.size ?? getU32Decoder();
function getMapDecoder(key, value, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...mapCodecHelper(key, value, size, options.description),
...mapCodecHelper(key, value, size, config.description),
decode: (bytes, offset = 0) => {

@@ -370,4 +370,4 @@ const map = /* @__PURE__ */ new Map();

}
function getMapCodec(key, value, options = {}) {
return combineCodec(getMapEncoder(key, value, options), getMapDecoder(key, value, options));
function getMapCodec(key, value, config = {}) {
return combineCodec(getMapEncoder(key, value, config), getMapDecoder(key, value, config));
}

@@ -389,7 +389,7 @@ function nullableCodecHelper(item, prefix, fixed, description) {

}
function getNullableEncoder(item, options = {}) {
const prefix = options.prefix ?? getU8Encoder();
const fixed = options.fixed ?? false;
function getNullableEncoder(item, config = {}) {
const prefix = config.prefix ?? getU8Encoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
encode: (option) => {

@@ -403,7 +403,7 @@ const prefixByte = prefix.encode(Number(option !== null));

}
function getNullableDecoder(item, options = {}) {
const prefix = options.prefix ?? getU8Decoder();
const fixed = options.fixed ?? false;
function getNullableDecoder(item, config = {}) {
const prefix = config.prefix ?? getU8Decoder();
const fixed = config.fixed ?? false;
return {
...nullableCodecHelper(item, prefix, fixed, options.description),
...nullableCodecHelper(item, prefix, fixed, config.description),
decode: (bytes, offset = 0) => {

@@ -425,4 +425,4 @@ if (bytes.length - offset <= 0) {

}
function getNullableCodec(item, options = {}) {
return combineCodec(getNullableEncoder(item, options), getNullableDecoder(item, options));
function getNullableCodec(item, config = {}) {
return combineCodec(getNullableEncoder(item, config), getNullableDecoder(item, config));
}

@@ -449,5 +449,5 @@ function scalarEnumCoderHelper(constructor, prefix, description) {

}
function getScalarEnumEncoder(constructor, options = {}) {
const prefix = options.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, options.description);
function getScalarEnumEncoder(constructor, config = {}) {
const prefix = config.size ?? getU8Encoder();
const { description, fixedSize, maxSize, minRange, maxRange, stringValues, enumKeys, enumValues } = scalarEnumCoderHelper(constructor, prefix, config.description);
return {

@@ -474,8 +474,8 @@ description,

}
function getScalarEnumDecoder(constructor, options = {}) {
const prefix = options.size ?? getU8Decoder();
function getScalarEnumDecoder(constructor, config = {}) {
const prefix = config.size ?? getU8Decoder();
const { description, fixedSize, maxSize, minRange, maxRange, isNumericEnum, enumValues } = scalarEnumCoderHelper(
constructor,
prefix,
options.description
config.description
);

@@ -500,4 +500,4 @@ return {

}
function getScalarEnumCodec(constructor, options = {}) {
return combineCodec(getScalarEnumEncoder(constructor, options), getScalarEnumDecoder(constructor, options));
function getScalarEnumCodec(constructor, config = {}) {
return combineCodec(getScalarEnumEncoder(constructor, config), getScalarEnumDecoder(constructor, config));
}

@@ -514,6 +514,6 @@ function setCodecHelper(item, size, description) {

}
function getSetEncoder(item, options = {}) {
const size = options.size ?? getU32Encoder();
function getSetEncoder(item, config = {}) {
const size = config.size ?? getU32Encoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
encode: (set) => {

@@ -528,6 +528,6 @@ if (typeof size === "number" && set.size !== size) {

}
function getSetDecoder(item, options = {}) {
const size = options.size ?? getU32Decoder();
function getSetDecoder(item, config = {}) {
const size = config.size ?? getU32Decoder();
return {
...setCodecHelper(item, size, options.description),
...setCodecHelper(item, size, config.description),
decode: (bytes, offset = 0) => {

@@ -549,4 +549,4 @@ const set = /* @__PURE__ */ new Set();

}
function getSetCodec(item, options = {}) {
return combineCodec(getSetEncoder(item, options), getSetDecoder(item, options));
function getSetCodec(item, config = {}) {
return combineCodec(getSetEncoder(item, config), getSetDecoder(item, config));
}

@@ -561,5 +561,5 @@ function structCodecHelper(fields, description) {

}
function getStructEncoder(fields, options = {}) {
function getStructEncoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
encode: (struct) => {

@@ -571,5 +571,5 @@ const fieldBytes = fields.map(([key, codec]) => codec.encode(struct[key]));

}
function getStructDecoder(fields, options = {}) {
function getStructDecoder(fields, config = {}) {
return {
...structCodecHelper(fields, options.description),
...structCodecHelper(fields, config.description),
decode: (bytes, offset = 0) => {

@@ -586,4 +586,4 @@ const struct = {};

}
function getStructCodec(fields, options = {}) {
return combineCodec(getStructEncoder(fields, options), getStructDecoder(fields, options));
function getStructCodec(fields, config = {}) {
return combineCodec(getStructEncoder(fields, config), getStructDecoder(fields, config));
}

@@ -598,5 +598,5 @@ function tupleCodecHelper(items, description) {

}
function getTupleEncoder(items, options = {}) {
function getTupleEncoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
encode: (value) => {

@@ -608,5 +608,5 @@ assertValidNumberOfItemsForCodec("tuple", items.length, value.length);

}
function getTupleDecoder(items, options = {}) {
function getTupleDecoder(items, config = {}) {
return {
...tupleCodecHelper(items, options.description),
...tupleCodecHelper(items, config.description),
decode: (bytes, offset = 0) => {

@@ -623,11 +623,11 @@ const values = [];

}
function getTupleCodec(items, options = {}) {
function getTupleCodec(items, config = {}) {
return combineCodec(
getTupleEncoder(items, options),
getTupleDecoder(items, options)
getTupleEncoder(items, config),
getTupleDecoder(items, config)
);
}
function getUnitEncoder(options = {}) {
function getUnitEncoder(config = {}) {
return {
description: options.description ?? "unit",
description: config.description ?? "unit",
encode: () => new Uint8Array(),

@@ -638,6 +638,6 @@ fixedSize: 0,

}
function getUnitDecoder(options = {}) {
function getUnitDecoder(config = {}) {
return {
decode: (_bytes, offset = 0) => [void 0, offset],
description: options.description ?? "unit",
description: config.description ?? "unit",
fixedSize: 0,

@@ -647,4 +647,4 @@ maxSize: 0

}
function getUnitCodec(options = {}) {
return combineCodec(getUnitEncoder(options), getUnitDecoder(options));
function getUnitCodec(config = {}) {
return combineCodec(getUnitEncoder(config), getUnitDecoder(config));
}

@@ -651,0 +651,0 @@

@@ -5,12 +5,12 @@ this.globalThis = this.globalThis || {};

function C(e,r,n=0){if(r.length-n<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function E(e,r,n,o=0){let t=n.length-o;if(t<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${t}.`)}function D(e,r){if(e.fixedSize===null)throw new Error(r??"Expected a fixed-size codec, got a variable-size one.")}var x=e=>{let r=e.filter(i=>i.length);if(r.length===0)return e.length?e[0]:new Uint8Array;if(r.length===1)return r[0];let n=r.reduce((i,c)=>i+c.length,0),o=new Uint8Array(n),t=0;return r.forEach(i=>{o.set(i,t),t+=i.length;}),o},G=(e,r)=>{if(e.length>=r)return e;let n=new Uint8Array(r).fill(0);return n.set(e),n},v=(e,r)=>G(e.length<=r?e:e.slice(0,r),r);function u(e,r,n){if(e.fixedSize!==r.fixedSize)throw new Error(`Encoder and decoder must have the same fixed size, got [${e.fixedSize}] and [${r.fixedSize}].`);if(e.maxSize!==r.maxSize)throw new Error(`Encoder and decoder must have the same max size, got [${e.maxSize}] and [${r.maxSize}].`);if(n===void 0&&e.description!==r.description)throw new Error(`Encoder and decoder must have the same description, got [${e.description}] and [${r.description}]. Pass a custom description as a third argument if you want to override the description and bypass this error.`);return {decode:r.decode,description:n??e.description,encode:e.encode,fixedSize:e.fixedSize,maxSize:e.maxSize}}function w(e,r,n){return {description:n??`fixed(${r}, ${e.description})`,fixedSize:r,maxSize:r}}function k(e,r,n){return {...w(e,r,n),encode:o=>v(e.encode(o),r)}}function I(e,r,n){return {...w(e,r,n),decode:(o,t=0)=>{E("fixCodec",r,o,t),(t>0||o.length>r)&&(o=o.slice(t,t+r)),e.fixedSize!==null&&(o=v(o,e.fixedSize));let[i]=e.decode(o,0);return [i,t+r]}}}function q(e,r,n,o){if(o<r||o>n)throw new Error(`Codec [${e}] expected number to be in the range [${r}, ${n}], got ${o}.`)}function $(e){let r,n=e.name;return e.size>1&&(r=!("endian"in e.options)||e.options.endian===0,n+=r?"(le)":"(be)"),{description:e.options.description??n,fixedSize:e.size,littleEndian:r,maxSize:e.size}}function _(e){let r=$(e);return {description:r.description,encode(n){e.range&&q(e.name,e.range[0],e.range[1],n);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),n,r.littleEndian),new Uint8Array(o)},fixedSize:r.fixedSize,maxSize:r.maxSize}}function F(e){let r=$(e);return {decode(n,o=0){C(r.description,n,o),E(r.description,e.size,n,o);let t=new DataView(J(n,o,e.size));return [e.get(t,r.littleEndian),o+e.size]},description:r.description,fixedSize:r.fixedSize,maxSize:r.maxSize}}function J(e,r,n){let o=e.byteOffset+(r??0),t=n??e.byteLength;return e.buffer.slice(o,o+t)}var O=(e={})=>_({name:"u32",options:e,range:[0,+"0xffffffff"],set:(r,n,o)=>r.setUint32(0,n,o),size:4}),N=(e={})=>F({get:(r,n)=>r.getUint32(0,n),name:"u32",options:e,size:4});var S=(e={})=>_({name:"u8",options:e,range:[0,+"0xff"],set:(r,n)=>r.setUint8(0,n),size:1}),b=(e={})=>F({get:r=>r.getUint8(0),name:"u8",options:e,size:1});function V(e){return e.reduce((r,n)=>r===null||n===null?null:Math.max(r,n),0)}function l(e){return e.reduce((r,n)=>r===null||n===null?null:r+n,0)}function U(e,r,n,o){if(typeof e=="number")return [e,o];if(typeof e=="object")return e.decode(n,o);if(e==="remainder"){let t=l(r);if(t===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');let i=n.slice(o).length;if(i%t!==0)throw new Error(`The remainder of the byte array (${i} bytes) cannot be split into chunks of ${t} bytes. Codecs of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${i} modulo ${t} should be equal to zero.`);return [i/t,o]}throw new Error(`Unrecognized array-like codec size: ${JSON.stringify(e)}`)}function h(e){return typeof e=="object"?e.description:`${e}`}function g(e,r){if(typeof e!="number")return null;if(e===0)return 0;let n=l(r);return n===null?null:n*e}function B(e,r){return typeof e=="object"?e.encode(r):new Uint8Array}function y(e,r,n){if(r!==n)throw new Error(`Expected [${e}] to have ${r} items, got ${n}.`)}function L(e,r,n){if(r==="remainder"&&e.fixedSize===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:n??`array(${e.description}; ${h(r)})`,fixedSize:g(r,[e.fixedSize]),maxSize:g(r,[e.maxSize])}}function Q(e,r={}){let n=r.size??O();return {...L(e,n,r.description),encode:o=>(typeof n=="number"&&y("array",n,o.length),x([B(n,o.length),...o.map(t=>e.encode(t))]))}}function X(e,r={}){let n=r.size??N();return {...L(e,n,r.description),decode:(o,t=0)=>{if(typeof n=="object"&&o.slice(t).length===0)return [[],t];let[i,c]=U(n,[e.fixedSize],o,t);t=c;let d=[];for(let a=0;a<i;a+=1){let[s,f]=e.decode(o,t);d.push(s),t=f;}return [d,t]}}}function We(e,r={}){return u(Q(e,r),X(e,r))}var Y=(e,r={})=>{let n=typeof r=="boolean"?{backward:r}:r,o=n.backward??!1,t=o?"; backward":"";return {description:n.description??`bitArray(${e}${t})`,encode(i){let c=[];for(let d=0;d<e;d+=1){let a=0;for(let s=0;s<8;s+=1){let f=Number(i[d*8+s]??0);a|=f<<(o?s:7-s);}o?c.unshift(a):c.push(a);}return new Uint8Array(c)},fixedSize:e,maxSize:e}},Z=(e,r={})=>{let n=typeof r=="boolean"?{backward:r}:r,o=n.backward??!1,t=o?"; backward":"";return {decode(i,c=0){E("bitArray",e,i,c);let d=[],a=i.slice(c,c+e);return a=o?a.reverse():a,a.forEach(s=>{for(let f=0;f<8;f+=1)o?(d.push(!!(s&1)),s>>=1):(d.push(!!(s&128)),s<<=1);}),[d,c+e]},description:n.description??`bitArray(${e}${t})`,fixedSize:e,maxSize:e}},er=(e,r={})=>u(Y(e,r),Z(e,r));function ee(e={}){let r=e.size??S();return D(r,"Codec [bool] requires a fixed size."),{description:e.description??`bool(${r.description})`,encode:n=>r.encode(n?1:0),fixedSize:r.fixedSize,maxSize:r.fixedSize}}function re(e={}){let r=e.size??b();return D(r,"Codec [bool] requires a fixed size."),{decode:(n,o=0)=>{C("bool",n,o);let[t,i]=r.decode(n,o);return [t===1,i]},description:e.description??`bool(${r.description})`,fixedSize:r.fixedSize,maxSize:r.fixedSize}}function mr(e={}){return u(ee(e),re(e))}function ne(e={}){let r=e.size??"variable",n=typeof r=="object"?r.description:`${r}`,o=e.description??`bytes(${n})`,t={description:o,encode:i=>i,fixedSize:null,maxSize:null};return r==="variable"?t:typeof r=="number"?k(t,r,o):{...t,encode:i=>{let c=t.encode(i),d=r.encode(c.length);return x([d,c])}}}function oe(e={}){let r=e.size??"variable",n=typeof r=="object"?r.description:`${r}`,o=e.description??`bytes(${n})`,t={decode:(i,c=0)=>{let d=i.slice(c);return [d,c+d.length]},description:o,fixedSize:null,maxSize:null};return r==="variable"?t:typeof r=="number"?I(t,r,o):{...t,decode:(i,c=0)=>{C("bytes",i,c);let[d,a]=r.decode(i,c),s=Number(d);c=a;let f=i.slice(c,c+s);E("bytes",s,f);let[m,T]=t.decode(f);return c+=T,[m,c]}}}function br(e={}){return u(ne(e),oe(e))}function K(e,r,n){let o=e.map(([d,a])=>`${String(d)}${a?`: ${a.description}`:""}`).join(", "),i=e.every((d,a,s)=>d[1].fixedSize===s[0][1].fixedSize)?e[0][1].fixedSize:null,c=V(e.map(([,d])=>d.maxSize));return {description:n??`dataEnum(${o}; ${r.description})`,fixedSize:e.length===0?r.fixedSize:l([r.fixedSize,i]),maxSize:e.length===0?r.maxSize:l([r.maxSize,c])}}function te(e,r={}){let n=r.size??S();return {...K(e,n,r.description),encode:o=>{let t=e.findIndex(([a])=>o.__kind===a);if(t<0)throw new Error(`Invalid data enum variant. Expected one of [${e.map(([a])=>a).join(", ")}], got "${o.__kind}".`);let i=n.encode(t),d=e[t][1].encode(o);return x([i,d])}}}function ie(e,r={}){let n=r.size??b();return {...K(e,n,r.description),decode:(o,t=0)=>{C("dataEnum",o,t);let[i,c]=n.decode(o,t);t=c;let d=e[Number(i)]??null;if(!d)throw new Error(`Enum discriminator out of range. Expected a number between 0 and ${e.length-1}, got ${i}.`);let[a,s]=d[1].decode(o,t);return t=s,[{__kind:d[0],...a??{}},t]}}}function Ir(e,r={}){return u(te(e,r),ie(e,r))}function P(e,r,n,o){if(n==="remainder"&&(e.fixedSize===null||r.fixedSize===null))throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:o??`map(${e.description}, ${r.description}; ${h(n)})`,fixedSize:g(n,[e.fixedSize,r.fixedSize]),maxSize:g(n,[e.maxSize,r.maxSize])}}function ce(e,r,n={}){let o=n.size??O();return {...P(e,r,o,n.description),encode:t=>{typeof o=="number"&&y("map",o,t.size);let i=Array.from(t,([c,d])=>x([e.encode(c),r.encode(d)]));return x([B(o,t.size),...i])}}}function de(e,r,n={}){let o=n.size??N();return {...P(e,r,o,n.description),decode:(t,i=0)=>{let c=new Map;if(typeof o=="object"&&t.slice(i).length===0)return [c,i];let[d,a]=U(o,[e.fixedSize,r.fixedSize],t,i);i=a;for(let s=0;s<d;s+=1){let[f,m]=e.decode(t,i);i=m;let[T,A]=r.decode(t,i);i=A,c.set(f,T);}return [c,i]}}}function Qr(e,r,n={}){return u(ce(e,r,n),de(e,r,n))}function j(e,r,n,o){let t=`; ${r.description}`,i=e.fixedSize===0?r.fixedSize:null;return n&&(D(e,"Fixed nullables can only be used with fixed-size codecs."),D(r,"Fixed nullables can only be used with fixed-size prefix."),t+="; fixed",i=r.fixedSize+e.fixedSize),{description:o??`nullable(${e.description+t})`,fixedSize:i,maxSize:l([r.maxSize,e.maxSize])}}function ae(e,r={}){let n=r.prefix??S(),o=r.fixed??!1;return {...j(e,n,o,r.description),encode:t=>{let i=n.encode(+(t!==null)),c=t!==null?e.encode(t):new Uint8Array;return c=o?v(c,e.fixedSize):c,x([i,c])}}}function se(e,r={}){let n=r.prefix??b(),o=r.fixed??!1;return {...j(e,n,o,r.description),decode:(t,i=0)=>{if(t.length-i<=0)return [null,i];let c=i+(n.fixedSize??0)+(e.fixedSize??0),[d,a]=n.decode(t,i);if(i=a,d===0)return [null,o?c:i];let[s,f]=e.decode(t,i);return i=f,[s,o?c:i]}}}function fn(e,r={}){return u(ae(e,r),se(e,r))}function M(e,r,n){let o=Object.keys(e),t=Object.values(e),i=t.some(f=>typeof f=="number"),c=t.filter(f=>typeof f=="string").join(", "),d=0,a=i?t.length/2-1:t.length-1,s=i?[...o]:[...new Set([...o,...t])];return {description:n??`enum(${c}; ${r.description})`,enumKeys:o,enumValues:t,fixedSize:r.fixedSize,isNumericEnum:i,maxRange:a,maxSize:r.maxSize,minRange:d,stringValues:s}}function ue(e,r={}){let n=r.size??S(),{description:o,fixedSize:t,maxSize:i,minRange:c,maxRange:d,stringValues:a,enumKeys:s,enumValues:f}=M(e,n,r.description);return {description:o,encode:m=>{let T=typeof m=="number"&&(m<c||m>d),A=typeof m=="string"&&!a.includes(m);if(T||A)throw new Error(`Invalid scalar enum variant. Expected one of [${a.join(", ")}] or a number between ${c} and ${d}, got "${m}".`);if(typeof m=="number")return n.encode(m);let z=f.indexOf(m);return z>=0?n.encode(z):n.encode(s.indexOf(m))},fixedSize:t,maxSize:i}}function fe(e,r={}){let n=r.size??b(),{description:o,fixedSize:t,maxSize:i,minRange:c,maxRange:d,isNumericEnum:a,enumValues:s}=M(e,n,r.description);return {decode:(f,m=0)=>{C("enum",f,m);let[T,A]=n.decode(f,m),z=Number(T);if(m=A,z<c||z>d)throw new Error(`Enum discriminator out of range. Expected a number between ${c} and ${d}, got ${z}.`);return [a?z:s[z],m]},description:o,fixedSize:t,maxSize:i}}function Dn(e,r={}){return u(ue(e,r),fe(e,r))}function H(e,r,n){if(r==="remainder"&&e.fixedSize===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:n??`set(${e.description}; ${h(r)})`,fixedSize:g(r,[e.fixedSize]),maxSize:g(r,[e.maxSize])}}function me(e,r={}){let n=r.size??O();return {...H(e,n,r.description),encode:o=>{typeof n=="number"&&o.size!==n&&y("set",n,o.size);let t=Array.from(o,i=>e.encode(i));return x([B(n,o.size),...t])}}}function pe(e,r={}){let n=r.size??N();return {...H(e,n,r.description),decode:(o,t=0)=>{let i=new Set;if(typeof n=="object"&&o.slice(t).length===0)return [i,t];let[c,d]=U(n,[e.fixedSize],o,t);t=d;for(let a=0;a<c;a+=1){let[s,f]=e.decode(o,t);t=f,i.add(s);}return [i,t]}}}function Kn(e,r={}){return u(me(e,r),pe(e,r))}function R(e,r){let n=e.map(([o,t])=>`${String(o)}: ${t.description}`).join(", ");return {description:r??`struct(${n})`,fixedSize:l(e.map(([,o])=>o.fixedSize)),maxSize:l(e.map(([,o])=>o.maxSize))}}function xe(e,r={}){return {...R(e,r.description),encode:n=>{let o=e.map(([t,i])=>i.encode(n[t]));return x(o)}}}function le(e,r={}){return {...R(e,r.description),decode:(n,o=0)=>{let t={};return e.forEach(([i,c])=>{let[d,a]=c.decode(n,o);o=a,t[i]=d;}),[t,o]}}}function Qn(e,r={}){return u(xe(e,r),le(e,r))}function W(e,r){let n=e.map(o=>o.description).join(", ");return {description:r??`tuple(${n})`,fixedSize:l(e.map(o=>o.fixedSize)),maxSize:l(e.map(o=>o.maxSize))}}function Ce(e,r={}){return {...W(e,r.description),encode:n=>(y("tuple",e.length,n.length),x(e.map((o,t)=>o.encode(n[t]))))}}function ge(e,r={}){return {...W(e,r.description),decode:(n,o=0)=>{let t=[];return e.forEach(i=>{let[c,d]=i.decode(n,o);t.push(c),o=d;}),[t,o]}}}function ao(e,r={}){return u(Ce(e,r),ge(e,r))}function ze(e={}){return {description:e.description??"unit",encode:()=>new Uint8Array,fixedSize:0,maxSize:0}}function Se(e={}){return {decode:(r,n=0)=>[void 0,n],description:e.description??"unit",fixedSize:0,maxSize:0}}function Co(e={}){return u(ze(e),Se(e))}
function l(e,r,o=0){if(r.length-o<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function E(e,r,o,n=0){let t=o.length-n;if(t<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${t}.`)}function D(e,r){if(e.fixedSize===null)throw new Error(r??"Expected a fixed-size codec, got a variable-size one.")}var p=e=>{let r=e.filter(i=>i.length);if(r.length===0)return e.length?e[0]:new Uint8Array;if(r.length===1)return r[0];let o=r.reduce((i,d)=>i+d.length,0),n=new Uint8Array(o),t=0;return r.forEach(i=>{n.set(i,t),t+=i.length;}),n},G=(e,r)=>{if(e.length>=r)return e;let o=new Uint8Array(r).fill(0);return o.set(e),o},w=(e,r)=>G(e.length<=r?e:e.slice(0,r),r);function f(e,r,o){if(e.fixedSize!==r.fixedSize)throw new Error(`Encoder and decoder must have the same fixed size, got [${e.fixedSize}] and [${r.fixedSize}].`);if(e.maxSize!==r.maxSize)throw new Error(`Encoder and decoder must have the same max size, got [${e.maxSize}] and [${r.maxSize}].`);if(o===void 0&&e.description!==r.description)throw new Error(`Encoder and decoder must have the same description, got [${e.description}] and [${r.description}]. Pass a custom description as a third argument if you want to override the description and bypass this error.`);return {decode:r.decode,description:o??e.description,encode:e.encode,fixedSize:e.fixedSize,maxSize:e.maxSize}}function k(e,r,o){return {description:o??`fixed(${r}, ${e.description})`,fixedSize:r,maxSize:r}}function I(e,r,o){return {...k(e,r,o),encode:n=>w(e.encode(n),r)}}function $(e,r,o){return {...k(e,r,o),decode:(n,t=0)=>{E("fixCodec",r,n,t),(t>0||n.length>r)&&(n=n.slice(t,t+r)),e.fixedSize!==null&&(n=w(n,e.fixedSize));let[i]=e.decode(n,0);return [i,t+r]}}}function q(e,r,o,n){if(n<r||n>o)throw new Error(`Codec [${e}] expected number to be in the range [${r}, ${o}], got ${n}.`)}function O(e){let r,o=e.name;return e.size>1&&(r=!("endian"in e.config)||e.config.endian===0,o+=r?"(le)":"(be)"),{description:e.config.description??o,fixedSize:e.size,littleEndian:r,maxSize:e.size}}function _(e){let r=O(e);return {description:r.description,encode(o){e.range&&q(e.name,e.range[0],e.range[1],o);let n=new ArrayBuffer(e.size);return e.set(new DataView(n),o,r.littleEndian),new Uint8Array(n)},fixedSize:r.fixedSize,maxSize:r.maxSize}}function F(e){let r=O(e);return {decode(o,n=0){l(r.description,o,n),E(r.description,e.size,o,n);let t=new DataView(J(o,n,e.size));return [e.get(t,r.littleEndian),n+e.size]},description:r.description,fixedSize:r.fixedSize,maxSize:r.maxSize}}function J(e,r,o){let n=e.byteOffset+(r??0),t=o??e.byteLength;return e.buffer.slice(n,n+t)}var N=(e={})=>_({config:e,name:"u32",range:[0,+"0xffffffff"],set:(r,o,n)=>r.setUint32(0,o,n),size:4}),U=(e={})=>F({config:e,get:(r,o)=>r.getUint32(0,o),name:"u32",size:4});var S=(e={})=>_({config:e,name:"u8",range:[0,+"0xff"],set:(r,o)=>r.setUint8(0,o),size:1}),b=(e={})=>F({config:e,get:r=>r.getUint8(0),name:"u8",size:1});function V(e){return e.reduce((r,o)=>r===null||o===null?null:Math.max(r,o),0)}function x(e){return e.reduce((r,o)=>r===null||o===null?null:r+o,0)}function h(e,r,o,n){if(typeof e=="number")return [e,n];if(typeof e=="object")return e.decode(o,n);if(e==="remainder"){let t=x(r);if(t===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');let i=o.slice(n).length;if(i%t!==0)throw new Error(`The remainder of the byte array (${i} bytes) cannot be split into chunks of ${t} bytes. Codecs of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${i} modulo ${t} should be equal to zero.`);return [i/t,n]}throw new Error(`Unrecognized array-like codec size: ${JSON.stringify(e)}`)}function B(e){return typeof e=="object"?e.description:`${e}`}function g(e,r){if(typeof e!="number")return null;if(e===0)return 0;let o=x(r);return o===null?null:o*e}function A(e,r){return typeof e=="object"?e.encode(r):new Uint8Array}function y(e,r,o){if(r!==o)throw new Error(`Expected [${e}] to have ${r} items, got ${o}.`)}function L(e,r,o){if(r==="remainder"&&e.fixedSize===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:o??`array(${e.description}; ${B(r)})`,fixedSize:g(r,[e.fixedSize]),maxSize:g(r,[e.maxSize])}}function Q(e,r={}){let o=r.size??N();return {...L(e,o,r.description),encode:n=>(typeof o=="number"&&y("array",o,n.length),p([A(o,n.length),...n.map(t=>e.encode(t))]))}}function X(e,r={}){let o=r.size??U();return {...L(e,o,r.description),decode:(n,t=0)=>{if(typeof o=="object"&&n.slice(t).length===0)return [[],t];let[i,d]=h(o,[e.fixedSize],n,t);t=d;let c=[];for(let a=0;a<i;a+=1){let[s,u]=e.decode(n,t);c.push(s),t=u;}return [c,t]}}}function We(e,r={}){return f(Q(e,r),X(e,r))}var Y=(e,r={})=>{let o=typeof r=="boolean"?{backward:r}:r,n=o.backward??!1,t=n?"; backward":"";return {description:o.description??`bitArray(${e}${t})`,encode(i){let d=[];for(let c=0;c<e;c+=1){let a=0;for(let s=0;s<8;s+=1){let u=Number(i[c*8+s]??0);a|=u<<(n?s:7-s);}n?d.unshift(a):d.push(a);}return new Uint8Array(d)},fixedSize:e,maxSize:e}},Z=(e,r={})=>{let o=typeof r=="boolean"?{backward:r}:r,n=o.backward??!1,t=n?"; backward":"";return {decode(i,d=0){E("bitArray",e,i,d);let c=[],a=i.slice(d,d+e);return a=n?a.reverse():a,a.forEach(s=>{for(let u=0;u<8;u+=1)n?(c.push(!!(s&1)),s>>=1):(c.push(!!(s&128)),s<<=1);}),[c,d+e]},description:o.description??`bitArray(${e}${t})`,fixedSize:e,maxSize:e}},er=(e,r={})=>f(Y(e,r),Z(e,r));function ee(e={}){let r=e.size??S();return D(r,"Codec [bool] requires a fixed size."),{description:e.description??`bool(${r.description})`,encode:o=>r.encode(o?1:0),fixedSize:r.fixedSize,maxSize:r.fixedSize}}function re(e={}){let r=e.size??b();return D(r,"Codec [bool] requires a fixed size."),{decode:(o,n=0)=>{l("bool",o,n);let[t,i]=r.decode(o,n);return [t===1,i]},description:e.description??`bool(${r.description})`,fixedSize:r.fixedSize,maxSize:r.fixedSize}}function mr(e={}){return f(ee(e),re(e))}function oe(e={}){let r=e.size??"variable",o=typeof r=="object"?r.description:`${r}`,n=e.description??`bytes(${o})`,t={description:n,encode:i=>i,fixedSize:null,maxSize:null};return r==="variable"?t:typeof r=="number"?I(t,r,n):{...t,encode:i=>{let d=t.encode(i),c=r.encode(d.length);return p([c,d])}}}function ne(e={}){let r=e.size??"variable",o=typeof r=="object"?r.description:`${r}`,n=e.description??`bytes(${o})`,t={decode:(i,d=0)=>{let c=i.slice(d);return [c,d+c.length]},description:n,fixedSize:null,maxSize:null};return r==="variable"?t:typeof r=="number"?$(t,r,n):{...t,decode:(i,d=0)=>{l("bytes",i,d);let[c,a]=r.decode(i,d),s=Number(c);d=a;let u=i.slice(d,d+s);E("bytes",s,u);let[m,T]=t.decode(u);return d+=T,[m,d]}}}function br(e={}){return f(oe(e),ne(e))}function K(e,r,o){let n=e.map(([c,a])=>`${String(c)}${a?`: ${a.description}`:""}`).join(", "),i=e.every((c,a,s)=>c[1].fixedSize===s[0][1].fixedSize)?e[0][1].fixedSize:null,d=V(e.map(([,c])=>c.maxSize));return {description:o??`dataEnum(${n}; ${r.description})`,fixedSize:e.length===0?r.fixedSize:x([r.fixedSize,i]),maxSize:e.length===0?r.maxSize:x([r.maxSize,d])}}function te(e,r={}){let o=r.size??S();return {...K(e,o,r.description),encode:n=>{let t=e.findIndex(([a])=>n.__kind===a);if(t<0)throw new Error(`Invalid data enum variant. Expected one of [${e.map(([a])=>a).join(", ")}], got "${n.__kind}".`);let i=o.encode(t),c=e[t][1].encode(n);return p([i,c])}}}function ie(e,r={}){let o=r.size??b();return {...K(e,o,r.description),decode:(n,t=0)=>{l("dataEnum",n,t);let[i,d]=o.decode(n,t);t=d;let c=e[Number(i)]??null;if(!c)throw new Error(`Enum discriminator out of range. Expected a number between 0 and ${e.length-1}, got ${i}.`);let[a,s]=c[1].decode(n,t);return t=s,[{__kind:c[0],...a??{}},t]}}}function $r(e,r={}){return f(te(e,r),ie(e,r))}function P(e,r,o,n){if(o==="remainder"&&(e.fixedSize===null||r.fixedSize===null))throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:n??`map(${e.description}, ${r.description}; ${B(o)})`,fixedSize:g(o,[e.fixedSize,r.fixedSize]),maxSize:g(o,[e.maxSize,r.maxSize])}}function de(e,r,o={}){let n=o.size??N();return {...P(e,r,n,o.description),encode:t=>{typeof n=="number"&&y("map",n,t.size);let i=Array.from(t,([d,c])=>p([e.encode(d),r.encode(c)]));return p([A(n,t.size),...i])}}}function ce(e,r,o={}){let n=o.size??U();return {...P(e,r,n,o.description),decode:(t,i=0)=>{let d=new Map;if(typeof n=="object"&&t.slice(i).length===0)return [d,i];let[c,a]=h(n,[e.fixedSize,r.fixedSize],t,i);i=a;for(let s=0;s<c;s+=1){let[u,m]=e.decode(t,i);i=m;let[T,v]=r.decode(t,i);i=v,d.set(u,T);}return [d,i]}}}function Qr(e,r,o={}){return f(de(e,r,o),ce(e,r,o))}function j(e,r,o,n){let t=`; ${r.description}`,i=e.fixedSize===0?r.fixedSize:null;return o&&(D(e,"Fixed nullables can only be used with fixed-size codecs."),D(r,"Fixed nullables can only be used with fixed-size prefix."),t+="; fixed",i=r.fixedSize+e.fixedSize),{description:n??`nullable(${e.description+t})`,fixedSize:i,maxSize:x([r.maxSize,e.maxSize])}}function ae(e,r={}){let o=r.prefix??S(),n=r.fixed??!1;return {...j(e,o,n,r.description),encode:t=>{let i=o.encode(+(t!==null)),d=t!==null?e.encode(t):new Uint8Array;return d=n?w(d,e.fixedSize):d,p([i,d])}}}function se(e,r={}){let o=r.prefix??b(),n=r.fixed??!1;return {...j(e,o,n,r.description),decode:(t,i=0)=>{if(t.length-i<=0)return [null,i];let d=i+(o.fixedSize??0)+(e.fixedSize??0),[c,a]=o.decode(t,i);if(i=a,c===0)return [null,n?d:i];let[s,u]=e.decode(t,i);return i=u,[s,n?d:i]}}}function uo(e,r={}){return f(ae(e,r),se(e,r))}function M(e,r,o){let n=Object.keys(e),t=Object.values(e),i=t.some(u=>typeof u=="number"),d=t.filter(u=>typeof u=="string").join(", "),c=0,a=i?t.length/2-1:t.length-1,s=i?[...n]:[...new Set([...n,...t])];return {description:o??`enum(${d}; ${r.description})`,enumKeys:n,enumValues:t,fixedSize:r.fixedSize,isNumericEnum:i,maxRange:a,maxSize:r.maxSize,minRange:c,stringValues:s}}function fe(e,r={}){let o=r.size??S(),{description:n,fixedSize:t,maxSize:i,minRange:d,maxRange:c,stringValues:a,enumKeys:s,enumValues:u}=M(e,o,r.description);return {description:n,encode:m=>{let T=typeof m=="number"&&(m<d||m>c),v=typeof m=="string"&&!a.includes(m);if(T||v)throw new Error(`Invalid scalar enum variant. Expected one of [${a.join(", ")}] or a number between ${d} and ${c}, got "${m}".`);if(typeof m=="number")return o.encode(m);let z=u.indexOf(m);return z>=0?o.encode(z):o.encode(s.indexOf(m))},fixedSize:t,maxSize:i}}function ue(e,r={}){let o=r.size??b(),{description:n,fixedSize:t,maxSize:i,minRange:d,maxRange:c,isNumericEnum:a,enumValues:s}=M(e,o,r.description);return {decode:(u,m=0)=>{l("enum",u,m);let[T,v]=o.decode(u,m),z=Number(T);if(m=v,z<d||z>c)throw new Error(`Enum discriminator out of range. Expected a number between ${d} and ${c}, got ${z}.`);return [a?z:s[z],m]},description:n,fixedSize:t,maxSize:i}}function Do(e,r={}){return f(fe(e,r),ue(e,r))}function H(e,r,o){if(r==="remainder"&&e.fixedSize===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:o??`set(${e.description}; ${B(r)})`,fixedSize:g(r,[e.fixedSize]),maxSize:g(r,[e.maxSize])}}function me(e,r={}){let o=r.size??N();return {...H(e,o,r.description),encode:n=>{typeof o=="number"&&n.size!==o&&y("set",o,n.size);let t=Array.from(n,i=>e.encode(i));return p([A(o,n.size),...t])}}}function Ce(e,r={}){let o=r.size??U();return {...H(e,o,r.description),decode:(n,t=0)=>{let i=new Set;if(typeof o=="object"&&n.slice(t).length===0)return [i,t];let[d,c]=h(o,[e.fixedSize],n,t);t=c;for(let a=0;a<d;a+=1){let[s,u]=e.decode(n,t);t=u,i.add(s);}return [i,t]}}}function Ko(e,r={}){return f(me(e,r),Ce(e,r))}function R(e,r){let o=e.map(([n,t])=>`${String(n)}: ${t.description}`).join(", ");return {description:r??`struct(${o})`,fixedSize:x(e.map(([,n])=>n.fixedSize)),maxSize:x(e.map(([,n])=>n.maxSize))}}function pe(e,r={}){return {...R(e,r.description),encode:o=>{let n=e.map(([t,i])=>i.encode(o[t]));return p(n)}}}function xe(e,r={}){return {...R(e,r.description),decode:(o,n=0)=>{let t={};return e.forEach(([i,d])=>{let[c,a]=d.decode(o,n);n=a,t[i]=c;}),[t,n]}}}function Qo(e,r={}){return f(pe(e,r),xe(e,r))}function W(e,r){let o=e.map(n=>n.description).join(", ");return {description:r??`tuple(${o})`,fixedSize:x(e.map(n=>n.fixedSize)),maxSize:x(e.map(n=>n.maxSize))}}function le(e,r={}){return {...W(e,r.description),encode:o=>(y("tuple",e.length,o.length),p(e.map((n,t)=>n.encode(o[t]))))}}function ge(e,r={}){return {...W(e,r.description),decode:(o,n=0)=>{let t=[];return e.forEach(i=>{let[d,c]=i.decode(o,n);t.push(d),n=c;}),[t,n]}}}function an(e,r={}){return f(le(e,r),ge(e,r))}function ze(e={}){return {description:e.description??"unit",encode:()=>new Uint8Array,fixedSize:0,maxSize:0}}function Se(e={}){return {decode:(r,o=0)=>[void 0,o],description:e.description??"unit",fixedSize:0,maxSize:0}}function ln(e={}){return f(ze(e),Se(e))}
exports.assertValidNumberOfItemsForCodec = y;
exports.decodeArrayLikeCodecSize = U;
exports.decodeArrayLikeCodecSize = h;
exports.getArrayCodec = We;
exports.getArrayDecoder = X;
exports.getArrayEncoder = Q;
exports.getArrayLikeCodecSizeDescription = h;
exports.getArrayLikeCodecSizeDescription = B;
exports.getArrayLikeCodecSizeFromChildren = g;
exports.getArrayLikeCodecSizePrefix = B;
exports.getArrayLikeCodecSizePrefix = A;
exports.getBitArrayCodec = er;

@@ -23,26 +23,26 @@ exports.getBitArrayDecoder = Z;

exports.getBytesCodec = br;
exports.getBytesDecoder = oe;
exports.getBytesEncoder = ne;
exports.getDataEnumCodec = Ir;
exports.getBytesDecoder = ne;
exports.getBytesEncoder = oe;
exports.getDataEnumCodec = $r;
exports.getDataEnumDecoder = ie;
exports.getDataEnumEncoder = te;
exports.getMapCodec = Qr;
exports.getMapDecoder = de;
exports.getMapEncoder = ce;
exports.getNullableCodec = fn;
exports.getMapDecoder = ce;
exports.getMapEncoder = de;
exports.getNullableCodec = uo;
exports.getNullableDecoder = se;
exports.getNullableEncoder = ae;
exports.getScalarEnumCodec = Dn;
exports.getScalarEnumDecoder = fe;
exports.getScalarEnumEncoder = ue;
exports.getSetCodec = Kn;
exports.getSetDecoder = pe;
exports.getScalarEnumCodec = Do;
exports.getScalarEnumDecoder = ue;
exports.getScalarEnumEncoder = fe;
exports.getSetCodec = Ko;
exports.getSetDecoder = Ce;
exports.getSetEncoder = me;
exports.getStructCodec = Qn;
exports.getStructDecoder = le;
exports.getStructEncoder = xe;
exports.getTupleCodec = ao;
exports.getStructCodec = Qo;
exports.getStructDecoder = xe;
exports.getStructEncoder = pe;
exports.getTupleCodec = an;
exports.getTupleDecoder = ge;
exports.getTupleEncoder = Ce;
exports.getUnitCodec = Co;
exports.getTupleEncoder = le;
exports.getUnitCodec = ln;
exports.getUnitDecoder = Se;

@@ -49,0 +49,0 @@ exports.getUnitEncoder = ze;

@@ -1,6 +0,6 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
import { ArrayLikeCodecSize } from './array-like-codec-size';
/** Defines the options for array codecs. */
export type ArrayCodecOptions<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the configs for array codecs. */
export type ArrayCodecConfig<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -16,5 +16,5 @@ * The size of the array.

* @param item - The encoder to use for the array's items.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getArrayEncoder<T>(item: Encoder<T>, options?: ArrayCodecOptions<NumberEncoder>): Encoder<T[]>;
export declare function getArrayEncoder<T>(item: Encoder<T>, config?: ArrayCodecConfig<NumberEncoder>): Encoder<T[]>;
/**

@@ -24,5 +24,5 @@ * Decodes an array of items.

* @param item - The encoder to use for the array's items.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getArrayDecoder<T>(item: Decoder<T>, options?: ArrayCodecOptions<NumberDecoder>): Decoder<T[]>;
export declare function getArrayDecoder<T>(item: Decoder<T>, config?: ArrayCodecConfig<NumberDecoder>): Decoder<T[]>;
/**

@@ -32,5 +32,5 @@ * Creates a codec for an array of items.

* @param item - The codec to use for the array's items.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getArrayCodec<T, U extends T = T>(item: Codec<T, U>, options?: ArrayCodecOptions<NumberCodec>): Codec<T[], U[]>;
export declare function getArrayCodec<T, U extends T = T>(item: Codec<T, U>, config?: ArrayCodecConfig<NumberCodec>): Codec<T[], U[]>;
//# sourceMappingURL=array.d.ts.map

@@ -1,4 +0,4 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the options for bitArray codecs. */
export type BitArrayCodecOptions = BaseCodecOptions & {
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the config for bitArray codecs. */
export type BitArrayCodecConfig = BaseCodecConfig & {
/**

@@ -14,5 +14,5 @@ * Whether to read the bits in reverse order.

* @param size - The amount of bytes to use for the bit array.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare const getBitArrayEncoder: (size: number, options?: BitArrayCodecOptions | boolean) => Encoder<boolean[]>;
export declare const getBitArrayEncoder: (size: number, config?: BitArrayCodecConfig | boolean) => Encoder<boolean[]>;
/**

@@ -22,5 +22,5 @@ * Decodes bits into an array of booleans.

* @param size - The amount of bytes to use for the bit array.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare const getBitArrayDecoder: (size: number, options?: BitArrayCodecOptions | boolean) => Decoder<boolean[]>;
export declare const getBitArrayDecoder: (size: number, config?: BitArrayCodecConfig | boolean) => Decoder<boolean[]>;
/**

@@ -30,5 +30,5 @@ * An array of boolean codec that converts booleans to bits and vice versa.

* @param size - The amount of bytes to use for the bit array.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare const getBitArrayCodec: (size: number, options?: BitArrayCodecOptions | boolean) => Codec<boolean[]>;
export declare const getBitArrayCodec: (size: number, config?: BitArrayCodecConfig | boolean) => Codec<boolean[]>;
//# sourceMappingURL=bit-array.d.ts.map

@@ -1,5 +0,5 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
/** Defines the options for boolean codecs. */
export type BooleanCodecOptions<TSize extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for boolean codecs. */
export type BooleanCodecConfig<TSize extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -14,17 +14,17 @@ * The number codec to delegate to.

*
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getBooleanEncoder(options?: BooleanCodecOptions<NumberEncoder>): Encoder<boolean>;
export declare function getBooleanEncoder(config?: BooleanCodecConfig<NumberEncoder>): Encoder<boolean>;
/**
* Decodes booleans.
*
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getBooleanDecoder(options?: BooleanCodecOptions<NumberDecoder>): Decoder<boolean>;
export declare function getBooleanDecoder(config?: BooleanCodecConfig<NumberDecoder>): Decoder<boolean>;
/**
* Creates a boolean codec.
*
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getBooleanCodec(options?: BooleanCodecOptions<NumberCodec>): Codec<boolean>;
export declare function getBooleanCodec(config?: BooleanCodecConfig<NumberCodec>): Codec<boolean>;
//# sourceMappingURL=boolean.d.ts.map

@@ -1,5 +0,5 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
/** Defines the options for bytes codecs. */
export type BytesCodecOptions<TSize extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for bytes codecs. */
export type BytesCodecConfig<TSize extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -17,17 +17,17 @@ * The size of the byte array. It can be one of the following:

*
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getBytesEncoder(options?: BytesCodecOptions<NumberEncoder>): Encoder<Uint8Array>;
export declare function getBytesEncoder(config?: BytesCodecConfig<NumberEncoder>): Encoder<Uint8Array>;
/**
* Decodes sized bytes.
*
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getBytesDecoder(options?: BytesCodecOptions<NumberDecoder>): Decoder<Uint8Array>;
export declare function getBytesDecoder(config?: BytesCodecConfig<NumberDecoder>): Decoder<Uint8Array>;
/**
* Creates a sized bytes codec.
*
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getBytesCodec(options?: BytesCodecOptions<NumberCodec>): Codec<Uint8Array>;
export declare function getBytesCodec(config?: BytesCodecConfig<NumberCodec>): Codec<Uint8Array>;
//# sourceMappingURL=bytes.d.ts.map

@@ -1,2 +0,2 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';

@@ -61,4 +61,4 @@ /**

]>;
/** Defines the options for data enum codecs. */
export type DataEnumCodecOptions<TDiscriminator = NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for data enum codecs. */
export type DataEnumCodecConfig<TDiscriminator = NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -74,5 +74,5 @@ * The codec to use for the enum discriminator prefixing the variant.

* @param variants - The variant encoders of the data enum.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getDataEnumEncoder<T extends DataEnum>(variants: DataEnumToEncoderTuple<T>, options?: DataEnumCodecOptions<NumberEncoder>): Encoder<T>;
export declare function getDataEnumEncoder<T extends DataEnum>(variants: DataEnumToEncoderTuple<T>, config?: DataEnumCodecConfig<NumberEncoder>): Encoder<T>;
/**

@@ -82,5 +82,5 @@ * Creates a data enum decoder.

* @param variants - The variant decoders of the data enum.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getDataEnumDecoder<T extends DataEnum>(variants: DataEnumToDecoderTuple<T>, options?: DataEnumCodecOptions<NumberDecoder>): Decoder<T>;
export declare function getDataEnumDecoder<T extends DataEnum>(variants: DataEnumToDecoderTuple<T>, config?: DataEnumCodecConfig<NumberDecoder>): Decoder<T>;
/**

@@ -90,5 +90,5 @@ * Creates a data enum codec.

* @param variants - The variant codecs of the data enum.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getDataEnumCodec<T extends DataEnum, U extends T = T>(variants: DataEnumToCodecTuple<T, U>, options?: DataEnumCodecOptions<NumberCodec>): Codec<T, U>;
export declare function getDataEnumCodec<T extends DataEnum, U extends T = T>(variants: DataEnumToCodecTuple<T, U>, config?: DataEnumCodecConfig<NumberCodec>): Codec<T, U>;
//# sourceMappingURL=data-enum.d.ts.map

@@ -1,6 +0,6 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
import { ArrayLikeCodecSize } from './array-like-codec-size';
/** Defines the options for Map codecs. */
export type MapCodecOptions<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for Map codecs. */
export type MapCodecConfig<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -17,5 +17,5 @@ * The size of the array.

* @param value - The encoder to use for the map's values.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getMapEncoder<K, V>(key: Encoder<K>, value: Encoder<V>, options?: MapCodecOptions<NumberEncoder>): Encoder<Map<K, V>>;
export declare function getMapEncoder<K, V>(key: Encoder<K>, value: Encoder<V>, config?: MapCodecConfig<NumberEncoder>): Encoder<Map<K, V>>;
/**

@@ -26,5 +26,5 @@ * Creates a decoder for a map.

* @param value - The decoder to use for the map's values.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getMapDecoder<K, V>(key: Decoder<K>, value: Decoder<V>, options?: MapCodecOptions<NumberDecoder>): Decoder<Map<K, V>>;
export declare function getMapDecoder<K, V>(key: Decoder<K>, value: Decoder<V>, config?: MapCodecConfig<NumberDecoder>): Decoder<Map<K, V>>;
/**

@@ -35,5 +35,5 @@ * Creates a codec for a map.

* @param value - The codec to use for the map's values.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getMapCodec<TK, TV, UK extends TK = TK, UV extends TV = TV>(key: Codec<TK, UK>, value: Codec<TV, UV>, options?: MapCodecOptions<NumberCodec>): Codec<Map<TK, TV>, Map<UK, UV>>;
export declare function getMapCodec<TK, TV, UK extends TK = TK, UV extends TV = TV>(key: Codec<TK, UK>, value: Codec<TV, UV>, config?: MapCodecConfig<NumberCodec>): Codec<Map<TK, TV>, Map<UK, UV>>;
//# sourceMappingURL=map.d.ts.map

@@ -1,5 +0,5 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
/** Defines the options for nullable codecs. */
export type NullableCodecOptions<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for nullable codecs. */
export type NullableCodecConfig<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -24,5 +24,5 @@ * The codec to use for the boolean prefix.

* @param item - The encoder to use for the value that may be present.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getNullableEncoder<T>(item: Encoder<T>, options?: NullableCodecOptions<NumberEncoder>): Encoder<T | null>;
export declare function getNullableEncoder<T>(item: Encoder<T>, config?: NullableCodecConfig<NumberEncoder>): Encoder<T | null>;
/**

@@ -32,5 +32,5 @@ * Creates a decoder for an optional value using `null` as the `None` value.

* @param item - The decoder to use for the value that may be present.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getNullableDecoder<T>(item: Decoder<T>, options?: NullableCodecOptions<NumberDecoder>): Decoder<T | null>;
export declare function getNullableDecoder<T>(item: Decoder<T>, config?: NullableCodecConfig<NumberDecoder>): Decoder<T | null>;
/**

@@ -40,5 +40,5 @@ * Creates a codec for an optional value using `null` as the `None` value.

* @param item - The codec to use for the value that may be present.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getNullableCodec<T, U extends T = T>(item: Codec<T, U>, options?: NullableCodecOptions<NumberCodec>): Codec<T | null, U | null>;
export declare function getNullableCodec<T, U extends T = T>(item: Codec<T, U>, config?: NullableCodecConfig<NumberCodec>): Codec<T | null, U | null>;
//# sourceMappingURL=nullable.d.ts.map

@@ -1,2 +0,2 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';

@@ -15,4 +15,4 @@ /**

} | number | T) & NonNullable<unknown>;
/** Defines the options for scalar enum codecs. */
export type ScalarEnumCodecOptions<TDiscriminator extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for scalar enum codecs. */
export type ScalarEnumCodecConfig<TDiscriminator extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -28,5 +28,5 @@ * The codec to use for the enum discriminator.

* @param constructor - The constructor of the scalar enum.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getScalarEnumEncoder<T>(constructor: ScalarEnum<T>, options?: ScalarEnumCodecOptions<NumberCodec>): Encoder<T>;
export declare function getScalarEnumEncoder<T>(constructor: ScalarEnum<T>, config?: ScalarEnumCodecConfig<NumberEncoder>): Encoder<T>;
/**

@@ -36,5 +36,5 @@ * Creates a scalar enum decoder.

* @param constructor - The constructor of the scalar enum.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getScalarEnumDecoder<T>(constructor: ScalarEnum<T>, options?: ScalarEnumCodecOptions<NumberCodec>): Decoder<T>;
export declare function getScalarEnumDecoder<T>(constructor: ScalarEnum<T>, config?: ScalarEnumCodecConfig<NumberDecoder>): Decoder<T>;
/**

@@ -44,5 +44,5 @@ * Creates a scalar enum codec.

* @param constructor - The constructor of the scalar enum.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getScalarEnumCodec<T>(constructor: ScalarEnum<T>, options?: ScalarEnumCodecOptions<NumberCodec>): Codec<T>;
export declare function getScalarEnumCodec<T>(constructor: ScalarEnum<T>, config?: ScalarEnumCodecConfig<NumberCodec>): Codec<T>;
//# sourceMappingURL=scalar-enum.d.ts.map

@@ -1,6 +0,6 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodec, NumberDecoder, NumberEncoder } from '@solana/codecs-numbers';
import { ArrayLikeCodecSize } from './array-like-codec-size';
/** Defines the options for set codecs. */
export type SetCodecOptions<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecOptions & {
/** Defines the config for set codecs. */
export type SetCodecConfig<TPrefix extends NumberCodec | NumberEncoder | NumberDecoder> = BaseCodecConfig & {
/**

@@ -16,5 +16,5 @@ * The size of the set.

* @param item - The encoder to use for the set's items.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getSetEncoder<T>(item: Encoder<T>, options?: SetCodecOptions<NumberEncoder>): Encoder<Set<T>>;
export declare function getSetEncoder<T>(item: Encoder<T>, config?: SetCodecConfig<NumberEncoder>): Encoder<Set<T>>;
/**

@@ -24,5 +24,5 @@ * Decodes an set of items.

* @param item - The encoder to use for the set's items.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getSetDecoder<T>(item: Decoder<T>, options?: SetCodecOptions<NumberDecoder>): Decoder<Set<T>>;
export declare function getSetDecoder<T>(item: Decoder<T>, config?: SetCodecConfig<NumberDecoder>): Decoder<Set<T>>;
/**

@@ -32,5 +32,5 @@ * Creates a codec for an set of items.

* @param item - The codec to use for the set's items.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getSetCodec<T, U extends T = T>(item: Codec<T, U>, options?: SetCodecOptions<NumberCodec>): Codec<Set<T>, Set<U>>;
export declare function getSetCodec<T, U extends T = T>(item: Codec<T, U>, config?: SetCodecConfig<NumberCodec>): Codec<Set<T>, Set<U>>;
//# sourceMappingURL=set.d.ts.map

@@ -1,2 +0,2 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Get the name and encoder of each field in a struct. */

@@ -14,4 +14,4 @@ export type StructToEncoderTuple<T extends object> = Array<{

}[keyof T]>;
/** Defines the options for struct codecs. */
export type StructCodecOptions = BaseCodecOptions;
/** Defines the config for struct codecs. */
export type StructCodecConfig = BaseCodecConfig;
/**

@@ -21,5 +21,5 @@ * Creates a encoder for a custom object.

* @param fields - The name and encoder of each field.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getStructEncoder<T extends object>(fields: StructToEncoderTuple<T>, options?: StructCodecOptions): Encoder<T>;
export declare function getStructEncoder<T extends object>(fields: StructToEncoderTuple<T>, config?: StructCodecConfig): Encoder<T>;
/**

@@ -29,5 +29,5 @@ * Creates a decoder for a custom object.

* @param fields - The name and decoder of each field.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getStructDecoder<T extends object>(fields: StructToDecoderTuple<T>, options?: StructCodecOptions): Decoder<T>;
export declare function getStructDecoder<T extends object>(fields: StructToDecoderTuple<T>, config?: StructCodecConfig): Decoder<T>;
/**

@@ -37,5 +37,5 @@ * Creates a codec for a custom object.

* @param fields - The name and codec of each field.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getStructCodec<T extends object, U extends T = T>(fields: StructToCodecTuple<T, U>, options?: StructCodecOptions): Codec<T, U>;
export declare function getStructCodec<T extends object, U extends T = T>(fields: StructToCodecTuple<T, U>, config?: StructCodecConfig): Codec<T, U>;
//# sourceMappingURL=struct.d.ts.map

@@ -1,4 +0,4 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the options for tuple codecs. */
export type TupleCodecOptions = BaseCodecOptions;
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the config for tuple codecs. */
export type TupleCodecConfig = BaseCodecConfig;
type WrapInEncoder<T> = {

@@ -18,5 +18,5 @@ [P in keyof T]: Encoder<T[P]>;

* @param items - The encoders to use for each item in the tuple.
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getTupleEncoder<T extends AnyArray>(items: WrapInEncoder<[...T]>, options?: TupleCodecOptions): Encoder<T>;
export declare function getTupleEncoder<T extends AnyArray>(items: WrapInEncoder<[...T]>, config?: TupleCodecConfig): Encoder<T>;
/**

@@ -26,5 +26,5 @@ * Creates a decoder for a tuple-like array.

* @param items - The decoders to use for each item in the tuple.
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getTupleDecoder<T extends AnyArray>(items: WrapInDecoder<[...T]>, options?: TupleCodecOptions): Decoder<T>;
export declare function getTupleDecoder<T extends AnyArray>(items: WrapInDecoder<[...T]>, config?: TupleCodecConfig): Decoder<T>;
/**

@@ -34,6 +34,6 @@ * Creates a codec for a tuple-like array.

* @param items - The codecs to use for each item in the tuple.
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getTupleCodec<T extends AnyArray, U extends T = T>(items: WrapInCodec<[...T], [...U]>, options?: TupleCodecOptions): Codec<T, U>;
export declare function getTupleCodec<T extends AnyArray, U extends T = T>(items: WrapInCodec<[...T], [...U]>, config?: TupleCodecConfig): Codec<T, U>;
export {};
//# sourceMappingURL=tuple.d.ts.map

@@ -1,22 +0,22 @@

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the options for unit codecs. */
export type UnitSerializerOptions = BaseCodecOptions;
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines the config for unit codecs. */
export type UnitSerializerconfig = BaseCodecConfig;
/**
* Creates a void encoder.
*
* @param options - A set of options for the encoder.
* @param config - A set of config for the encoder.
*/
export declare function getUnitEncoder(options?: UnitSerializerOptions): Encoder<void>;
export declare function getUnitEncoder(config?: UnitSerializerconfig): Encoder<void>;
/**
* Creates a void decoder.
*
* @param options - A set of options for the decoder.
* @param config - A set of config for the decoder.
*/
export declare function getUnitDecoder(options?: UnitSerializerOptions): Decoder<void>;
export declare function getUnitDecoder(config?: UnitSerializerconfig): Decoder<void>;
/**
* Creates a void codec.
*
* @param options - A set of options for the codec.
* @param config - A set of config for the codec.
*/
export declare function getUnitCodec(options?: UnitSerializerOptions): Codec<void>;
export declare function getUnitCodec(config?: UnitSerializerconfig): Codec<void>;
//# sourceMappingURL=unit.d.ts.map
{
"name": "@solana/codecs-data-structures",
"version": "2.0.0-experimental.32b59a5",
"version": "2.0.0-experimental.3690b65",
"description": "Codecs for various data structures",

@@ -52,9 +52,9 @@ "exports": {

"dependencies": {
"@solana/codecs-core": "2.0.0-experimental.32b59a5",
"@solana/codecs-numbers": "2.0.0-experimental.32b59a5"
"@solana/codecs-core": "2.0.0-experimental.3690b65",
"@solana/codecs-numbers": "2.0.0-experimental.3690b65"
},
"devDependencies": {
"@solana/eslint-config-solana": "^1.0.2",
"@swc/jest": "^0.2.28",
"@types/jest": "^29.5.5",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.7.0",

@@ -64,13 +64,13 @@ "@typescript-eslint/parser": "^6.3.0",

"eslint": "^8.45.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.6.4",
"jest-runner-eslint": "^2.1.0",
"jest-environment-jsdom": "^29.7.0",
"jest-runner-eslint": "^2.1.2",
"jest-runner-prettier": "^1.0.0",
"prettier": "^2.8",
"tsup": "7.2.0",
"tsup": "^8.0.1",
"typescript": "^5.2.2",
"version-from-git": "^1.1.1",
"@solana/codecs-strings": "2.0.0-experimental.32b59a5",
"@solana/codecs-strings": "2.0.0-experimental.3690b65",
"build-scripts": "0.0.0",

@@ -93,3 +93,3 @@ "test-config": "0.0.0",

"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/*",
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",

@@ -96,0 +96,0 @@ "test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc