Options
All
  • Public
  • Public/Protected
  • All
Menu

Package base

@ckb-lumos/base

Base data structures and utilities used in lumos.

Index

References

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

References

Address

Re-exports Address

Address

Re-exports Address

Alert

Re-exports Alert

Alert

Re-exports Alert

AlertMessage

Re-exports AlertMessage

AlertMessage

Re-exports AlertMessage

BannedAddr

Re-exports BannedAddr

BannedAddr

Re-exports BannedAddr

BaseCellCollector

Re-exports BaseCellCollector

BaseCellCollector

Re-exports BaseCellCollector

Block

Re-exports Block

Block

Re-exports Block

BlockEconomicState

Re-exports BlockEconomicState

BlockEconomicState

Re-exports BlockEconomicState

Cell

Re-exports Cell

Cell

Re-exports Cell

CellCollector

Re-exports CellCollector

CellCollector

Re-exports CellCollector

CellCollectorResults

Re-exports CellCollectorResults

CellCollectorResults

Re-exports CellCollectorResults

CellDep

Re-exports CellDep

CellDep

Re-exports CellDep

CellProvider

Re-exports CellProvider

CellProvider

Re-exports CellProvider

CellWithStatus

Re-exports CellWithStatus

CellWithStatus

Re-exports CellWithStatus

ChainInfo

Re-exports ChainInfo

ChainInfo

Re-exports ChainInfo

Consensus

Re-exports Consensus

Consensus

Re-exports Consensus

DataWithSearchMode

Re-exports DataWithSearchMode

DataWithSearchMode

Re-exports DataWithSearchMode

DepType

Re-exports DepType

DepType

Re-exports DepType

DryRunResult

Re-exports DryRunResult

DryRunResult

Re-exports DryRunResult

Epoch

Re-exports Epoch

Epoch

Re-exports Epoch

Hash

Re-exports Hash

Hash

Re-exports Hash

HashType

Re-exports HashType

HashType

Re-exports HashType

Header

Re-exports Header

Header

Re-exports Header

HexNumber

Re-exports HexNumber

HexNumber

Re-exports HexNumber

HexString

Re-exports HexString

HexString

Re-exports HexString

Hexadecimal

Re-exports Hexadecimal

Hexadecimal

Re-exports Hexadecimal

HexadecimalRange

Re-exports HexadecimalRange

HexadecimalRange

Re-exports HexadecimalRange

Indexer

Re-exports Indexer

Indexer

Re-exports Indexer

IndexerOptions

Re-exports IndexerOptions

IndexerOptions

Re-exports IndexerOptions

Input

Re-exports Input

Input

Re-exports Input

LiveCell

Re-exports LiveCell

LiveCell

Re-exports LiveCell

LocalNode

Re-exports LocalNode

LocalNode

Re-exports LocalNode

LocalNodeProtocol

Re-exports LocalNodeProtocol

LocalNodeProtocol

Re-exports LocalNodeProtocol

MerkleProof

Re-exports MerkleProof

MerkleProof

Re-exports MerkleProof

NodeAddress

Re-exports NodeAddress

NodeAddress

Re-exports NodeAddress

OutPoint

Re-exports OutPoint

OutPoint

Re-exports OutPoint

Output

Re-exports Output

Output

Re-exports Output

PackedDao

Re-exports PackedDao

PackedDao

Re-exports PackedDao

PackedSince

Re-exports PackedSince

PackedSince

Re-exports PackedSince

PeerSyncState

Re-exports PeerSyncState

PeerSyncState

Re-exports PeerSyncState

ProposalWindow

Re-exports ProposalWindow

ProposalWindow

Re-exports ProposalWindow

QueryOptions

Re-exports QueryOptions

QueryOptions

Re-exports QueryOptions

Rational

Re-exports Rational

Rational

Re-exports Rational

RawTransaction

Re-exports RawTransaction

RawTransaction

Re-exports RawTransaction

RawTxPool

Re-exports RawTxPool

RawTxPool

Re-exports RawTxPool

RemoteNode

Re-exports RemoteNode

RemoteNode

Re-exports RemoteNode

RemoteNodeProtocol

Re-exports RemoteNodeProtocol

RemoteNodeProtocol

Re-exports RemoteNodeProtocol

Script

Re-exports Script

Script

Re-exports Script

ScriptWrapper

Re-exports ScriptWrapper

ScriptWrapper

Re-exports ScriptWrapper

SearchMode

Re-exports SearchMode

SearchMode

Re-exports SearchMode

SinceValidationInfo

Re-exports SinceValidationInfo

SinceValidationInfo

Re-exports SinceValidationInfo

SyncState

Re-exports SyncState

SyncState

Re-exports SyncState

Tip

Re-exports Tip

Tip

Re-exports Tip

Transaction

Re-exports Transaction

Transaction

Re-exports Transaction

TransactionCollector

Re-exports TransactionCollector

TransactionCollector

Re-exports TransactionCollector

TransactionCollectorOptions

Re-exports TransactionCollectorOptions

TransactionCollectorOptions

Re-exports TransactionCollectorOptions

TransactionCollectorResults

Re-exports TransactionCollectorResults

TransactionCollectorResults

Re-exports TransactionCollectorResults

TransactionProof

Re-exports TransactionProof

TransactionProof

Re-exports TransactionProof

TransactionWithStatus

Re-exports TransactionWithStatus

TransactionWithStatus

Re-exports TransactionWithStatus

TxPoolIds

Re-exports TxPoolIds

TxPoolIds

Re-exports TxPoolIds

