Skip to content

@acala-network/chopsticks-coreDocs


@acala-network/chopsticks-core / GenesisProvider

Class: GenesisProvider

Provider to start a chain from genesis

Implements

  • ProviderInterface

Properties

genesisHeaderLogs

genesisHeaderLogs: `0x${string}`[] = []

Defined in

packages/core/src/genesis-provider.ts:26

Accessors

_jsCallback

get _jsCallback(): JsCallback

Returns

JsCallback

Defined in

packages/core/src/genesis-provider.ts:120


blockHash

get blockHash(): `0x${string}`

Returns

`0x${string}`

Defined in

packages/core/src/genesis-provider.ts:95


hasSubscriptions

get hasSubscriptions(): boolean

true if the provider supports subscriptions (not available for HTTP)

Returns

boolean

Implementation of

ProviderInterface.hasSubscriptions

Defined in

packages/core/src/genesis-provider.ts:65


isClonable

get isClonable(): boolean

true if the clone() functionality is available on the provider

Returns

boolean

Implementation of

ProviderInterface.isClonable

Defined in

packages/core/src/genesis-provider.ts:57


isConnected

get isConnected(): boolean

true if the provider is currently connected (ws/sc has connection logic)

Returns

boolean

Implementation of

ProviderInterface.isConnected

Defined in

packages/core/src/genesis-provider.ts:69


isReady

get isReady(): Promise<void>

Returns

Promise<void>

Defined in

packages/core/src/genesis-provider.ts:73

Methods

clone()

clone(): GenesisProvider

Returns

GenesisProvider

Implementation of

ProviderInterface.clone

Defined in

packages/core/src/genesis-provider.ts:61


connect()

connect(): Promise<void>

Returns

Promise<void>

Implementation of

ProviderInterface.connect

Defined in

packages/core/src/genesis-provider.ts:77


disconnect()

disconnect(): Promise<void>

Returns

Promise<void>

Implementation of

ProviderInterface.disconnect

Defined in

packages/core/src/genesis-provider.ts:82


getBlock()

getBlock(): Promise<object>

Returns

Promise<object>

block

block: object

block.extrinsics

extrinsics: never[] = []

block.header

header: object

block.header.digest

digest: object

block.header.digest.logs

logs: `0x${string}`[]

block.header.extrinsicsRoot

extrinsicsRoot: string = '0x03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314'

block.header.number

number: `0x${string}`

block.header.parentHash

parentHash: string = '0x4545454545454545454545454545454545454545454545454545454545454545'

block.header.stateRoot

stateRoot: `0x${string}`

Defined in

packages/core/src/genesis-provider.ts:111


getHeader()

getHeader(): Promise<object>

Returns

Promise<object>

digest

digest: object

digest.logs

logs: `0x${string}`[]

extrinsicsRoot

extrinsicsRoot: string = '0x03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314'

number

number: `0x${string}`

parentHash

parentHash: string = '0x4545454545454545454545454545454545454545454545454545454545454545'

stateRoot

stateRoot: `0x${string}`

Defined in

packages/core/src/genesis-provider.ts:99


on()

on(type, sub): () => void

Parameters

type: ProviderInterfaceEmitted

sub: ProviderInterfaceEmitCb

Returns

Function

Returns

void

Implementation of

ProviderInterface.on

Defined in

packages/core/src/genesis-provider.ts:87


send()

send(method, params, _isCacheable?): Promise<any>

Parameters

method: string

params: unknown[]

_isCacheable?: boolean

Returns

Promise<any>

Implementation of

ProviderInterface.send

Defined in

packages/core/src/genesis-provider.ts:147


subscribe()

subscribe(_type, _method, _params, _cb): Promise<string | number>

Parameters

_type: string

_method: string

_params: unknown[]

_cb: ProviderInterfaceCallback

Returns

Promise<string | number>

Implementation of

ProviderInterface.subscribe

Defined in

packages/core/src/genesis-provider.ts:198


unsubscribe()

unsubscribe(_type, _method, _id): Promise<boolean>

Parameters

_type: string

_method: string

_id: string | number

Returns

Promise<boolean>

Implementation of

ProviderInterface.unsubscribe

Defined in

packages/core/src/genesis-provider.ts:207