@solana/codecs-numbers 2.0.0-experimental.5e8ac8d
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/LICENSE +20 -0
- package/README.md +25 -0
- package/dist/index.browser.cjs +345 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.js +301 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.development.js +412 -0
- package/dist/index.development.js.map +1 -0
- package/dist/index.native.js +303 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.node.cjs +345 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.js +303 -0
- package/dist/index.node.js.map +1 -0
- package/dist/index.production.min.js +51 -0
- package/dist/types/assertions.d.ts +5 -0
- package/dist/types/assertions.d.ts.map +1 -0
- package/dist/types/common.d.ts +23 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/f32.d.ts +6 -0
- package/dist/types/f32.d.ts.map +1 -0
- package/dist/types/f64.d.ts +6 -0
- package/dist/types/f64.d.ts.map +1 -0
- package/dist/types/i128.d.ts +6 -0
- package/dist/types/i128.d.ts.map +1 -0
- package/dist/types/i16.d.ts +6 -0
- package/dist/types/i16.d.ts.map +1 -0
- package/dist/types/i32.d.ts +6 -0
- package/dist/types/i32.d.ts.map +1 -0
- package/dist/types/i64.d.ts +6 -0
- package/dist/types/i64.d.ts.map +1 -0
- package/dist/types/i8.d.ts +6 -0
- package/dist/types/i8.d.ts.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/short-u16.d.ts +26 -0
- package/dist/types/short-u16.d.ts.map +1 -0
- package/dist/types/u128.d.ts +6 -0
- package/dist/types/u128.d.ts.map +1 -0
- package/dist/types/u16.d.ts +6 -0
- package/dist/types/u16.d.ts.map +1 -0
- package/dist/types/u32.d.ts +6 -0
- package/dist/types/u32.d.ts.map +1 -0
- package/dist/types/u64.d.ts +6 -0
- package/dist/types/u64.d.ts.map +1 -0
- package/dist/types/u8.d.ts +6 -0
- package/dist/types/u8.d.ts.map +1 -0
- package/dist/types/utils.d.ts +18 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u32.d.ts","sourceRoot":"","sources":["../../src/u32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,eAAO,MAAM,aAAa,aAAa,kBAAkB,KAAQ,QAAQ,MAAM,CAOzE,CAAC;AAEP,eAAO,MAAM,aAAa,aAAa,kBAAkB,KAAQ,QAAQ,MAAM,CAMzE,CAAC;AAEP,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,MAAM,MAAM,CACX,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecOptions } from './common';
|
|
3
|
+
export declare const getU64Encoder: (options?: NumberCodecOptions) => Encoder<number | bigint>;
|
|
4
|
+
export declare const getU64Decoder: (options?: NumberCodecOptions) => Decoder<bigint>;
|
|
5
|
+
export declare const getU64Codec: (options?: NumberCodecOptions) => Codec<number | bigint, bigint>;
|
|
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,EAAE,KAAK,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,eAAO,MAAM,aAAa,aAAa,kBAAkB,KAAQ,QAAQ,MAAM,GAAG,MAAM,CAOlF,CAAC;AAEP,eAAO,MAAM,aAAa,aAAa,kBAAkB,KAAQ,QAAQ,MAAM,CAMzE,CAAC;AAEP,eAAO,MAAM,WAAW,aAAa,kBAAkB,KAAQ,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,CAC5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { SingleByteNumberCodecOptions } from './common';
|
|
3
|
+
export declare const getU8Encoder: (options?: SingleByteNumberCodecOptions) => Encoder<number>;
|
|
4
|
+
export declare const getU8Decoder: (options?: SingleByteNumberCodecOptions) => Decoder<number>;
|
|
5
|
+
export declare const getU8Codec: (options?: SingleByteNumberCodecOptions) => Codec<number>;
|
|
6
|
+
//# sourceMappingURL=u8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u8.d.ts","sourceRoot":"","sources":["../../src/u8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAGxD,eAAO,MAAM,YAAY,aAAa,4BAA4B,KAAQ,QAAQ,MAAM,CAOlF,CAAC;AAEP,eAAO,MAAM,YAAY,aAAa,4BAA4B,KAAQ,QAAQ,MAAM,CAMlF,CAAC;AAEP,eAAO,MAAM,UAAU,aAAa,4BAA4B,KAAQ,MAAM,MAAM,CACtB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { NumberCodecOptions, SingleByteNumberCodecOptions } from './common';
|
|
3
|
+
type NumberFactorySharedInput = {
|
|
4
|
+
name: string;
|
|
5
|
+
size: number;
|
|
6
|
+
options: SingleByteNumberCodecOptions | NumberCodecOptions;
|
|
7
|
+
};
|
|
8
|
+
type NumberFactoryEncoderInput<T> = NumberFactorySharedInput & {
|
|
9
|
+
range?: [number | bigint, number | bigint];
|
|
10
|
+
set: (view: DataView, value: T, littleEndian?: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
type NumberFactoryDecoderInput<T> = NumberFactorySharedInput & {
|
|
13
|
+
get: (view: DataView, littleEndian?: boolean) => T;
|
|
14
|
+
};
|
|
15
|
+
export declare function numberEncoderFactory<T extends number | bigint>(input: NumberFactoryEncoderInput<T>): Encoder<T>;
|
|
16
|
+
export declare function numberDecoderFactory<T extends number | bigint>(input: NumberFactoryDecoderInput<T>): Decoder<T>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,OAAO,EACV,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAU,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAEpF,KAAK,wBAAwB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,4BAA4B,GAAG,kBAAkB,CAAC;CAC9D,CAAC;AAEF,KAAK,yBAAyB,CAAC,CAAC,IAAI,wBAAwB,GAAG;IAC3D,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3C,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,KAAK,yBAAyB,CAAC,CAAC,IAAI,wBAAwB,GAAG;IAC3D,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC;CACtD,CAAC;AAmBF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAgB/G;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAc/G"}
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana/codecs-numbers",
|
|
3
|
+
"version": "2.0.0-experimental.5e8ac8d",
|
|
4
|
+
"description": "Codecs for numbers of different sizes and endianness",
|
|
5
|
+
"exports": {
|
|
6
|
+
"browser": {
|
|
7
|
+
"import": "./dist/index.browser.js",
|
|
8
|
+
"require": "./dist/index.browser.cjs"
|
|
9
|
+
},
|
|
10
|
+
"node": {
|
|
11
|
+
"import": "./dist/index.node.js",
|
|
12
|
+
"require": "./dist/index.node.cjs"
|
|
13
|
+
},
|
|
14
|
+
"react-native": "./dist/index.native.js",
|
|
15
|
+
"types": "./dist/types/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"browser": {
|
|
18
|
+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
|
|
19
|
+
"./dist/index.node.js": "./dist/index.browser.js"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.node.cjs",
|
|
22
|
+
"module": "./dist/index.node.js",
|
|
23
|
+
"react-native": "./dist/index.native.js",
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"files": [
|
|
27
|
+
"./dist/"
|
|
28
|
+
],
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"keywords": [
|
|
31
|
+
"blockchain",
|
|
32
|
+
"solana",
|
|
33
|
+
"web3"
|
|
34
|
+
],
|
|
35
|
+
"author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/solana-labs/solana-web3.js"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "http://github.com/solana-labs/solana-web3.js/issues"
|
|
43
|
+
},
|
|
44
|
+
"browserslist": [
|
|
45
|
+
"supports bigint and not dead",
|
|
46
|
+
"maintained node versions"
|
|
47
|
+
],
|
|
48
|
+
"engine": {
|
|
49
|
+
"node": ">=17.4"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@solana/codecs-core": "2.0.0-experimental.5e8ac8d"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@solana/eslint-config-solana": "^1.0.2",
|
|
56
|
+
"@swc/jest": "^0.2.28",
|
|
57
|
+
"@types/jest": "^29.5.5",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
59
|
+
"@typescript-eslint/parser": "^6.3.0",
|
|
60
|
+
"agadoo": "^3.0.0",
|
|
61
|
+
"eslint": "^8.45.0",
|
|
62
|
+
"eslint-plugin-jest": "^27.2.3",
|
|
63
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
64
|
+
"jest": "^29.7.0",
|
|
65
|
+
"jest-environment-jsdom": "^29.6.4",
|
|
66
|
+
"jest-runner-eslint": "^2.1.0",
|
|
67
|
+
"jest-runner-prettier": "^1.0.0",
|
|
68
|
+
"prettier": "^2.8",
|
|
69
|
+
"tsup": "7.2.0",
|
|
70
|
+
"typescript": "^5.2.2",
|
|
71
|
+
"version-from-git": "^1.1.1",
|
|
72
|
+
"test-config": "0.0.0",
|
|
73
|
+
"build-scripts": "0.0.0",
|
|
74
|
+
"tsconfig": "0.0.0"
|
|
75
|
+
},
|
|
76
|
+
"bundlewatch": {
|
|
77
|
+
"defaultCompression": "gzip",
|
|
78
|
+
"files": [
|
|
79
|
+
{
|
|
80
|
+
"path": "./dist/index*.js"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"compile:js": "tsup --config build-scripts/tsup.config.library.ts",
|
|
86
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
87
|
+
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
88
|
+
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
|
|
89
|
+
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/*",
|
|
90
|
+
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
91
|
+
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
92
|
+
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
93
|
+
"test:treeshakability:native": "agadoo dist/index.node.js",
|
|
94
|
+
"test:treeshakability:node": "agadoo dist/index.native.js",
|
|
95
|
+
"test:typecheck": "tsc --noEmit",
|
|
96
|
+
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
97
|
+
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
98
|
+
}
|
|
99
|
+
}
|