Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/codecs-numbers

Package Overview
Dependencies
Maintainers
14
Versions
1182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/codecs-numbers - npm Package Compare versions

Comparing version 2.0.0-experimental.856952e to 2.0.0-experimental.85b7dfe

dist/types/assertions.d.ts.map

134

dist/index.browser.js

@@ -22,7 +22,7 @@ import { combineCodec, assertByteArrayIsNotEmptyForCodec, assertByteArrayHasEnoughBytesForCodec } from '@solana/codecs-core';

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

@@ -70,31 +70,31 @@ littleEndian,

// src/f32.ts
var getF32Encoder = (options = {}) => numberEncoderFactory({
var getF32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f32",
options,
set: (view, value, le) => view.setFloat32(0, value, le),
size: 4
});
var getF32Decoder = (options = {}) => numberDecoderFactory({
var getF32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat32(0, le),
name: "f32",
options,
size: 4
});
var getF32Codec = (options = {}) => combineCodec(getF32Encoder(options), getF32Decoder(options));
var getF64Encoder = (options = {}) => numberEncoderFactory({
var getF32Codec = (config = {}) => combineCodec(getF32Encoder(config), getF32Decoder(config));
var getF64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f64",
options,
set: (view, value, le) => view.setFloat64(0, value, le),
size: 8
});
var getF64Decoder = (options = {}) => numberDecoderFactory({
var getF64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat64(0, le),
name: "f64",
options,
size: 8
});
var getF64Codec = (options = {}) => combineCodec(getF64Encoder(options), getF64Decoder(options));
var getI128Encoder = (options = {}) => numberEncoderFactory({
var getF64Codec = (config = {}) => combineCodec(getF64Encoder(config), getF64Decoder(config));
var getI128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i128",
options,
range: [-BigInt("0x7fffffffffffffffffffffffffffffff") - 1n, BigInt("0x7fffffffffffffffffffffffffffffff")],

@@ -110,3 +110,4 @@ set: (view, value, le) => {

});
var getI128Decoder = (options = {}) => numberDecoderFactory({
var getI128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -120,9 +121,8 @@ const leftOffset = le ? 8 : 0;

name: "i128",
options,
size: 16
});
var getI128Codec = (options = {}) => combineCodec(getI128Encoder(options), getI128Decoder(options));
var getI16Encoder = (options = {}) => numberEncoderFactory({
var getI128Codec = (config = {}) => combineCodec(getI128Encoder(config), getI128Decoder(config));
var getI16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i16",
options,
range: [-Number("0x7fff") - 1, Number("0x7fff")],

@@ -132,12 +132,12 @@ set: (view, value, le) => view.setInt16(0, value, le),

});
var getI16Decoder = (options = {}) => numberDecoderFactory({
var getI16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt16(0, le),
name: "i16",
options,
size: 2
});
var getI16Codec = (options = {}) => combineCodec(getI16Encoder(options), getI16Decoder(options));
var getI32Encoder = (options = {}) => numberEncoderFactory({
var getI16Codec = (config = {}) => combineCodec(getI16Encoder(config), getI16Decoder(config));
var getI32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i32",
options,
range: [-Number("0x7fffffff") - 1, Number("0x7fffffff")],

@@ -147,12 +147,12 @@ set: (view, value, le) => view.setInt32(0, value, le),

});
var getI32Decoder = (options = {}) => numberDecoderFactory({
var getI32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt32(0, le),
name: "i32",
options,
size: 4
});
var getI32Codec = (options = {}) => combineCodec(getI32Encoder(options), getI32Decoder(options));
var getI64Encoder = (options = {}) => numberEncoderFactory({
var getI32Codec = (config = {}) => combineCodec(getI32Encoder(config), getI32Decoder(config));
var getI64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i64",
options,
range: [-BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff")],

@@ -162,12 +162,12 @@ set: (view, value, le) => view.setBigInt64(0, BigInt(value), le),

});
var getI64Decoder = (options = {}) => numberDecoderFactory({
var getI64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigInt64(0, le),
name: "i64",
options,
size: 8
});
var getI64Codec = (options = {}) => combineCodec(getI64Encoder(options), getI64Decoder(options));
var getI8Encoder = (options = {}) => numberEncoderFactory({
var getI64Codec = (config = {}) => combineCodec(getI64Encoder(config), getI64Decoder(config));
var getI8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i8",
options,
range: [-Number("0x7f") - 1, Number("0x7f")],

@@ -177,11 +177,11 @@ set: (view, value) => view.setInt8(0, value),

});
var getI8Decoder = (options = {}) => numberDecoderFactory({
var getI8Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view) => view.getInt8(0),
name: "i8",
options,
size: 1
});
var getI8Codec = (options = {}) => combineCodec(getI8Encoder(options), getI8Decoder(options));
var getShortU16Encoder = (options = {}) => ({
description: options.description ?? "shortU16",
var getI8Codec = (config = {}) => combineCodec(getI8Encoder(config), getI8Decoder(config));
var getShortU16Encoder = (config = {}) => ({
description: config.description ?? "shortU16",
encode: (value) => {

@@ -206,3 +206,3 @@ assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);

});
var getShortU16Decoder = (options = {}) => ({
var getShortU16Decoder = (config = {}) => ({
decode: (bytes, offset = 0) => {

@@ -222,10 +222,10 @@ let value = 0;

},
description: options.description ?? "shortU16",
description: config.description ?? "shortU16",
fixedSize: null,
maxSize: 3
});
var getShortU16Codec = (options = {}) => combineCodec(getShortU16Encoder(options), getShortU16Decoder(options));
var getU128Encoder = (options = {}) => numberEncoderFactory({
var getShortU16Codec = (config = {}) => combineCodec(getShortU16Encoder(config), getShortU16Decoder(config));
var getU128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u128",
options,
range: [0, BigInt("0xffffffffffffffffffffffffffffffff")],

@@ -241,3 +241,4 @@ set: (view, value, le) => {

});
var getU128Decoder = (options = {}) => numberDecoderFactory({
var getU128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -251,9 +252,8 @@ const leftOffset = le ? 8 : 0;

name: "u128",
options,
size: 16
});
var getU128Codec = (options = {}) => combineCodec(getU128Encoder(options), getU128Decoder(options));
var getU16Encoder = (options = {}) => numberEncoderFactory({
var getU128Codec = (config = {}) => combineCodec(getU128Encoder(config), getU128Decoder(config));
var getU16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u16",
options,
range: [0, Number("0xffff")],

@@ -263,12 +263,12 @@ set: (view, value, le) => view.setUint16(0, value, le),

});
var getU16Decoder = (options = {}) => numberDecoderFactory({
var getU16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getUint16(0, le),
name: "u16",
options,
size: 2
});
var getU16Codec = (options = {}) => combineCodec(getU16Encoder(options), getU16Decoder(options));
var getU32Encoder = (options = {}) => numberEncoderFactory({
var getU16Codec = (config = {}) => combineCodec(getU16Encoder(config), getU16Decoder(config));
var getU32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u32",
options,
range: [0, Number("0xffffffff")],

@@ -278,12 +278,12 @@ 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 getU32Codec = (options = {}) => combineCodec(getU32Encoder(options), getU32Decoder(options));
var getU64Encoder = (options = {}) => numberEncoderFactory({
var getU32Codec = (config = {}) => combineCodec(getU32Encoder(config), getU32Decoder(config));
var getU64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u64",
options,
range: [0, BigInt("0xffffffffffffffff")],

@@ -293,12 +293,12 @@ set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),

});
var getU64Decoder = (options = {}) => numberDecoderFactory({
var getU64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigUint64(0, le),
name: "u64",
options,
size: 8
});
var getU64Codec = (options = {}) => combineCodec(getU64Encoder(options), getU64Decoder(options));
var getU8Encoder = (options = {}) => numberEncoderFactory({
var getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config));
var getU8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u8",
options,
range: [0, Number("0xff")],

@@ -308,9 +308,9 @@ 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
});
var getU8Codec = (options = {}) => combineCodec(getU8Encoder(options), getU8Decoder(options));
var getU8Codec = (config = {}) => combineCodec(getU8Encoder(config), getU8Decoder(config));

@@ -317,0 +317,0 @@ export { Endian, assertNumberIsBetweenForCodec, getF32Codec, getF32Decoder, getF32Encoder, getF64Codec, getF64Decoder, getF64Encoder, getI128Codec, getI128Decoder, getI128Encoder, getI16Codec, getI16Decoder, getI16Encoder, getI32Codec, getI32Decoder, getI32Encoder, getI64Codec, getI64Decoder, getI64Encoder, getI8Codec, getI8Decoder, getI8Encoder, getShortU16Codec, getShortU16Decoder, getShortU16Encoder, getU128Codec, getU128Decoder, getU128Encoder, getU16Codec, getU16Decoder, getU16Encoder, getU32Codec, getU32Decoder, getU32Encoder, getU64Codec, getU64Decoder, getU64Encoder, getU8Codec, getU8Decoder, getU8Encoder };

@@ -51,3 +51,3 @@ this.globalThis = this.globalThis || {};

decode: decoder.decode,
description: description ?? encoder.description,
description: description != null ? description : encoder.description,
encode: encoder.encode,

@@ -61,10 +61,11 @@ fixedSize: encoder.fixedSize,

function sharedNumberFactory(input) {
var _a;
let littleEndian;
let defaultDescription = input.name;
if (input.size > 1) {
littleEndian = !("endian" in input.options) || input.options.endian === 0 /* LITTLE */;
littleEndian = !("endian" in input.config) || input.config.endian === 0 /* LITTLE */;
defaultDescription += littleEndian ? "(le)" : "(be)";
}
return {
description: input.options.description ?? defaultDescription,
description: (_a = input.config.description) != null ? _a : defaultDescription,
fixedSize: input.size,

@@ -106,4 +107,4 @@ littleEndian,

function toArrayBuffer(bytes, offset, length) {
const bytesOffset = bytes.byteOffset + (offset ?? 0);
const bytesLength = length ?? bytes.byteLength;
const bytesOffset = bytes.byteOffset + (offset != null ? offset : 0);
const bytesLength = length != null ? length : bytes.byteLength;
return bytes.buffer.slice(bytesOffset, bytesOffset + bytesLength);

@@ -113,35 +114,35 @@ }

// src/f32.ts
var getF32Encoder = (options = {}) => numberEncoderFactory({
var getF32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f32",
options,
set: (view, value, le) => view.setFloat32(0, value, le),
size: 4
});
var getF32Decoder = (options = {}) => numberDecoderFactory({
var getF32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat32(0, le),
name: "f32",
options,
size: 4
});
var getF32Codec = (options = {}) => combineCodec(getF32Encoder(options), getF32Decoder(options));
var getF32Codec = (config = {}) => combineCodec(getF32Encoder(config), getF32Decoder(config));
// src/f64.ts
var getF64Encoder = (options = {}) => numberEncoderFactory({
var getF64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f64",
options,
set: (view, value, le) => view.setFloat64(0, value, le),
size: 8
});
var getF64Decoder = (options = {}) => numberDecoderFactory({
var getF64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat64(0, le),
name: "f64",
options,
size: 8
});
var getF64Codec = (options = {}) => combineCodec(getF64Encoder(options), getF64Decoder(options));
var getF64Codec = (config = {}) => combineCodec(getF64Encoder(config), getF64Decoder(config));
// src/i128.ts
var getI128Encoder = (options = {}) => numberEncoderFactory({
var getI128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i128",
options,
range: [-BigInt("0x7fffffffffffffffffffffffffffffff") - 1n, BigInt("0x7fffffffffffffffffffffffffffffff")],

@@ -157,3 +158,4 @@ set: (view, value, le) => {

});
var getI128Decoder = (options = {}) => numberDecoderFactory({
var getI128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -167,11 +169,10 @@ const leftOffset = le ? 8 : 0;

name: "i128",
options,
size: 16
});
var getI128Codec = (options = {}) => combineCodec(getI128Encoder(options), getI128Decoder(options));
var getI128Codec = (config = {}) => combineCodec(getI128Encoder(config), getI128Decoder(config));
// src/i16.ts
var getI16Encoder = (options = {}) => numberEncoderFactory({
var getI16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i16",
options,
range: [-Number("0x7fff") - 1, Number("0x7fff")],

@@ -181,14 +182,14 @@ set: (view, value, le) => view.setInt16(0, value, le),

});
var getI16Decoder = (options = {}) => numberDecoderFactory({
var getI16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt16(0, le),
name: "i16",
options,
size: 2
});
var getI16Codec = (options = {}) => combineCodec(getI16Encoder(options), getI16Decoder(options));
var getI16Codec = (config = {}) => combineCodec(getI16Encoder(config), getI16Decoder(config));
// src/i32.ts
var getI32Encoder = (options = {}) => numberEncoderFactory({
var getI32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i32",
options,
range: [-Number("0x7fffffff") - 1, Number("0x7fffffff")],

@@ -198,14 +199,14 @@ set: (view, value, le) => view.setInt32(0, value, le),

});
var getI32Decoder = (options = {}) => numberDecoderFactory({
var getI32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt32(0, le),
name: "i32",
options,
size: 4
});
var getI32Codec = (options = {}) => combineCodec(getI32Encoder(options), getI32Decoder(options));
var getI32Codec = (config = {}) => combineCodec(getI32Encoder(config), getI32Decoder(config));
// src/i64.ts
var getI64Encoder = (options = {}) => numberEncoderFactory({
var getI64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i64",
options,
range: [-BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff")],

@@ -215,14 +216,14 @@ set: (view, value, le) => view.setBigInt64(0, BigInt(value), le),

});
var getI64Decoder = (options = {}) => numberDecoderFactory({
var getI64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigInt64(0, le),
name: "i64",
options,
size: 8
});
var getI64Codec = (options = {}) => combineCodec(getI64Encoder(options), getI64Decoder(options));
var getI64Codec = (config = {}) => combineCodec(getI64Encoder(config), getI64Decoder(config));
// src/i8.ts
var getI8Encoder = (options = {}) => numberEncoderFactory({
var getI8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i8",
options,
range: [-Number("0x7f") - 1, Number("0x7f")],

@@ -232,57 +233,63 @@ set: (view, value) => view.setInt8(0, value),

});
var getI8Decoder = (options = {}) => numberDecoderFactory({
var getI8Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view) => view.getInt8(0),
name: "i8",
options,
size: 1
});
var getI8Codec = (options = {}) => combineCodec(getI8Encoder(options), getI8Decoder(options));
var getI8Codec = (config = {}) => combineCodec(getI8Encoder(config), getI8Decoder(config));
// src/short-u16.ts
var getShortU16Encoder = (options = {}) => ({
description: options.description ?? "shortU16",
encode: (value) => {
assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);
const bytes = [0];
for (let ii = 0; ; ii += 1) {
const alignedValue = value >> ii * 7;
if (alignedValue === 0) {
break;
var getShortU16Encoder = (config = {}) => {
var _a;
return {
description: (_a = config.description) != null ? _a : "shortU16",
encode: (value) => {
assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);
const bytes = [0];
for (let ii = 0; ; ii += 1) {
const alignedValue = value >> ii * 7;
if (alignedValue === 0) {
break;
}
const nextSevenBits = 127 & alignedValue;
bytes[ii] = nextSevenBits;
if (ii > 0) {
bytes[ii - 1] |= 128;
}
}
const nextSevenBits = 127 & alignedValue;
bytes[ii] = nextSevenBits;
if (ii > 0) {
bytes[ii - 1] |= 128;
return new Uint8Array(bytes);
},
fixedSize: null,
maxSize: 3
};
};
var getShortU16Decoder = (config = {}) => {
var _a;
return {
decode: (bytes, offset = 0) => {
let value = 0;
let byteCount = 0;
while (++byteCount) {
const byteIndex = byteCount - 1;
const currentByte = bytes[offset + byteIndex];
const nextSevenBits = 127 & currentByte;
value |= nextSevenBits << byteIndex * 7;
if ((currentByte & 128) === 0) {
break;
}
}
}
return new Uint8Array(bytes);
},
fixedSize: null,
maxSize: 3
});
var getShortU16Decoder = (options = {}) => ({
decode: (bytes, offset = 0) => {
let value = 0;
let byteCount = 0;
while (++byteCount) {
const byteIndex = byteCount - 1;
const currentByte = bytes[offset + byteIndex];
const nextSevenBits = 127 & currentByte;
value |= nextSevenBits << byteIndex * 7;
if ((currentByte & 128) === 0) {
break;
}
}
return [value, offset + byteCount];
},
description: options.description ?? "shortU16",
fixedSize: null,
maxSize: 3
});
var getShortU16Codec = (options = {}) => combineCodec(getShortU16Encoder(options), getShortU16Decoder(options));
return [value, offset + byteCount];
},
description: (_a = config.description) != null ? _a : "shortU16",
fixedSize: null,
maxSize: 3
};
};
var getShortU16Codec = (config = {}) => combineCodec(getShortU16Encoder(config), getShortU16Decoder(config));
// src/u128.ts
var getU128Encoder = (options = {}) => numberEncoderFactory({
var getU128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u128",
options,
range: [0, BigInt("0xffffffffffffffffffffffffffffffff")],

@@ -298,3 +305,4 @@ set: (view, value, le) => {

});
var getU128Decoder = (options = {}) => numberDecoderFactory({
var getU128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -308,11 +316,10 @@ const leftOffset = le ? 8 : 0;

name: "u128",
options,
size: 16
});
var getU128Codec = (options = {}) => combineCodec(getU128Encoder(options), getU128Decoder(options));
var getU128Codec = (config = {}) => combineCodec(getU128Encoder(config), getU128Decoder(config));
// src/u16.ts
var getU16Encoder = (options = {}) => numberEncoderFactory({
var getU16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u16",
options,
range: [0, Number("0xffff")],

@@ -322,14 +329,14 @@ set: (view, value, le) => view.setUint16(0, value, le),

});
var getU16Decoder = (options = {}) => numberDecoderFactory({
var getU16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getUint16(0, le),
name: "u16",
options,
size: 2
});
var getU16Codec = (options = {}) => combineCodec(getU16Encoder(options), getU16Decoder(options));
var getU16Codec = (config = {}) => combineCodec(getU16Encoder(config), getU16Decoder(config));
// src/u32.ts
var getU32Encoder = (options = {}) => numberEncoderFactory({
var getU32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u32",
options,
range: [0, Number("0xffffffff")],

@@ -339,14 +346,14 @@ 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 getU32Codec = (options = {}) => combineCodec(getU32Encoder(options), getU32Decoder(options));
var getU32Codec = (config = {}) => combineCodec(getU32Encoder(config), getU32Decoder(config));
// src/u64.ts
var getU64Encoder = (options = {}) => numberEncoderFactory({
var getU64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u64",
options,
range: [0, BigInt("0xffffffffffffffff")],

@@ -356,14 +363,14 @@ set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),

});
var getU64Decoder = (options = {}) => numberDecoderFactory({
var getU64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigUint64(0, le),
name: "u64",
options,
size: 8
});
var getU64Codec = (options = {}) => combineCodec(getU64Encoder(options), getU64Decoder(options));
var getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config));
// src/u8.ts
var getU8Encoder = (options = {}) => numberEncoderFactory({
var getU8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u8",
options,
range: [0, Number("0xff")],

@@ -373,9 +380,9 @@ 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
});
var getU8Codec = (options = {}) => combineCodec(getU8Encoder(options), getU8Decoder(options));
var getU8Codec = (config = {}) => combineCodec(getU8Encoder(config), getU8Decoder(config));

@@ -382,0 +389,0 @@ exports.Endian = Endian;

@@ -22,7 +22,7 @@ import { combineCodec, assertByteArrayIsNotEmptyForCodec, assertByteArrayHasEnoughBytesForCodec } from '@solana/codecs-core';

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

@@ -70,31 +70,31 @@ littleEndian,

// src/f32.ts
var getF32Encoder = (options = {}) => numberEncoderFactory({
var getF32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f32",
options,
set: (view, value, le) => view.setFloat32(0, value, le),
size: 4
});
var getF32Decoder = (options = {}) => numberDecoderFactory({
var getF32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat32(0, le),
name: "f32",
options,
size: 4
});
var getF32Codec = (options = {}) => combineCodec(getF32Encoder(options), getF32Decoder(options));
var getF64Encoder = (options = {}) => numberEncoderFactory({
var getF32Codec = (config = {}) => combineCodec(getF32Encoder(config), getF32Decoder(config));
var getF64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f64",
options,
set: (view, value, le) => view.setFloat64(0, value, le),
size: 8
});
var getF64Decoder = (options = {}) => numberDecoderFactory({
var getF64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat64(0, le),
name: "f64",
options,
size: 8
});
var getF64Codec = (options = {}) => combineCodec(getF64Encoder(options), getF64Decoder(options));
var getI128Encoder = (options = {}) => numberEncoderFactory({
var getF64Codec = (config = {}) => combineCodec(getF64Encoder(config), getF64Decoder(config));
var getI128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i128",
options,
range: [-BigInt("0x7fffffffffffffffffffffffffffffff") - 1n, BigInt("0x7fffffffffffffffffffffffffffffff")],

@@ -110,3 +110,4 @@ set: (view, value, le) => {

});
var getI128Decoder = (options = {}) => numberDecoderFactory({
var getI128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -120,9 +121,8 @@ const leftOffset = le ? 8 : 0;

name: "i128",
options,
size: 16
});
var getI128Codec = (options = {}) => combineCodec(getI128Encoder(options), getI128Decoder(options));
var getI16Encoder = (options = {}) => numberEncoderFactory({
var getI128Codec = (config = {}) => combineCodec(getI128Encoder(config), getI128Decoder(config));
var getI16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i16",
options,
range: [-Number("0x7fff") - 1, Number("0x7fff")],

@@ -132,12 +132,12 @@ set: (view, value, le) => view.setInt16(0, value, le),

});
var getI16Decoder = (options = {}) => numberDecoderFactory({
var getI16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt16(0, le),
name: "i16",
options,
size: 2
});
var getI16Codec = (options = {}) => combineCodec(getI16Encoder(options), getI16Decoder(options));
var getI32Encoder = (options = {}) => numberEncoderFactory({
var getI16Codec = (config = {}) => combineCodec(getI16Encoder(config), getI16Decoder(config));
var getI32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i32",
options,
range: [-Number("0x7fffffff") - 1, Number("0x7fffffff")],

@@ -147,12 +147,12 @@ set: (view, value, le) => view.setInt32(0, value, le),

});
var getI32Decoder = (options = {}) => numberDecoderFactory({
var getI32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt32(0, le),
name: "i32",
options,
size: 4
});
var getI32Codec = (options = {}) => combineCodec(getI32Encoder(options), getI32Decoder(options));
var getI64Encoder = (options = {}) => numberEncoderFactory({
var getI32Codec = (config = {}) => combineCodec(getI32Encoder(config), getI32Decoder(config));
var getI64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i64",
options,
range: [-BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff")],

@@ -162,12 +162,12 @@ set: (view, value, le) => view.setBigInt64(0, BigInt(value), le),

});
var getI64Decoder = (options = {}) => numberDecoderFactory({
var getI64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigInt64(0, le),
name: "i64",
options,
size: 8
});
var getI64Codec = (options = {}) => combineCodec(getI64Encoder(options), getI64Decoder(options));
var getI8Encoder = (options = {}) => numberEncoderFactory({
var getI64Codec = (config = {}) => combineCodec(getI64Encoder(config), getI64Decoder(config));
var getI8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i8",
options,
range: [-Number("0x7f") - 1, Number("0x7f")],

@@ -177,11 +177,11 @@ set: (view, value) => view.setInt8(0, value),

});
var getI8Decoder = (options = {}) => numberDecoderFactory({
var getI8Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view) => view.getInt8(0),
name: "i8",
options,
size: 1
});
var getI8Codec = (options = {}) => combineCodec(getI8Encoder(options), getI8Decoder(options));
var getShortU16Encoder = (options = {}) => ({
description: options.description ?? "shortU16",
var getI8Codec = (config = {}) => combineCodec(getI8Encoder(config), getI8Decoder(config));
var getShortU16Encoder = (config = {}) => ({
description: config.description ?? "shortU16",
encode: (value) => {

@@ -206,3 +206,3 @@ assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);

});
var getShortU16Decoder = (options = {}) => ({
var getShortU16Decoder = (config = {}) => ({
decode: (bytes, offset = 0) => {

@@ -222,10 +222,10 @@ let value = 0;

},
description: options.description ?? "shortU16",
description: config.description ?? "shortU16",
fixedSize: null,
maxSize: 3
});
var getShortU16Codec = (options = {}) => combineCodec(getShortU16Encoder(options), getShortU16Decoder(options));
var getU128Encoder = (options = {}) => numberEncoderFactory({
var getShortU16Codec = (config = {}) => combineCodec(getShortU16Encoder(config), getShortU16Decoder(config));
var getU128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u128",
options,
range: [0, BigInt("0xffffffffffffffffffffffffffffffff")],

@@ -241,3 +241,4 @@ set: (view, value, le) => {

});
var getU128Decoder = (options = {}) => numberDecoderFactory({
var getU128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -251,9 +252,8 @@ const leftOffset = le ? 8 : 0;

name: "u128",
options,
size: 16
});
var getU128Codec = (options = {}) => combineCodec(getU128Encoder(options), getU128Decoder(options));
var getU16Encoder = (options = {}) => numberEncoderFactory({
var getU128Codec = (config = {}) => combineCodec(getU128Encoder(config), getU128Decoder(config));
var getU16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u16",
options,
range: [0, Number("0xffff")],

@@ -263,12 +263,12 @@ set: (view, value, le) => view.setUint16(0, value, le),

});
var getU16Decoder = (options = {}) => numberDecoderFactory({
var getU16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getUint16(0, le),
name: "u16",
options,
size: 2
});
var getU16Codec = (options = {}) => combineCodec(getU16Encoder(options), getU16Decoder(options));
var getU32Encoder = (options = {}) => numberEncoderFactory({
var getU16Codec = (config = {}) => combineCodec(getU16Encoder(config), getU16Decoder(config));
var getU32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u32",
options,
range: [0, Number("0xffffffff")],

@@ -278,12 +278,12 @@ 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 getU32Codec = (options = {}) => combineCodec(getU32Encoder(options), getU32Decoder(options));
var getU64Encoder = (options = {}) => numberEncoderFactory({
var getU32Codec = (config = {}) => combineCodec(getU32Encoder(config), getU32Decoder(config));
var getU64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u64",
options,
range: [0, BigInt("0xffffffffffffffff")],

@@ -293,12 +293,12 @@ set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),

});
var getU64Decoder = (options = {}) => numberDecoderFactory({
var getU64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigUint64(0, le),
name: "u64",
options,
size: 8
});
var getU64Codec = (options = {}) => combineCodec(getU64Encoder(options), getU64Decoder(options));
var getU8Encoder = (options = {}) => numberEncoderFactory({
var getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config));
var getU8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u8",
options,
range: [0, Number("0xff")],

@@ -308,10 +308,12 @@ 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
});
var getU8Codec = (options = {}) => combineCodec(getU8Encoder(options), getU8Decoder(options));
var getU8Codec = (config = {}) => combineCodec(getU8Encoder(config), getU8Decoder(config));
export { Endian, assertNumberIsBetweenForCodec, getF32Codec, getF32Decoder, getF32Encoder, getF64Codec, getF64Decoder, getF64Encoder, getI128Codec, getI128Decoder, getI128Encoder, getI16Codec, getI16Decoder, getI16Encoder, getI32Codec, getI32Decoder, getI32Encoder, getI64Codec, getI64Decoder, getI64Encoder, getI8Codec, getI8Decoder, getI8Encoder, getShortU16Codec, getShortU16Decoder, getShortU16Encoder, getU128Codec, getU128Decoder, getU128Encoder, getU16Codec, getU16Decoder, getU16Encoder, getU32Codec, getU32Decoder, getU32Encoder, getU64Codec, getU64Decoder, getU64Encoder, getU8Codec, getU8Decoder, getU8Encoder };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

@@ -22,7 +22,7 @@ import { combineCodec, assertByteArrayIsNotEmptyForCodec, assertByteArrayHasEnoughBytesForCodec } from '@solana/codecs-core';

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

@@ -70,31 +70,31 @@ littleEndian,

// src/f32.ts
var getF32Encoder = (options = {}) => numberEncoderFactory({
var getF32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f32",
options,
set: (view, value, le) => view.setFloat32(0, value, le),
size: 4
});
var getF32Decoder = (options = {}) => numberDecoderFactory({
var getF32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat32(0, le),
name: "f32",
options,
size: 4
});
var getF32Codec = (options = {}) => combineCodec(getF32Encoder(options), getF32Decoder(options));
var getF64Encoder = (options = {}) => numberEncoderFactory({
var getF32Codec = (config = {}) => combineCodec(getF32Encoder(config), getF32Decoder(config));
var getF64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "f64",
options,
set: (view, value, le) => view.setFloat64(0, value, le),
size: 8
});
var getF64Decoder = (options = {}) => numberDecoderFactory({
var getF64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getFloat64(0, le),
name: "f64",
options,
size: 8
});
var getF64Codec = (options = {}) => combineCodec(getF64Encoder(options), getF64Decoder(options));
var getI128Encoder = (options = {}) => numberEncoderFactory({
var getF64Codec = (config = {}) => combineCodec(getF64Encoder(config), getF64Decoder(config));
var getI128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i128",
options,
range: [-BigInt("0x7fffffffffffffffffffffffffffffff") - 1n, BigInt("0x7fffffffffffffffffffffffffffffff")],

@@ -110,3 +110,4 @@ set: (view, value, le) => {

});
var getI128Decoder = (options = {}) => numberDecoderFactory({
var getI128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -120,9 +121,8 @@ const leftOffset = le ? 8 : 0;

name: "i128",
options,
size: 16
});
var getI128Codec = (options = {}) => combineCodec(getI128Encoder(options), getI128Decoder(options));
var getI16Encoder = (options = {}) => numberEncoderFactory({
var getI128Codec = (config = {}) => combineCodec(getI128Encoder(config), getI128Decoder(config));
var getI16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i16",
options,
range: [-Number("0x7fff") - 1, Number("0x7fff")],

@@ -132,12 +132,12 @@ set: (view, value, le) => view.setInt16(0, value, le),

});
var getI16Decoder = (options = {}) => numberDecoderFactory({
var getI16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt16(0, le),
name: "i16",
options,
size: 2
});
var getI16Codec = (options = {}) => combineCodec(getI16Encoder(options), getI16Decoder(options));
var getI32Encoder = (options = {}) => numberEncoderFactory({
var getI16Codec = (config = {}) => combineCodec(getI16Encoder(config), getI16Decoder(config));
var getI32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i32",
options,
range: [-Number("0x7fffffff") - 1, Number("0x7fffffff")],

@@ -147,12 +147,12 @@ set: (view, value, le) => view.setInt32(0, value, le),

});
var getI32Decoder = (options = {}) => numberDecoderFactory({
var getI32Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getInt32(0, le),
name: "i32",
options,
size: 4
});
var getI32Codec = (options = {}) => combineCodec(getI32Encoder(options), getI32Decoder(options));
var getI64Encoder = (options = {}) => numberEncoderFactory({
var getI32Codec = (config = {}) => combineCodec(getI32Encoder(config), getI32Decoder(config));
var getI64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i64",
options,
range: [-BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff")],

@@ -162,12 +162,12 @@ set: (view, value, le) => view.setBigInt64(0, BigInt(value), le),

});
var getI64Decoder = (options = {}) => numberDecoderFactory({
var getI64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigInt64(0, le),
name: "i64",
options,
size: 8
});
var getI64Codec = (options = {}) => combineCodec(getI64Encoder(options), getI64Decoder(options));
var getI8Encoder = (options = {}) => numberEncoderFactory({
var getI64Codec = (config = {}) => combineCodec(getI64Encoder(config), getI64Decoder(config));
var getI8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "i8",
options,
range: [-Number("0x7f") - 1, Number("0x7f")],

@@ -177,11 +177,11 @@ set: (view, value) => view.setInt8(0, value),

});
var getI8Decoder = (options = {}) => numberDecoderFactory({
var getI8Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view) => view.getInt8(0),
name: "i8",
options,
size: 1
});
var getI8Codec = (options = {}) => combineCodec(getI8Encoder(options), getI8Decoder(options));
var getShortU16Encoder = (options = {}) => ({
description: options.description ?? "shortU16",
var getI8Codec = (config = {}) => combineCodec(getI8Encoder(config), getI8Decoder(config));
var getShortU16Encoder = (config = {}) => ({
description: config.description ?? "shortU16",
encode: (value) => {

@@ -206,3 +206,3 @@ assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);

});
var getShortU16Decoder = (options = {}) => ({
var getShortU16Decoder = (config = {}) => ({
decode: (bytes, offset = 0) => {

@@ -222,10 +222,10 @@ let value = 0;

},
description: options.description ?? "shortU16",
description: config.description ?? "shortU16",
fixedSize: null,
maxSize: 3
});
var getShortU16Codec = (options = {}) => combineCodec(getShortU16Encoder(options), getShortU16Decoder(options));
var getU128Encoder = (options = {}) => numberEncoderFactory({
var getShortU16Codec = (config = {}) => combineCodec(getShortU16Encoder(config), getShortU16Decoder(config));
var getU128Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u128",
options,
range: [0, BigInt("0xffffffffffffffffffffffffffffffff")],

@@ -241,3 +241,4 @@ set: (view, value, le) => {

});
var getU128Decoder = (options = {}) => numberDecoderFactory({
var getU128Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => {

@@ -251,9 +252,8 @@ const leftOffset = le ? 8 : 0;

name: "u128",
options,
size: 16
});
var getU128Codec = (options = {}) => combineCodec(getU128Encoder(options), getU128Decoder(options));
var getU16Encoder = (options = {}) => numberEncoderFactory({
var getU128Codec = (config = {}) => combineCodec(getU128Encoder(config), getU128Decoder(config));
var getU16Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u16",
options,
range: [0, Number("0xffff")],

@@ -263,12 +263,12 @@ set: (view, value, le) => view.setUint16(0, value, le),

});
var getU16Decoder = (options = {}) => numberDecoderFactory({
var getU16Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getUint16(0, le),
name: "u16",
options,
size: 2
});
var getU16Codec = (options = {}) => combineCodec(getU16Encoder(options), getU16Decoder(options));
var getU32Encoder = (options = {}) => numberEncoderFactory({
var getU16Codec = (config = {}) => combineCodec(getU16Encoder(config), getU16Decoder(config));
var getU32Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u32",
options,
range: [0, Number("0xffffffff")],

@@ -278,12 +278,12 @@ 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 getU32Codec = (options = {}) => combineCodec(getU32Encoder(options), getU32Decoder(options));
var getU64Encoder = (options = {}) => numberEncoderFactory({
var getU32Codec = (config = {}) => combineCodec(getU32Encoder(config), getU32Decoder(config));
var getU64Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u64",
options,
range: [0, BigInt("0xffffffffffffffff")],

@@ -293,12 +293,12 @@ set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),

});
var getU64Decoder = (options = {}) => numberDecoderFactory({
var getU64Decoder = (config = {}) => numberDecoderFactory({
config,
get: (view, le) => view.getBigUint64(0, le),
name: "u64",
options,
size: 8
});
var getU64Codec = (options = {}) => combineCodec(getU64Encoder(options), getU64Decoder(options));
var getU8Encoder = (options = {}) => numberEncoderFactory({
var getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config));
var getU8Encoder = (config = {}) => numberEncoderFactory({
config,
name: "u8",
options,
range: [0, Number("0xff")],

@@ -308,9 +308,9 @@ 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
});
var getU8Codec = (options = {}) => combineCodec(getU8Encoder(options), getU8Decoder(options));
var getU8Codec = (config = {}) => combineCodec(getU8Encoder(config), getU8Decoder(config));

@@ -317,0 +317,0 @@ export { Endian, assertNumberIsBetweenForCodec, getF32Codec, getF32Decoder, getF32Encoder, getF64Codec, getF64Decoder, getF64Encoder, getI128Codec, getI128Decoder, getI128Encoder, getI16Codec, getI16Decoder, getI16Encoder, getI32Codec, getI32Decoder, getI32Encoder, getI64Codec, getI64Decoder, getI64Encoder, getI8Codec, getI8Decoder, getI8Encoder, getShortU16Codec, getShortU16Decoder, getShortU16Encoder, getU128Codec, getU128Decoder, getU128Encoder, getU16Codec, getU16Decoder, getU16Encoder, getU32Codec, getU32Decoder, getU32Encoder, getU64Codec, getU64Decoder, getU64Encoder, getU8Codec, getU8Decoder, getU8Encoder };

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

function u(e,r,o,t){if(t<r||t>o)throw new Error(`Codec [${e}] expected number to be in the range [${r}, ${o}], got ${t}.`)}var C=(o=>(o[o.LITTLE=0]="LITTLE",o[o.BIG=1]="BIG",o))(C||{});function a(e,r,o=0){if(r.length-o<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function b(e,r,o,t=0){let d=o.length-t;if(d<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${d}.`)}function n(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 p(e){let r,o=e.name;return e.size>1&&(r=!("endian"in e.options)||e.options.endian===0,o+=r?"(le)":"(be)"),{description:e.options.description??o,fixedSize:e.size,littleEndian:r,maxSize:e.size}}function i(e){let r=p(e);return {description:r.description,encode(o){e.range&&u(e.name,e.range[0],e.range[1],o);let t=new ArrayBuffer(e.size);return e.set(new DataView(t),o,r.littleEndian),new Uint8Array(t)},fixedSize:r.fixedSize,maxSize:r.maxSize}}function c(e){let r=p(e);return {decode(o,t=0){a(r.description,o,t),b(r.description,e.size,o,t);let d=new DataView(x(o,t,e.size));return [e.get(d,r.littleEndian),t+e.size]},description:r.description,fixedSize:r.fixedSize,maxSize:r.maxSize}}function x(e,r,o){let t=e.byteOffset+(r??0),d=o??e.byteLength;return e.buffer.slice(t,t+d)}var E=(e={})=>i({name:"f32",options:e,set:(r,o,t)=>r.setFloat32(0,o,t),size:4}),z=(e={})=>c({get:(r,o)=>r.getFloat32(0,o),name:"f32",options:e,size:4}),me=(e={})=>n(E(e),z(e));var N=(e={})=>i({name:"f64",options:e,set:(r,o,t)=>r.setFloat64(0,o,t),size:8}),D=(e={})=>c({get:(r,o)=>r.getFloat64(0,o),name:"f64",options:e,size:8}),xe=(e={})=>n(N(e),D(e));var O=(e={})=>i({name:"i128",options:e,range:[-BigInt("0x7fffffffffffffffffffffffffffffff")-1n,BigInt("0x7fffffffffffffffffffffffffffffff")],set:(r,o,t)=>{let d=t?8:0,m=t?0:8,s=0xffffffffffffffffn;r.setBigInt64(d,BigInt(o)>>64n,t),r.setBigUint64(m,BigInt(o)&s,t);},size:16}),y=(e={})=>c({get:(r,o)=>{let t=o?8:0,d=o?0:8,m=r.getBigInt64(t,o),s=r.getBigUint64(d,o);return (m<<64n)+s},name:"i128",options:e,size:16}),Se=(e={})=>n(O(e),y(e));var l=(e={})=>i({name:"i16",options:e,range:[-+"0x7fff"-1,+"0x7fff"],set:(r,o,t)=>r.setInt16(0,o,t),size:2}),S=(e={})=>c({get:(r,o)=>r.getInt16(0,o),name:"i16",options:e,size:2}),Te=(e={})=>n(l(e),S(e));var h=(e={})=>i({name:"i32",options:e,range:[-+"0x7fffffff"-1,+"0x7fffffff"],set:(r,o,t)=>r.setInt32(0,o,t),size:4}),B=(e={})=>c({get:(r,o)=>r.getInt32(0,o),name:"i32",options:e,size:4}),Me=(e={})=>n(h(e),B(e));var I=(e={})=>i({name:"i64",options:e,range:[-BigInt("0x7fffffffffffffff")-1n,BigInt("0x7fffffffffffffff")],set:(r,o,t)=>r.setBigInt64(0,BigInt(o),t),size:8}),F=(e={})=>c({get:(r,o)=>r.getBigInt64(0,o),name:"i64",options:e,size:8}),Re=(e={})=>n(I(e),F(e));var U=(e={})=>i({name:"i8",options:e,range:[-+"0x7f"-1,+"0x7f"],set:(r,o)=>r.setInt8(0,o),size:1}),w=(e={})=>c({get:r=>r.getInt8(0),name:"i8",options:e,size:1}),tr=(e={})=>n(U(e),w(e));var v=(e={})=>({description:e.description??"shortU16",encode:r=>{u("shortU16",0,65535,r);let o=[0];for(let t=0;;t+=1){let d=r>>t*7;if(d===0)break;let m=127&d;o[t]=m,t>0&&(o[t-1]|=128);}return new Uint8Array(o)},fixedSize:null,maxSize:3}),T=(e={})=>({decode:(r,o=0)=>{let t=0,d=0;for(;++d;){let m=d-1,s=r[o+m],g=127&s;if(t|=g<<m*7,!(s&128))break}return [t,o+d]},description:e.description??"shortU16",fixedSize:null,maxSize:3}),ar=(e={})=>n(v(e),T(e));var $=(e={})=>i({name:"u128",options:e,range:[0,BigInt("0xffffffffffffffffffffffffffffffff")],set:(r,o,t)=>{let d=t?8:0,m=t?0:8,s=0xffffffffffffffffn;r.setBigUint64(d,BigInt(o)>>64n,t),r.setBigUint64(m,BigInt(o)&s,t);},size:16}),A=(e={})=>c({get:(r,o)=>{let t=o?8:0,d=o?0:8,m=r.getBigUint64(t,o),s=r.getBigUint64(d,o);return (m<<64n)+s},name:"u128",options:e,size:16}),Nr=(e={})=>n($(e),A(e));var L=(e={})=>i({name:"u16",options:e,range:[0,+"0xffff"],set:(r,o,t)=>r.setUint16(0,o,t),size:2}),V=(e={})=>c({get:(r,o)=>r.getUint16(0,o),name:"u16",options:e,size:2}),Ir=(e={})=>n(L(e),V(e));var _=(e={})=>i({name:"u32",options:e,range:[0,+"0xffffffff"],set:(r,o,t)=>r.setUint32(0,o,t),size:4}),k=(e={})=>c({get:(r,o)=>r.getUint32(0,o),name:"u32",options:e,size:4}),Lr=(e={})=>n(_(e),k(e));var H=(e={})=>i({name:"u64",options:e,range:[0,BigInt("0xffffffffffffffff")],set:(r,o,t)=>r.setBigUint64(0,BigInt(o),t),size:8}),M=(e={})=>c({get:(r,o)=>r.getBigUint64(0,o),name:"u64",options:e,size:8}),jr=(e={})=>n(H(e),M(e));var G=(e={})=>i({name:"u8",options:e,range:[0,+"0xff"],set:(r,o)=>r.setUint8(0,o),size:1}),P=(e={})=>c({get:r=>r.getUint8(0),name:"u8",options:e,size:1}),Yr=(e={})=>n(G(e),P(e));
function g(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}.`)}var x=(o=>(o[o.LITTLE=0]="LITTLE",o[o.BIG=1]="BIG",o))(x||{});function b(e,r,o=0){if(r.length-o<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function s(e,r,o,n=0){let f=o.length-n;if(f<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${f}.`)}function t(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!=null?o:e.description,encode:e.encode,fixedSize:e.fixedSize,maxSize:e.maxSize}}function C(e){var n;let r,o=e.name;return e.size>1&&(r=!("endian"in e.config)||e.config.endian===0,o+=r?"(le)":"(be)"),{description:(n=e.config.description)!=null?n:o,fixedSize:e.size,littleEndian:r,maxSize:e.size}}function i(e){let r=C(e);return {description:r.description,encode(o){e.range&&g(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 c(e){let r=C(e);return {decode(o,n=0){b(r.description,o,n),s(r.description,e.size,o,n);let f=new DataView(E(o,n,e.size));return [e.get(f,r.littleEndian),n+e.size]},description:r.description,fixedSize:r.fixedSize,maxSize:r.maxSize}}function E(e,r,o){let n=e.byteOffset+(r!=null?r:0),f=o!=null?o:e.byteLength;return e.buffer.slice(n,n+f)}var z=(e={})=>i({config:e,name:"f32",set:(r,o,n)=>r.setFloat32(0,o,n),size:4}),N=(e={})=>c({config:e,get:(r,o)=>r.getFloat32(0,o),name:"f32",size:4}),ue=(e={})=>t(z(e),N(e));var D=(e={})=>i({config:e,name:"f64",set:(r,o,n)=>r.setFloat64(0,o,n),size:8}),y=(e={})=>c({config:e,get:(r,o)=>r.getFloat64(0,o),name:"f64",size:8}),Ee=(e={})=>t(D(e),y(e));var S=(e={})=>i({config:e,name:"i128",range:[-BigInt("0x7fffffffffffffffffffffffffffffff")-1n,BigInt("0x7fffffffffffffffffffffffffffffff")],set:(r,o,n)=>{let f=n?8:0,m=n?0:8,u=0xffffffffffffffffn;r.setBigInt64(f,BigInt(o)>>64n,n),r.setBigUint64(m,BigInt(o)&u,n);},size:16}),l=(e={})=>c({config:e,get:(r,o)=>{let n=o?8:0,f=o?0:8,m=r.getBigInt64(n,o),u=r.getBigUint64(f,o);return (m<<64n)+u},name:"i128",size:16}),Be=(e={})=>t(S(e),l(e));var h=(e={})=>i({config:e,name:"i16",range:[-+"0x7fff"-1,+"0x7fff"],set:(r,o,n)=>r.setInt16(0,o,n),size:2}),B=(e={})=>c({config:e,get:(r,o)=>r.getInt16(0,o),name:"i16",size:2}),Ae=(e={})=>t(h(e),B(e));var I=(e={})=>i({config:e,name:"i32",range:[-+"0x7fffffff"-1,+"0x7fffffff"],set:(r,o,n)=>r.setInt32(0,o,n),size:4}),F=(e={})=>c({config:e,get:(r,o)=>r.getInt32(0,o),name:"i32",size:4}),Ge=(e={})=>t(I(e),F(e));var U=(e={})=>i({config:e,name:"i64",range:[-BigInt("0x7fffffffffffffff")-1n,BigInt("0x7fffffffffffffff")],set:(r,o,n)=>r.setBigInt64(0,BigInt(o),n),size:8}),w=(e={})=>c({config:e,get:(r,o)=>r.getBigInt64(0,o),name:"i64",size:8}),We=(e={})=>t(U(e),w(e));var v=(e={})=>i({config:e,name:"i8",range:[-+"0x7f"-1,+"0x7f"],set:(r,o)=>r.setInt8(0,o),size:1}),T=(e={})=>c({config:e,get:r=>r.getInt8(0),name:"i8",size:1}),tr=(e={})=>t(v(e),T(e));var $=(e={})=>{var r;return {description:(r=e.description)!=null?r:"shortU16",encode:o=>{g("shortU16",0,65535,o);let n=[0];for(let f=0;;f+=1){let m=o>>f*7;if(m===0)break;let u=127&m;n[f]=u,f>0&&(n[f-1]|=128);}return new Uint8Array(n)},fixedSize:null,maxSize:3}},A=(e={})=>{var r;return {decode:(o,n=0)=>{let f=0,m=0;for(;++m;){let u=m-1,a=o[n+u],p=127&a;if(f|=p<<u*7,!(a&128))break}return [f,n+m]},description:(r=e.description)!=null?r:"shortU16",fixedSize:null,maxSize:3}},br=(e={})=>t($(e),A(e));var O=(e={})=>i({config:e,name:"u128",range:[0,BigInt("0xffffffffffffffffffffffffffffffff")],set:(r,o,n)=>{let f=n?8:0,m=n?0:8,u=0xffffffffffffffffn;r.setBigUint64(f,BigInt(o)>>64n,n),r.setBigUint64(m,BigInt(o)&u,n);},size:16}),L=(e={})=>c({config:e,get:(r,o)=>{let n=o?8:0,f=o?0:8,m=r.getBigUint64(n,o),u=r.getBigUint64(f,o);return (m<<64n)+u},name:"u128",size:16}),Dr=(e={})=>t(O(e),L(e));var V=(e={})=>i({config:e,name:"u16",range:[0,+"0xffff"],set:(r,o,n)=>r.setUint16(0,o,n),size:2}),_=(e={})=>c({config:e,get:(r,o)=>r.getUint16(0,o),name:"u16",size:2}),Ur=(e={})=>t(V(e),_(e));var k=(e={})=>i({config:e,name:"u32",range:[0,+"0xffffffff"],set:(r,o,n)=>r.setUint32(0,o,n),size:4}),H=(e={})=>c({config:e,get:(r,o)=>r.getUint32(0,o),name:"u32",size:4}),Vr=(e={})=>t(k(e),H(e));var M=(e={})=>i({config:e,name:"u64",range:[0,BigInt("0xffffffffffffffff")],set:(r,o,n)=>r.setBigUint64(0,BigInt(o),n),size:8}),G=(e={})=>c({config:e,get:(r,o)=>r.getBigUint64(0,o),name:"u64",size:8}),qr=(e={})=>t(M(e),G(e));var P=(e={})=>i({config:e,name:"u8",range:[0,+"0xff"],set:(r,o)=>r.setUint8(0,o),size:1}),j=(e={})=>c({config:e,get:r=>r.getUint8(0),name:"u8",size:1}),Zr=(e={})=>t(P(e),j(e));
exports.Endian = C;
exports.assertNumberIsBetweenForCodec = u;
exports.getF32Codec = me;
exports.getF32Decoder = z;
exports.getF32Encoder = E;
exports.getF64Codec = xe;
exports.getF64Decoder = D;
exports.getF64Encoder = N;
exports.getI128Codec = Se;
exports.getI128Decoder = y;
exports.getI128Encoder = O;
exports.getI16Codec = Te;
exports.getI16Decoder = S;
exports.getI16Encoder = l;
exports.getI32Codec = Me;
exports.getI32Decoder = B;
exports.getI32Encoder = h;
exports.getI64Codec = Re;
exports.getI64Decoder = F;
exports.getI64Encoder = I;
exports.Endian = x;
exports.assertNumberIsBetweenForCodec = g;
exports.getF32Codec = ue;
exports.getF32Decoder = N;
exports.getF32Encoder = z;
exports.getF64Codec = Ee;
exports.getF64Decoder = y;
exports.getF64Encoder = D;
exports.getI128Codec = Be;
exports.getI128Decoder = l;
exports.getI128Encoder = S;
exports.getI16Codec = Ae;
exports.getI16Decoder = B;
exports.getI16Encoder = h;
exports.getI32Codec = Ge;
exports.getI32Decoder = F;
exports.getI32Encoder = I;
exports.getI64Codec = We;
exports.getI64Decoder = w;
exports.getI64Encoder = U;
exports.getI8Codec = tr;
exports.getI8Decoder = w;
exports.getI8Encoder = U;
exports.getShortU16Codec = ar;
exports.getShortU16Decoder = T;
exports.getShortU16Encoder = v;
exports.getU128Codec = Nr;
exports.getU128Decoder = A;
exports.getU128Encoder = $;
exports.getU16Codec = Ir;
exports.getU16Decoder = V;
exports.getU16Encoder = L;
exports.getU32Codec = Lr;
exports.getU32Decoder = k;
exports.getU32Encoder = _;
exports.getU64Codec = jr;
exports.getU64Decoder = M;
exports.getU64Encoder = H;
exports.getU8Codec = Yr;
exports.getU8Decoder = P;
exports.getU8Encoder = G;
exports.getI8Decoder = T;
exports.getI8Encoder = v;
exports.getShortU16Codec = br;
exports.getShortU16Decoder = A;
exports.getShortU16Encoder = $;
exports.getU128Codec = Dr;
exports.getU128Decoder = L;
exports.getU128Encoder = O;
exports.getU16Codec = Ur;
exports.getU16Decoder = _;
exports.getU16Encoder = V;
exports.getU32Codec = Vr;
exports.getU32Decoder = H;
exports.getU32Encoder = k;
exports.getU64Codec = qr;
exports.getU64Decoder = G;
exports.getU64Encoder = M;
exports.getU8Codec = Zr;
exports.getU8Decoder = j;
exports.getU8Encoder = P;

@@ -50,0 +50,0 @@ return exports;

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

import { BaseCodecOptions, Codec, Decoder, Encoder } from '@solana/codecs-core';
import { BaseCodecConfig, Codec, Decoder, Encoder } from '@solana/codecs-core';
/** Defines a encoder for numbers and bigints. */

@@ -8,6 +8,6 @@ export type NumberEncoder = Encoder<number> | Encoder<number | bigint>;

export type NumberCodec = Codec<number> | Codec<number | bigint, bigint>;
/** Defines the options for u8 and i8 codecs. */
export type SingleByteNumberCodecOptions = BaseCodecOptions;
/** Defines the options for number codecs that use more than one byte. */
export type NumberCodecOptions = BaseCodecOptions & {
/** Defines the config for u8 and i8 codecs. */
export type SingleByteNumberCodecConfig = BaseCodecConfig;
/** Defines the config for number codecs that use more than one byte. */
export type NumberCodecConfig = BaseCodecConfig & {
/**

@@ -14,0 +14,0 @@ * Whether the serializer should use little-endian or big-endian encoding.

import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getF32Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getF32Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getF32Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getF32Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getF32Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getF32Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=f32.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getF64Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getF64Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getF64Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getF64Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getF64Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getF64Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=f64.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getI128Encoder: (options?: NumberCodecOptions) => Encoder<number | bigint>;
export declare const getI128Decoder: (options?: NumberCodecOptions) => Decoder<bigint>;
export declare const getI128Codec: (options?: NumberCodecOptions) => Codec<number | bigint, bigint>;
import { NumberCodecConfig } from './common';
export declare const getI128Encoder: (config?: NumberCodecConfig) => Encoder<number | bigint>;
export declare const getI128Decoder: (config?: NumberCodecConfig) => Decoder<bigint>;
export declare const getI128Codec: (config?: NumberCodecConfig) => Codec<number | bigint, bigint>;
//# sourceMappingURL=i128.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getI16Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getI16Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getI16Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getI16Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getI16Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getI16Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=i16.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getI32Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getI32Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getI32Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getI32Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getI32Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getI32Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=i32.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getI64Encoder: (options?: NumberCodecOptions) => Encoder<number | bigint>;
export declare const getI64Decoder: (options?: NumberCodecOptions) => Decoder<bigint>;
export declare const getI64Codec: (options?: NumberCodecOptions) => Codec<number | bigint, bigint>;
import { NumberCodecConfig } from './common';
export declare const getI64Encoder: (config?: NumberCodecConfig) => Encoder<number | bigint>;
export declare const getI64Decoder: (config?: NumberCodecConfig) => Decoder<bigint>;
export declare const getI64Codec: (config?: NumberCodecConfig) => Codec<number | bigint, bigint>;
//# sourceMappingURL=i64.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { SingleByteNumberCodecOptions } from './common';
export declare const getI8Encoder: (options?: SingleByteNumberCodecOptions) => Encoder<number>;
export declare const getI8Decoder: (options?: SingleByteNumberCodecOptions) => Decoder<number>;
export declare const getI8Codec: (options?: SingleByteNumberCodecOptions) => Codec<number>;
import { SingleByteNumberCodecConfig } from './common';
export declare const getI8Encoder: (config?: SingleByteNumberCodecConfig) => Encoder<number>;
export declare const getI8Decoder: (config?: SingleByteNumberCodecConfig) => Decoder<number>;
export declare const getI8Codec: (config?: SingleByteNumberCodecConfig) => Codec<number>;
//# sourceMappingURL=i8.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';
/**
* Defines the options for the shortU16 serializer.
* Defines the config for the shortU16 serializer.
*/
export type ShortU16CodecOptions = BaseCodecOptions;
export type ShortU16CodecConfig = BaseCodecConfig;
/**

@@ -10,3 +10,3 @@ * Encodes short u16 numbers.

*/
export declare const getShortU16Encoder: (options?: ShortU16CodecOptions) => Encoder<number>;
export declare const getShortU16Encoder: (config?: ShortU16CodecConfig) => Encoder<number>;
/**

@@ -16,3 +16,3 @@ * Decodes short u16 numbers.

*/
export declare const getShortU16Decoder: (options?: ShortU16CodecOptions) => Decoder<number>;
export declare const getShortU16Decoder: (config?: ShortU16CodecConfig) => Decoder<number>;
/**

@@ -27,3 +27,3 @@ * Encodes and decodes short u16 numbers.

*/
export declare const getShortU16Codec: (options?: ShortU16CodecOptions) => Codec<number>;
export declare const getShortU16Codec: (config?: ShortU16CodecConfig) => Codec<number>;
//# sourceMappingURL=short-u16.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getU128Encoder: (options?: NumberCodecOptions) => Encoder<number | bigint>;
export declare const getU128Decoder: (options?: NumberCodecOptions) => Decoder<bigint>;
export declare const getU128Codec: (options?: NumberCodecOptions) => Codec<number | bigint, bigint>;
import { NumberCodecConfig } from './common';
export declare const getU128Encoder: (config?: NumberCodecConfig) => Encoder<number | bigint>;
export declare const getU128Decoder: (config?: NumberCodecConfig) => Decoder<bigint>;
export declare const getU128Codec: (config?: NumberCodecConfig) => Codec<number | bigint, bigint>;
//# sourceMappingURL=u128.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getU16Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getU16Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getU16Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getU16Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getU16Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getU16Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=u16.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getU32Encoder: (options?: NumberCodecOptions) => Encoder<number>;
export declare const getU32Decoder: (options?: NumberCodecOptions) => Decoder<number>;
export declare const getU32Codec: (options?: NumberCodecOptions) => Codec<number>;
import { NumberCodecConfig } from './common';
export declare const getU32Encoder: (config?: NumberCodecConfig) => Encoder<number>;
export declare const getU32Decoder: (config?: NumberCodecConfig) => Decoder<number>;
export declare const getU32Codec: (config?: NumberCodecConfig) => Codec<number>;
//# sourceMappingURL=u32.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions } from './common';
export declare const getU64Encoder: (options?: NumberCodecOptions) => Encoder<number | bigint>;
export declare const getU64Decoder: (options?: NumberCodecOptions) => Decoder<bigint>;
export declare const getU64Codec: (options?: NumberCodecOptions) => Codec<number | bigint, bigint>;
import { NumberCodecConfig } from './common';
export declare const getU64Encoder: (config?: NumberCodecConfig) => Encoder<number | bigint>;
export declare const getU64Decoder: (config?: NumberCodecConfig) => Decoder<bigint>;
export declare const getU64Codec: (config?: NumberCodecConfig) => Codec<number | bigint, bigint>;
//# sourceMappingURL=u64.d.ts.map
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
import { SingleByteNumberCodecOptions } from './common';
export declare const getU8Encoder: (options?: SingleByteNumberCodecOptions) => Encoder<number>;
export declare const getU8Decoder: (options?: SingleByteNumberCodecOptions) => Decoder<number>;
export declare const getU8Codec: (options?: SingleByteNumberCodecOptions) => Codec<number>;
import { SingleByteNumberCodecConfig } from './common';
export declare const getU8Encoder: (config?: SingleByteNumberCodecConfig) => Encoder<number>;
export declare const getU8Decoder: (config?: SingleByteNumberCodecConfig) => Decoder<number>;
export declare const getU8Codec: (config?: SingleByteNumberCodecConfig) => Codec<number>;
//# sourceMappingURL=u8.d.ts.map
import { Decoder, Encoder } from '@solana/codecs-core';
import { NumberCodecOptions, SingleByteNumberCodecOptions } from './common';
import { NumberCodecConfig, SingleByteNumberCodecConfig } from './common';
type NumberFactorySharedInput = {
name: string;
size: number;
options: SingleByteNumberCodecOptions | NumberCodecOptions;
config: SingleByteNumberCodecConfig | NumberCodecConfig;
};

@@ -8,0 +8,0 @@ type NumberFactoryEncoderInput<T> = NumberFactorySharedInput & {

{
"name": "@solana/codecs-numbers",
"version": "2.0.0-experimental.856952e",
"version": "2.0.0-experimental.85b7dfe",
"description": "Codecs for numbers of different sizes and endianness",

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

"dependencies": {
"@solana/codecs-core": "2.0.0-experimental.856952e"
"@solana/codecs-core": "2.0.0-experimental.85b7dfe"
},
"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",

@@ -63,10 +63,10 @@ "@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",
"prettier": "^3.1",
"tsup": "^8.0.1",
"typescript": "^5.2.2",

@@ -91,8 +91,8 @@ "version-from-git": "^1.1.1",

"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",
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
"test:treeshakability:browser": "agadoo dist/index.browser.js",
"test:treeshakability:native": "agadoo dist/index.node.js",
"test:treeshakability:node": "agadoo dist/index.native.js",
"test:treeshakability:native": "agadoo dist/index.native.js",
"test:treeshakability:node": "agadoo dist/index.node.js",
"test:typecheck": "tsc --noEmit",

@@ -99,0 +99,0 @@ "test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.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