TxPoolInfo

Re-exports TxPoolInfo

TxPoolInfo

Re-exports TxPoolInfo

TxPoolVerbosity

Re-exports TxPoolVerbosity

TxPoolVerbosity

Re-exports TxPoolVerbosity

TxStatus

Re-exports TxStatus

TxStatus

Re-exports TxStatus

TxVerbosity

Re-exports TxVerbosity

TxVerbosity

Re-exports TxVerbosity

UncleBlock

Re-exports UncleBlock

UncleBlock

Re-exports UncleBlock

WitnessArgs

Re-exports WitnessArgs

WitnessArgs

Re-exports WitnessArgs

blockchain

Re-exports blockchain

blockchain

Re-exports blockchain

helpers

Re-exports helpers

helpers

Re-exports helpers

indexer

Re-exports indexer

indexer

Re-exports indexer

logger

Re-exports logger

logger

Re-exports logger

since

Re-exports since

since

Re-exports since

utils

Re-exports utils

utils

Re-exports utils

values

Re-exports values

values

Re-exports values

Type aliases

Address

Address: string

Address

Address: string

CKBHasherOptions

CKBHasherOptions: { outLength?: undefined | number }

Type declaration

  • Optional outLength?: undefined | number

CKBHasherOptions

CKBHasherOptions: { outLength?: undefined | number }

Type declaration

  • Optional outLength?: undefined | number

DataWithSearchMode

DataWithSearchMode: { data: HexString; searchMode: SearchMode }

Type declaration

DataWithSearchMode

DataWithSearchMode: { data: HexString; searchMode: SearchMode }

Type declaration

DepType

DepType: "depGroup" | "code"

DepType

DepType: "depGroup" | "code"

Hash

Hash: HexString

Hash

Hash: HexString

HashType

HashType: "type" | "data" | "data1"

HashType

HashType: "type" | "data" | "data1"

HeaderCodecType

HeaderCodecType: PackParam<typeof BaseHeader>

HeaderCodecType

HeaderCodecType: PackParam<typeof BaseHeader>

HeaderUnpackResultType

HeaderUnpackResultType: UnpackResult<typeof BaseHeader>

HeaderUnpackResultType

HeaderUnpackResultType: UnpackResult<typeof BaseHeader>

HexNumber

HexNumber: Hexadecimal

HexNumber

HexNumber: Hexadecimal

HexString

HexString: string

HexString represents string starts with "0x" and followed by even number(including empty) of [0-9a-fA-F] characters.

HexString

HexString: string

HexString represents string starts with "0x" and followed by even number(including empty) of [0-9a-fA-F] characters.

Hexadecimal

Hexadecimal: string

Hexadecimal represents string starts with "0x" and followed by any number(excluding empty) of [0-9a-fA-F] characters.

Hexadecimal

Hexadecimal: string

Hexadecimal represents string starts with "0x" and followed by any number(excluding empty) of [0-9a-fA-F] characters.

HexadecimalRange

HexadecimalRange: [Hexadecimal, Hexadecimal]

HexadecimalRange

HexadecimalRange: [Hexadecimal, Hexadecimal]

Log

Log: (message: string) => void

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

Log

Log: (message: string) => void

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

LogLevel

LogLevel: "warn" | "error" | string

LogLevel

LogLevel: "warn" | "error" | string

Logger

Logger: (level: LogLevel, message: string) => void

Type declaration

    • (level: LogLevel, message: string): void
    • Parameters

      Returns void

Logger

Logger: (level: LogLevel, message: string) => void

Type declaration

    • (level: LogLevel, message: string): void
    • Parameters

      Returns void

PackedDao

PackedDao: string

PackedDao

PackedDao: string

PackedSince

PackedSince: string

PackedSince

PackedSince: string

RawHeaderUnpackResultType

RawHeaderUnpackResultType: UnpackResult<typeof RawHeader>

RawHeaderUnpackResultType

RawHeaderUnpackResultType: UnpackResult<typeof RawHeader>

RawTransactionUnpackResultType

RawTransactionUnpackResultType: UnpackResult<typeof RawTransaction>

RawTransactionUnpackResultType

RawTransactionUnpackResultType: UnpackResult<typeof RawTransaction>

RawTxPool

RawTxPool

SearchMode

SearchMode: "exact" | "prefix"

SearchMode

SearchMode: "exact" | "prefix"

SinceParseResult

SinceParseResult: { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: BI }

SinceParseResult

SinceParseResult: { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: BI }

SinceType

SinceType: "epochNumber" | "blockNumber" | "blockTimestamp"

SinceType

SinceType: "epochNumber" | "blockNumber" | "blockTimestamp"

TransactionCodecType

TransactionCodecType: PackParam<typeof BaseTransaction>

TransactionCodecType

TransactionCodecType: PackParam<typeof BaseTransaction>

TransactionUnpackResultType

TransactionUnpackResultType: UnpackResult<typeof BaseTransaction>

TransactionUnpackResultType

TransactionUnpackResultType: UnpackResult<typeof BaseTransaction>

Variables

Const BaseHeader

BaseHeader: BytesCodec<Partial<Pick<{ nonce: BI; raw: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> }, never>> & Pick<{ nonce: BI; raw: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> }, "raw" | "nonce">, Partial<Pick<{ nonce: string | number | bigint | BI; raw: Partial<Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, never>> & Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> }, never>> & Pick<{ nonce: string | number | bigint | BI; raw: Partial<Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, never>> & Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> }, "raw" | "nonce">> & { __isFixedCodec__: true; byteLength: number }

