code: function verifyAddress(addr,networkType) {
    try {
      //验证传入的地址类型    
      assert(typeof(addr) === 'string');    
      assert(addr.length > 0);
      assert(addr.length <= 100);
      // 默认为testnet
      if(!networkType){
        networkType = "testnet";
      }
      // 使用bech32解码
      const verifiedAddr = decode(addr);    
      // 验证地址前缀
      let verifiddPrefix = false;
      for (const prefix of networks.prefix) {     
        if (prefix.type === networkType && prefix.bech32 === verifiedAddr.hrp){
          verifiddPrefix = true;
          break;
        }
      }
      if(!verifiddPrefix)
        throw new Error(`Network not found for ${verifiedAddr.hrp}.`);
    
      //验证地址构成
      let hash = verifiedAddr.hash;
      if (typeof(verifiedAddr.hash) === 'string'){
        hash = Buffer.from(verifiedAddr.hash, 'hex'); 
      }
      assert(Buffer.isBuffer(hash));
      // version === 0 && type === Address.types.WITNESS
      assert(hash.length === 20 || hash.length === 32,
        'Witness program hash is the wrong size.');       
      assert(hash.length >= 2 && hash.length <= 40, 'Hash is the wrong size.');
      
      return {
        result: true,
      }
    } catch (e) {
      return {
        result: false,
        error: {
          type: e.type || 'Error',
          message: e.message,
          code: e.code
        }
      }
    }
  }
docs: 验证持地址是否是合法的--仅验证bech32
  @param {String} addr 地址
  @param {String} networkType 地址网络类型