@onflow/sdk-latest-block
v0.0.9
Published
Flow JS SDK -- Fetch the Latest Block from the Configured Access Node
Downloads
31
Maintainers
Keywords
Readme
sdk-latest-block
Fetch the Latest Block from the configured Access Node
import {config} from "@onflow/config"
import {latestBlock} from "@onflow/sdk-latest-block"
config()
.put("accessNode.api", "https://access-testnet.onflow.org") // point the sdk to the desired access node
var block = await latestBlock()
console.log("id", block.id) // The blocks ID
console.log("height", block.height) // The blocks Height
console.log("parent id", block.parentId) // ID of the blocks parent