jsonld-signatures-merkleproof2019
Version:
A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context
18 lines (13 loc) • 535 B
text/typescript
import { BLOCKCHAINS } from '@blockcerts/explorer-lookup';
import type { IBlockchainObject } from '@blockcerts/explorer-lookup';
export default function isMockChain (chain: IBlockchainObject | string): boolean {
if (chain) {
const chainCode = typeof chain === 'string' ? chain : chain.code; // TODO: can it be string?
const isChainValid = Object.keys(BLOCKCHAINS).some(chainObj => chainObj === chainCode);
if (!isChainValid) {
return false;
}
return !!BLOCKCHAINS[chainCode].test;
}
return false;
}