Skip to content

Commit

Permalink
refactor(core): remove Lumos
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanssen0 committed Aug 25, 2024
1 parent a1854a4 commit 00bfe49
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 94 deletions.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"access": "public"
},
"dependencies": {
"@ckb-lumos/helpers": "^0.22.2",
"@joyid/ckb": "^1.0.1",
"@noble/ciphers": "^0.5.3",
"@noble/curves": "^1.4.2",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/ckb/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./script.js";
export * from "./transaction.js";
export * from "./transactionLumos.js";
6 changes: 4 additions & 2 deletions packages/core/src/ckb/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { TransactionSkeletonType } from "@ckb-lumos/helpers";
import { ClientCollectableSearchKeyFilterLike } from "../advancedBarrel.js";
import { Bytes, BytesLike, bytesFrom } from "../bytes/index.js";
import { CellDepInfoLike, Client, KnownScript } from "../client/index.js";
Expand All @@ -22,6 +21,7 @@ import { apply, reduceAsync } from "../utils/index.js";
import * as mol from "./molecule.advanced/index.js";
import { Script, ScriptLike } from "./script.js";
import { DEP_TYPE_TO_NUM, NUM_TO_DEP_TYPE } from "./transaction.advanced.js";
import { LumosTransactionSkeletonType } from "./transactionLumos.js";

/**
* @public
Expand Down Expand Up @@ -990,7 +990,9 @@ export class Transaction {
* ```
*/

static fromLumosSkeleton(skeleton: TransactionSkeletonType): Transaction {
static fromLumosSkeleton(
skeleton: LumosTransactionSkeletonType,
): Transaction {
return Transaction.from({
version: 0n,
cellDeps: skeleton.cellDeps.toArray(),
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/ckb/transactionLumos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { CellDepLike, CellOutputLike, HexLike, OutPointLike } from "../barrel";

export interface LumosTransactionSkeletonType {
cellDeps: {
toArray(): CellDepLike[];
};
headerDeps: {
toArray(): HexLike[];
};
inputs: {
toArray(): {
outPoint?: OutPointLike;
cellOutput: CellOutputLike;
data: HexLike;
}[];
};
inputSinces: {
get(i: number, defaultVal: string): HexLike;
};
outputs: {
toArray(): { cellOutput: CellOutputLike; data: HexLike }[];
};
witnesses: {
toArray(): HexLike[];
};
}
91 changes: 0 additions & 91 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00bfe49

Please sign in to comment.