getRegistryError

Return a RegistryError if a result errored in one of many Substrate pallets, or undefined if not.

See dispatchErrorarrow-up-right code implementation.

import { call, getRegistryError } from 'useink/core';

const result = await call(contract, ...additionalArgs);

if (!result.ok) {
  const registryError = getRegistryError(result, { contract });
}

interface RegistryError {
    args: string[];
    docs: string[];
    index: number;
    method: string;
    name: string;
    section: string;
}

Last updated