Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,954 changes: 1,954 additions & 0 deletions circular.json

Large diffs are not rendered by default.

5,851 changes: 5,851 additions & 0 deletions graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions packages/bcs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@aptos-labs/bcs",
"version": "1.0.0",
"description": "BCS (Binary Canonical Serialization) library for Aptos",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
"types": "./dist/esm/index.d.mts",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
},
"files": [
"dist",
"package.json"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"aptos",
"bcs",
"serialization"
],
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@aptos-labs/utils": "workspace:*",
"@noble/hashes": "^1.5.0"
},
"devDependencies": {
"tsup": "^8.5.0",
"typescript": "^5.8.3"
}
}

19 changes: 19 additions & 0 deletions packages/bcs/src/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

import { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from "./types";

// Upper bound values for uint8, uint16, uint64 etc. These are all derived as
// 2^N - 1, where N is the number of bits in the type.
export const MAX_U8_NUMBER: Uint8 = 255;
export const MAX_U16_NUMBER: Uint16 = 65535;
export const MAX_U32_NUMBER: Uint32 = 4294967295;
export const MAX_U64_BIG_INT: Uint64 = 18446744073709551615n;
export const MAX_U128_BIG_INT: Uint128 = 340282366920938463463374607431768211455n;
export const MAX_U256_BIG_INT: Uint256 =
115792089237316195423570985008687907853269984665640564039457584007913129639935n;





Loading
Loading