Options
All
  • Public
  • Public/Protected
  • All
Menu

Package debugger

@ckb-lumos/debugger

A ckb-debugger wrapper for lumos, helping you to debug your transaction without lunching a full node

Quick Start

import { createTestContext } from "@ckb-lumos/debugger";

const { executor, scriptConfigs } = createTestContext({
  contract1: { path: path.join("path/to/contracts", "contract1") },
  contract2: { path: path.join("path/to/contracts", "contract2") },
});

// ...

executor.execute(txSkeleton);

Index

References

CKBDebugger

Re-exports CKBDebugger

CKBDebugger

Re-exports CKBDebugger

CKBDebuggerDownloader

Re-exports CKBDebuggerDownloader

CKBDebuggerDownloader

Re-exports CKBDebuggerDownloader

DataLoader

Re-exports DataLoader

DataLoader

Re-exports DataLoader

DebuggerData

Re-exports DebuggerData

DebuggerData

Re-exports DebuggerData

ExecuteResult

Re-exports ExecuteResult

ExecuteResult

Re-exports ExecuteResult

Executor

Re-exports Executor

Executor

Re-exports Executor

Grouped

Re-exports Grouped

Grouped

Re-exports Grouped

TestContext

Re-exports TestContext

TestContext

Re-exports TestContext

createTestContext

Re-exports createTestContext

createTestContext

Re-exports createTestContext

getDefaultConfig

Re-exports getDefaultConfig

getDefaultConfig

Re-exports getDefaultConfig

groupBy

Re-exports groupBy

groupBy

Re-exports groupBy

identity

Re-exports identity

identity

Re-exports identity

Type aliases

CreateContextOptions

CreateContextOptions: { codeLocale: LocaleCode }

Type declaration

CreateContextOptions

CreateContextOptions: { codeLocale: LocaleCode }

Type declaration

DepCodePath

DepCodePath: { depType?: undefined | "code"; path: string }

Type declaration

  • Optional depType?: undefined | "code"
  • path: string

DepCodePath

DepCodePath: { depType?: undefined | "code"; path: string }

Type declaration

  • Optional depType?: undefined | "code"
  • path: string

DepGroupPath

DepGroupPath: { depType: "depGroup"; includes: string[]; path: string }

Type declaration

  • depType: "depGroup"
  • includes: string[]
  • path: string

DepGroupPath

DepGroupPath: { depType: "depGroup"; includes: string[]; path: string }

Type declaration

  • depType: "depGroup"
  • includes: string[]
  • path: string

LoadedCode

LoadedCode: { binary: HexString; codeHash: HexString }

Type declaration

LoadedCode

LoadedCode: { binary: HexString; codeHash: HexString }

Type declaration

LocaleCode

LocaleCode: {}

Type declaration

LocaleCode

LocaleCode: {}

Type declaration

LocaleConfig

LocaleConfig: DepCodePath | DepGroupPath

LocaleConfig

LocaleConfig: DepCodePath | DepGroupPath

ResolvedCellDep

ResolvedCellDep: { cell_dep: CellDep; data: HexString }

Type declaration

TestContext

TestContext<T>: { executor: CKBDebugger; scriptConfigs: Record<keyof T, ScriptConfig> }

Type parameters

Type declaration

TestContext

TestContext<T>: { executor: CKBDebugger; scriptConfigs: Record<keyof T, ScriptConfig> }

Type parameters

Type declaration

ValueOf

ValueOf<T>: T[keyof T]

Type parameters

  • T

ValueOf

ValueOf<T>: T[keyof T]

Type parameters

  • T

Variables

Const CKB_DEBUGGER_VERSION

CKB_DEBUGGER_VERSION: "0.21.1" = "0.21.1"

Const CKB_DEBUGGER_VERSION

CKB_DEBUGGER_VERSION: "0.21.1" = "0.21.1"

Const DEFAULT_CKB_DEBUGGER_DIRECTORY_PATH

DEFAULT_CKB_DEBUGGER_DIRECTORY_PATH: string

Const DEFAULT_CKB_DEBUGGER_DIRECTORY_PATH

DEFAULT_CKB_DEBUGGER_DIRECTORY_PATH: string = envPaths("ckb-debugger", {suffix: CKB_DEBUGGER_VERSION,}).cache

Const OutPoint

