|
|
@ -10,7 +10,7 @@ const { DIDResolutionResult } = require('did-resolver'); |
|
|
|
* |
|
|
|
* Similar code resides in endorser-ch |
|
|
|
*/ |
|
|
|
export const didEthLocalResolver = async(did) => { |
|
|
|
const didEthLocalResolver = async(did) => { |
|
|
|
const didRegex = /^did:ethr:(0x[0-9a-fA-F]{40})$/; |
|
|
|
const match = did.match(didRegex); |
|
|
|
|
|
|
@ -43,3 +43,5 @@ export const didEthLocalResolver = async(did) => { |
|
|
|
|
|
|
|
throw new Error(`Unsupported DID format: ${did}`); |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports = { didEthLocalResolver }; |
|
|
|