@solana/codecs-numbers 2.0.0-experimental.0099b2a → 2.0.0-experimental.025ef21
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/README.md +112 -4
- package/dist/index.browser.cjs +95 -111
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +96 -112
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +96 -112
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +95 -111
- 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/types/common.d.ts +9 -5
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/f32.d.ts +5 -5
- package/dist/types/f32.d.ts.map +1 -1
- package/dist/types/f64.d.ts +5 -5
- package/dist/types/f64.d.ts.map +1 -1
- package/dist/types/i128.d.ts +5 -5
- package/dist/types/i128.d.ts.map +1 -1
- package/dist/types/i16.d.ts +5 -5
- package/dist/types/i16.d.ts.map +1 -1
- package/dist/types/i32.d.ts +5 -5
- package/dist/types/i32.d.ts.map +1 -1
- package/dist/types/i64.d.ts +5 -5
- package/dist/types/i64.d.ts.map +1 -1
- package/dist/types/i8.d.ts +4 -5
- package/dist/types/i8.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -15
- package/dist/types/short-u16.d.ts +4 -8
- package/dist/types/short-u16.d.ts.map +1 -1
- package/dist/types/u128.d.ts +5 -5
- package/dist/types/u128.d.ts.map +1 -1
- package/dist/types/u16.d.ts +5 -5
- package/dist/types/u16.d.ts.map +1 -1
- package/dist/types/u32.d.ts +5 -5
- package/dist/types/u32.d.ts.map +1 -1
- package/dist/types/u64.d.ts +5 -5
- package/dist/types/u64.d.ts.map +1 -1
- package/dist/types/u8.d.ts +4 -5
- package/dist/types/u8.d.ts.map +1 -1
- package/dist/types/utils.d.ts +11 -11
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/index.development.js +0 -412
- package/dist/index.development.js.map +0 -1
- package/dist/index.production.min.js +0 -51
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.js';
|
|
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
|
package/dist/types/i32.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i32.d.ts","sourceRoot":"","sources":["../../src/i32.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
package/dist/types/i64.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i64.d.ts","sourceRoot":"","sources":["../../src/i64.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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
|
package/dist/types/i8.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i8.d.ts","sourceRoot":"","sources":["../../src/i8.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './assertions';
|
|
2
|
-
export * from './common';
|
|
3
|
-
export * from './f32';
|
|
4
|
-
export * from './f64';
|
|
5
|
-
export * from './i128';
|
|
6
|
-
export * from './i16';
|
|
7
|
-
export * from './i32';
|
|
8
|
-
export * from './i64';
|
|
9
|
-
export * from './i8';
|
|
10
|
-
export * from './short-u16';
|
|
11
|
-
export * from './u128';
|
|
12
|
-
export * from './u16';
|
|
13
|
-
export * from './u32';
|
|
14
|
-
export * from './u64';
|
|
15
|
-
export * from './u8';
|
|
1
|
+
export * from './assertions.js';
|
|
2
|
+
export * from './common.js';
|
|
3
|
+
export * from './f32.js';
|
|
4
|
+
export * from './f64.js';
|
|
5
|
+
export * from './i128.js';
|
|
6
|
+
export * from './i16.js';
|
|
7
|
+
export * from './i32.js';
|
|
8
|
+
export * from './i64.js';
|
|
9
|
+
export * from './i8.js';
|
|
10
|
+
export * from './short-u16.js';
|
|
11
|
+
export * from './u128.js';
|
|
12
|
+
export * from './u16.js';
|
|
13
|
+
export * from './u32.js';
|
|
14
|
+
export * from './u64.js';
|
|
15
|
+
export * from './u8.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"short-u16.d.ts","sourceRoot":"","sources":["../../src/short-u16.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
package/dist/types/u128.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"u128.d.ts","sourceRoot":"","sources":["../../src/u128.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
package/dist/types/u16.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"u16.d.ts","sourceRoot":"","sources":["../../src/u16.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
package/dist/types/u32.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"u32.d.ts","sourceRoot":"","sources":["../../src/u32.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
package/dist/types/u64.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"u64.d.ts","sourceRoot":"","sources":["../../src/u64.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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
|
package/dist/types/u8.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"u8.d.ts","sourceRoot":"","sources":["../../src/u8.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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.js';
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,gBAAgB,EAChB,gBAAgB,EAEnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAU,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErD,KAAK,wBAAwB,CAAC,KAAK,SAAS,MAAM,IAAI;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,KAAK,yBAAyB,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC5F,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3C,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACvE,CAAC;AAEF,KAAK,yBAAyB,CAAC,GAAG,EAAE,KAAK,SAAS,MAAM,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC1F,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC;CACxD,CAAC;AAMF,wBAAgB,oBAAoB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,SAAS,MAAM,EACpF,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE,KAAK,CAAC,GAC/C,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAahC;AAED,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,SAAS,MAAM,EAClF,KAAK,EAAE,yBAAyB,CAAC,GAAG,EAAE,KAAK,CAAC,GAC7C,gBAAgB,CAAC,GAAG,EAAE,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.025ef21",
|
|
4
4
|
"description": "Codecs for numbers of different sizes and endianness",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -49,13 +49,13 @@
|
|
|
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.025ef21"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@solana/eslint-config-solana": "^1.0.2",
|
|
56
56
|
"@swc/jest": "^0.2.29",
|
|
57
|
-
"@types/jest": "^29.5.
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
57
|
+
"@types/jest": "^29.5.11",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
59
59
|
"@typescript-eslint/parser": "^6.3.0",
|
|
60
60
|
"agadoo": "^3.0.0",
|
|
61
61
|
"eslint": "^8.45.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"jest-environment-jsdom": "^29.7.0",
|
|
66
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",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
|
-
"compile:js": "tsup --config build-scripts/tsup.config.
|
|
86
|
-
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
85
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
86
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
|
|
87
87
|
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
88
88
|
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
|
|
89
89
|
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|