Const BaseHeader

BaseHeader: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({raw: RawHeader,nonce: Uint128LE,},["raw", "nonce"])

Const BaseTransaction

BaseTransaction: BytesCodec<Partial<Pick<{ raw: Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">; witnesses: string[] }, never>> & Pick<{ raw: Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">; witnesses: string[] }, "raw" | "witnesses">, Partial<Pick<{ raw: Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">; witnesses: BytesLike[] }, never>> & Pick<{ raw: Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">; witnesses: BytesLike[] }, "raw" | "witnesses">>

Const BaseTransaction

BaseTransaction: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({raw: RawTransaction,witnesses: BytesVec,},["raw", "witnesses"])

Const Block

Block: BytesCodec<Partial<Pick<{ header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[]; transactions: ({} & {} & { witnesses: string[] })[]; uncles: ({} & {})[] }, never>> & Pick<{ header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[]; transactions: ({} & {} & { witnesses: string[] })[]; uncles: ({} & {})[] }, "header" | "proposals" | "uncles" | "transactions">, Partial<Pick<{ header: Header; proposals: BytesLike[]; transactions: Transaction[]; uncles: ({} & {})[] }, never>> & Pick<{ header: Header; proposals: BytesLike[]; transactions: Transaction[]; uncles: ({} & {})[] }, "header" | "proposals" | "uncles" | "transactions">>

Const Block

Block: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({header: Header,uncles: UncleBlockVec,transactions: TransactionVec,proposals: ProposalShortIdVec,},["header", "uncles", "transactions", "proposals"])

Const BlockV1

BlockV1: BytesCodec<Partial<Pick<{ extension: string; header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[]; transactions: ({} & {} & { witnesses: string[] })[]; uncles: ({} & {})[] }, never>> & Pick<{ extension: string; header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[]; transactions: ({} & {} & { witnesses: string[] })[]; uncles: ({} & {})[] }, "header" | "proposals" | "uncles" | "transactions" | "extension">, Partial<Pick<{ extension: BytesLike; header: Header; proposals: BytesLike[]; transactions: Transaction[]; uncles: ({} & {})[] }, never>> & Pick<{ extension: BytesLike; header: Header; proposals: BytesLike[]; transactions: Transaction[]; uncles: ({} & {})[] }, "header" | "proposals" | "uncles" | "transactions" | "extension">>

Const BlockV1

BlockV1: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({header: Header,uncles: UncleBlockVec,transactions: TransactionVec,proposals: ProposalShortIdVec,extension: Bytes,},["header", "uncles", "transactions", "proposals", "extension"])

Const Byte32

Byte32: FixedBytesCodec<string, BytesLike>

Const Byte32

Byte32: Codec<Uint8Array, string, string | ArrayLike<number> | ArrayBuffer, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = createFixedHexBytesCodec(32)

Const Byte32Vec

Byte32Vec: BytesCodec<string[], BytesLike[]>

Const Byte32Vec

Byte32Vec: Codec<Uint8Array, string[], (string | ArrayLike<number> | ArrayBuffer)[], string | ArrayLike<number> | ArrayBuffer> = vector(Byte32)

Const Bytes

Bytes: BytesCodec<string, BytesLike>

placeholder codec, generally used as a placeholder

// for example, when some BytesOpt is not used, it will be filled with this codec
// option BytesOpt (Bytes);
const UnusedBytesOpt = UnknownOpt

Const Bytes

Bytes: Codec<Uint8Array, string, string | ArrayLike<number> | ArrayBuffer, string | ArrayLike<number> | ArrayBuffer> = byteVecOf({ pack: bytify, unpack: hexify })

placeholder codec, generally used as a placeholder

// for example, when some BytesOpt is not used, it will be filled with this codec
// option BytesOpt (Bytes);
const UnusedBytesOpt = UnknownOpt

Const BytesOpt

BytesOpt: OptionCodec<BytesCodec<string, BytesLike>>

Const BytesOpt

BytesOpt: OptionCodec<Codec<Uint8Array, string, string | ArrayLike<number> | ArrayBuffer, string | ArrayLike<number> | ArrayBuffer>> = option(Bytes)

Const BytesVec

BytesVec: BytesCodec<string[], BytesLike[]>

Const BytesVec

BytesVec: Codec<Uint8Array, string[], (string | ArrayLike<number> | ArrayBuffer)[], string | ArrayLike<number> | ArrayBuffer> = vector(Bytes)

Const CellDep

CellDep: BytesCodec<Partial<Pick<{ depType: api.DepType; outPoint: Partial<Pick<{ index: number; txHash: string }, never>> & Pick<{ index: number; txHash: string }, "txHash" | "index"> }, never>> & Pick<{ depType: api.DepType; outPoint: Partial<Pick<{ index: number; txHash: string }, never>> & Pick<{ index: number; txHash: string }, "txHash" | "index"> }, "outPoint" | "depType">, Partial<Pick<{ depType: api.DepType; outPoint: Partial<Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, never>> & Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, "txHash" | "index"> }, never>> & Pick<{ depType: api.DepType; outPoint: Partial<Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, never>> & Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, "txHash" | "index"> }, "outPoint" | "depType">> & { __isFixedCodec__: true; byteLength: number }

Const CellDep

CellDep: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({outPoint: OutPoint,depType: DepType,},["outPoint", "depType"])

Const CellDepVec

CellDepVec: BytesCodec<({} & {})[], ({} & {})[]>

Const CellDepVec

