You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`"This credential is based on CType kilt:ctype:0xf0fd09f9ed6233b2627d37eb5d6c528345e8945e0b610e70997ed470728b2ebf whose definition has not been passed to the validator, while automatic CType loading has been disabled."`
* Used in validating the credentialSubject of a {@link KiltCredentialV1} against the Claim Type referenced in its `type` field.
21
23
*
22
24
* @param initialCTypes An array of CTypes with which the cache is to be initialized.
23
-
* @returns A function that takes a CType id and looks up a CType definition in an internal cache, and if not found, tries to fetch it from the KILT blochchain.
25
+
* @param cTypeLoader A basic {@link CTypeLoader} to augment with a caching layer.
26
+
* Defaults to loading CType definitions from the KILT blockchain.
27
+
* @returns A function that takes a CType id and looks up a CType definition in an internal cache, and if not found, tries to fetch it from an external source.
24
28
*/
25
29
exportfunctionnewCachingCTypeLoader(
26
-
initialCTypes: ICType[]=[]
30
+
initialCTypes: ICType[]=[],
31
+
cTypeLoader=chainCTypeLoader
27
32
): CTypeLoader{
28
33
constctypes: Map<string,ICType>=newMap()
29
34
@@ -32,9 +37,69 @@ export function newCachingCTypeLoader(
0 commit comments