OutPoint: Codec<Partial<Pick<{ index: string; txHash: string }, never>> & Pick<{ index: string; txHash: string }, "txHash" | "index">, Partial<Pick<{ index: any; txHash: string | ArrayLike<number> | ArrayBuffer }, "index">> & Pick<{ index: any; txHash: string | ArrayLike<number> | ArrayBuffer }, "txHash">> & { __isFixedCodec__: true; byteLength: number }

Const OutPoint

OutPoint: Codec<Uint8Array, {} & {}, {} & {}, string | ArrayLike<number> | ArrayBuffer> & { __isFixedCodec__: true; byteLength: number } = struct({txHash: Byte32,index: createFixedBytesCodec({byteLength: 4,pack: (hex) => Uint32.pack(hex),unpack: (buf) => BI.from(Uint32.unpack(buf)).toHexString(),}),},["txHash", "index"])

Const OutPointVec

OutPointVec: Codec<({} & {})[], ({} & {})[]>

Const OutPointVec

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

Functions

createCKBDebugger

createTestContext

  • createTestContext<Code>(config: { deps: Code }): TestContext<Code>
  • Type parameters

    Parameters

    • config: { deps: Code }
      • deps: Code

    Returns TestContext<Code>

createTestContext

  • createTestContext<Code>(config: { deps: Code }): TestContext<Code>
  • Type parameters

    Parameters

    • config: { deps: Code }
      • deps: Code

    Returns TestContext<Code>

getDefaultConfig

getDefaultConfig

groupBy

  • groupBy<V, GetK>(list: V[], keyGetter: GetK, options?: undefined | { hashCode: (k: ReturnType<GetK>) => string }): Grouped<ReturnType<GetK>, V>
  • Type parameters

    • V

    • GetK: (val: V) => any

    Parameters

    • list: V[]
    • keyGetter: GetK
    • Optional options: undefined | { hashCode: (k: ReturnType<GetK>) => string }

    Returns Grouped<ReturnType<GetK>, V>

groupBy

  • groupBy<V, GetK>(list: V[], keyGetter: GetK, options?: undefined | { hashCode: (k: ReturnType<GetK>) => string }): Grouped<ReturnType<GetK>, V>
  • Type parameters

    • V

    • GetK: (val: V) => any

    Parameters

    • list: V[]
    • keyGetter: GetK
    • Optional options: undefined | { hashCode: (k: ReturnType<GetK>) => string }

    Returns Grouped<ReturnType<GetK>, V>

identity

  • identity<T>(x: T): T
  • Type parameters

    • T

    Parameters

    • x: T

    Returns T

identity

  • identity<T>(x: T): T
  • Type parameters

    • T

    Parameters

    • x: T

    Returns T

isDepCode

  • Parameters

    Returns obj is DepCodePath

isDepGroup

  • Parameters

    Returns obj is DepGroupPath

loadCode

  • Parameters

    • binaryPath: string

    Returns LoadedCode

loadCode

  • Parameters

    • binaryPath: string

    Returns LoadedCode

mapObj

  • mapObj<Obj, Fn>(obj: Obj, map: Fn): Record<keyof Obj, ReturnType<Fn>>
  • Type parameters

    • Obj: Record<string, any>

    • Fn: (v: ValueOf<Obj>, k: keyof Obj, i: number) => any

    Parameters

    • obj: Obj
    • map: Fn

    Returns Record<keyof Obj, ReturnType<Fn>>

mapObj

  • mapObj<Obj, Fn>(obj: Obj, map: Fn): Record<keyof Obj, ReturnType<Fn>>
  • Type parameters

    • Obj: Record<string, any>

    • Fn: (v: ValueOf<Obj>, k: keyof Obj, i: number) => any

    Parameters

    • obj: Obj
    • map: Fn

    Returns Record<keyof Obj, ReturnType<Fn>>

mockOutPoint

  • Returns OutPoint

mockOutPoint

  • Returns OutPoint

parseDebuggerData

parseDebuggerData

parseDebuggerMessage

  • parseDebuggerMessage(message: string, debugMessage?: undefined | string): ExecuteResult
  • Parameters

    • message: string
    • Optional debugMessage: undefined | string

    Returns ExecuteResult

parseDebuggerMessage

  • parseDebuggerMessage(message: string, debugMessage?: string): ExecuteResult
  • Parameters

    • message: string
    • Default value debugMessage: string = ""

    Returns ExecuteResult

resolveCellDeps

Generated using TypeDoc