CellDepVec: Codec<Uint8Array, ({} & {})[], ({} & {})[], string | ArrayLike<number> | ArrayBuffer> = vector(CellDep)

Const CellInput

CellInput: BytesCodec<Partial<Pick<{ previousOutput: Partial<Pick<{ index: number; txHash: string }, never>> & Pick<{ index: number; txHash: string }, "txHash" | "index">; since: BI }, never>> & Pick<{ previousOutput: Partial<Pick<{ index: number; txHash: string }, never>> & Pick<{ index: number; txHash: string }, "txHash" | "index">; since: BI }, "since" | "previousOutput">, Partial<Pick<{ previousOutput: Partial<Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, never>> & Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, "txHash" | "index">; since: string | number | bigint | BI }, never>> & Pick<{ previousOutput: Partial<Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, never>> & Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, "txHash" | "index">; since: string | number | bigint | BI }, "since" | "previousOutput">> & { __isFixedCodec__: true; byteLength: number }

Const CellInput

CellInput: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({since: Uint64LE,previousOutput: OutPoint,},["since", "previousOutput"])

Const CellInputVec

CellInputVec: BytesCodec<({} & {})[], ({} & {})[]>

Const CellInputVec

CellInputVec: Codec<Uint8Array, ({} & {})[], ({} & {})[], string | ArrayLike<number> | ArrayBuffer> = vector(CellInput)

Const CellOutput

CellOutput: BytesCodec<Partial<Pick<{ capacity: BI; lock: Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">; type: ({} & {}) | undefined }, "type">> & Pick<{ capacity: BI; lock: Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">; type: ({} & {}) | undefined }, "capacity" | "lock">, Partial<Pick<{ capacity: string | number | bigint | BI; lock: Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">; type: ({} & {}) | undefined }, "type">> & Pick<{ capacity: string | number | bigint | BI; lock: Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">; type: ({} & {}) | undefined }, "capacity" | "lock">>

Const CellOutput

CellOutput: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({capacity: Uint64LE,lock: Script,type: ScriptOpt,},["capacity", "lock", "type"])

Const CellOutputVec

CellOutputVec: BytesCodec<({} & {})[], ({} & {})[]>

Const CellOutputVec

CellOutputVec: Codec<Uint8Array, ({} & {})[], ({} & {})[], string | ArrayLike<number> | ArrayBuffer> = vector(CellOutput)

Const CellbaseWitness

CellbaseWitness: BytesCodec<Partial<Pick<{ lock: Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">; message: string }, never>> & Pick<{ lock: Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">; message: string }, "lock" | "message">, Partial<Pick<{ lock: Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">; message: BytesLike }, never>> & Pick<{ lock: Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">; message: BytesLike }, "lock" | "message">>

Const CellbaseWitness

CellbaseWitness: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({lock: Script,message: Bytes,},["lock", "message"])

Const DepType

DepType: FixedBytesCodec<api.DepType, api.DepType>

Const DepType

DepType: Codec<Uint8Array, "depGroup" | "code", "depGroup" | "code", string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = createFixedBytesCodec<api.DepType>({byteLength: 1,pack: (type) => {if (type === "code") return Uint8.pack(0);if (type === "depGroup") return Uint8.pack(1);throw new Error(`Invalid dep type: ${type}`);},unpack: (buf) => {const depTypeBuf = Uint8.unpack(buf);if (depTypeBuf === 0) return "code";if (depTypeBuf === 1) return "depGroup";throw new Error(`Invalid dep type: ${depTypeBuf}`);},})

Const HashType

HashType: FixedBytesCodec<api.HashType, api.HashType>

Const HashType

HashType: Codec<Uint8Array, "type" | "data" | "data1", "type" | "data" | "data1", string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = createFixedBytesCodec<api.HashType>({byteLength: 1,pack: (type) => {if (type === "data") return Uint8.pack(0);if (type === "type") return Uint8.pack(1);if (type === "data1") return Uint8.pack(2);throw new Error(`Invalid hash type: ${type}`);},unpack: (buf) => {const hashTypeBuf = Uint8.unpack(buf);if (hashTypeBuf === 0) return "data";if (hashTypeBuf === 1) return "type";if (hashTypeBuf === 2) return "data1";throw new Error(`Invalid hash type: ${hashTypeBuf}`);},})

Const Header

Header: BytesCodec<Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }, Header>

Const Header

Header: Codec<Uint8Array, {} & {} & { hash: string; nonce: BI }, Header, string | ArrayLike<number> | ArrayBuffer> = createBytesCodec({pack: (header: api.Header) =>BaseHeader.pack(transformHeaderCodecType(header)),unpack: (buf) => deTransformHeaderCodecType(BaseHeader.unpack(buf)),})

Const HexifyCodec

HexifyCodec: Codec<Uint8Array, string, string | ArrayLike<number> | ArrayBuffer, string | ArrayLike<number> | ArrayBuffer> = createBytesCodec<string, BytesLike>({pack: bytify,unpack: hexify,})

Const OutPoint

OutPoint: BytesCodec<Partial<Pick<{ index: number; txHash: string }, never>> & Pick<{ index: number; txHash: string }, "txHash" | "index">, Partial<Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, never>> & Pick<{ index: string | number | bigint | BI; txHash: BytesLike }, "txHash" | "index">> & { __isFixedCodec__: true; byteLength: number }

Const OutPoint

OutPoint: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({txHash: Byte32,index: Uint32LE,},["txHash", "index"])

Const ProposalShortId

ProposalShortId: FixedBytesCodec<string, BytesLike>

Const ProposalShortId

