@ckb-lumos/base
Advanced tools
Comparing version 0.22.0-next.1 to 0.22.0-next.2
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>; | ||
@@ -84,20 +84,20 @@ type TransactionUnpackResultType = UnpackResult<typeof BaseTransaction>; | ||
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 +115,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 +131,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 +139,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 +145,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 +156,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 +180,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 +191,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 +216,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 +230,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -240,22 +240,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 +280,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -303,10 +303,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 +317,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -327,22 +327,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 +367,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -393,10 +393,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 +407,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -417,22 +417,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 +457,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -480,10 +480,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 +494,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -504,22 +504,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 +544,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -570,7 +570,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 +584,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 +596,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 +611,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 +623,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -631,7 +631,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 +643,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 +655,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -663,7 +663,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 +675,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 +687,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -695,7 +695,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 +707,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 +719,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -725,7 +725,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 +737,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 +749,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -756,10 +756,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 +770,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -780,22 +780,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 +820,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -843,10 +843,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 +857,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -867,22 +867,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 +907,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -936,7 +936,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 +948,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 +960,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -966,7 +966,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 +978,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 +990,3 @@ transactionsRoot: string; | ||
}, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -997,10 +997,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 +1011,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1021,22 +1021,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 +1061,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1084,10 +1084,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 +1098,6 @@ depType: api.DepType; | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, never>> & Pick<{ | ||
txHash: string; | ||
index: number; | ||
index: string; | ||
}, "index" | "txHash">; | ||
@@ -1108,22 +1108,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 +1148,3 @@ codeHash: string; | ||
}, "type">> & Pick<{ | ||
capacity: BI; | ||
capacity: string; | ||
lock: Partial<Pick<{ | ||
@@ -1219,3 +1219,3 @@ codeHash: string; | ||
export declare function deTransformHeaderCodecType(data: HeaderUnpackResultType): RawHeaderUnpackResultType & { | ||
nonce: BI; | ||
nonce: string; | ||
hash: string; | ||
@@ -1222,0 +1222,0 @@ }; |
@@ -14,9 +14,14 @@ "use strict"; | ||
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, | ||
@@ -111,11 +116,11 @@ option, | ||
// 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 +142,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 +145,0 @@ if (depTypeBuf === 1) return "depGroup"; |
{ | ||
"name": "@ckb-lumos/base", | ||
"version": "0.22.0-next.1", | ||
"version": "0.22.0-next.2", | ||
"description": "Base data structures and utilities used in lumos", | ||
@@ -38,5 +38,5 @@ "author": "Xuejie Xiao <xxuejie@gmail.com>", | ||
"dependencies": { | ||
"@ckb-lumos/bi": "0.22.0-next.1", | ||
"@ckb-lumos/codec": "0.22.0-next.1", | ||
"@ckb-lumos/toolkit": "0.22.0-next.1", | ||
"@ckb-lumos/bi": "0.22.0-next.2", | ||
"@ckb-lumos/codec": "0.22.0-next.2", | ||
"@ckb-lumos/toolkit": "0.22.0-next.2", | ||
"@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
230853
3096
+ Added@ckb-lumos/bi@0.22.0-next.2(transitive)
+ Added@ckb-lumos/codec@0.22.0-next.2(transitive)
+ Added@ckb-lumos/toolkit@0.22.0-next.2(transitive)
- Removed@ckb-lumos/bi@0.22.0-next.1(transitive)
- Removed@ckb-lumos/codec@0.22.0-next.1(transitive)
- Removed@ckb-lumos/toolkit@0.22.0-next.1(transitive)
Updated@ckb-lumos/bi@0.22.0-next.2