@morpho-org/midnight-sdk
Version:
Viem-based package for Morpho Midnight that exports protocol utilities, fetch helpers, and Midnight API utilities under a dedicated API subpath.
10 lines (9 loc) • 445 B
JavaScript
import { InvalidTreeError } from "../errors.js";
import { Tree } from "./Tree.js";
/** @internal Parses tagged standard-ratifier inputs and rejects legacy or mismatched routes. */
export function parseStandardRatifierTree(tree, expected) {
if (tree.type !== expected) {
throw new InvalidTreeError(`Expected a "${expected}" tree. Create a tree with an explicit matching ratifier type.`);
}
return Tree.fromDescriptor(tree);
}