ProposalShortId: Codec<Uint8Array, string, string | ArrayLike<number> | ArrayBuffer, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = createFixedHexBytesCodec(10)

Const ProposalShortIdVec

ProposalShortIdVec: BytesCodec<string[], BytesLike[]>

Const ProposalShortIdVec

ProposalShortIdVec: Codec<Uint8Array, string[], (string | ArrayLike<number> | ArrayBuffer)[], string | ArrayLike<number> | ArrayBuffer> = vector(ProposalShortId)

Const RawHeader

RawHeader: BytesCodec<Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao">, Partial<Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, never>> & Pick<{ compactTarget: string | number | bigint | BI; dao: BytesLike; epoch: string | number | bigint | BI; extraHash: BytesLike; number: string | number | bigint | BI; parentHash: BytesLike; proposalsHash: BytesLike; timestamp: string | number | bigint | BI; transactionsRoot: BytesLike; version: string | number | bigint | BI }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao">> & { __isFixedCodec__: true; byteLength: number }

Const RawHeader

RawHeader: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({version: Uint32LE,compactTarget: Uint32LE,timestamp: Uint64LE,number: Uint64LE,epoch: Uint64LE,parentHash: Byte32,transactionsRoot: Byte32,proposalsHash: Byte32,extraHash: Byte32,dao: Byte32,},["version","compactTarget","timestamp","number","epoch","parentHash","transactionsRoot","proposalsHash","extraHash","dao",])

Const RawTransaction

RawTransaction: BytesCodec<Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">, Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: BytesLike[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: BytesLike[]; version: string | number | bigint | BI }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData">>

Const RawTransaction

RawTransaction: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({version: Uint32LE,cellDeps: CellDepVec,headerDeps: Byte32Vec,inputs: CellInputVec,outputs: CellOutputVec,outputsData: BytesVec,},["version", "cellDeps", "headerDeps", "inputs", "outputs", "outputsData"])

Const Script

Script: BytesCodec<Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">, Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">>

Const Script

Script: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({codeHash: Byte32,hashType: HashType,args: Bytes,},["codeHash", "hashType", "args"])

Const ScriptOpt

ScriptOpt: OptionCodec<BytesCodec<Partial<Pick<{ args: string; codeHash: string; hashType: api.HashType }, never>> & Pick<{ args: string; codeHash: string; hashType: api.HashType }, "codeHash" | "hashType" | "args">, Partial<Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, never>> & Pick<{ args: BytesLike; codeHash: BytesLike; hashType: api.HashType }, "codeHash" | "hashType" | "args">>>

Const ScriptOpt

ScriptOpt: OptionCodec<Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer>> = option(Script)

Const TYPE_ID_CODE_HASH

TYPE_ID_CODE_HASH: "0x00000000000000000000000000000000000000000000000000545950455f4944" = "0x00000000000000000000000000000000000000000000000000545950455f4944"

Const Transaction

Transaction: BytesCodec<Partial<Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, never>> & Pick<{ cellDeps: ({} & {})[]; headerDeps: string[]; inputs: ({} & {})[]; outputs: ({} & {})[]; outputsData: string[]; version: number }, "version" | "cellDeps" | "headerDeps" | "inputs" | "outputs" | "outputsData"> & { witnesses: string[] }, Transaction>

Const Transaction

Transaction: Codec<Uint8Array, {} & {} & { witnesses: string[] }, Transaction, string | ArrayLike<number> | ArrayBuffer> = createBytesCodec({pack: (tx: api.Transaction) =>BaseTransaction.pack(transformTransactionCodecType(tx)),unpack: (buf) => deTransformTransactionCodecType(BaseTransaction.unpack(buf)),})

Const TransactionVec

TransactionVec: BytesCodec<({} & {} & { witnesses: string[] })[], Transaction[]>

Const TransactionVec

TransactionVec: Codec<Uint8Array, ({} & {} & { witnesses: string[] })[], Transaction[], string | ArrayLike<number> | ArrayBuffer> = vector(Transaction)

Const U128_MAX_COMPATIBLE

U128_MAX_COMPATIBLE: BI = BI.from("340282366920938463463374607431768211455")

Const U128_MIN_COMPATIBLE

U128_MIN_COMPATIBLE: BI = BI.from(0)

Uint128LE

Uint128LE: Codec<Uint8Array, BI, string | number | bigint | BI, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number }

Uint32LE

Uint32LE: Codec<Uint8Array, number, string | number | bigint | BI, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number }

Uint64LE

Uint64LE: Codec<Uint8Array, BI, string | number | bigint | BI, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number }

Uint8

Uint8: Codec<Uint8Array, number, string | number | bigint | BI, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number }

Const UncleBlock

UncleBlock: BytesCodec<Partial<Pick<{ header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[] }, never>> & Pick<{ header: Partial<Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, never>> & Pick<{ compactTarget: number; dao: string; epoch: BI; extraHash: string; number: BI; parentHash: string; proposalsHash: string; timestamp: BI; transactionsRoot: string; version: number }, "number" | "version" | "compactTarget" | "timestamp" | "epoch" | "parentHash" | "transactionsRoot" | "proposalsHash" | "extraHash" | "dao"> & { hash: string; nonce: BI }; proposals: string[] }, "header" | "proposals">, Partial<Pick<{ header: Header; proposals: BytesLike[] }, never>> & Pick<{ header: Header; proposals: BytesLike[] }, "header" | "proposals">>

Const UncleBlock

UncleBlock: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> = table({header: Header,proposals: ProposalShortIdVec,},["header", "proposals"])

Const UncleBlockVec

