UNPKG

virto-signer

Version:

A signer for constructing a signed extrinsic using Pass-provided authenticators

13 lines (12 loc) 396 B
import { decAnyMetadata } from "@polkadot-api/substrate-bindings"; export function getTypedMetadata(metadata) { try { const tmpMeta = decAnyMetadata(metadata); if (tmpMeta.metadata.tag !== "v14" && tmpMeta.metadata.tag !== "v15") throw null; return tmpMeta.metadata.value; } catch { throw new Error("Unsupported metadata version"); } }