@ckb-lumos/base
Advanced tools
Comparing version 0.0.0-ckb2023-4d2367a-20230803074047 to 0.0.0-ckb2023-72bca3f-20230926123805
@@ -64,5 +64,7 @@ import { Hash, Hexadecimal, HexNumber, HexString, PackedSince } from "./primitive"; | ||
} | ||
type Status = "pending" | "proposed" | "committed" | "unknown" | "rejected"; | ||
export interface TxStatus { | ||
status: Status; | ||
blockHash?: Hash; | ||
status: string; | ||
reason?: string; | ||
} | ||
@@ -171,6 +173,3 @@ export interface TransactionWithStatus<Tx = Transaction> { | ||
} | ||
export type HardForks = { | ||
ckb2021: HardforkFeature[]; | ||
ckb2023: HardforkFeature[]; | ||
}; | ||
export type HardForks = HardforkFeature[]; | ||
export interface HardforkFeature { | ||
@@ -177,0 +176,0 @@ rfc: string; |
@@ -56,2 +56,12 @@ import { AnyCodec, BytesLike, PackParam, UnpackResult } from "@ckb-lumos/codec"; | ||
/** | ||
* <pre> | ||
* 0b0000000 0 | ||
* ───┬─── │ | ||
* │ ▼ | ||
* │ type - use the default vm version | ||
* │ | ||
* ▼ | ||
* data* - use a particular vm version | ||
* </pre> | ||
* | ||
* Implementation of blockchain.mol | ||
@@ -58,0 +68,0 @@ * https://github.com/nervosnetwork/ckb/blob/5a7efe7a0b720de79ff3761dc6e8424b8d5b22ea/util/types/schemas/blockchain.mol |
@@ -90,2 +90,12 @@ "use strict"; | ||
/** | ||
* <pre> | ||
* 0b0000000 0 | ||
* ───┬─── │ | ||
* │ ▼ | ||
* │ type - use the default vm version | ||
* │ | ||
* ▼ | ||
* data* - use a particular vm version | ||
* </pre> | ||
* | ||
* Implementation of blockchain.mol | ||
@@ -98,6 +108,8 @@ * https://github.com/nervosnetwork/ckb/blob/5a7efe7a0b720de79ff3761dc6e8424b8d5b22ea/util/types/schemas/blockchain.mol | ||
pack: type => { | ||
if (type === "data") return Uint8.pack(0); | ||
if (type === "type") return Uint8.pack(1); | ||
if (type === "data1") return Uint8.pack(2); | ||
if (type === "data2") return Uint8.pack(3); | ||
// prettier-ignore | ||
if (type === "type") return Uint8.pack(0b0000000_1); | ||
// prettier-ignore | ||
if (type === "data") return Uint8.pack(0b0000000_0); | ||
if (type === "data1") return Uint8.pack(0b0000001_0); | ||
if (type === "data2") return Uint8.pack(0b0000010_0); | ||
throw new Error(`Invalid hash type: ${type}`); | ||
@@ -107,6 +119,6 @@ }, | ||
const hashTypeBuf = Uint8.unpack(buf); | ||
if (hashTypeBuf === 0) return "data"; | ||
if (hashTypeBuf === 1) return "type"; | ||
if (hashTypeBuf === 2) return "data1"; | ||
if (hashTypeBuf === 3) return "data2"; | ||
if (hashTypeBuf === 0b0000000_1) return "type"; | ||
if (hashTypeBuf === 0b0000000_0) return "data"; | ||
if (hashTypeBuf === 0b0000001_0) return "data1"; | ||
if (hashTypeBuf === 0b0000010_0) return "data2"; | ||
throw new Error(`Invalid hash type: ${hashTypeBuf}`); | ||
@@ -113,0 +125,0 @@ } |
{ | ||
"name": "@ckb-lumos/base", | ||
"version": "0.0.0-ckb2023-4d2367a-20230803074047", | ||
"version": "0.0.0-ckb2023-72bca3f-20230926123805", | ||
"description": "Base data structures and utilities used in lumos", | ||
@@ -38,5 +38,5 @@ "author": "Xuejie Xiao <xxuejie@gmail.com>", | ||
"dependencies": { | ||
"@ckb-lumos/bi": "0.0.0-ckb2023-4d2367a-20230803074047", | ||
"@ckb-lumos/codec": "0.0.0-ckb2023-4d2367a-20230803074047", | ||
"@ckb-lumos/toolkit": "0.0.0-ckb2023-4d2367a-20230803074047", | ||
"@ckb-lumos/bi": "0.0.0-ckb2023-72bca3f-20230926123805", | ||
"@ckb-lumos/codec": "0.0.0-ckb2023-72bca3f-20230926123805", | ||
"@ckb-lumos/toolkit": "0.0.0-ckb2023-72bca3f-20230926123805", | ||
"@types/blake2b": "^2.1.0", | ||
@@ -43,0 +43,0 @@ "@types/lodash.isequal": "^4.5.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
228934
3078
+ Added@ckb-lumos/bi@0.0.0-ckb2023-72bca3f-20230926123805(transitive)
+ Added@ckb-lumos/codec@0.0.0-ckb2023-72bca3f-20230926123805(transitive)
+ Added@ckb-lumos/toolkit@0.0.0-ckb2023-72bca3f-20230926123805(transitive)
- Removed@ckb-lumos/bi@0.0.0-ckb2023-4d2367a-20230803074047(transitive)
- Removed@ckb-lumos/codec@0.0.0-ckb2023-4d2367a-20230803074047(transitive)
- Removed@ckb-lumos/toolkit@0.0.0-ckb2023-4d2367a-20230803074047(transitive)
Updated@ckb-lumos/codec@0.0.0-ckb2023-72bca3f-20230926123805
Updated@ckb-lumos/toolkit@0.0.0-ckb2023-72bca3f-20230926123805