UncleBlockVec: BytesCodec<({} & {})[], ({} & {})[]>

Const UncleBlockVec

UncleBlockVec: Codec<Uint8Array, ({} & {})[], ({} & {})[], string | ArrayLike<number> | ArrayBuffer> = vector(UncleBlock)

Const WitnessArgs

WitnessArgs: BytesCodec<{ inputType?: string | undefined; lock?: string | undefined; outputType?: string | undefined }, { inputType?: string | ArrayBuffer | ArrayLike<number> | undefined; lock?: string | ArrayBuffer | ArrayLike<number> | undefined; outputType?: string | ArrayBuffer | ArrayLike<number> | undefined }>
example
// secp256k1 lock witness
WitnessArgs.pack({ lock: '0x' + '00'.repeat(65) })

Const WitnessArgs

WitnessArgs: Codec<Uint8Array, { inputType?: UnpackResult<InputTypeCodec>; lock?: UnpackResult<LockCodec>; outputType?: UnpackResult<OutputTypeCodec> }, { inputType?: PackParam<InputTypeCodec>; lock?: PackParam<LockCodec>; outputType?: PackParam<OutputTypeCodec> }, string | ArrayLike<number> | ArrayBuffer> = WitnessArgsOf({lock: HexifyCodec,inputType: HexifyCodec,outputType: HexifyCodec,})
example
// secp256k1 lock witness
WitnessArgs.pack({ lock: '0x' + '00'.repeat(65) })

byteVecOf

byteVecOf: byteVecOf

bytify

bytify: bytify

bytify

bytify: bytify

bytifyRawString

bytifyRawString: bytifyRawString

hexify

hexify: hexify

hexify

hexify: hexify

hexify

hexify: hexify

Const indexer

indexer: { TransactionCollector: typeof TransactionCollector }

Type declaration

option

option: option

struct

struct: struct

table

table: table

vector

vector: vector

Functions

WitnessArgsOf

  • WitnessArgsOf<LockCodec, InputTypeCodec, OutputTypeCodec>(payload: { inputType: InputTypeCodec; lock: LockCodec; outputType: OutputTypeCodec }): BytesCodec<{ inputType?: UnpackResult<InputTypeCodec>; lock?: UnpackResult<LockCodec>; outputType?: UnpackResult<OutputTypeCodec> }, { inputType?: PackParam<InputTypeCodec>; lock?: PackParam<LockCodec>; outputType?: PackParam<OutputTypeCodec> }>
  • Type parameters

    Parameters

    • payload: { inputType: InputTypeCodec; lock: LockCodec; outputType: OutputTypeCodec }
      • inputType: InputTypeCodec
      • lock: LockCodec
      • outputType: OutputTypeCodec

    Returns BytesCodec<{ inputType?: UnpackResult<InputTypeCodec>; lock?: UnpackResult<LockCodec>; outputType?: UnpackResult<OutputTypeCodec> }, { inputType?: PackParam<InputTypeCodec>; lock?: PackParam<LockCodec>; outputType?: PackParam<OutputTypeCodec> }>

WitnessArgsOf

  • WitnessArgsOf<LockCodec, InputTypeCodec, OutputTypeCodec>(payload: { inputType: InputTypeCodec; lock: LockCodec; outputType: OutputTypeCodec }): BytesCodec<{ inputType?: UnpackResult<InputTypeCodec>; lock?: UnpackResult<LockCodec>; outputType?: UnpackResult<OutputTypeCodec> }, { inputType?: PackParam<InputTypeCodec>; lock?: PackParam<LockCodec>; outputType?: PackParam<OutputTypeCodec> }>
  • Type parameters

    Parameters

    • payload: { inputType: InputTypeCodec; lock: LockCodec; outputType: OutputTypeCodec }
      • inputType: InputTypeCodec
      • lock: LockCodec
      • outputType: OutputTypeCodec

    Returns BytesCodec<{ inputType?: UnpackResult<InputTypeCodec>; lock?: UnpackResult<LockCodec>; outputType?: UnpackResult<OutputTypeCodec> }, { inputType?: PackParam<InputTypeCodec>; lock?: PackParam<LockCodec>; outputType?: PackParam<OutputTypeCodec> }>

_toHex

  • _toHex(num: number | BI): string
  • Parameters

    • num: number | BI

    Returns string

assertHexString

  • assertHexString(debugPath: string, str: string): void
  • Parameters

    • debugPath: string
    • str: string

    Returns void

assertHexString

  • assertHexString(debugPath: string, str: string): void
  • Parameters

    • debugPath: string
    • str: string

    Returns void

assertHexadecimal

  • assertHexadecimal(debugPath: string, str: string): void
  • Parameters

    • debugPath: string
    • str: string

    Returns void

assertHexadecimal

  • assertHexadecimal(debugPath: string, str: string): void
  • Parameters

    • debugPath: string
    • str: string

    Returns void

ckbHash

  • Parameters

    Returns Hash

ckbHash

  • Parameters

    Returns Hash

computeScriptHash

  • computeScriptHash(script: Script): string
  • compute lock/type hash

    Parameters

    Returns string

computeScriptHash

  • computeScriptHash(script: Script): string
  • compute lock/type hash

    Parameters

    Returns string

createFixedHexBytesCodec

  • Parameters

    • byteLength: number

    Returns FixedBytesCodec<string, BytesLike>

createFixedHexBytesCodec

  • Parameters

    • byteLength: number

    Returns FixedBytesCodec<string, BytesLike>

deTransformHeaderCodecType

deTransformHeaderCodecType

