Skip to content

fetchMetadata

Fetch metadata from a Substrate RPC endpoint.

Usage

import { fetchMetadata } from '@phala/sdk'
 
const metadata = await fetchMetadata('wss://api.phala.network/ws')

Returns

Promise<Record<string, HexString>>

A map of 'genesis hash and runtime spec version' as key to metadata hex string. It can be seralized with JSON.stringify and cache for future used.