• Create a unique identifier for a result within a given method. This is typically used to create hashmap keys for method to result mappings.

    Parameters

    • method: MethodObject

      The OpenRPC Method which encloses the content descriptor

    • contentDescriptor: ContentDescriptorObject

      The OpenRPC Content Descriptor (either a method param or the result).

    Returns string

    an ID for the result/method combo. It follows the format {method.name}/result.

    Throws

    [[ContentDescriptorNotFoundInMethodError]]

    Example


    const { generateMethodResultId }
    const methodObject = {
    name: "foo",
    params: [],
    result: {
    name: "fooResult",
    schema: { type: "string" }
    }
    };
    const resultId = generateMethodResultId(methodObject, methodObject.result);
    console.log(paramId);
    // outputs:
    // "foo/result"