deTransformTransactionCodecType

deTransformTransactionCodecType

deepCamel

  • deepCamel(data: any): any
  • Parameters

    • data: any

    Returns any

deepCamel

  • deepCamel(data: any): any
  • Parameters

    • data: any

    Returns any

deepCamelizeDepGroup

  • deepCamelizeDepGroup(data: any): any
  • Parameters

    • data: any

    Returns any

deepCamelizeTransaction

  • deepCamelizeTransaction(data: any): any
  • Parameters

    • data: any

    Returns any

deepCamelizeTransaction

  • deepCamelizeTransaction(data: any): any
  • Parameters

    • data: any

    Returns any

defaultLogger

  • defaultLogger(level: LogLevel, message: string): void
  • Parameters

    Returns void

defaultLogger

  • defaultLogger(level: LogLevel, message: string): void
  • Parameters

    Returns void

deprecated

  • deprecated(message: string): void
  • Parameters

    • message: string

    Returns void

deprecated

  • deprecated(message: string): void
  • Parameters

    • message: string

    Returns void

generateAbsoluteEpochSince

  • generateAbsoluteEpochSince(__namedParameters: { index: number; length: number; number: number }): PackedSince
  • generate absolute-epoch-number format since

    Parameters

    • __namedParameters: { index: number; length: number; number: number }
      • index: number
      • length: number
      • number: number

    Returns PackedSince

generateAbsoluteEpochSince

  • generateAbsoluteEpochSince(__namedParameters: { index: number; length: number; number: number }): PackedSince
  • generate absolute-epoch-number format since

    Parameters

    • __namedParameters: { index: number; length: number; number: number }
      • index: number
      • length: number
      • number: number

    Returns PackedSince

generateHeaderEpoch

  • generateHeaderEpoch(__namedParameters: { index: number; length: number; number: number }): HexString
  • generate header epoch from epoch since value

    Parameters

    • __namedParameters: { index: number; length: number; number: number }
      • index: number
      • length: number
      • number: number

    Returns HexString

generateHeaderEpoch

  • generateHeaderEpoch(__namedParameters: { index: number; length: number; number: number }): HexString
  • generate header epoch from epoch since value

    Parameters

    • __namedParameters: { index: number; length: number; number: number }
      • index: number
      • length: number
      • number: number

    Returns HexString

generateSince

  • generateSince(__namedParameters: { relative: boolean; type: "epochNumber" | "blockNumber" | "blockTimestamp"; value: string | number | bigint | BI | EpochSinceValue }): string
  • Parameters

    • __namedParameters: { relative: boolean; type: "epochNumber" | "blockNumber" | "blockTimestamp"; value: string | number | bigint | BI | EpochSinceValue }
      • relative: boolean
      • type: "epochNumber" | "blockNumber" | "blockTimestamp"
      • value: string | number | bigint | BI | EpochSinceValue

    Returns string

generateSince

  • generateSince(__namedParameters: { relative: boolean; type: "epochNumber" | "blockNumber" | "blockTimestamp"; value: string | number | bigint | BI | EpochSinceValue }): string
  • Parameters

    • __namedParameters: { relative: boolean; type: "epochNumber" | "blockNumber" | "blockTimestamp"; value: string | number | bigint | BI | EpochSinceValue }
      • relative: boolean
      • type: "epochNumber" | "blockNumber" | "blockTimestamp"
      • value: string | number | bigint | BI | EpochSinceValue

    Returns string

generateTypeIdArgs

generateTypeIdScript

  • generateTypeIdScript(input: Input, outputIndex?: undefined | string): Script
  • Parameters

    • input: Input
    • Optional outputIndex: undefined | string

    Returns Script

generateTypeIdScript

  • generateTypeIdScript(input: Input, outputIndex?: string): Script
  • Parameters

    • input: Input
    • Default value outputIndex: string = "0x0"

    Returns Script

hashCode

  • hashCode(buffer: Buffer): number
  • Parameters

    • buffer: Buffer

    Returns number

hashCode

  • hashCode(buffer: Buffer): number
  • Parameters

    • buffer: Buffer

    Returns number

isCellMatchQueryOptions

  • isCellMatchQueryOptions(cell: Cell, __namedParameters: { argsLen: undefined | number | "any"; data: undefined | string | { data: HexString; searchMode: SearchMode }; fromBlock: undefined | string; lock: undefined | Script | ScriptWrapper; toBlock: undefined | string; type: undefined | Script | ScriptWrapper | "empty" }): boolean
  • Parameters

    Returns boolean

isCellMatchQueryOptions

  • isCellMatchQueryOptions(cell: Cell, __namedParameters: { argsLen: number | "any"; data: string | { data: HexString; searchMode: SearchMode }; fromBlock: undefined | string; lock: undefined | Script | ScriptWrapper; toBlock: undefined | string; type: undefined | "empty" | Script | ScriptWrapper }): boolean

