@acala-network/chopsticks-core • Docs
@acala-network/chopsticks-core / Database
Class: Database
Constructors
new Database()
new Database(
location
):Database
Parameters
• location: string
Returns
Defined in
packages/core/src/database.ts:19
Properties
blocksCount()
blocksCount: () =>
Promise
<number
>
Returns
Promise
<number
>
Defined in
packages/core/src/database.ts:26
close()
close: () =>
Promise
<void
>
Returns
Promise
<void
>
Defined in
packages/core/src/database.ts:20
deleteBlock()
deleteBlock: (
hash
) =>Promise
<void
>
Parameters
• hash: `0x${string}`
Returns
Promise
<void
>
Defined in
packages/core/src/database.ts:25
queryBlock()
queryBlock: (
hash
) =>Promise
<null
|BlockEntry
>
Parameters
• hash: `0x${string}`
Returns
Promise
<null
| BlockEntry
>
Defined in
packages/core/src/database.ts:22
queryBlockByNumber()
queryBlockByNumber: (
number
) =>Promise
<null
|BlockEntry
>
Parameters
• number: number
Returns
Promise
<null
| BlockEntry
>
Defined in
packages/core/src/database.ts:23
queryHighestBlock()
queryHighestBlock: () =>
Promise
<null
|BlockEntry
>
Returns
Promise
<null
| BlockEntry
>
Defined in
packages/core/src/database.ts:24
queryStorage()
queryStorage: (
blockHash
,key
) =>Promise
<null
|KeyValueEntry
>
Parameters
• blockHash: `0x${string}`
• key: `0x${string}`
Returns
Promise
<null
| KeyValueEntry
>
Defined in
packages/core/src/database.ts:29
saveBlock()
saveBlock: (
block
) =>Promise
<void
>
Parameters
• block: BlockEntry
Returns
Promise
<void
>
Defined in
packages/core/src/database.ts:21
saveStorage()
saveStorage: (
blockHash
,key
,value
) =>Promise
<void
>
Parameters
• blockHash: `0x${string}`
• key: `0x${string}`
• value: null
| `0x${string}`
Returns
Promise
<void
>
Defined in
packages/core/src/database.ts:27
saveStorageBatch()?
optional
saveStorageBatch: (entries
) =>Promise
<void
>
Parameters
• entries: KeyValueEntry
[]
Returns
Promise
<void
>