Chain module

This is very simple module, where we get block hash of block by its number:

public protocol ChainModule: AnyObject {
    func blockHash(number: UInt) async throws -> String?
}

To get block's hash write next code:

let blockNumber: UInt
let client: SubstrateClient
let blockHash: String? = try await client.modules.chain.blockHash(number: blockNumber)

Last updated