isDeepEqual

  • isDeepEqual(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean

isDeepEqual

  • isDeepEqual(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean

isScriptWrapper

  • return if the input is a script wrapper

    Parameters

    Returns maybeWrapped is ScriptWrapper

isScriptWrapper

  • return if the input is a script wrapper

    Parameters

    Returns maybeWrapped is ScriptWrapper

maximumAbsoluteEpochSince

  • maximumAbsoluteEpochSince(...args: PackedSince[]): string
  • return maximum since of args

    Parameters

    • Rest ...args: PackedSince[]

      sinces in absolute-epoch-number format

    Returns string

maximumAbsoluteEpochSince

  • maximumAbsoluteEpochSince(...args: PackedSince[]): string
  • return maximum since of args

    Parameters

    • Rest ...args: PackedSince[]

      sinces in absolute-epoch-number format

    Returns string

parseAbsoluteEpochSince

  • Will throw an error if since not in absolute-epoch-number format

    Parameters

    Returns EpochSinceValue

parseAbsoluteEpochSince

  • Will throw an error if since not in absolute-epoch-number format

    Parameters

    Returns EpochSinceValue

parseEpoch

  • parse epoch from blockHeader.epoch

    Parameters

    Returns EpochSinceValue

parseEpoch

  • parse epoch from blockHeader.epoch

    Parameters

    Returns EpochSinceValue

parseSince

  • parseSince(since: PackedSince): { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: bigint }
  • Parse since and get relative or not, type, and value of since

    Parameters

    Returns { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: bigint }

parseSince

  • parseSince(since: PackedSince): { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: bigint }
  • Parse since and get relative or not, type, and value of since

    Parameters

    Returns { relative: boolean; type: "epochNumber"; value: EpochSinceValue } | { relative: boolean; type: "blockNumber" | "blockTimestamp"; value: bigint }

parseSinceCompatible

parseSinceCompatible

readBigUInt128LE

  • deprecated

    please follow the migration-guide convert BigUInt64 little-endian hex string to bigint

    Parameters

    • leHex: HexString

      BigUInt128 little-endian hex string

    Returns bigint

readBigUInt128LE

  • deprecated

    please follow the migration-guide convert BigUInt64 little-endian hex string to bigint

    Parameters

    • leHex: HexString

      BigUInt128 little-endian hex string

    Returns bigint

readBigUInt128LECompatible

readBigUInt128LECompatible

readBigUInt64LE

  • deprecated

    please follow the migration-guide convert BigUInt64 little-endian hex string to bigint

    Parameters

    • hex: HexString

      BigUInt64 little-endian hex string

    Returns bigint

readBigUInt64LE

  • deprecated

    please follow the migration-guide convert BigUInt64 little-endian hex string to bigint

    Parameters

    • hex: HexString

      BigUInt64 little-endian hex string

    Returns bigint

readBigUInt64LECompatible

readBigUInt64LECompatible

toBigUInt128LE

  • toBigUInt128LE(u128: BIish): string
  • deprecated

    please follow the migration-guide convert bigint to BigUInt128 little-endian hex string

    Parameters

    Returns string

toBigUInt128LE

  • toBigUInt128LE(u128: BIish): string
  • deprecated

    please follow the migration-guide convert bigint to BigUInt128 little-endian hex string

    Parameters

    Returns string

toBigUInt128LECompatible

  • Parameters

    Returns HexNumber

toBigUInt128LECompatible

  • Parameters

    Returns HexNumber

toBigUInt64LE

  • deprecated

    please follow the migration-guide convert bigint to BigUInt64 little-endian hex string

    Parameters

    Returns HexString

toBigUInt64LE

  • deprecated

    please follow the migration-guide convert bigint to BigUInt64 little-endian hex string

    Parameters

    Returns HexString

toBigUInt64LECompatible

  • Parameters

    Returns HexString

toBigUInt64LECompatible

  • Parameters

    Returns HexString

toCamel

  • toCamel(s: string): string
  • Parameters

    • s: string

    Returns string

transformHeaderCodecType

transformHeaderCodecType

transformTransactionCodecType

  • from Transantion defined in @ckb-lumos/base/lib/api.d.ts

    export interface Transaction {
     cellDeps: CellDep[];
     hash?: Hash;
     headerDeps: Hash[];
     inputs: Input[];
     outputs: Output[];
     outputsData: HexString[];
     version: HexNumber;
     witnesses: HexString[];
    }
    to :
    interface TransactionCodecType {
      raw: {
        version: Uint32LE;
        cellDeps: DeCellDepVec;
        headerDeps: Byte32Vec;
        inputs: CellInputVec;
        outputs: CellOutputVec;
        outputsData: BytesVec;
      };
      witnesses: BytesVec;
    }

    Parameters

    • data: Transaction

      Transantion defined in @ckb-lumos/base/lib/api.d.ts

    Returns TransactionCodecType

    TransactionCodecType

transformTransactionCodecType

  • from Transantion defined in @ckb-lumos/base/lib/api.d.ts

    export interface Transaction {
     cellDeps: CellDep[];
     hash?: Hash;
     headerDeps: Hash[];
     inputs: Input[];
     outputs: Output[];
     outputsData: HexString[];
     version: HexNumber;
     witnesses: HexString[];
    }
    to :
    interface TransactionCodecType {
      raw: {
        version: Uint32LE;
        cellDeps: DeCellDepVec;
        headerDeps: Byte32Vec;
        inputs: CellInputVec;
        outputs: CellOutputVec;
        outputsData: BytesVec;
      };
      witnesses: BytesVec;
    }

    Parameters

    • data: Transaction

      Transantion defined in @ckb-lumos/base/lib/api.d.ts

    Returns TransactionCodecType

    TransactionCodecType

validateAbsoluteEpochSince

  • Will throw an error if since not in absolute-epoch-number format

    Parameters

    Returns boolean

validateAbsoluteEpochSince

  • Will throw an error if since not in absolute-epoch-number format

    Parameters

    Returns boolean

validateSince

validateSince

Object literals

Const indexer

indexer: object

TransactionCollector

TransactionCollector: TransactionCollector

Generated using TypeDoc