BrowserECDHLink(String _conn, String dsIdPrefix, PrivateKey privateKey, { NodeProvider nodeProvider, bool isRequester: true, bool isResponder: true, String token, List formats })

Source

BrowserECDHLink(this._conn, String dsIdPrefix, PrivateKey privateKey,
    {NodeProvider nodeProvider,
    bool isRequester: true,
    bool isResponder: true,
    this.token, List formats})
    : privateKey = privateKey,
      dsId = '$dsIdPrefix${privateKey.publicKey.qHash64}',
      requester = isRequester ? new Requester() : null,
      responder = (isResponder && nodeProvider != null)
          ? new Responder(nodeProvider)
          : null {
  if (!_conn.contains('://')) {
    _conn = 'http://$_conn';
  }
  if (token != null && token.length > 16) {
    // pre-generate tokenHash
    String tokenId = token.substring(0, 16);
    String hashStr = CryptoProvider.sha256(
        toUTF8('$dsId$token'));
    tokenHash = '&token=$tokenId$hashStr';
  }
  if (formats != null) {
    this.formats = formats;
  }
  if (window.location.hash.contains('dsa_json')) {
    formats = ['json'];
  }
}