unlock-js/src/unlockService.js
/**
   * Private method, which given an address will query the lock and return the version of the lock
   * @param {*} address
   */
Private method, which given an address will query the lock and return the version of the lock
@param {*} address
Private method which given an address will query the lock and return the version of the lock @param { * } address
async _getPublicLockVersionFromContract(address) {
    const contract = new ethers.Contract(
      address,
      ['function publicLockVersion() view returns (uint8)'],
      this.provider
    )
    let version = 0
    try {
      const contractVersion = await contract.publicLockVersion()
      version = parseInt(contractVersion, 10) || 0
    } catch (error) {
    }
    return version
  }
async _getPublicLockVersionFromContract ( address ) { const contract = new ethers . Contract ( address , [ 'function publicLockVersion() view returns (uint8)' ] , this . provider ) let version = 0 try { const contractVersion = await contract . publicLockVersion ( ) version = parseInt ( contractVersion , 10 ) || 0 } catch ( error ) { } return version }
Private method, which given an address will query the lock and return the version of the lock
 @param {*} address
Private method which given an address will query the lock and return the version of the lock @param { * } address
// This is an older version of Unlock which did not support publicLockVersion