@solana/fixed-points 0.0.0 → 6.9.0-canary-20260505202922

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 ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2023 Solana Labs, Inc
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ [![npm][npm-image]][npm-url]
2
+ [![npm-downloads][npm-downloads-image]][npm-url]
3
+ <br />
4
+ [![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]
5
+
6
+ [code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
7
+ [code-style-prettier-url]: https://github.com/prettier/prettier
8
+ [npm-downloads-image]: https://img.shields.io/npm/dm/@solana/fixed-points?style=flat
9
+ [npm-image]: https://img.shields.io/npm/v/@solana/fixed-points?style=flat
10
+ [npm-url]: https://www.npmjs.com/package/@solana/fixed-points
11
+
12
+ # @solana/fixed-points
13
+
14
+ Fixed-point number types for JavaScript — both decimal (scale is a power of 10) and binary (scale is a power of 2), signed and unsigned, with arbitrary bit widths. It can be used standalone, but it is also exported as part of Kit [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
15
+
16
+ This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs) which acts as an entry point for all codec packages as well as for their documentation.
17
+
18
+ > [!NOTE]
19
+ > This package is under active development. Its public API is being landed incrementally as part of [issue #1545](https://github.com/anza-xyz/kit/issues/1545). Usage documentation will appear here as each feature lands.
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // src/index.ts
4
+ var __placeholder = Symbol("@solana/fixed-points/placeholder");
5
+
6
+ exports.__placeholder = __placeholder;
7
+ //# sourceMappingURL=index.browser.cjs.map
8
+ //# sourceMappingURL=index.browser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAoBO,IAAM,aAAA,GAA+B,OAAO,kCAAkC","file":"index.browser.cjs","sourcesContent":["/**\n * This package provides fixed-point number types — both decimal (scale is a\n * power of 10) and binary (scale is a power of 2) — in signed and unsigned\n * flavors with arbitrary bit widths. It can be used standalone, but it is also\n * exported as part of Kit\n * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n *\n * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\n * which acts as an entry point for all codec packages as well as for their documentation.\n *\n * @packageDocumentation\n */\n\n/**\n * Placeholder export that exists solely to give this package tree-shakable\n * contents while its real API is implemented in follow-up PRs. It will be\n * removed as soon as the first real export lands.\n *\n * @internal\n */\nexport const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');\n"]}
@@ -0,0 +1,6 @@
1
+ // src/index.ts
2
+ var __placeholder = Symbol("@solana/fixed-points/placeholder");
3
+
4
+ export { __placeholder };
5
+ //# sourceMappingURL=index.browser.mjs.map
6
+ //# sourceMappingURL=index.browser.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAoBO,IAAM,aAAA,GAA+B,OAAO,kCAAkC","file":"index.browser.mjs","sourcesContent":["/**\n * This package provides fixed-point number types — both decimal (scale is a\n * power of 10) and binary (scale is a power of 2) — in signed and unsigned\n * flavors with arbitrary bit widths. It can be used standalone, but it is also\n * exported as part of Kit\n * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n *\n * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\n * which acts as an entry point for all codec packages as well as for their documentation.\n *\n * @packageDocumentation\n */\n\n/**\n * Placeholder export that exists solely to give this package tree-shakable\n * contents while its real API is implemented in follow-up PRs. It will be\n * removed as soon as the first real export lands.\n *\n * @internal\n */\nexport const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');\n"]}
@@ -0,0 +1,6 @@
1
+ // src/index.ts
2
+ var __placeholder = Symbol("@solana/fixed-points/placeholder");
3
+
4
+ export { __placeholder };
5
+ //# sourceMappingURL=index.native.mjs.map
6
+ //# sourceMappingURL=index.native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAoBO,IAAM,aAAA,GAA+B,OAAO,kCAAkC","file":"index.native.mjs","sourcesContent":["/**\n * This package provides fixed-point number types — both decimal (scale is a\n * power of 10) and binary (scale is a power of 2) — in signed and unsigned\n * flavors with arbitrary bit widths. It can be used standalone, but it is also\n * exported as part of Kit\n * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n *\n * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\n * which acts as an entry point for all codec packages as well as for their documentation.\n *\n * @packageDocumentation\n */\n\n/**\n * Placeholder export that exists solely to give this package tree-shakable\n * contents while its real API is implemented in follow-up PRs. It will be\n * removed as soon as the first real export lands.\n *\n * @internal\n */\nexport const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');\n"]}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // src/index.ts
4
+ var __placeholder = Symbol("@solana/fixed-points/placeholder");
5
+
6
+ exports.__placeholder = __placeholder;
7
+ //# sourceMappingURL=index.node.cjs.map
8
+ //# sourceMappingURL=index.node.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAoBO,IAAM,aAAA,GAA+B,OAAO,kCAAkC","file":"index.node.cjs","sourcesContent":["/**\n * This package provides fixed-point number types — both decimal (scale is a\n * power of 10) and binary (scale is a power of 2) — in signed and unsigned\n * flavors with arbitrary bit widths. It can be used standalone, but it is also\n * exported as part of Kit\n * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n *\n * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\n * which acts as an entry point for all codec packages as well as for their documentation.\n *\n * @packageDocumentation\n */\n\n/**\n * Placeholder export that exists solely to give this package tree-shakable\n * contents while its real API is implemented in follow-up PRs. It will be\n * removed as soon as the first real export lands.\n *\n * @internal\n */\nexport const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');\n"]}
@@ -0,0 +1,6 @@
1
+ // src/index.ts
2
+ var __placeholder = Symbol("@solana/fixed-points/placeholder");
3
+
4
+ export { __placeholder };
5
+ //# sourceMappingURL=index.node.mjs.map
6
+ //# sourceMappingURL=index.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAoBO,IAAM,aAAA,GAA+B,OAAO,kCAAkC","file":"index.node.mjs","sourcesContent":["/**\n * This package provides fixed-point number types — both decimal (scale is a\n * power of 10) and binary (scale is a power of 2) — in signed and unsigned\n * flavors with arbitrary bit widths. It can be used standalone, but it is also\n * exported as part of Kit\n * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n *\n * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\n * which acts as an entry point for all codec packages as well as for their documentation.\n *\n * @packageDocumentation\n */\n\n/**\n * Placeholder export that exists solely to give this package tree-shakable\n * contents while its real API is implemented in follow-up PRs. It will be\n * removed as soon as the first real export lands.\n *\n * @internal\n */\nexport const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This package provides fixed-point number types — both decimal (scale is a
3
+ * power of 10) and binary (scale is a power of 2) — in signed and unsigned
4
+ * flavors with arbitrary bit widths. It can be used standalone, but it is also
5
+ * exported as part of Kit
6
+ * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
7
+ *
8
+ * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)
9
+ * which acts as an entry point for all codec packages as well as for their documentation.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ /**
14
+ * Placeholder export that exists solely to give this package tree-shakable
15
+ * contents while its real API is implemented in follow-up PRs. It will be
16
+ * removed as soon as the first real export lands.
17
+ *
18
+ * @internal
19
+ */
20
+ export declare const __placeholder: unique symbol;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,OAAO,MAAmD,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,86 @@
1
1
  {
2
2
  "name": "@solana/fixed-points",
3
- "version": "0.0.0",
4
- "description": "",
5
- "license": "ISC",
6
- "author": "",
3
+ "version": "6.9.0-canary-20260505202922",
4
+ "description": "Fixed-point number types for JavaScript",
5
+ "homepage": "https://www.solanakit.com/api#solanafixed-points",
6
+ "exports": {
7
+ "edge-light": {
8
+ "import": "./dist/index.node.mjs",
9
+ "require": "./dist/index.node.cjs"
10
+ },
11
+ "workerd": {
12
+ "import": "./dist/index.node.mjs",
13
+ "require": "./dist/index.node.cjs"
14
+ },
15
+ "browser": {
16
+ "import": "./dist/index.browser.mjs",
17
+ "require": "./dist/index.browser.cjs"
18
+ },
19
+ "node": {
20
+ "import": "./dist/index.node.mjs",
21
+ "require": "./dist/index.node.cjs"
22
+ },
23
+ "react-native": "./dist/index.native.mjs",
24
+ "types": "./dist/types/index.d.ts"
25
+ },
26
+ "browser": {
27
+ "./dist/index.node.cjs": "./dist/index.browser.cjs",
28
+ "./dist/index.node.mjs": "./dist/index.browser.mjs"
29
+ },
30
+ "main": "./dist/index.node.cjs",
31
+ "module": "./dist/index.node.mjs",
32
+ "react-native": "./dist/index.native.mjs",
33
+ "types": "./dist/types/index.d.ts",
7
34
  "type": "commonjs",
8
- "main": "index.js",
35
+ "files": [
36
+ "./dist/",
37
+ "./src/"
38
+ ],
39
+ "sideEffects": false,
40
+ "keywords": [
41
+ "blockchain",
42
+ "solana",
43
+ "web3"
44
+ ],
45
+ "author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/anza-xyz/kit"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/anza-xyz/kit/issues"
53
+ },
54
+ "browserslist": [
55
+ "supports bigint and not dead",
56
+ "maintained node versions"
57
+ ],
58
+ "peerDependencies": {
59
+ "typescript": ">=5.0.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "typescript": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "engines": {
67
+ "node": ">=20.18.0"
68
+ },
9
69
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
70
+ "compile:docs": "typedoc",
71
+ "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
72
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json",
73
+ "dev": "NODE_OPTIONS=\"--no-experimental-webstorage\" jest -c ../../node_modules/@solana/test-config/jest-dev.config.js --rootDir . --watch",
74
+ "publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ -n \"${GITHUB_OUTPUT:-}\" ] && echo 'published=true' >> \"$GITHUB_OUTPUT\") || true) && (([ \"$PUBLISH_TAG\" != \"canary\" ] && ../build-scripts/maybe-tag-latest.ts --token \"$GITHUB_TOKEN\" $npm_package_name@$npm_package_version) || true))",
75
+ "publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
76
+ "style:fix": "pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*",
77
+ "test:lint": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-lint.config.js --rootDir . --silent",
78
+ "test:prettier": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-prettier.config.js --rootDir . --silent",
79
+ "test:treeshakability:browser": "agadoo dist/index.browser.mjs",
80
+ "test:treeshakability:native": "agadoo dist/index.node.mjs",
81
+ "test:treeshakability:node": "agadoo dist/index.native.mjs",
82
+ "test:typecheck": "tsc --noEmit",
83
+ "test:unit:browser": "NODE_OPTIONS=\"--no-experimental-webstorage\" TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.js --rootDir . --silent",
84
+ "test:unit:node": "NODE_OPTIONS=\"--no-experimental-webstorage\" TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.js --rootDir . --silent"
11
85
  }
12
- }
86
+ }
package/src/index.ts ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This package provides fixed-point number types — both decimal (scale is a
3
+ * power of 10) and binary (scale is a power of 2) — in signed and unsigned
4
+ * flavors with arbitrary bit widths. It can be used standalone, but it is also
5
+ * exported as part of Kit
6
+ * [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
7
+ *
8
+ * This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs)
9
+ * which acts as an entry point for all codec packages as well as for their documentation.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+
14
+ /**
15
+ * Placeholder export that exists solely to give this package tree-shakable
16
+ * contents while its real API is implemented in follow-up PRs. It will be
17
+ * removed as soon as the first real export lands.
18
+ *
19
+ * @internal
20
+ */
21
+ export const __placeholder: unique symbol = Symbol('@solana/fixed-points/placeholder');