@ckb-lumos/base
Advanced tools
Comparing version 0.0.0-canary-b8e9396-20231206155226 to 0.0.0-canary-ba8d0a5-20240225081932
import { AnyCodec, BytesLike, PackParam, UnpackResult } from "@ckb-lumos/codec"; | ||
import { BytesCodec, FixedBytesCodec } from "@ckb-lumos/codec/lib/base"; | ||
import type * as api from "./api"; | ||
import { BI } from "@ckb-lumos/bi"; | ||
import { BIish } from "@ckb-lumos/bi"; | ||
type TransactionCodecType = PackParam<typeof BaseTransaction>; | ||
@@ -23,2 +23,3 @@ type TransactionUnpackResultType = UnpackResult<typeof BaseTransaction>; | ||
export declare const BytesVec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<BytesCodec<string, BytesLike>>; | ||
export declare const BytesOptVec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").OptionCodec<BytesCodec<string, BytesLike>>>; | ||
export declare const Byte32: FixedBytesCodec<string, BytesLike>; | ||
@@ -84,20 +85,20 @@ export declare const Byte32Vec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<FixedBytesCodec<string, BytesLike>>; | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
export declare const CellInput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
since: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
since: FixedBytesCodec<string, BIish>; | ||
previousOutput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
export declare const CellInputVec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
since: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
since: FixedBytesCodec<string, BIish>; | ||
previousOutput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed>; | ||
export declare const CellOutput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
capacity: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
capacity: FixedBytesCodec<string, BIish>; | ||
lock: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
@@ -115,3 +116,3 @@ codeHash: FixedBytesCodec<string, BytesLike>; | ||
export declare const CellOutputVec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
capacity: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
capacity: FixedBytesCodec<string, BIish>; | ||
lock: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
@@ -131,3 +132,3 @@ codeHash: FixedBytesCodec<string, BytesLike>; | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
@@ -139,3 +140,3 @@ depType: FixedBytesCodec<api.DepType, api.DepType>; | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
@@ -145,7 +146,7 @@ depType: FixedBytesCodec<api.DepType, api.DepType>; | ||
export declare const RawTransaction: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
version: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
version: FixedBytesCodec<string, BIish>; | ||
cellDeps: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
outPoint: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
@@ -156,10 +157,10 @@ depType: FixedBytesCodec<api.DepType, api.DepType>; | ||
inputs: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
since: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
since: FixedBytesCodec<string, BIish>; | ||
previousOutput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed>; | ||
outputs: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
capacity: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
capacity: FixedBytesCodec<string, BIish>; | ||
lock: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
@@ -180,7 +181,7 @@ codeHash: FixedBytesCodec<string, BytesLike>; | ||
raw: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
version: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
version: FixedBytesCodec<string, BIish>; | ||
cellDeps: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
outPoint: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
@@ -191,10 +192,10 @@ depType: FixedBytesCodec<api.DepType, api.DepType>; | ||
inputs: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
since: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
since: FixedBytesCodec<string, BIish>; | ||
previousOutput: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
txHash: FixedBytesCodec<string, BytesLike>; | ||
index: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
index: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed>; | ||
outputs: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
capacity: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
capacity: FixedBytesCodec<string, BIish>; | ||
lock: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
@@ -216,10 +217,10 @@ codeHash: FixedBytesCodec<string, BytesLike>; | ||
export declare const Transaction: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -230,6 +231,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -240,22 +241,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -280,3 +281,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -303,10 +304,10 @@ codeHash: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -317,6 +318,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -327,22 +328,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -367,3 +368,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -393,10 +394,10 @@ codeHash: string; | ||
export declare const TransactionVec: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<BytesCodec<Partial<Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -407,6 +408,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -417,22 +418,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -457,3 +458,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -480,10 +481,10 @@ codeHash: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -494,6 +495,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -504,22 +505,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -544,3 +545,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -570,7 +571,7 @@ codeHash: string; | ||
export declare const RawHeader: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
version: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
compactTarget: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
timestamp: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
number: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
epoch: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
version: FixedBytesCodec<string, BIish>; | ||
compactTarget: FixedBytesCodec<string, BIish>; | ||
timestamp: FixedBytesCodec<string, BIish>; | ||
number: FixedBytesCodec<string, BIish>; | ||
epoch: FixedBytesCodec<string, BIish>; | ||
parentHash: FixedBytesCodec<string, BytesLike>; | ||
@@ -584,7 +585,7 @@ transactionsRoot: FixedBytesCodec<string, BytesLike>; | ||
raw: import("@ckb-lumos/codec/lib/molecule/layout").ObjectCodec<{ | ||
version: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
compactTarget: FixedBytesCodec<number, import("@ckb-lumos/bi").BIish>; | ||
timestamp: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
number: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
epoch: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
version: FixedBytesCodec<string, BIish>; | ||
compactTarget: FixedBytesCodec<string, BIish>; | ||
timestamp: FixedBytesCodec<string, BIish>; | ||
number: FixedBytesCodec<string, BIish>; | ||
epoch: FixedBytesCodec<string, BIish>; | ||
parentHash: FixedBytesCodec<string, BytesLike>; | ||
@@ -596,10 +597,10 @@ transactionsRoot: FixedBytesCodec<string, BytesLike>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
nonce: FixedBytesCodec<BI, import("@ckb-lumos/bi").BIish>; | ||
nonce: FixedBytesCodec<string, BIish>; | ||
}> & import("@ckb-lumos/codec/lib/base").Fixed; | ||
export declare const Header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -611,7 +612,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -623,3 +624,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -631,7 +632,7 @@ }, api.Header>; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -643,7 +644,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -655,3 +656,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -663,7 +664,7 @@ }, api.Header>; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -675,7 +676,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -687,3 +688,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -695,7 +696,7 @@ }, api.Header>; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -707,7 +708,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -719,3 +720,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -725,7 +726,7 @@ }, api.Header>; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -737,7 +738,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -749,3 +750,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -756,10 +757,10 @@ }, api.Header>; | ||
transactions: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<BytesCodec<Partial<Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -770,6 +771,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -780,22 +781,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -820,3 +821,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -843,10 +844,10 @@ codeHash: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -857,6 +858,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -867,22 +868,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -907,3 +908,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -936,7 +937,7 @@ codeHash: string; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -948,7 +949,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -960,3 +961,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -966,7 +967,7 @@ }, api.Header>; | ||
header: BytesCodec<Partial<Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -978,7 +979,7 @@ transactionsRoot: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
compactTarget: number; | ||
timestamp: BI; | ||
number: BI; | ||
epoch: BI; | ||
version: string; | ||
compactTarget: string; | ||
timestamp: string; | ||
number: string; | ||
epoch: string; | ||
parentHash: string; | ||
@@ -990,3 +991,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -997,10 +998,10 @@ }, api.Header>; | ||
transactions: import("@ckb-lumos/codec/lib/molecule/layout").ArrayCodec<BytesCodec<Partial<Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1011,6 +1012,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1021,22 +1022,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1061,3 +1062,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1084,10 +1085,10 @@ codeHash: string; | ||
}, never>> & Pick<{ | ||
version: number; | ||
version: string; | ||
cellDeps: (Partial<Pick<{ | ||
outPoint: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1098,6 +1099,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1108,22 +1109,22 @@ depType: api.DepType; | ||
inputs: (Partial<Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, never>> & Pick<{ | ||
since: BI; | ||
since: string; | ||
previousOutput: Partial<Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
}, "since" | "previousOutput">)[]; | ||
outputs: (Partial<Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1148,3 +1149,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1219,3 +1220,3 @@ codeHash: string; | ||
export declare function deTransformHeaderCodecType(data: HeaderUnpackResultType): RawHeaderUnpackResultType & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -1222,0 +1223,0 @@ }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.WitnessArgs = exports.UncleBlockVec = exports.UncleBlock = exports.TransactionVec = exports.Transaction = exports.ScriptOpt = exports.Script = exports.RawTransaction = exports.RawHeader = exports.ProposalShortIdVec = exports.ProposalShortId = exports.OutPoint = exports.Header = exports.HashType = exports.DepType = exports.CellbaseWitness = exports.CellOutputVec = exports.CellOutput = exports.CellInputVec = exports.CellInput = exports.CellDepVec = exports.CellDep = exports.BytesVec = exports.BytesOpt = exports.Bytes = exports.Byte32Vec = exports.Byte32 = exports.BlockV1 = exports.Block = exports.BaseHeader = void 0; | ||
exports.WitnessArgs = exports.UncleBlockVec = exports.UncleBlock = exports.TransactionVec = exports.Transaction = exports.ScriptOpt = exports.Script = exports.RawTransaction = exports.RawHeader = exports.ProposalShortIdVec = exports.ProposalShortId = exports.OutPoint = exports.Header = exports.HashType = exports.DepType = exports.CellbaseWitness = exports.CellOutputVec = exports.CellOutput = exports.CellInputVec = exports.CellInput = exports.CellDepVec = exports.CellDep = exports.BytesVec = exports.BytesOptVec = exports.BytesOpt = exports.Bytes = exports.Byte32Vec = exports.Byte32 = exports.BlockV1 = exports.Block = exports.BaseHeader = void 0; | ||
exports.WitnessArgsOf = WitnessArgsOf; | ||
@@ -15,9 +15,14 @@ exports.createFixedHexBytesCodec = createFixedHexBytesCodec; | ||
var _codec = require("@ckb-lumos/codec"); | ||
var _bi = require("@ckb-lumos/bi"); | ||
function asHexadecimal(codec) { | ||
return { | ||
...codec, | ||
unpack: value => _bi.BI.from(codec.unpack(value)).toHexString() | ||
}; | ||
} | ||
const Uint8 = asHexadecimal(_codec.number.Uint8); | ||
const Uint32LE = asHexadecimal(_codec.number.Uint32LE); | ||
const Uint64LE = asHexadecimal(_codec.number.Uint64LE); | ||
const Uint128LE = asHexadecimal(_codec.number.Uint128LE); | ||
const { | ||
Uint128LE, | ||
Uint8, | ||
Uint32LE, | ||
Uint64LE | ||
} = _codec.number; | ||
const { | ||
byteVecOf, | ||
@@ -61,2 +66,4 @@ option, | ||
exports.BytesVec = BytesVec; | ||
const BytesOptVec = vector(BytesOpt); | ||
exports.BytesOptVec = BytesOptVec; | ||
const Byte32 = createFixedHexBytesCodec(32); | ||
@@ -111,11 +118,11 @@ exports.Byte32 = Byte32; | ||
// prettier-ignore | ||
if (type === "type") return Uint8.pack(0b0000000_1); | ||
if (type === "type") return _codec.number.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); | ||
if (type === "data") return _codec.number.Uint8.pack(0b0000000_0); | ||
if (type === "data1") return _codec.number.Uint8.pack(0b0000001_0); | ||
if (type === "data2") return _codec.number.Uint8.pack(0b0000010_0); | ||
throw new Error(`Invalid hash type: ${type}`); | ||
}, | ||
unpack: buf => { | ||
const hashTypeBuf = Uint8.unpack(buf); | ||
const hashTypeBuf = _codec.number.Uint8.unpack(buf); | ||
if (hashTypeBuf === 0b0000000_1) return "type"; | ||
@@ -137,3 +144,3 @@ if (hashTypeBuf === 0b0000000_0) return "data"; | ||
unpack: buf => { | ||
const depTypeBuf = Uint8.unpack(buf); | ||
const depTypeBuf = _codec.number.Uint8.unpack(buf); | ||
if (depTypeBuf === 0) return "code"; | ||
@@ -140,0 +147,0 @@ if (depTypeBuf === 1) return "depGroup"; |
@@ -65,2 +65,7 @@ /// <reference types="node" /> | ||
declare function isDeepEqual(a: any, b: any): boolean; | ||
/** | ||
* Generate a type script for type id {@link https://xuejie.space/2020_02_03_introduction_to_ckb_script_programming_type_id/} | ||
* @param input | ||
* @param outputIndex | ||
*/ | ||
declare function generateTypeIdScript(input: Input, outputIndex?: string): Script; | ||
@@ -67,0 +72,0 @@ declare function deepCamel(data: any): any; |
@@ -187,2 +187,8 @@ "use strict"; | ||
} | ||
/** | ||
* Generate a type script for type id {@link https://xuejie.space/2020_02_03_introduction_to_ckb_script_programming_type_id/} | ||
* @param input | ||
* @param outputIndex | ||
*/ | ||
function generateTypeIdScript(input, outputIndex = "0x0") { | ||
@@ -189,0 +195,0 @@ blockchain.CellInput.pack(input); |
{ | ||
"name": "@ckb-lumos/base", | ||
"version": "0.0.0-canary-b8e9396-20231206155226", | ||
"version": "0.0.0-canary-ba8d0a5-20240225081932", | ||
"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-canary-b8e9396-20231206155226", | ||
"@ckb-lumos/codec": "0.0.0-canary-b8e9396-20231206155226", | ||
"@ckb-lumos/toolkit": "0.0.0-canary-b8e9396-20231206155226", | ||
"@ckb-lumos/bi": "0.0.0-canary-ba8d0a5-20240225081932", | ||
"@ckb-lumos/codec": "0.0.0-canary-ba8d0a5-20240225081932", | ||
"@ckb-lumos/toolkit": "0.0.0-canary-ba8d0a5-20240225081932", | ||
"@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
230941
3096
+ Added@ckb-lumos/bi@0.0.0-canary-ba8d0a5-20240225081932(transitive)
+ Added@ckb-lumos/codec@0.0.0-canary-ba8d0a5-20240225081932(transitive)
+ Added@ckb-lumos/toolkit@0.0.0-canary-ba8d0a5-20240225081932(transitive)
- Removed@ckb-lumos/bi@0.0.0-canary-b8e9396-20231206155226(transitive)
- Removed@ckb-lumos/codec@0.0.0-canary-b8e9396-20231206155226(transitive)
- Removed@ckb-lumos/toolkit@0.0.0-canary-b8e9396-20231206155226(transitive)
Updated@ckb-lumos/toolkit@0.0.0-canary-ba8d0a5-20240225081932