@solana/codecs-numbers 2.0.0-experimental.fc4e943 → 2.0.0-experimental.fcff844
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +95 -113
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +96 -114
- package/dist/index.browser.js.map +1 -1
- package/dist/index.development.js +129 -124
- package/dist/index.development.js.map +1 -1
- package/dist/index.native.js +96 -114
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +95 -113
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +96 -112
- package/dist/index.node.js.map +1 -1
- package/dist/index.production.min.js +38 -38
- package/dist/types/assertions.d.ts.map +1 -0
- package/dist/types/common.d.ts +9 -5
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/f32.d.ts +5 -5
- package/dist/types/f32.d.ts.map +1 -0
- package/dist/types/f64.d.ts +5 -5
- package/dist/types/f64.d.ts.map +1 -0
- package/dist/types/i128.d.ts +5 -5
- package/dist/types/i128.d.ts.map +1 -0
- package/dist/types/i16.d.ts +5 -5
- package/dist/types/i16.d.ts.map +1 -0
- package/dist/types/i32.d.ts +5 -5
- package/dist/types/i32.d.ts.map +1 -0
- package/dist/types/i64.d.ts +5 -5
- package/dist/types/i64.d.ts.map +1 -0
- package/dist/types/i8.d.ts +4 -5
- package/dist/types/i8.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/short-u16.d.ts +4 -8
- package/dist/types/short-u16.d.ts.map +1 -0
- package/dist/types/u128.d.ts +5 -5
- package/dist/types/u128.d.ts.map +1 -0
- package/dist/types/u16.d.ts +5 -5
- package/dist/types/u16.d.ts.map +1 -0
- package/dist/types/u32.d.ts +5 -5
- package/dist/types/u32.d.ts.map +1 -0
- package/dist/types/u64.d.ts +5 -5
- package/dist/types/u64.d.ts.map +1 -0
- package/dist/types/u8.d.ts +4 -5
- package/dist/types/u8.d.ts.map +1 -0
- package/dist/types/utils.d.ts +11 -11
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +9 -9
package/dist/types/common.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Codec, Decoder, Encoder, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
2
|
/** Defines a encoder for numbers and bigints. */
|
|
3
3
|
export type NumberEncoder = Encoder<number> | Encoder<number | bigint>;
|
|
4
|
+
/** Defines a fixed-size encoder for numbers and bigints. */
|
|
5
|
+
export type FixedSizeNumberEncoder<TSize extends number = number> = FixedSizeEncoder<number, TSize> | FixedSizeEncoder<number | bigint, TSize>;
|
|
4
6
|
/** Defines a decoder for numbers and bigints. */
|
|
5
7
|
export type NumberDecoder = Decoder<number> | Decoder<bigint>;
|
|
8
|
+
/** Defines a fixed-size decoder for numbers and bigints. */
|
|
9
|
+
export type FixedSizeNumberDecoder<TSize extends number = number> = FixedSizeDecoder<number, TSize> | FixedSizeDecoder<bigint, TSize>;
|
|
6
10
|
/** Defines a codec for numbers and bigints. */
|
|
7
11
|
export type NumberCodec = Codec<number> | Codec<number | bigint, bigint>;
|
|
8
|
-
/** Defines
|
|
9
|
-
export type
|
|
10
|
-
/** Defines the
|
|
11
|
-
export type
|
|
12
|
+
/** Defines a fixed-size codec for numbers and bigints. */
|
|
13
|
+
export type FixedSizeNumberCodec<TSize extends number = number> = FixedSizeCodec<number, number, TSize> | FixedSizeCodec<number | bigint, bigint, TSize>;
|
|
14
|
+
/** Defines the config for number codecs that use more than one byte. */
|
|
15
|
+
export type NumberCodecConfig = {
|
|
12
16
|
/**
|
|
13
17
|
* Whether the serializer should use little-endian or big-endian encoding.
|
|
14
18
|
* @defaultValue `Endian.LITTLE`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getF32Encoder: (
|
|
4
|
-
export declare const getF32Decoder: (
|
|
5
|
-
export declare const getF32Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getF32Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 4>;
|
|
4
|
+
export declare const getF32Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 4>;
|
|
5
|
+
export declare const getF32Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 4>;
|
|
6
6
|
//# sourceMappingURL=f32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"f32.d.ts","sourceRoot":"","sources":["../../src/f32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/f64.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getF64Encoder: (
|
|
4
|
-
export declare const getF64Decoder: (
|
|
5
|
-
export declare const getF64Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getF64Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 8>;
|
|
4
|
+
export declare const getF64Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 8>;
|
|
5
|
+
export declare const getF64Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 8>;
|
|
6
6
|
//# sourceMappingURL=f64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"f64.d.ts","sourceRoot":"","sources":["../../src/f64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/i128.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getI128Encoder: (
|
|
4
|
-
export declare const getI128Decoder: (
|
|
5
|
-
export declare const getI128Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getI128Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number | bigint, 16>;
|
|
4
|
+
export declare const getI128Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<bigint, 16>;
|
|
5
|
+
export declare const getI128Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number | bigint, bigint, 16>;
|
|
6
6
|
//# sourceMappingURL=i128.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i128.d.ts","sourceRoot":"","sources":["../../src/i128.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,cAAc,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,GAAG,MAAM,EAAE,EAAE,CAa9F,CAAC;AAEP,eAAO,MAAM,cAAc,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,EAAE,CAYrF,CAAC;AAEP,eAAO,MAAM,YAAY,YAAY,iBAAiB,KAAQ,eAAe,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,EAAE,CACxC,CAAC"}
|
package/dist/types/i16.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getI16Encoder: (
|
|
4
|
-
export declare const getI16Decoder: (
|
|
5
|
-
export declare const getI16Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getI16Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 2>;
|
|
4
|
+
export declare const getI16Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 2>;
|
|
5
|
+
export declare const getI16Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 2>;
|
|
6
6
|
//# sourceMappingURL=i16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i16.d.ts","sourceRoot":"","sources":["../../src/i16.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAOnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/i32.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getI32Encoder: (
|
|
4
|
-
export declare const getI32Decoder: (
|
|
5
|
-
export declare const getI32Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getI32Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 4>;
|
|
4
|
+
export declare const getI32Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 4>;
|
|
5
|
+
export declare const getI32Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 4>;
|
|
6
6
|
//# sourceMappingURL=i32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i32.d.ts","sourceRoot":"","sources":["../../src/i32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAOnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/i64.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getI64Encoder: (
|
|
4
|
-
export declare const getI64Decoder: (
|
|
5
|
-
export declare const getI64Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getI64Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number | bigint, 8>;
|
|
4
|
+
export declare const getI64Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<bigint, 8>;
|
|
5
|
+
export declare const getI64Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number | bigint, bigint, 8>;
|
|
6
6
|
//# sourceMappingURL=i64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i64.d.ts","sourceRoot":"","sources":["../../src/i64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,GAAG,MAAM,EAAE,CAAC,CAO5F,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CACxC,CAAC"}
|
package/dist/types/i8.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const getI8Codec: (options?: SingleByteNumberCodecOptions) => Codec<number>;
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
export declare const getI8Encoder: () => FixedSizeEncoder<number, 1>;
|
|
3
|
+
export declare const getI8Decoder: () => FixedSizeDecoder<number, 1>;
|
|
4
|
+
export declare const getI8Codec: () => FixedSizeCodec<number, number, 1>;
|
|
6
5
|
//# sourceMappingURL=i8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i8.d.ts","sourceRoot":"","sources":["../../src/i8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvG,eAAO,MAAM,YAAY,QAAO,iBAAiB,MAAM,EAAE,CAAC,CAMpD,CAAC;AAEP,eAAO,MAAM,YAAY,QAAO,iBAAiB,MAAM,EAAE,CAAC,CAKpD,CAAC;AAEP,eAAO,MAAM,UAAU,QAAO,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,MAAM,CAAC"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* Defines the options for the shortU16 serializer.
|
|
4
|
-
*/
|
|
5
|
-
export type ShortU16CodecOptions = BaseCodecOptions;
|
|
1
|
+
import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
|
|
6
2
|
/**
|
|
7
3
|
* Encodes short u16 numbers.
|
|
8
4
|
* @see {@link getShortU16Codec} for a more detailed description.
|
|
9
5
|
*/
|
|
10
|
-
export declare const getShortU16Encoder: (
|
|
6
|
+
export declare const getShortU16Encoder: () => VariableSizeEncoder<number>;
|
|
11
7
|
/**
|
|
12
8
|
* Decodes short u16 numbers.
|
|
13
9
|
* @see {@link getShortU16Codec} for a more detailed description.
|
|
14
10
|
*/
|
|
15
|
-
export declare const getShortU16Decoder: (
|
|
11
|
+
export declare const getShortU16Decoder: () => VariableSizeDecoder<number>;
|
|
16
12
|
/**
|
|
17
13
|
* Encodes and decodes short u16 numbers.
|
|
18
14
|
*
|
|
@@ -22,5 +18,5 @@ export declare const getShortU16Decoder: (options?: ShortU16CodecOptions) => Dec
|
|
|
22
18
|
* pattern until the 3rd byte. The 3rd byte, if needed, uses
|
|
23
19
|
* all 8 bits to store the last byte of the original value.
|
|
24
20
|
*/
|
|
25
|
-
export declare const getShortU16Codec: (
|
|
21
|
+
export declare const getShortU16Codec: () => VariableSizeCodec<number>;
|
|
26
22
|
//# sourceMappingURL=short-u16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"short-u16.d.ts","sourceRoot":"","sources":["../../src/short-u16.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAI7B;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,oBAAoB,MAAM,CA6B1D,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,oBAAoB,MAAM,CAmB1D,CAAC;AAEP;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAO,kBAAkB,MAAM,CACA,CAAC"}
|
package/dist/types/u128.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getU128Encoder: (
|
|
4
|
-
export declare const getU128Decoder: (
|
|
5
|
-
export declare const getU128Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getU128Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number | bigint, 16>;
|
|
4
|
+
export declare const getU128Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<bigint, 16>;
|
|
5
|
+
export declare const getU128Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number | bigint, bigint, 16>;
|
|
6
6
|
//# sourceMappingURL=u128.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u128.d.ts","sourceRoot":"","sources":["../../src/u128.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,cAAc,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,GAAG,MAAM,EAAE,EAAE,CAa9F,CAAC;AAEP,eAAO,MAAM,cAAc,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,EAAE,CAYrF,CAAC;AAEP,eAAO,MAAM,YAAY,YAAY,iBAAiB,KAAQ,eAAe,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,EAAE,CACxC,CAAC"}
|
package/dist/types/u16.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getU16Encoder: (
|
|
4
|
-
export declare const getU16Decoder: (
|
|
5
|
-
export declare const getU16Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getU16Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 2>;
|
|
4
|
+
export declare const getU16Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 2>;
|
|
5
|
+
export declare const getU16Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 2>;
|
|
6
6
|
//# sourceMappingURL=u16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u16.d.ts","sourceRoot":"","sources":["../../src/u16.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAOnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/u32.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getU32Encoder: (
|
|
4
|
-
export declare const getU32Decoder: (
|
|
5
|
-
export declare const getU32Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getU32Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number, 4>;
|
|
4
|
+
export declare const getU32Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 4>;
|
|
5
|
+
export declare const getU32Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number, number, 4>;
|
|
6
6
|
//# sourceMappingURL=u32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u32.d.ts","sourceRoot":"","sources":["../../src/u32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAOnF,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAC/B,CAAC"}
|
package/dist/types/u64.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const getU64Encoder: (
|
|
4
|
-
export declare const getU64Decoder: (
|
|
5
|
-
export declare const getU64Codec: (
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
export declare const getU64Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<number | bigint, 8>;
|
|
4
|
+
export declare const getU64Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<bigint, 8>;
|
|
5
|
+
export declare const getU64Codec: (config?: NumberCodecConfig) => FixedSizeCodec<number | bigint, bigint, 8>;
|
|
6
6
|
//# sourceMappingURL=u64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u64.d.ts","sourceRoot":"","sources":["../../src/u64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,GAAG,MAAM,EAAE,CAAC,CAO5F,CAAC;AAEP,eAAO,MAAM,aAAa,YAAY,iBAAiB,KAAQ,iBAAiB,MAAM,EAAE,CAAC,CAMnF,CAAC;AAEP,eAAO,MAAM,WAAW,YAAY,iBAAiB,KAAQ,eAAe,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CACxC,CAAC"}
|
package/dist/types/u8.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const getU8Codec: (options?: SingleByteNumberCodecOptions) => Codec<number>;
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
export declare const getU8Encoder: () => FixedSizeEncoder<number, 1>;
|
|
3
|
+
export declare const getU8Decoder: () => FixedSizeDecoder<number, 1>;
|
|
4
|
+
export declare const getU8Codec: () => FixedSizeCodec<number, number, 1>;
|
|
6
5
|
//# sourceMappingURL=u8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u8.d.ts","sourceRoot":"","sources":["../../src/u8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvG,eAAO,MAAM,YAAY,QAAO,iBAAiB,MAAM,EAAE,CAAC,CAMpD,CAAC;AAEP,eAAO,MAAM,YAAY,QAAO,iBAAiB,MAAM,EAAE,CAAC,CAKpD,CAAC;AAEP,eAAO,MAAM,UAAU,QAAO,eAAe,MAAM,EAAE,MAAM,EAAE,CAAC,CAAiD,CAAC"}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type NumberFactorySharedInput = {
|
|
1
|
+
import { FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecConfig } from './common';
|
|
3
|
+
type NumberFactorySharedInput<TSize extends number> = {
|
|
4
4
|
name: string;
|
|
5
|
-
size:
|
|
6
|
-
|
|
5
|
+
size: TSize;
|
|
6
|
+
config?: NumberCodecConfig;
|
|
7
7
|
};
|
|
8
|
-
type NumberFactoryEncoderInput<
|
|
8
|
+
type NumberFactoryEncoderInput<TFrom, TSize extends number> = NumberFactorySharedInput<TSize> & {
|
|
9
9
|
range?: [number | bigint, number | bigint];
|
|
10
|
-
set: (view: DataView, value:
|
|
10
|
+
set: (view: DataView, value: TFrom, littleEndian?: boolean) => void;
|
|
11
11
|
};
|
|
12
|
-
type NumberFactoryDecoderInput<
|
|
13
|
-
get: (view: DataView, littleEndian?: boolean) =>
|
|
12
|
+
type NumberFactoryDecoderInput<TTo, TSize extends number> = NumberFactorySharedInput<TSize> & {
|
|
13
|
+
get: (view: DataView, littleEndian?: boolean) => TTo;
|
|
14
14
|
};
|
|
15
|
-
export declare function numberEncoderFactory<
|
|
16
|
-
export declare function numberDecoderFactory<
|
|
15
|
+
export declare function numberEncoderFactory<TFrom extends number | bigint, TSize extends number>(input: NumberFactoryEncoderInput<TFrom, TSize>): FixedSizeEncoder<TFrom, TSize>;
|
|
16
|
+
export declare function numberDecoderFactory<TTo extends number | bigint, TSize extends number>(input: NumberFactoryDecoderInput<TTo, TSize>): FixedSizeDecoder<TTo, TSize>;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@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,KAAK,CAAC,CAU9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/codecs-numbers",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.fcff844",
|
|
4
4
|
"description": "Codecs for numbers of different sizes and endianness",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -49,24 +49,24 @@
|
|
|
49
49
|
"node": ">=17.4"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@solana/codecs-core": "2.0.0-experimental.
|
|
52
|
+
"@solana/codecs-core": "2.0.0-experimental.fcff844"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@solana/eslint-config-solana": "^1.0.2",
|
|
56
|
-
"@swc/jest": "^0.2.
|
|
57
|
-
"@types/jest": "^29.5.
|
|
56
|
+
"@swc/jest": "^0.2.29",
|
|
57
|
+
"@types/jest": "^29.5.6",
|
|
58
58
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
59
59
|
"@typescript-eslint/parser": "^6.3.0",
|
|
60
60
|
"agadoo": "^3.0.0",
|
|
61
61
|
"eslint": "^8.45.0",
|
|
62
|
-
"eslint-plugin-jest": "^27.2
|
|
62
|
+
"eslint-plugin-jest": "^27.4.2",
|
|
63
63
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
64
64
|
"jest": "^29.7.0",
|
|
65
|
-
"jest-environment-jsdom": "^29.
|
|
66
|
-
"jest-runner-eslint": "^2.1.
|
|
65
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
66
|
+
"jest-runner-eslint": "^2.1.2",
|
|
67
67
|
"jest-runner-prettier": "^1.0.0",
|
|
68
|
-
"prettier": "^
|
|
69
|
-
"tsup": "
|
|
68
|
+
"prettier": "^3.1",
|
|
69
|
+
"tsup": "^8.0.1",
|
|
70
70
|
"typescript": "^5.2.2",
|
|
71
71
|
"version-from-git": "^1.1.1",
|
|
72
72
|
"build-scripts": "0.0.0",
|