Skip to content

Commit

Permalink
feat: add @ckb-js-std/core
Browse files Browse the repository at this point in the history
migrated from ccc
  • Loading branch information
XuJiandong committed Jan 24, 2025
1 parent 09fa16b commit 0a6f5ad
Show file tree
Hide file tree
Showing 24 changed files with 1,056 additions and 41 deletions.
4 changes: 3 additions & 1 deletion packages/bindings/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"types": ["./index.d.ts"]
}
},
"include": ["src/**/*"]
}
10 changes: 7 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.js",
"exports": {
".": "./dist/index.js",
"./barrel": "./dist/barrel.js"
},
"scripts": {
"build": "tsc --noEmit",
"build": "tsc",
"format": "prettier --write .",
"clean": "rm -f dist/*"
},
"devDependencies": {},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@ckb-js-std/bindings": "workspace:*"
"@ckb-js-std/bindings": "workspace:*",
"@ckb-js-std/core": "link:"
}
}
1 change: 0 additions & 1 deletion packages/core/src/advanced.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/src/advancedBarrel.ts

This file was deleted.

11 changes: 6 additions & 5 deletions packages/core/src/barrel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./bytes/index.js";
export * from "./ckb/index.js";
export * from "./molecule/index.js";
export * from "./num/index.js";
export * from "./utils/index.js";
export * from "./bytes/index";
export * from "./ckb/index";
export * from "./molecule/index";
export * from "./num/index";
export * from "./utils/index";
export * from "./hasher/index";
9 changes: 3 additions & 6 deletions packages/core/src/bytes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ export function bytesEq(a: BytesLike, b: BytesLike): boolean {
return true;
}

const x = bytesFrom(a);
const y = bytesFrom(b);

if (x.length !== y.length) {
if (a.length !== b.length) {
return false;
}

for (let i = 0; i < x.length; i++) {
if (x[i] !== y[i]) {
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/ckb/advanced.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/src/ckb/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./script";
// export * from "./transaction";
export * from "./transaction";
4 changes: 2 additions & 2 deletions packages/core/src/ckb/script.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Bytes, BytesLike, bytesFrom } from "../bytes/index.js";
import { mol } from "../molecule/index.js";
import { Bytes, BytesLike, bytesFrom } from "../bytes/index";
import { mol } from "../molecule/index";

export const HashTypeCodec: mol.Codec<HashTypeLike, HashType> = mol.Codec.from({
byteLength: 1,
Expand Down
Loading

0 comments on commit 0a6f5ad

Please sign in to comment.