diff --git a/.gitmodules b/.gitmodules index 7474c8a54..66ee203f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "crypto_plugins/flutter_liblelantus"] path = crypto_plugins/flutter_liblelantus url = https://github.com/cypherstack/flutter_liblelantus.git +[submodule "fusiondart"] + path = fusiondart + url = https://github.com/cypherstack/fusiondart diff --git a/fusiondart b/fusiondart new file mode 160000 index 000000000..d7e42820f --- /dev/null +++ b/fusiondart @@ -0,0 +1 @@ +Subproject commit d7e42820f0511636c47dd91e9c4f425f5f9d5be3 diff --git a/lib/services/cashfusion/comms.dart b/lib/services/cashfusion/comms.dart deleted file mode 100644 index 98094a5ca..000000000 --- a/lib/services/cashfusion/comms.dart +++ /dev/null @@ -1,178 +0,0 @@ -import 'dart:async'; -import 'dart:io'; - -import 'package:protobuf/protobuf.dart'; -import 'package:stackwallet/services/cashfusion/connection.dart'; -import 'package:stackwallet/services/cashfusion/fusion.dart'; -import 'package:stackwallet/services/cashfusion/fusion.pb.dart'; -import 'package:stackwallet/services/cashfusion/socketwrapper.dart'; -import 'package:stackwallet/services/cashfusion/util.dart'; - -typedef PbCreateFunc = GeneratedMessage Function(); - -Map pbClassCreators = { - CovertResponse: () => CovertResponse(), - ClientMessage: () => ClientMessage(), - InputComponent: () => InputComponent(), - OutputComponent: () => OutputComponent(), - BlankComponent: () => BlankComponent(), - Component: () => Component(), - InitialCommitment: () => InitialCommitment(), - Proof: () => Proof(), - ClientHello: () => ClientHello(), - ServerHello: () => ServerHello(), - JoinPools: () => JoinPools(), - TierStatusUpdate: () => TierStatusUpdate(), - FusionBegin: () => FusionBegin(), - StartRound: () => StartRound(), - PlayerCommit: () => PlayerCommit(), - BlindSigResponses: () => BlindSigResponses(), - AllCommitments: () => AllCommitments(), - CovertComponent: () => CovertComponent(), - ShareCovertComponents: () => ShareCovertComponents(), - CovertTransactionSignature: () => CovertTransactionSignature(), - FusionResult: () => FusionResult(), - MyProofsList: () => MyProofsList(), - TheirProofsList: () => TheirProofsList(), - Blames: () => Blames(), - RestartRound: () => RestartRound(), - Error: () => Error(), - Ping: () => Ping(), - OK: () => OK(), - ServerMessage: () => ServerMessage(), - CovertMessage: () => CovertMessage(), -}; - -Future sendPb( - Connection connection, Type pbClass, GeneratedMessage subMsg, - {Duration? timeout}) async { - // Construct the outer message with the submessage. - - if (pbClassCreators[pbClass] == null) { - print('pbClassCreators[pbClass] is null'); - return; - } - - var pbMessage = pbClassCreators[pbClass]!()..mergeFromMessage(subMsg); - final msgBytes = pbMessage.writeToBuffer(); - try { - await connection.sendMessage(msgBytes, timeout: timeout); - } on SocketException { - throw FusionError('Connection closed by remote'); - } on TimeoutException { - throw FusionError('Timed out during send'); - } catch (e) { - throw FusionError('Communications error: ${e.runtimeType}: $e'); - } -} - -Future sendPb2(SocketWrapper socketwrapper, Connection connection, - Type pbClass, GeneratedMessage subMsg, - {Duration? timeout}) async { - // Construct the outer message with the submessage. - - if (pbClassCreators[pbClass] == null) { - print('pbClassCreators[pbClass] is null'); - return; - } - - var pbMessage = pbClassCreators[pbClass]!()..mergeFromMessage(subMsg); - final msgBytes = pbMessage.writeToBuffer(); - try { - await connection.sendMessageWithSocketWrapper(socketwrapper, msgBytes, - timeout: timeout); - } on SocketException { - throw FusionError('Connection closed by remote'); - } on TimeoutException { - throw FusionError('Timed out during send'); - } catch (e) { - throw FusionError('Communications error: ${e.runtimeType}: $e'); - } -} - -Future> recvPb2(SocketWrapper socketwrapper, - Connection connection, Type pbClass, List expectedFieldNames, - {Duration? timeout}) async { - try { - List blob = - await connection.recv_message2(socketwrapper, timeout: timeout); - - var pbMessage = pbClassCreators[pbClass]!()..mergeFromBuffer(blob); - - if (!pbMessage.isInitialized()) { - throw FusionError('Incomplete message received'); - } - - for (var name in expectedFieldNames) { - var fieldInfo = pbMessage.info_.byName[name]; - - if (fieldInfo == null) { - throw FusionError('Expected field not found in message: $name'); - } - - if (pbMessage.hasField(fieldInfo.tagNumber)) { - return Tuple(pbMessage, name); - } - } - - throw FusionError( - 'None of the expected fields found in the received message'); - } catch (e) { - // Handle different exceptions here - if (e is SocketException) { - throw FusionError('Connection closed by remote'); - } else if (e is InvalidProtocolBufferException) { - throw FusionError('Message decoding error: ' + e.toString()); - } else if (e is TimeoutException) { - throw FusionError('Timed out during receive'); - } else if (e is OSError && e.errorCode == 9) { - throw FusionError('Connection closed by local'); - } else { - throw FusionError( - 'Communications error: ${e.runtimeType}: ${e.toString()}'); - } - } -} - -Future> recvPb( - Connection connection, Type pbClass, List expectedFieldNames, - {Duration? timeout}) async { - try { - List blob = await connection.recv_message(timeout: timeout); - - var pbMessage = pbClassCreators[pbClass]!()..mergeFromBuffer(blob); - - if (!pbMessage.isInitialized()) { - throw FusionError('Incomplete message received'); - } - - for (var name in expectedFieldNames) { - var fieldInfo = pbMessage.info_.byName[name]; - - if (fieldInfo == null) { - throw FusionError('Expected field not found in message: $name'); - } - - if (pbMessage.hasField(fieldInfo.tagNumber)) { - return Tuple(pbMessage, name); - } - } - - throw FusionError( - 'None of the expected fields found in the received message'); - } catch (e) { - // Handle different exceptions here - if (e is SocketException) { - throw FusionError('Connection closed by remote'); - } else if (e is InvalidProtocolBufferException) { - throw FusionError('Message decoding error: ' + e.toString()); - } else if (e is TimeoutException) { - throw FusionError('Timed out during receive'); - } else if (e is OSError && e.errorCode == 9) { - throw FusionError('Connection closed by local'); - } else { - throw FusionError( - 'Communications error: ${e.runtimeType}: ${e.toString()}'); - } - } -} diff --git a/lib/services/cashfusion/connection.dart b/lib/services/cashfusion/connection.dart deleted file mode 100644 index e6b9581c0..000000000 --- a/lib/services/cashfusion/connection.dart +++ /dev/null @@ -1,290 +0,0 @@ -import 'dart:async'; -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:collection/collection.dart'; -import 'package:convert/convert.dart'; -import 'package:stackwallet/services/cashfusion/socketwrapper.dart'; - -/* -This file might need some fixing up because each time we call fillBuf, we're trying to -remove data from a buffer but its a local copy , might not actually -remove the data from the socket buffer. We may need a wrapper class for the buffer?? - - */ - -class BadFrameError extends Error { - final String message; - - BadFrameError(this.message); - - @override - String toString() => message; -} - -Future openConnection( - String host, - int port, { - double connTimeout = 5.0, - double defaultTimeout = 5.0, - bool ssl = false, - dynamic socksOpts, -}) async { - try { - // Dart's Socket class handles connection timeout internally. - Socket socket = await Socket.connect(host, port); - if (ssl) { - // We can use SecureSocket.secure to upgrade socket connection to SSL/TLS. - socket = await SecureSocket.secure(socket); - } - - return Connection( - socket: socket, timeout: Duration(seconds: defaultTimeout.toInt())); - } catch (e) { - throw 'Failed to open connection: $e'; - } -} - -class Connection { - Duration timeout = Duration(seconds: 1); - Socket? socket; - - static const int MAX_MSG_LENGTH = 200 * 1024; - static final Uint8List magic = - Uint8List.fromList([0x76, 0x5b, 0xe8, 0xb4, 0xe4, 0x39, 0x6d, 0xcf]); - final Uint8List recvbuf = Uint8List(0); - - Connection({required this.socket, this.timeout = const Duration(seconds: 1)}); - - Connection.withoutSocket({this.timeout = const Duration(seconds: 1)}); - - Future sendMessageWithSocketWrapper( - SocketWrapper socketwrapper, List msg, - {Duration? timeout}) async { - timeout ??= this.timeout; - print("DEBUG sendmessage msg sending "); - print(msg); - final lengthBytes = Uint8List(4); - final byteData = ByteData.view(lengthBytes.buffer); - byteData.setUint32(0, msg.length, Endian.big); - - final frame = [] - ..addAll(Connection.magic) - ..addAll(lengthBytes) - ..addAll(msg); - - try { - socketwrapper.send(frame); - } on SocketException catch (e) { - throw TimeoutException('Socket write timed out', timeout); - } - } - - Future sendMessage(List msg, {Duration? timeout}) async { - timeout ??= this.timeout; - - final lengthBytes = Uint8List(4); - final byteData = ByteData.view(lengthBytes.buffer); - byteData.setUint32(0, msg.length, Endian.big); - - print(Connection.magic); - final frame = [] - ..addAll(Connection.magic) - ..addAll(lengthBytes) - ..addAll(msg); - - try { - StreamController> controller = StreamController(); - - controller.stream.listen((data) { - socket?.add(data); - }); - - try { - controller.add(frame); - // Remove the socket.flush() if it doesn't help. - // await socket?.flush(); - } catch (e) { - print('Error when adding to controller: $e'); - } finally { - controller.close(); - } - } on SocketException catch (e) { - throw TimeoutException('Socket write timed out', timeout); - } - } - - void close() { - socket?.close(); - } - - Future> fillBuf2( - SocketWrapper socketwrapper, List recvBuf, int n, - {Duration? timeout}) async { - final maxTime = timeout != null ? DateTime.now().add(timeout) : null; - - await for (var data in socketwrapper.socket!.cast>()) { - print("DEBUG fillBuf2 1 - new data received: $data"); - if (maxTime != null && DateTime.now().isAfter(maxTime)) { - throw SocketException('Timeout'); - } - - if (data.isEmpty) { - if (recvBuf.isNotEmpty) { - throw SocketException('Connection ended mid-message.'); - } else { - throw SocketException('Connection ended while awaiting message.'); - } - } - - recvBuf.addAll(data); - print( - "DEBUG fillBuf2 2 - data added to recvBuf, new length: ${recvBuf.length}"); - - if (recvBuf.length >= n) { - print("DEBUG fillBuf2 3 - breaking loop, recvBuf is big enough"); - break; - } - } - - return recvBuf; - } - - Future> fillBuf(int n, {Duration? timeout}) async { - var recvBuf = []; - socket?.listen((data) { - print('Received from server: $data'); - }, onDone: () { - print('Server closed connection.'); - socket?.destroy(); - }, onError: (error) { - print('Error: $error'); - socket?.destroy(); - }); - return recvBuf; - - StreamSubscription>? subscription; // Declaration moved here - subscription = socket!.listen( - (List data) { - recvBuf.addAll(data); - if (recvBuf.length >= n) { - subscription?.cancel(); - } - }, - onError: (e) { - subscription?.cancel(); - if (e is Exception) { - throw e; - } else { - throw Exception(e ?? 'Error in `subscription` socket!.listen'); - } - }, - onDone: () { - print("DEBUG ON DONE"); - if (recvBuf.length < n) { - throw SocketException( - 'Connection closed before enough data was received'); - } - }, - ); - - if (timeout != null) { - Future.delayed(timeout, () { - if (recvBuf.length < n) { - subscription?.cancel(); - throw SocketException('Timeout'); - } - }); - } - - return recvBuf; - } - - Future> recv_message2(SocketWrapper socketwrapper, - {Duration? timeout}) async { - print("START OF RECV2"); - if (timeout == null) { - timeout = this.timeout; - } - - final maxTime = timeout != null ? DateTime.now().add(timeout) : null; - - List recvBuf = []; - int bytesRead = 0; - - print("DEBUG recv_message2 1 - about to read the header"); - - try { - await for (var data in socketwrapper.receiveStream) { - if (maxTime != null && DateTime.now().isAfter(maxTime)) { - throw SocketException('Timeout'); - } - - if (data.isEmpty) { - if (recvBuf.isNotEmpty) { - throw SocketException('Connection ended mid-message.'); - } else { - throw SocketException('Connection ended while awaiting message.'); - } - } - - recvBuf.addAll(data); - - if (bytesRead < 12) { - bytesRead += data.length; - } - - if (recvBuf.length >= 12) { - final magic = recvBuf.sublist(0, 8); - - if (!ListEquality().equals(magic, Connection.magic)) { - throw BadFrameError('Bad magic in frame: ${hex.encode(magic)}'); - } - - final byteData = - ByteData.view(Uint8List.fromList(recvBuf.sublist(8, 12)).buffer); - final messageLength = byteData.getUint32(0, Endian.big); - - if (messageLength > MAX_MSG_LENGTH) { - throw BadFrameError( - 'Got a frame with msg_length=$messageLength > $MAX_MSG_LENGTH (max)'); - } - - /* - print("DEBUG recv_message2 3 - about to read the message body, messageLength: $messageLength"); - - print("DEBUG recvfbuf len is "); - print(recvBuf.length); - print("bytes read is "); - print(bytesRead); - print("message length is "); - print(messageLength); - - */ - if (recvBuf.length == bytesRead && bytesRead == 12 + messageLength) { - final message = recvBuf.sublist(12, 12 + messageLength); - - //print("DEBUG recv_message2 4 - message received, length: ${message.length}"); - //print("DEBUG recv_message2 5 - message content: $message"); - print("END OF RECV2"); - return message; - } else { - // Throwing exception if the length doesn't match - throw Exception( - 'Message length mismatch: expected ${12 + messageLength} bytes, received ${recvBuf.length} bytes.'); - } - } - } - } on SocketException catch (e) { - print('Socket exception: $e'); - } - - // This is a default return in case of exceptions. - return []; - } - - Future> recv_message({Duration? timeout}) async { - // DEPRECATED - return []; - } -} // END OF CLASS diff --git a/lib/services/cashfusion/covert.dart b/lib/services/cashfusion/covert.dart deleted file mode 100644 index 62e5ed5a1..000000000 --- a/lib/services/cashfusion/covert.dart +++ /dev/null @@ -1,484 +0,0 @@ -import 'dart:async'; -import 'dart:collection'; -import 'dart:convert'; -import 'dart:io'; -import 'dart:math'; - -import 'package:protobuf/protobuf.dart' as pb; - -import 'comms.dart'; -import 'connection.dart'; -import 'fusion.pb.dart'; - -const int TOR_COOLDOWN_TIME = 660; -const int TIMEOUT_INACTIVE_CONNECTION = 120; - -class FusionError implements Exception { - String cause; - FusionError(this.cause); -} - -class Unrecoverable extends FusionError { - Unrecoverable(String cause) : super(cause); -} - -Future isTorPort(String host, int port) async { - if (port < 0 || port > 65535) { - return false; - } - - try { - Socket sock = - await Socket.connect(host, port, timeout: Duration(milliseconds: 100)); - sock.write("GET\n"); - List data = await sock.first; - sock.destroy(); - if (utf8.decode(data).contains("Tor is not an HTTP Proxy")) { - return true; - } - } on SocketException { - return false; - } - - return false; -} - -class TorLimiter { - Queue deque = Queue(); - int lifetime; - // Declare a lock here, may need a special Dart package for this - int _count = 0; - - TorLimiter(this.lifetime); - - void cleanup() {} - - int get count { - // return some default value for now - return 0; - } - - void bump() {} -} - -TorLimiter limiter = TorLimiter(TOR_COOLDOWN_TIME); - -double randTrap(Random rng) { - final sixth = 1.0 / 6; - final f = rng.nextDouble(); - final fc = 1.0 - f; - - if (f < sixth) { - return sqrt(0.375 * f); - } else if (fc < sixth) { - return 1.0 - sqrt(0.375 * fc); - } else { - return 0.75 * f + 0.125; - } -} - -class CovertConnection { - Connection? connection; // replace dynamic with the type of your connection - int? slotNum; - DateTime? tPing; - int? connNumber; - Completer wakeup = Completer(); - double? delay; - - Future waitWakeupOrTime(DateTime? t) async { - if (t == null) { - return false; - } - - var remTime = t.difference(DateTime.now()).inMilliseconds; - remTime = remTime > 0 ? remTime : 0; - - await Future.delayed(Duration(milliseconds: remTime)); - wakeup.complete(true); - - var wasSet = await wakeup.future; - wakeup = Completer(); - return wasSet; - } - - void ping() { - if (this.connection != null) { - sendPb(this.connection!, CovertMessage, Ping(), - timeout: Duration(seconds: 1)); - } - - this.tPing = null; - } - - void inactive() { - throw Unrecoverable("Timed out from inactivity (this is a bug!)"); - } -} - -class CovertSlot { - int submitTimeout; - pb.GeneratedMessage? subMsg; // The work to be done. - bool done; // Whether last work requested is done. - CovertConnection? - covConn; // which CovertConnection is assigned to work on this slot - CovertSlot(this.submitTimeout) : done = true; - DateTime? t_submit; - - // Define a getter for tSubmit - DateTime? get tSubmit => t_submit; - - Future submit() async { - var connection = covConn?.connection; - - if (connection == null) { - throw Unrecoverable('connection is null'); - } - - await sendPb(connection, CovertMessage, subMsg!, - timeout: Duration(seconds: submitTimeout)); - var result = await recvPb(connection, CovertResponse, ['ok', 'error'], - timeout: Duration(seconds: submitTimeout)); - - if (result.item1 == 'error') { - throw Unrecoverable('error from server: ${result.item2}'); - } - done = true; - t_submit = DateTime.fromMillisecondsSinceEpoch(0); - covConn?.tPing = DateTime.fromMillisecondsSinceEpoch( - 0); // if a submission is done, no ping is needed. - } -} - -class PrintError { - // Declare properties here -} - -class CovertSubmitter extends PrintError { - // Declare properties here - List slots; - bool done = true; - String failure_exception = ""; - int num_slots; - - bool stopping = false; - Map? proxyOpts; - String? randtag; - String? destAddr; - int? destPort; - bool ssl = false; - Object lock = Object(); - int countFailed = 0; - int countEstablished = 0; - int countAttempted = 0; - Random rng = Random.secure(); - int? randSpan; - DateTime? stopTStart; - List spareConnections = []; - String? failureException; - int submit_timeout = 0; - - CovertSubmitter( - String dest_addr, - int dest_port, - bool ssl, - String tor_host, - int tor_port, - this.num_slots, - double randSpan, // changed from int to double - double submit_timeout) // changed from int to double - : slots = List.generate( - num_slots, (index) => CovertSlot(submit_timeout.toInt())) { - // constructor body... - } - - void wakeAll() { - for (var s in slots) { - if (s.covConn != null) { - s.covConn!.wakeup.complete(); - } - } - for (var c in spareConnections) { - c.wakeup.complete(); - } - } - - void setStopTime(int tstart) { - this.stopTStart = DateTime.fromMillisecondsSinceEpoch(tstart * 1000); - if (this.stopping) { - this.wakeAll(); - } - } - - void stop([Exception? exception]) { - if (this.stopping) { - // already requested! - return; - } - this.failureException = exception?.toString(); - this.stopping = true; - var timeRemaining = - this.stopTStart?.difference(DateTime.now()).inSeconds ?? 0; - print( - "Stopping; connections will close in approximately $timeRemaining seconds"); - this.wakeAll(); - } - -// PYTHON USES MULTITHREADING, WHICH ISNT IMPLEMENTED HERE YET - void scheduleConnections(DateTime tStart, Duration tSpan, - {int numSpares = 0, int connectTimeout = 10}) { - var newConns = []; - - for (var sNum = 0; sNum < this.slots.length; sNum++) { - var s = this.slots[sNum]; - if (s.covConn == null) { - s.covConn = CovertConnection(); - s.covConn?.slotNum = sNum; - CovertConnection? myCovConn = s.covConn; - if (myCovConn != null) { - newConns.add(myCovConn); - } - } - } - - var numNewSpares = max(0, numSpares - this.spareConnections.length); - var newSpares = List.generate(numNewSpares, (index) => CovertConnection()); - this.spareConnections = [...newSpares, ...this.spareConnections]; - - newConns.addAll(newSpares); - - for (var covConn in newConns) { - covConn.connNumber = this.countAttempted; - this.countAttempted++; - var connTime = tStart.add( - Duration(seconds: (tSpan.inSeconds * randTrap(this.rng)).round())); - var randDelay = (this.randSpan ?? 0) * randTrap(this.rng); - - runConnection( - covConn, connTime.millisecondsSinceEpoch, randDelay, connectTimeout); - } - } - - void scheduleSubmit( - int slotNum, DateTime tStart, pb.GeneratedMessage subMsg) { - var slot = slots[slotNum]; - - assert(slot.done, "tried to set new work when prior work not done"); - - slot.subMsg = subMsg; - slot.done = false; - slot.t_submit = tStart; - var covConn = slot.covConn; - if (covConn != null) { - covConn.wakeup.complete(); - } - } - - void scheduleSubmissions(DateTime tStart, List slotMessages) { - // Convert to list (Dart does not have tuples) - slotMessages = List.from(slotMessages); - - // Ensure that the number of slot messages equals the number of slots - assert(slotMessages.length == slots.length); - - // First, notify the spare connections that they will need to make a ping. - // Note that Dart does not require making a copy of the list before iteration, - // since Dart does not support mutation during iteration. - for (var c in spareConnections) { - c.tPing = tStart; - c.wakeup.complete(); - } - - // Then, notify the slots that there is a message to submit. - for (var i = 0; i < slots.length; i++) { - var slot = slots[i]; - var subMsg = slotMessages[i] as pb.GeneratedMessage; - var covConn = slot.covConn; - - if (covConn != null) { - if (subMsg == null) { - covConn.tPing = tStart; - } else { - slot.subMsg = subMsg; - slot.done = false; - slot.t_submit = tStart; - } - covConn.wakeup.complete(); - } - } - } - - Future runConnection(CovertConnection covConn, int connTime, double randDelay, - int connectTimeout) async { - // Main loop for connection thread - DateTime connDateTime = - DateTime.fromMillisecondsSinceEpoch(connTime * 1000); - while (await covConn.waitWakeupOrTime(connDateTime)) { - // if we are woken up before connection and stopping is happening, then just don't make a connection at all - if (this.stopping) { - return; - } - - final tBegin = DateTime.now().millisecondsSinceEpoch; - - try { - // STATE 1 - connecting - Map proxyOpts; - - if (this.proxyOpts == null) { - proxyOpts = {}; - } else { - final unique = 'CF${this.randtag}_${covConn.connNumber}'; - proxyOpts = { - 'proxy_username': unique, - 'proxy_password': unique, - }; - proxyOpts.addAll(this.proxyOpts!); - } - - limiter.bump(); - - try { - final connection = await openConnection( - this.destAddr!, this.destPort!, - connTimeout: connectTimeout.toDouble(), - ssl: this.ssl, - socksOpts: proxyOpts); - covConn.connection = connection; - } catch (e) { - this.countFailed++; - - final tEnd = DateTime.now().millisecondsSinceEpoch; - - print( - 'could not establish connection (after ${((tEnd - tBegin) / 1000).toStringAsFixed(3)}s): $e'); - rethrow; - } - - this.countEstablished++; - - final tEnd = DateTime.now().millisecondsSinceEpoch; - - print( - '[${covConn.connNumber}] connection established after ${((tEnd - tBegin) / 1000).toStringAsFixed(3)}s'); - - covConn.delay = (randTrap(this.rng) ?? 0) * (this.randSpan ?? 0); - - var lastActionTime = DateTime.now().millisecondsSinceEpoch; - - // STATE 2 - working - while (!this.stopping) { - DateTime? nextTime; - final slotNum = covConn.slotNum; - Function()? action; // callback to hold the action function - - // Second preference: submit something - if (slotNum != null) { - CovertSlot slot = this.slots[slotNum]; - nextTime = slot.tSubmit; - action = slot.submit; - } - // Third preference: send a ping - if (nextTime == null && covConn.tPing != null) { - nextTime = covConn.tPing; - action = covConn.ping; - } - // Last preference: wait doing nothing - if (nextTime == null) { - nextTime = DateTime.now() - .add(Duration(seconds: TIMEOUT_INACTIVE_CONNECTION)); - action = covConn.inactive; - } - - nextTime = nextTime.add(Duration(seconds: randDelay.toInt())); - - if (await covConn.waitWakeupOrTime(nextTime)) { - // got woken up ... let's go back and reevaluate what to do - continue; - } - - // reached action time, time to do it - final label = "[${covConn.connNumber}-$slotNum]"; - try { - await action?.call(); - } catch (e) { - print("$label error $e"); - rethrow; - } finally { - print("$label done"); - } - - lastActionTime = DateTime.now().millisecondsSinceEpoch; - } - - // STATE 3 - stopping - while (true) { - final stopTime = - this.stopTStart?.add(Duration(seconds: randDelay.toInt())) ?? - DateTime.now(); - - if (!(await covConn.waitWakeupOrTime(stopTime))) { - break; - } - } - - print("[${covConn.connNumber}] closing from stop"); - } catch (e) { - // in case of any problem, record the exception and if we have a slot, reassign it. - final exception = e; - - final slotNum = covConn.slotNum; - if (slotNum != null) { - try { - final spare = this.spareConnections.removeLast(); - // Found a spare. - this.slots[slotNum].covConn = spare; - spare.slotNum = slotNum; - spare.wakeup - .complete(); // python code is using set, possibly dealing wiht multi thread...double check this is ok. - - covConn.slotNum = null; - } catch (e) { - // We failed, and there are no spares. Party is over! - - if (exception is Exception) { - this.stop(exception); - } else { - // Handle the case where the exception is not an instance of Exception - } - } - } - } finally { - covConn.connection?.close(); - } - } - } - - void checkOk() { - // Implement checkOk logic here - var e = this.failure_exception; - if (e != null) { - throw FusionError('Covert connections failed: ${e.runtimeType} $e'); - } - } - - void checkConnected() { - // Implement checkConnected logic here - this.checkOk(); - var numMissing = - this.slots.where((s) => s.covConn?.connection == null).length; - if (numMissing > 0) { - throw FusionError( - "Covert connections were too slow ($numMissing incomplete out of ${this.slots.length})."); - } - } - - void checkDone() { - // Implement checkDone logic here - this.checkOk(); - var numMissing = this.slots.where((s) => !s.done).length; - if (numMissing > 0) { - throw FusionError( - "Covert submissions were too slow ($numMissing incomplete out of ${this.slots.length})."); - } - } -} diff --git a/lib/services/cashfusion/encrypt.dart b/lib/services/cashfusion/encrypt.dart deleted file mode 100644 index f6ffafe3e..000000000 --- a/lib/services/cashfusion/encrypt.dart +++ /dev/null @@ -1,136 +0,0 @@ -import 'dart:typed_data'; - -import 'package:crypto/crypto.dart' as crypto; -import 'package:cryptography/cryptography.dart'; -import 'package:pointycastle/pointycastle.dart' hide Mac; - -import 'util.dart'; - -final ECDomainParameters params = ECDomainParameters('secp256k1'); -final BigInt order = params.n; - -class EncryptionFailed implements Exception {} - -class DecryptionFailed implements Exception {} - -Future encrypt(Uint8List message, ECPoint pubkey, - {int? padToLength}) async { - ECPoint pubpoint; - try { - pubpoint = Util.ser_to_point(pubkey.getEncoded(true), params); - } catch (_) { - throw EncryptionFailed(); - } - var nonceSec = Util.secureRandomBigInt(params.n.bitLength); - var G_times_nonceSec = params.G * nonceSec; - if (G_times_nonceSec == null) { - throw Exception('Multiplication of G with nonceSec resulted in null'); - } - var noncePub = Util.point_to_ser(G_times_nonceSec, true); - - var pubpoint_times_nonceSec = pubpoint * nonceSec; - if (pubpoint_times_nonceSec == null) { - throw Exception( - 'Multiplication of pubpoint with nonceSec resulted in null'); - } - var key = crypto.sha256 - .convert(Util.point_to_ser(pubpoint_times_nonceSec, true)) - .bytes; - - var plaintext = Uint8List(4 + message.length) - ..buffer.asByteData().setUint32(0, message.length, Endian.big) - ..setRange(4, 4 + message.length, message); - if (padToLength == null) { - padToLength = - ((plaintext.length + 15) ~/ 16) * 16; // round up to nearest 16 - } else if (padToLength % 16 != 0) { - throw ArgumentError('$padToLength not multiple of 16'); - } - if (padToLength < plaintext.length) { - throw ArgumentError('$padToLength < ${plaintext.length}'); - } - plaintext = Uint8List(padToLength) - ..setRange(0, message.length + 4, plaintext); - - final secretKey = SecretKey(key); - - final macAlgorithm = Hmac(Sha256()); - - final cipher = AesCbc.with128bits(macAlgorithm: macAlgorithm); - - final nonce = Uint8List(16); // Random nonce - final secretBox = - await cipher.encrypt(plaintext, secretKey: secretKey, nonce: nonce); - - final ciphertext = secretBox.cipherText; - - return Uint8List( - noncePub.length + ciphertext.length + secretBox.mac.bytes.length) - ..setRange(0, noncePub.length, noncePub) - ..setRange(noncePub.length, noncePub.length + ciphertext.length, ciphertext) - ..setRange( - noncePub.length + ciphertext.length, - noncePub.length + ciphertext.length + secretBox.mac.bytes.length, - secretBox.mac.bytes); -} - -Future decryptWithSymmkey(Uint8List data, Uint8List key) async { - if (data.length < 33 + 16 + 16) { - throw DecryptionFailed(); - } - var ciphertext = data.sublist(33, data.length - 16); - if (ciphertext.length % 16 != 0) { - throw DecryptionFailed(); - } - - final secretKey = SecretKey(key); - final cipher = AesCbc.with128bits(macAlgorithm: Hmac.sha256()); - final nonce = Uint8List(16); // Random nonce - - final secretBox = SecretBox(ciphertext, - mac: Mac(data.sublist(data.length - 16)), nonce: nonce); - final plaintext = await cipher.decrypt(secretBox, secretKey: secretKey); - - if (plaintext.length < 4) { - throw DecryptionFailed(); - } - - Uint8List uint8list = Uint8List.fromList(plaintext); - ByteData byteData = ByteData.sublistView(uint8list); - var msgLength = byteData.getUint32(0, Endian.big); - - if (msgLength + 4 > plaintext.length) { - throw DecryptionFailed(); - } - return Uint8List.fromList(plaintext.sublist(4, 4 + msgLength)); -} - -Future> decrypt( - Uint8List data, ECPrivateKey privkey) async { - if (data.length < 33 + 16 + 16) { - throw DecryptionFailed(); - } - var noncePub = data.sublist(0, 33); - ECPoint noncePoint; - try { - noncePoint = Util.ser_to_point(noncePub, params); - } catch (_) { - throw DecryptionFailed(); - } - - // DOUBLE CHECK THIS IS RIGHT IDEA MATCHING PYTHON. - - ECPoint G = params.G; - final List key; - - if (privkey.d != null) { - var point = (G * privkey.d)! + noncePoint; - key = crypto.sha256.convert(Util.point_to_ser(point!, true)).bytes; - // ... - var decryptedData = await decryptWithSymmkey(data, Uint8List.fromList(key)); - return Tuple(decryptedData, Uint8List.fromList(key)); - } else { - // Handle the situation where privkey.d or noncePoint is null - throw Exception("FIXME"); - } -} diff --git a/lib/services/cashfusion/fusion.dart b/lib/services/cashfusion/fusion.dart deleted file mode 100644 index 1ce397a71..000000000 --- a/lib/services/cashfusion/fusion.dart +++ /dev/null @@ -1,1574 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:math'; -import 'dart:typed_data'; - -import 'package:collection/collection.dart'; -import 'package:crypto/crypto.dart'; -import 'package:fixnum/fixnum.dart'; -import "package:pointycastle/export.dart"; -import 'package:protobuf/protobuf.dart'; -import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart'; - -import 'comms.dart'; -import 'connection.dart'; -import 'covert.dart'; -import 'encrypt.dart'; -import 'fusion.pb.dart'; -import 'pedersen.dart'; -import 'protocol.dart'; -import 'socketwrapper.dart'; -import 'util.dart'; -import 'validation.dart'; - -class FusionError implements Exception { - final String message; - - FusionError(this.message); - - String toString() => "FusionError: $message"; -} - -class ComponentResult { - final Uint8List commitment; - final int counter; - final Uint8List component; - final Proof proof; - final Uint8List privateKey; - final dynamic pedersenAmount; // replace dynamic with actual type - final dynamic pedersenNonce; // replace dynamic with actual type - - ComponentResult(this.commitment, this.counter, this.component, this.proof, - this.privateKey, - {this.pedersenAmount, this.pedersenNonce}); -} - -class Transaction { - List Inputs = []; - List Outputs = []; - - Transaction(); - - static Tuple txFromComponents( - List allComponents, List sessionHash) { - Transaction tx = Transaction(); // Initialize a new Transaction - // This should be based on wallet layer... implement the logic of constructing the transaction from components - // For now, it just initializes Inputs and Outputs as empty lists - tx.Inputs = []; - tx.Outputs = []; - - // For now, just returning an empty list for inputIndices - List inputIndices = []; - - return Tuple(tx, inputIndices); - } - - List serializePreimage(int index, int hashType, {bool useCache = true}) { - // Add implementation here - // For now, returning an empty byte array - return []; - } - - String serialize() { - // To implement... - return ""; - } - - bool isComplete() { - // implement based on wallet. - return true; - } - - String txid() { - // To implement... - return ""; - } -} - -class Input { - List prevTxid; - int prevIndex; - List pubKey; - int amount; - List signatures = []; - - Input( - {required this.prevTxid, - required this.prevIndex, - required this.pubKey, - required this.amount}); - - int sizeOfInput() { - assert(1 < pubKey.length && - pubKey.length < 76); // need to assume regular push opcode - return 108 + pubKey.length; - } - - int get value { - return amount; - } - - String getPubKey(int pubkey_index) { - // TO BE IMPLEMENTED... - return ""; - } - - String getPrivKey(int pubkey_index) { - // TO BE IMPLEMENTED... - return ""; - } - - static Input fromInputComponent(InputComponent inputComponent) { - return Input( - prevTxid: inputComponent.prevTxid, // Make sure the types are matching - prevIndex: inputComponent.prevIndex.toInt(), - pubKey: inputComponent.pubkey, - amount: inputComponent.amount.toInt(), - ); - } - - static Input fromStackUTXO(UTXO utxo) { - return Input( - prevTxid: utf8.encode(utxo.txid), // Convert txid to a List - prevIndex: utxo.vout, - pubKey: utf8.encode('0000'), // Placeholder - amount: utxo.value, - ); - } -} - -class Output { - int value; - Address addr; - - int amount = 0; - - Output({required this.value, required this.addr}); - - int sizeOfOutput() { - List scriptpubkey = addr - .toScript(); // assuming addr.toScript() returns List that represents the scriptpubkey - assert(scriptpubkey.length < 253); - return 9 + scriptpubkey.length; - } - - static Output fromOutputComponent(OutputComponent outputComponent) { - Address address = Address.fromScriptPubKey(outputComponent.scriptpubkey); - return Output( - value: outputComponent.amount.toInt(), - addr: address, - ); - } -} - -// Class to handle fusion -class Fusion { - List coins = - []; //"coins" and "inputs" are often synonmous in the original python code. - List outputs = []; - bool server_connected_and_greeted = false; - bool stopping = false; - bool stopping_if_not_running = false; - String stopReason = ""; - String tor_host = ""; - bool server_ssl = false; - String server_host = "cashfusion.stackwallet.com"; - int server_port = 8787; - - //String server_host = "fusion.servo.cash"; - //int server_port = 8789; - - int tor_port = 0; - int roundcount = 0; - String txid = ""; - - Tuple status = Tuple("", ""); - Connection? connection; - - int numComponents = 0; - double componentFeeRate = 0; - double minExcessFee = 0; - double maxExcessFee = 0; - List availableTiers = []; - - int maxOutputs = 0; - int safety_sum_in = 0; - Map safety_exess_fees = {}; - Map> tierOutputs = - {}; // not sure if this should be using outputs class. - - int inactiveTimeLimit = 0; - int tier = 0; - int covertPort = 0; - bool covertSSL = false; - double beginTime = 0.0; // represent time in seconds. - List lastHash = []; - List
reservedAddresses =
[]; - int safetyExcessFee = 0; - DateTime t_fusionBegin = DateTime.now(); - Uint8List covertDomainB = Uint8List(0); - - var txInputIndices; - Transaction tx = Transaction(); - List myComponentIndexes = []; - List myCommitmentIndexes = []; - Set badComponents = {}; - - Fusion() { - //initializeConnection(host, port) - } - - /* - Future initializeConnection(String host, int port) async { - Socket socket = await Socket.connect(host, port); - connection = Connection()..socket = socket; - } -*/ - - Future add_coins_from_wallet(List utxoList) async { - // Convert each UTXO to an Input and add to 'coins' - for (UTXO utxo in utxoList) { - coins.add(Input.fromStackUTXO(utxo)); - } - } - - Future fusion_run() async { - print("DEBUG FUSION 223...fusion run...."); - try { - try { - // Check compatibility - This was done in python version to see if fast libsec installed. - // For now , in dart, just pass this test. - ; - } on Exception catch (e) { - // handle exception, rethrow as a custom FusionError - throw FusionError("Incompatible: " + e.toString()); - } - - // Check if can connect to Tor proxy, if not, raise FusionError. Empty String treated as no host. - if (tor_host.isNotEmpty && - tor_port != 0 && - !await isTorPort(tor_host, tor_port)) { - throw FusionError("Can't connect to Tor proxy at $tor_host:$tor_port"); - } - - try { - // Check stop condition - check_stop(running: false); - } catch (e) { - print(e); - } - - try { - // Check coins - check_coins(); - } catch (e) { - print(e); - } - - // Connect to server - status = Tuple("connecting", ""); - try { - connection = await openConnection(server_host, server_port, - connTimeout: 5.0, defaultTimeout: 5.0, ssl: server_ssl); - } catch (e) { - print("Connect failed: $e"); - String sslstr = server_ssl ? ' SSL ' : ''; - throw FusionError( - 'Could not connect to $sslstr$server_host:$server_port'); - } - - // Once connection is successful, wrap operations inside this block - // Within this block, version checks, downloads server params, handles coins and runs rounds - try { - SocketWrapper socketwrapper = SocketWrapper(server_host, server_port); - await socketwrapper.connect(); - - // Version check and download server params. - await greet(socketwrapper); - - socketwrapper.status(); - server_connected_and_greeted = true; - notify_server_status(true); - - // In principle we can hook a pause in here -- user can insert coins after seeing server params. - - try { - if (coins.isEmpty) { - throw FusionError('Started with no coins'); - return; - } - } catch (e) { - print(e); - return; - } - - await allocateOutputs(socketwrapper); - // In principle we can hook a pause in here -- user can tweak tier_outputs, perhaps cancelling some unwanted tiers. - - // Register for tiers, wait for a pool. - await registerAndWait(socketwrapper); - - print("FUSION DEBUG 273"); - print("RETURNING early in fusion_run...."); - return; - - // launch the covert submitter - CovertSubmitter covert = await start_covert(); - try { - // Pool started. Keep running rounds until fail or complete. - while (true) { - roundcount += 1; - if (await run_round(covert)) { - break; - } - } - } finally { - covert.stop(); - } - } finally { - (await connection)?.close(); - } - - for (int i = 0; i < 60; i++) { - if (stopping) { - break; // not an error - } - - if (Util.walletHasTransaction(txid)) { - break; - } - - await Future.delayed(Duration(seconds: 1)); - } - - // Set status to 'complete' with 'time_wait' - status = Tuple('complete', 'txid: $txid'); - - // Wait for transaction to show up in wallets - // Set status to 'complete' with txid - } on FusionError catch (err) { - print('Failed: ${err}'); - status.item1 = "failed"; - status.item2 = err.toString(); // setting the error message - } catch (exc) { - print('Exception: ${exc}'); - status.item1 = "failed"; - status.item2 = - "Exception: ${exc.toString()}"; // setting the exception message - } finally { - clear_coins(); - if (status.item1 != 'complete') { - for (var output in outputs) { - Util.unreserve_change_address(output.addr); - } - if (!server_connected_and_greeted) { - notify_server_status(false, tup: status); - } - } - } - } // end fusion_run function. - - Future start_covert() async { - // Function implementation here... - - // For now, just return a new instance of CovertSubmitter - return CovertSubmitter("dummy", 0, true, "some_host", 0, 0, 0, 0); - } - - Future run_round(CovertSubmitter covert) async { - // function implementation here... - - // placeholder return statement - return Future.value(false); - } - - void notify_server_status(bool b, {Tuple? tup}) { - // Function implementation goes here - } - - void stop([String reason = 'stopped', bool notIfRunning = false]) { - if (stopping) { - return; - } - if (notIfRunning) { - if (stopping_if_not_running) { - return; - } - stopReason = reason; - stopping_if_not_running = true; - } else { - stopReason = reason; - stopping = true; - } - // note the reason is only overwritten if we were not already stopping this way. - } - - void check_stop({bool running = true}) { - // Gets called occasionally from fusion thread to allow a stop point. - if (stopping || (!running && stopping_if_not_running)) { - throw FusionError(stopReason ?? 'Unknown stop reason'); - } - } - - void check_coins() { - // Implement by calling wallet layer to check the coins are ok. - return; - } - - static void foo() { - print("hello"); - } - - void clear_coins() { - coins = []; - } - - void addCoins(List newCoins) { - coins.addAll(newCoins); - } - - void notify_coins_UI() { - return; - } - - static bool walletCanFuse() { - return true; - - // Implement logic here to return false if the wallet can't fuse. (If its read only or non P2PKH) - } - - static double nextDoubleNonZero(Random rng) { - double value = 0.0; - while (value == 0.0) { - value = rng.nextDouble(); - } - return value; - } - - static List? randomOutputsForTier( - Random rng, int inputAmount, int scale, int offset, int maxCount) { - if (inputAmount < offset) { - return []; - } - double lambd = 1.0 / scale; - int remaining = inputAmount; - List values = []; // list of fractional random values without offset - bool didBreak = - false; // Add this flag to detect when a break is encountered - - for (int i = 0; i < maxCount + 1; i++) { - double val = -lambd * log(nextDoubleNonZero(rng)); - remaining -= (val.ceil() + offset); - if (remaining < 0) { - didBreak = true; // If you break, set this flag to true - break; - } - values.add(val); - } - - if (!didBreak && values.length > maxCount) { - values = values.sublist(0, maxCount); - } - - if (values.isEmpty) { - // Our first try put us over the limit, so we have nothing to work with. - // (most likely, scale was too large) - return []; - } - - int desiredRandomSum = inputAmount - values.length * offset; - assert(desiredRandomSum >= 0, 'desiredRandomSum is less than 0'); - - /*Now we need to rescale and round the values so they fill up the desired. - input amount exactly. We perform rounding in cumulative space so that the - sum is exact, and the rounding is distributed fairly. - */ - - // Dart equivalent of itertools.accumulate - List cumsum = []; - double sum = 0; - for (double value in values) { - sum += value; - cumsum.add(sum); - } - - double rescale = desiredRandomSum / cumsum[cumsum.length - 1]; - List normedCumsum = cumsum.map((v) => (rescale * v).round()).toList(); - assert(normedCumsum[normedCumsum.length - 1] == desiredRandomSum, - 'Last element of normedCumsum is not equal to desiredRandomSum'); - List differences = []; - differences.add(normedCumsum[0]); // First element - for (int i = 1; i < normedCumsum.length; i++) { - differences.add(normedCumsum[i] - normedCumsum[i - 1]); - } - - List result = differences.map((d) => offset + d).toList(); - assert(result.reduce((a, b) => a + b) == inputAmount, - 'Sum of result is not equal to inputAmount'); - return result; - } - - static List genComponents( - int numBlanks, List inputs, List outputs, int feerate) { - assert(numBlanks >= 0); - - List> components = []; - - // Set up Pedersen setup instance - Uint8List HBytes = Uint8List.fromList( - [0x02] + 'CashFusion gives us fungibility.'.codeUnits); - ECDomainParameters params = ECDomainParameters('secp256k1'); - ECPoint? HMaybe = params.curve.decodePoint(HBytes); - if (HMaybe == null) { - throw Exception('Failed to decode point'); - } - ECPoint H = HMaybe; - PedersenSetup setup = PedersenSetup(H); - - for (Input input in inputs) { - int fee = Util.componentFee(input.sizeOfInput(), feerate); - - var comp = Component(); - comp.input = InputComponent( - prevTxid: Uint8List.fromList(input.prevTxid.reversed.toList()), - prevIndex: input.prevIndex, - pubkey: input.pubKey, - amount: Int64(input.amount)); - components.add(Tuple(comp, input.amount - fee)); - } - - for (Output output in outputs) { - var script = output.addr.toScript(); - int fee = Util.componentFee(output.sizeOfOutput(), feerate); - - var comp = Component(); - comp.output = - OutputComponent(scriptpubkey: script, amount: Int64(output.value)); - components.add(Tuple(comp, -output.value - fee)); - } - - for (int i = 0; i < numBlanks; i++) { - var comp = Component(); - comp.blank = BlankComponent(); - components.add(Tuple(comp, 0)); - } - - List resultList = []; - - components.asMap().forEach((cnum, Tuple componentTuple) { - Uint8List salt = Util.tokenBytes(32); - componentTuple.item1.saltCommitment = Util.sha256(salt); - var compser = componentTuple.item1.writeToBuffer(); - - Tuple keyPair = Util.genKeypair(); - Uint8List privateKey = keyPair.item1; - Uint8List pubKey = keyPair.item2; - - Commitment commitmentInstance = - setup.commit(BigInt.from(componentTuple.item2)); - Uint8List amountCommitment = commitmentInstance.PUncompressed; - -// Convert BigInt nonce to Uint8List - Uint8List pedersenNonce = Uint8List.fromList( - [int.parse(commitmentInstance.nonce.toRadixString(16), radix: 16)]); - -// Generating initial commitment - InitialCommitment commitment = InitialCommitment( - saltedComponentHash: - Util.sha256(Uint8List.fromList([...compser, ...salt])), - amountCommitment: amountCommitment, - communicationKey: pubKey); - - Uint8List commitser = commitment.writeToBuffer(); - - // Generating proof - Proof proof = - Proof(componentIdx: cnum, salt: salt, pedersenNonce: pedersenNonce); - - // Adding result to list - resultList - .add(ComponentResult(commitser, cnum, compser, proof, privateKey)); - }); - - return resultList; - } - - Future recv2( - SocketWrapper socketwrapper, List expectedMsgNames, - {Duration? timeout}) async { - if (connection == null) { - throw FusionError('Connection not initialized'); - } - - var result = await recvPb2( - socketwrapper, connection!, ServerMessage, expectedMsgNames, - timeout: timeout); - - var submsg = result.item1; - var mtype = result.item2; - - if (mtype == 'error') { - throw FusionError('server error: ${submsg.toString()}'); - } - - return submsg; - } - - Future recv(List expectedMsgNames, - {Duration? timeout}) async { - // DEPRECATED - if (connection == null) { - throw FusionError('Connection not initialized'); - } - - var result = await recvPb(connection!, ServerMessage, expectedMsgNames, - timeout: timeout); - - var submsg = result.item1; - var mtype = result.item2; - - if (mtype == 'error') { - throw FusionError('server error: ${submsg.toString()}'); - } - - return submsg; - } - - Future send(GeneratedMessage submsg, {Duration? timeout}) async { - // DEPRECATED - if (connection != null) { - await sendPb(connection!, ClientMessage, submsg, timeout: timeout); - } else { - print('Connection is null'); - } - } - - Future send2(SocketWrapper socketwrapper, GeneratedMessage submsg, - {Duration? timeout}) async { - if (connection != null) { - await sendPb2(socketwrapper, connection!, ClientMessage, submsg, - timeout: timeout); - } else { - print('Connection is null'); - } - } - - Future greet(SocketWrapper socketwrapper) async { - ClientHello clientHello = ClientHello( - version: Uint8List.fromList(utf8.encode(Protocol.VERSION)), - genesisHash: Util.get_current_genesis_hash()); - - ClientMessage clientMessage = ClientMessage()..clienthello = clientHello; - - //deprecated - //Connection greet_connection_1 = Connection.withoutSocket(); - - /* - lets move this up a level to the fusion_run and pass it in.... - SocketWrapper socketwrapper = SocketWrapper(server_host, server_port); - await socketwrapper.connect(); -*/ - send2(socketwrapper, clientMessage); - - var replyMsg = await recv2(socketwrapper, ['serverhello']); - if (replyMsg is ServerMessage) { - ServerHello reply = replyMsg.serverhello; - - numComponents = reply.numComponents; - componentFeeRate = reply.componentFeerate.toDouble(); - minExcessFee = reply.minExcessFee.toDouble(); - maxExcessFee = reply.maxExcessFee.toDouble(); - availableTiers = reply.tiers.map((tier) => tier.toInt()).toList(); - - // Enforce some sensible limits, in case server is crazy - if (componentFeeRate > Protocol.MAX_COMPONENT_FEERATE) { - throw FusionError('excessive component feerate from server'); - } - if (minExcessFee > 400) { - // note this threshold should be far below MAX_EXCESS_FEE - throw FusionError('excessive min excess fee from server'); - } - if (minExcessFee > maxExcessFee) { - throw FusionError('bad config on server: fees'); - } - if (numComponents < Protocol.MIN_TX_COMPONENTS * 1.5) { - throw FusionError('bad config on server: num_components'); - } - } else { - throw Exception( - 'Received unexpected message type: ${replyMsg.runtimeType}'); - } - } - - Future allocateOutputs(socketwrapper) async { - print("DBUG allocateoutputs 746"); - - print("CHECK socketwrapper 746"); - socketwrapper.status(); - assert(['setup', 'connecting'].contains(status.item1)); - - List inputs = coins; - int numInputs = inputs.length; - - int maxComponents = min(numComponents, Protocol.MAX_COMPONENTS); - int maxOutputs = maxComponents - numInputs; - if (maxOutputs < 1) { - throw FusionError('Too many inputs ($numInputs >= $maxComponents)'); - } - - if (maxOutputs != null) { - assert(maxOutputs >= 1); - maxOutputs = min(maxOutputs, maxOutputs); - } - - int numDistinct = inputs.map((e) => e.value).toSet().length; - int minOutputs = max(Protocol.MIN_TX_COMPONENTS - numDistinct, 1); - if (maxOutputs < minOutputs) { - throw FusionError( - 'Too few distinct inputs selected ($numDistinct); cannot satisfy output count constraint (>= $minOutputs, <= $maxOutputs)'); - } - - int sumInputsValue = inputs.map((e) => e.value).reduce((a, b) => a + b); - int inputFees = inputs - .map( - (e) => Util.componentFee(e.sizeOfInput(), componentFeeRate.toInt())) - .reduce((a, b) => a + b); - int availForOutputs = sumInputsValue - inputFees - minExcessFee.toInt(); - - int feePerOutput = Util.componentFee(34, componentFeeRate.toInt()); - - int offsetPerOutput = Protocol.MIN_OUTPUT + feePerOutput; - - if (availForOutputs < offsetPerOutput) { - throw FusionError('Selected inputs had too little value'); - } - - var rng = Random(); - var seed = List.generate(32, (_) => rng.nextInt(256)); - - print("DBUG allocateoutputs 785"); - tierOutputs = {}; - var excessFees = {}; - for (var scale in availableTiers) { - int fuzzFeeMax = scale ~/ 1000000; - int fuzzFeeMaxReduced = min( - fuzzFeeMax, - min(Protocol.MAX_EXCESS_FEE - minExcessFee.toInt(), - maxExcessFee.toInt())); - - assert(fuzzFeeMaxReduced >= 0); - int fuzzFee = rng.nextInt(fuzzFeeMaxReduced + 1); - - int reducedAvailForOutputs = availForOutputs - fuzzFee; - if (reducedAvailForOutputs < offsetPerOutput) { - continue; - } - - var outputs = randomOutputsForTier( - rng, reducedAvailForOutputs, scale, offsetPerOutput, maxOutputs); - if (outputs != null) { - print(outputs); - } - if (outputs == null || outputs.length < minOutputs) { - continue; - } - outputs = outputs.map((o) => o - feePerOutput).toList(); - - assert(inputs.length + (outputs?.length ?? 0) <= Protocol.MAX_COMPONENTS); - - excessFees[scale] = sumInputsValue - inputFees - reducedAvailForOutputs; - tierOutputs[scale] = outputs!; - } - - print('Possible tiers: $tierOutputs'); - - safety_sum_in = sumInputsValue; - safety_exess_fees = excessFees; - return; - } - - Future registerAndWait(SocketWrapper socketwrapper) async { - print("DEBUG register and wait top."); - // msg can be different classes depending on which protobuf msg is sent. - dynamic? msg; - - var tierOutputs = this.tierOutputs; - var tiersSorted = tierOutputs.keys.toList()..sort(); - - if (tierOutputs.isEmpty) { - throw FusionError( - 'No outputs available at any tier (selected inputs were too small / too large).'); - } - - print('registering for tiers: $tiersSorted'); - - int self_fuse = 1; // Temporary value for now - var cashfusionTag = [1]; // temp value for now - - check_stop(running: false); - check_coins(); - - var tags = [JoinPools_PoolTag(id: cashfusionTag, limit: self_fuse)]; - -// Create JoinPools message - JoinPools joinPools = - JoinPools(tiers: tiersSorted.map((i) => Int64(i)).toList(), tags: tags); - -// Wrap it in a ClientMessage - ClientMessage clientMessage = ClientMessage()..joinpools = joinPools; - - send2(socketwrapper, clientMessage); - - status = Tuple('waiting', 'Registered for tiers'); - - var tiersStrings = { - for (var entry in tierOutputs.entries) - entry.key: - (entry.key * 1e-8).toStringAsFixed(8).replaceAll(RegExp(r'0+$'), '') - }; - - while (true) { - print("RECEIVE LOOP 870............DEBUG"); - var msg = await recv2(socketwrapper, ['tierstatusupdate', 'fusionbegin'], - timeout: Duration(seconds: 10)); - - var fieldInfoFusionBegin = msg.info_.byName["fusionbegin"]; - if (fieldInfoFusionBegin != null && - msg.hasField(fieldInfoFusionBegin.tagNumber)) { - break; - } - - check_stop(running: false); - check_coins(); - - // Define the bool variable - - var fieldInfo = msg.info_.byName["tierstatusupdate"]; - if (fieldInfo == null) { - throw FusionError( - 'Expected field not found in message: tierstatusupdate'); - } - - bool messageIsTierStatusUpdate = msg.hasField(fieldInfo.tagNumber); - - if (!messageIsTierStatusUpdate) { - throw FusionError('Expected a TierStatusUpdate message'); - } - - late var statuses; - if (messageIsTierStatusUpdate) { - //TierStatusUpdate tierStatusUpdate = msg.tierstatusupdate; - var tierStatusUpdate = - msg.getField(fieldInfo.tagNumber) as TierStatusUpdate; - statuses = tierStatusUpdate.statuses; - } - - double maxfraction = 0.0; - var maxtiers = []; - int? besttime; - int? besttimetier; - for (var entry in statuses.entries) { - double frac = - entry.value.players.toInt() / entry.value.minPlayers.toInt(); - if (frac >= maxfraction) { - if (frac > maxfraction) { - maxfraction = frac; - maxtiers.clear(); - } - maxtiers.add(entry.key.toInt()); - } - - var fieldInfoTimeRemaining = entry.value.info_.byName["timeRemaining"]; - if (fieldInfoTimeRemaining == null) { - throw FusionError( - 'Expected field not found in message: timeRemaining'); - } - - if (entry.value.hasField(fieldInfoTimeRemaining.tagNumber)) { - int tr = entry.value.timeRemaining.toInt(); - if (besttime == null || tr < besttime) { - besttime = tr; - besttimetier = entry.key.toInt(); - } - } - } - - var displayBest = []; - var displayMid = []; - var displayQueued = []; - for (var tier in tiersSorted) { - if (statuses.containsKey(tier)) { - var tierStr = tiersStrings[tier]; - if (tierStr == null) { - throw FusionError( - 'server reported status on tier we are not registered for'); - } - if (tier == besttimetier) { - displayBest.insert(0, '**$tierStr**'); - } else if (maxtiers.contains(tier)) { - displayBest.add('[$tierStr]'); - } else { - displayMid.add(tierStr); - } - } else { - displayQueued.add(tiersStrings[tier]!); - } - } - - var parts = []; - if (displayBest.isNotEmpty || displayMid.isNotEmpty) { - parts.add("Tiers: ${displayBest.join(', ')} ${displayMid.join(', ')}"); - } - if (displayQueued.isNotEmpty) { - parts.add("Queued: ${displayQueued.join(', ')}"); - } - var tiersString = parts.join(' '); - - if (besttime == null && inactiveTimeLimit != null) { - if (DateTime.now().millisecondsSinceEpoch > inactiveTimeLimit) { - throw FusionError('stopping due to inactivity'); - } - } - - if (besttime != null) { - status = Tuple( - 'waiting', 'Starting in ${besttime}s. $tiersString'); - } else if (maxfraction >= 1) { - status = - Tuple('waiting', 'Starting soon. $tiersString'); - } else if (displayBest.isNotEmpty || displayMid.isNotEmpty) { - status = Tuple( - 'waiting', '${(maxfraction * 100).round()}% full. $tiersString'); - } else { - status = Tuple('waiting', tiersString); - } - } - - var fieldInfoFusionBegin = msg.info_.byName["fusionbegin"]; - if (fieldInfoFusionBegin == null) { - throw FusionError('Expected field not found in message: fusionbegin'); - } - - bool messageIsFusionBegin = msg.hasField(fieldInfoFusionBegin.tagNumber); - if (!messageIsFusionBegin) { - throw FusionError('Expected a FusionBegin message'); - } - - t_fusionBegin = DateTime.now(); - - var clockMismatch = - msg.serverTime - DateTime.now().millisecondsSinceEpoch / 1000; - if (clockMismatch.abs() > Protocol.MAX_CLOCK_DISCREPANCY) { - throw FusionError( - "Clock mismatch too large: ${clockMismatch.toStringAsFixed(3)}."); - } - - tier = msg.tier; - if (msg is FusionBegin) { - covertDomainB = Uint8List.fromList(msg.covertDomain); - } - - covertPort = msg.covertPort; - covertSSL = msg.covertSSL; - beginTime = msg.serverTime; - - lastHash = Util.calcInitialHash( - tier, covertDomainB, covertPort, covertSSL, beginTime); - - var outAmounts = tierOutputs[tier]; - var outAddrs = Util.reserve_change_addresses(outAmounts?.length ?? 0); - - reservedAddresses = outAddrs; - outputs = Util.zip(outAmounts ?? [], outAddrs) - .map((pair) => Output(value: pair[0], addr: pair[1])) - .toList(); - - safetyExcessFee = safety_exess_fees[tier] ?? 0; - - print( - "starting fusion rounds at tier $tier: ${coins.length} inputs and ${outputs.length} outputs"); - } - - Future startCovert() async { - status = Tuple('running', 'Setting up Tor connections'); - - String covertDomain; - try { - covertDomain = utf8.decode(covertDomainB); - } catch (e) { - throw FusionError('badly encoded covert domain'); - } - CovertSubmitter covert = CovertSubmitter( - covertDomain, - covertPort, - covertSSL, - tor_host, - tor_port, - numComponents, - Protocol.COVERT_SUBMIT_WINDOW, - Protocol.COVERT_SUBMIT_TIMEOUT); - try { - covert.scheduleConnections(t_fusionBegin, - Duration(seconds: Protocol.COVERT_CONNECT_WINDOW.toInt()), - numSpares: Protocol.COVERT_CONNECT_SPARES.toInt(), - connectTimeout: Protocol.COVERT_CONNECT_TIMEOUT.toInt()); - - // loop until a just a bit before we're expecting startRound, watching for status updates - final tend = t_fusionBegin.add(Duration( - seconds: (Protocol.WARMUP_TIME - Protocol.WARMUP_SLOP - 1).round())); - - while (DateTime.now().millisecondsSinceEpoch / 1000 < - tend.millisecondsSinceEpoch / 1000) { - int numConnected = - covert.slots.where((s) => s.covConn?.connection != null).length; - - int numSpareConnected = - covert.spareConnections.where((c) => c.connection != null).length; - - status = Tuple('running', - 'Setting up Tor connections ($numConnected+$numSpareConnected out of $numComponents)'); - - await Future.delayed(Duration(seconds: 1)); - - covert.checkOk(); - this.check_stop(); - this.check_coins(); - } - } catch (e) { - covert.stop(); - rethrow; - } - - return covert; - } - - void runRound(CovertSubmitter covert) async { - status = Tuple('running', 'Starting round ${roundcount.toString()}'); - int timeoutInSeconds = - (2 * Protocol.WARMUP_SLOP + Protocol.STANDARD_TIMEOUT).toInt(); - var msg = await recv(['startround'], - timeout: Duration(seconds: timeoutInSeconds)); - - // Record the time we got this message; it forms the basis time for all covert activities. - final covertT0 = DateTime.now().millisecondsSinceEpoch / 1000; - double covertClock() => - (DateTime.now().millisecondsSinceEpoch / 1000) - covertT0; - - final roundTime = (msg as StartRound).serverTime; - - // Check the server's declared unix time, which will be committed. - final clockMismatch = (msg as StartRound).serverTime - - DateTime.now().millisecondsSinceEpoch / 1000; - if (clockMismatch.abs() > Protocol.MAX_CLOCK_DISCREPANCY) { - throw FusionError( - "Clock mismatch too large: ${clockMismatch.toInt().toStringAsPrecision(3)}."); - } - - if (t_fusionBegin != null) { - // On the first startround message, check that the warmup time was within acceptable bounds. - final lag = covertT0 - - (t_fusionBegin.millisecondsSinceEpoch / 1000) - - Protocol.WARMUP_TIME; - if (lag.abs() > Protocol.WARMUP_SLOP) { - throw FusionError( - "Warmup period too different from expectation (|${lag.toStringAsFixed(3)}s| > ${Protocol.WARMUP_SLOP.toStringAsFixed(3)}s)."); - } - t_fusionBegin = DateTime.now(); - } - - print("round starting at ${DateTime.now().millisecondsSinceEpoch / 1000}"); - - final inputFees = coins - .map( - (e) => Util.componentFee(e.sizeOfInput(), componentFeeRate.toInt())) - .reduce((a, b) => a + b); - final outputFees = - outputs.length * Util.componentFee(34, componentFeeRate.toInt()); - - final sumIn = coins.map((e) => e.amount).reduce((a, b) => a + b); - final sumOut = outputs.map((e) => e.value).reduce((a, b) => a + b); - - final totalFee = sumIn - sumOut; - final excessFee = totalFee - inputFees - outputFees; - final safeties = [ - sumIn == safety_sum_in, - excessFee == safetyExcessFee, - excessFee <= Protocol.MAX_EXCESS_FEE, - totalFee <= Protocol.MAX_FEE, - ]; - - if (!safeties.every((element) => element)) { - throw Exception( - "(BUG!) Funds re-check failed -- aborting for safety. ${safeties.toString()}"); - } - - final roundPubKey = (msg as StartRound).roundPubkey; - - final blindNoncePoints = (msg as StartRound).blindNoncePoints; - if (blindNoncePoints.length != numComponents) { - throw FusionError('blind nonce miscount'); - } - - final numBlanks = numComponents - coins.length - outputs.length; - final List genComponentsResults = - genComponents(numBlanks, coins, outputs, componentFeeRate.toInt()); - - final List myCommitments = []; - final List myComponentSlots = []; - final List myComponents = []; - final List myProofs = []; - final List privKeys = []; - final List pedersenAmount = - []; // replace dynamic with the actual type - final List pedersenNonce = - []; // replace dynamic with the actual type - - for (var genComponentResult in genComponentsResults) { - myCommitments.add(genComponentResult.commitment); - myComponentSlots.add(genComponentResult.counter); - myComponents.add(genComponentResult.component); - myProofs.add(genComponentResult.proof); - privKeys.add(genComponentResult.privateKey); - pedersenAmount.add(genComponentResult.pedersenAmount); - pedersenNonce.add(genComponentResult.pedersenNonce); - } - assert(excessFee == - pedersenAmount.reduce( - (a, b) => a + b)); // sanity check that we didn't mess up the above - assert(myComponents.toSet().length == myComponents.length); // no duplicates - - // Need to implement this! schnorr is from EC schnorr.py - var blindSigRequests = []; - - /* - final blindSigRequests = blindNoncePoints.map((e) => Schnorr.BlindSignatureRequest(roundPubKey, e, sha256(myComponents.elementAt(e)))).toList(); - -*/ - final randomNumber = Util.getRandomBytes(32); - covert.checkOk(); - check_stop(); - check_coins(); - - await send(PlayerCommit( - initialCommitments: myCommitments, - excessFee: Int64(excessFee), - pedersenTotalNonce: pedersenNonce.cast(), - randomNumberCommitment: sha256.convert(randomNumber).bytes, - blindSigRequests: - blindSigRequests.map((r) => r.getRequest() as List).toList(), - )); - - msg = await recv(['blindsigresponses'], - timeout: Duration(seconds: Protocol.T_START_COMPS.toInt())); - - if (msg is BlindSigResponses) { - var typedMsg = msg as BlindSigResponses; - assert(typedMsg.scalars.length == blindSigRequests.length); - } else { - // Handle the case where msg is not of type BlindSigResponses - throw Exception('Unexpected message type: ${msg.runtimeType}'); - } - - final blindSigs = List.generate( - blindSigRequests.length, - (index) { - if (msg is BlindSigResponses) { - var typedMsg = msg as BlindSigResponses; - return blindSigRequests[index] - .finalize(typedMsg.scalars[index], check: true); - } else { - // Handle the case where msg is not of type BlindSigResponses - throw Exception('Unexpected message type: ${msg.runtimeType}'); - } - }, - ); - -// Sleep until the covert component phase really starts, to catch covert connection failures. - var remainingTime = Protocol.T_START_COMPS - covertClock(); - if (remainingTime < 0) { - throw FusionError('Arrived at covert-component phase too slowly.'); - } - await Future.delayed(Duration(seconds: remainingTime.floor())); - -// Our final check to leave the fusion pool, before we start telling our -// components. This is much more annoying since it will cause the round -// to fail, but since we would end up killing the round anyway then it's -// best for our privacy if we just leave now. -// (This also is our first call to check_connected.) - covert.checkConnected(); - check_coins(); - -// Start covert component submissions - print("starting covert component submission"); - status = Tuple('running', 'covert submission: components'); - -// If we fail after this point, we want to stop connections gradually and -// randomly. We don't want to stop them all at once, since if we had already -// provided our input components then it would be a leak to have them all drop at once. - covert.setStopTime((covertT0 + Protocol.T_START_CLOSE).toInt()); - - // Schedule covert submissions. - List messages = List.filled(myComponents.length, null); - - for (var i = 0; i < myComponents.length; i++) { - messages[myComponentSlots[i]] = CovertComponent( - roundPubkey: roundPubKey, - signature: blindSigs[i], - component: myComponents[i]); - } - if (messages.any((element) => element == null)) { - throw FusionError('Messages list includes null values.'); - } - - final targetDateTime = DateTime.fromMillisecondsSinceEpoch( - ((covertT0 + Protocol.T_START_COMPS) * 1000).toInt()); - covert.scheduleSubmissions(targetDateTime, messages); - - // While submitting, we download the (large) full commitment list. - msg = await recv(['allcommitments'], - timeout: Duration(seconds: Protocol.T_START_SIGS.toInt())); - AllCommitments allCommitmentsMsg = msg as AllCommitments; - List allCommitments = - allCommitmentsMsg.initialCommitments.map((commitmentBytes) { - return InitialCommitment.fromBuffer(commitmentBytes); - }).toList(); - - // Quick check on the commitment list. - if (allCommitments.toSet().length != allCommitments.length) { - throw FusionError('Commitments list includes duplicates.'); - } - try { - List allCommitmentsBytes = allCommitments - .map((commitment) => commitment.writeToBuffer()) - .toList(); - myCommitmentIndexes = - myCommitments.map((c) => allCommitmentsBytes.indexOf(c)).toList(); - } on Exception { - throw FusionError('One or more of my commitments missing.'); - } - - remainingTime = Protocol.T_START_SIGS - covertClock(); - if (remainingTime < 0) { - throw FusionError('took too long to download commitments list'); - } - - // Once all components are received, the server shares them with us: - msg = await recv(['sharecovertcomponents'], - timeout: Duration(seconds: Protocol.T_START_SIGS.toInt())); - - ShareCovertComponents shareCovertComponentsMsg = - msg as ShareCovertComponents; - List> allComponents = shareCovertComponentsMsg.components; - bool skipSignatures = msg.getField(2); - - // Critical check on server's response timing. - if (covertClock() > Protocol.T_START_SIGS) { - throw FusionError('Shared components message arrived too slowly.'); - } - - covert.checkDone(); - - try { - myComponentIndexes = myComponents - .map((c) => allComponents - .indexWhere((element) => ListEquality().equals(element, c))) - .toList(); - if (myComponentIndexes.contains(-1)) { - throw FusionError('One or more of my components missing.'); - } - } on StateError { - throw FusionError('One or more of my components missing.'); - } - - // Need to implement: check the components list and see if there are enough inputs/outputs - // for there to be significant privacy. - - List> allCommitmentsBytes = allCommitments - .map((commitment) => commitment.writeToBuffer().toList()) - .toList(); - List sessionHash = Util.calcRoundHash(lastHash, roundPubKey, - roundTime.toInt(), allCommitmentsBytes, allComponents); - - if (shareCovertComponentsMsg.sessionHash != null && - !ListEquality() - .equals(shareCovertComponentsMsg.sessionHash, sessionHash)) { - throw FusionError('Session hash mismatch (bug!)'); - } - - if (!shareCovertComponentsMsg.skipSignatures) { - print("starting covert signature submission"); - status = Tuple('running', 'covert submission: signatures'); - - if (allComponents.toSet().length != allComponents.length) { - throw FusionError('Server component list includes duplicates.'); - } - - var txInputIndices = - Transaction.txFromComponents(allComponents, sessionHash); - - Tuple txData = Transaction.txFromComponents(allComponents, sessionHash); - tx = txData.item1; - List inputIndices = txData.item2; - - List covertTransactionSignatureMessages = - List.filled(myComponents.length, null); - - var my_combined = List>.generate( - inputIndices.length, - (index) => Tuple(inputIndices[index], tx.Inputs[index]), - ); - - for (var i = 0; i < my_combined.length; i++) { - int cIdx = my_combined[i].item1; - Input inp = my_combined[i].item2; - - int myCompIdx = myComponentIndexes.indexOf(cIdx); - if (myCompIdx == -1) continue; // not my input - - var pubKey = inp.getPubKey(0); - var sec = inp.getPrivKey(0); - - var preimageBytes = tx.serializePreimage(i, 0x41, useCache: true); - var sighash = sha256.convert(sha256.convert(preimageBytes).bytes); - - //var sig = schnorr.sign(sec, sighash); // Needs implementation - var sig = [0, 1, 2, 3, 4]; // dummy placeholder - - covertTransactionSignatureMessages[myComponentSlots[myCompIdx]] = - CovertTransactionSignature(txsignature: sig, whichInput: i); - } - - DateTime covertT0DateTime = DateTime.fromMillisecondsSinceEpoch( - covertT0.toInt() * 1000); // covertT0 is in seconds - covert.scheduleSubmissions( - covertT0DateTime - .add(Duration(milliseconds: Protocol.T_START_SIGS.toInt())), - covertTransactionSignatureMessages); - - // wait for result - int timeoutMillis = (Protocol.T_EXPECTING_CONCLUSION - - Protocol.TS_EXPECTING_COVERT_COMPONENTS) - .toInt(); - Duration timeout = Duration(milliseconds: timeoutMillis); - msg = await recv(['fusionresult'], timeout: timeout); - - // Critical check on server's response timing. - if (covertClock() > Protocol.T_EXPECTING_CONCLUSION) { - throw FusionError('Fusion result message arrived too slowly.'); - } - - covert.checkDone(); - FusionResult fusionResultMsg = msg as FusionResult; - if (fusionResultMsg.ok) { - List> allSigs = msg.txsignatures; - - // assemble the transaction. - if (allSigs.length != tx.Inputs.length) { - throw FusionError('Server gave wrong number of signatures.'); - } - for (var i = 0; i < allSigs.length; i++) { - List sigBytes = allSigs[i]; - String sig = base64.encode(sigBytes); - Input inp = tx.Inputs[i]; - if (sig.length != 64) { - throw FusionError('server relayed bad signature'); - } - inp.signatures = [sig + '41']; - } - - assert(tx.isComplete()); - String txHex = tx.serialize(); - - txid = tx.txid(); - String sumInStr = Util.formatSatoshis(sumIn, numZeros: 8); - String feeStr = totalFee.toString(); - String feeLoc = 'fee'; - - String label = - "CashFusion ${coins.length}⇢${outputs.length}, ${sumInStr} BCH (−${feeStr} sats ${feeLoc})"; - - Util.updateWalletLabel(txid, label); - } else { - badComponents = msg.badComponents.toSet(); - if (badComponents.intersection(myComponentIndexes.toSet()).isNotEmpty) { - print( - "bad components: ${badComponents.toList()} mine: ${myComponentIndexes.toList()}"); - throw FusionError("server thinks one of my components is bad!"); - } - } - } else { - // skip_signatures True - Set badComponents = Set(); - } - -// ### Blame phase ### - - covert.setStopTime((covertT0 + Protocol.T_START_CLOSE_BLAME).floor()); - - print("sending proofs"); - status = Tuple('running', 'round failed - sending proofs'); - -// create a list of commitment indexes, but leaving out mine. - List othersCommitmentIdxes = []; - for (int i = 0; i < allCommitments.length; i++) { - if (!myCommitmentIndexes.contains(i)) { - othersCommitmentIdxes.add(i); - } - } - int N = othersCommitmentIdxes.length; - assert(N == allCommitments.length - myCommitments.length); - if (N == 0) { - throw FusionError( - "Fusion failed with only me as player -- I can only blame myself."); - } - -// where should I send my proofs? - List dstCommits = []; - for (int i = 0; i < myCommitments.length; i++) { - dstCommits.add(allCommitments[ - othersCommitmentIdxes[Util.randPosition(randomNumber, N, i)]]); - } - -// generate the encrypted proofs - List encproofs = List.filled(myCommitments.length, ''); - - ECDomainParameters params = ECDomainParameters('secp256k1'); - for (int i = 0; i < dstCommits.length; i++) { - InitialCommitment msg = dstCommits[i]; - Proof proof = myProofs[i]; - proof.componentIdx = myComponentIndexes[i]; - - ECPoint? communicationKeyPointMaybe = - params.curve.decodePoint(Uint8List.fromList(msg.communicationKey)); - if (communicationKeyPointMaybe == null) { - // handle the error case here, e.g., throw an exception or skip this iteration. - continue; - } - ECPoint communicationKeyPoint = communicationKeyPointMaybe; - - try { - Uint8List encryptedData = await encrypt( - proof.writeToBuffer(), communicationKeyPoint, - padToLength: 80); - encproofs[i] = String.fromCharCodes(encryptedData); - } catch (EncryptionFailed) { - // The communication key was bad (probably invalid x coordinate). - // We will just send a blank. They can't even blame us since there is no private key! :) - continue; - } - } - - List encodedEncproofs = - encproofs.map((e) => Uint8List.fromList(e.codeUnits)).toList(); - this.send(MyProofsList( - encryptedProofs: encodedEncproofs, randomNumber: randomNumber)); - - status = Tuple('running', 'round failed - checking proofs'); - - print("receiving proofs"); - msg = await this.recv(['theirproofslist'], - timeout: Duration(seconds: (2 * Protocol.STANDARD_TIMEOUT).round())); - - List blames = []; - - int countInputs = 0; - - TheirProofsList proofsList = msg as TheirProofsList; - - var privKey; - var commitmentBlob; - for (var i = 0; i < proofsList.proofs.length; i++) { - var rp = msg.proofs[i]; - try { - privKey = privKeys[rp.dstKeyIdx]; - commitmentBlob = allCommitments[rp.srcCommitmentIdx]; - } on RangeError catch (e) { - throw FusionError("Server relayed bad proof indices"); - } - - var sKey; - var proofBlob; - - try { - var result = - await decrypt(Uint8List.fromList(rp.encryptedProof), privKey); - proofBlob = result.item1; // First item is the decrypted data - sKey = result.item2; // Second item is the symmetric key - } on Exception catch (e) { - print("found an undecryptable proof"); - blames.add(Blames_BlameProof( - whichProof: i, privkey: privKey, blameReason: 'undecryptable')); - continue; - } - - var commitment = InitialCommitment(); - try { - commitment - .mergeFromBuffer(commitmentBlob); // Method to parse protobuf data - } on FormatException catch (e) { - throw FusionError("Server relayed bad commitment"); - } - - var inpComp; - - try { - // Convert allComponents to List - List allComponentsUint8 = allComponents - .map((component) => Uint8List.fromList(component)) - .toList(); - // Convert badComponents to List - List badComponentsList = badComponents.toList(); - // Convert componentFeeRate to int if it's double - int componentFeerateInt = componentFeeRate - .round(); // or use .toInt() if you want to truncate instead of rounding - - var inpComp = validateProofInternal(proofBlob, commitment, - allComponentsUint8, badComponentsList, componentFeerateInt); - } on Exception catch (e) { - print("found an erroneous proof: ${e.toString()}"); - var blameProof = Blames_BlameProof(); - blameProof.whichProof = i; - blameProof.sessionKey = sKey; - blameProof.blameReason = e.toString(); - blames.add(blameProof); - continue; - } - - if (inpComp != null) { - countInputs++; - try { - Util.checkInputElectrumX(inpComp); - } on Exception catch (e) { - print( - "found a bad input [${rp.srcCommitmentIdx}]: $e (${inpComp.prevTxid.reversed.toList().toHex()}:${inpComp.prevIndex})"); - - var blameProof = Blames_BlameProof(); - blameProof.whichProof = i; - blameProof.sessionKey = sKey; - blameProof.blameReason = - 'input does not match blockchain: ' + e.toString(); - blameProof.needLookupBlockchain = true; - blames.add(blameProof); - } catch (e) { - print( - "verified an input internally, but was unable to check it against blockchain: ${e}"); - } - } - } - print("checked ${msg.proofs.length} proofs, $countInputs of them inputs"); - - print("sending blames"); - send(Blames(blames: blames)); - - status = Tuple('running', 'awaiting restart'); - -// Await the final 'restartround' message. It might take some time -// to arrive since other players might be slow, and then the server -// itself needs to check blockchain. - await recv(['restartround'], - timeout: Duration( - seconds: 2 * - (Protocol.STANDARD_TIMEOUT.round() + - Protocol.BLAME_VERIFY_TIME.round()))); - } // end of run_round() function. -} // END OF CLASS diff --git a/lib/services/cashfusion/fusion.pb.dart b/lib/services/cashfusion/fusion.pb.dart deleted file mode 100644 index dac659f95..000000000 --- a/lib/services/cashfusion/fusion.pb.dart +++ /dev/null @@ -1,2501 +0,0 @@ -/// -// Generated code. Do not modify. -// source: fusion.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; - -import 'package:fixnum/fixnum.dart' as $fixnum; -import 'package:protobuf/protobuf.dart' as $pb; - -class InputComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InputComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'prevTxid', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'prevIndex', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pubkey', $pb.PbFieldType.QY) - ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amount', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - InputComponent._() : super(); - factory InputComponent({ - $core.List<$core.int>? prevTxid, - $core.int? prevIndex, - $core.List<$core.int>? pubkey, - $fixnum.Int64? amount, - }) { - final _result = create(); - if (prevTxid != null) { - _result.prevTxid = prevTxid; - } - if (prevIndex != null) { - _result.prevIndex = prevIndex; - } - if (pubkey != null) { - _result.pubkey = pubkey; - } - if (amount != null) { - _result.amount = amount; - } - return _result; - } - factory InputComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory InputComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - InputComponent clone() => InputComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - InputComponent copyWith(void Function(InputComponent) updates) => super.copyWith((message) => updates(message as InputComponent)) as InputComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static InputComponent create() => InputComponent._(); - InputComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static InputComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static InputComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get prevTxid => $_getN(0); - @$pb.TagNumber(1) - set prevTxid($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasPrevTxid() => $_has(0); - @$pb.TagNumber(1) - void clearPrevTxid() => clearField(1); - - @$pb.TagNumber(2) - $core.int get prevIndex => $_getIZ(1); - @$pb.TagNumber(2) - set prevIndex($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasPrevIndex() => $_has(1); - @$pb.TagNumber(2) - void clearPrevIndex() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pubkey => $_getN(2); - @$pb.TagNumber(3) - set pubkey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPubkey() => $_has(2); - @$pb.TagNumber(3) - void clearPubkey() => clearField(3); - - @$pb.TagNumber(4) - $fixnum.Int64 get amount => $_getI64(3); - @$pb.TagNumber(4) - set amount($fixnum.Int64 v) { $_setInt64(3, v); } - @$pb.TagNumber(4) - $core.bool hasAmount() => $_has(3); - @$pb.TagNumber(4) - void clearAmount() => clearField(4); -} - -class OutputComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OutputComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scriptpubkey', $pb.PbFieldType.QY) - ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amount', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - OutputComponent._() : super(); - factory OutputComponent({ - $core.List<$core.int>? scriptpubkey, - $fixnum.Int64? amount, - }) { - final _result = create(); - if (scriptpubkey != null) { - _result.scriptpubkey = scriptpubkey; - } - if (amount != null) { - _result.amount = amount; - } - return _result; - } - factory OutputComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory OutputComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OutputComponent clone() => OutputComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OutputComponent copyWith(void Function(OutputComponent) updates) => super.copyWith((message) => updates(message as OutputComponent)) as OutputComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OutputComponent create() => OutputComponent._(); - OutputComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OutputComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static OutputComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get scriptpubkey => $_getN(0); - @$pb.TagNumber(1) - set scriptpubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasScriptpubkey() => $_has(0); - @$pb.TagNumber(1) - void clearScriptpubkey() => clearField(1); - - @$pb.TagNumber(2) - $fixnum.Int64 get amount => $_getI64(1); - @$pb.TagNumber(2) - set amount($fixnum.Int64 v) { $_setInt64(1, v); } - @$pb.TagNumber(2) - $core.bool hasAmount() => $_has(1); - @$pb.TagNumber(2) - void clearAmount() => clearField(2); -} - -class BlankComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlankComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - BlankComponent._() : super(); - factory BlankComponent() => create(); - factory BlankComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlankComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlankComponent clone() => BlankComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlankComponent copyWith(void Function(BlankComponent) updates) => super.copyWith((message) => updates(message as BlankComponent)) as BlankComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlankComponent create() => BlankComponent._(); - BlankComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlankComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlankComponent? _defaultInstance; -} - -enum Component_Component { - input, - output, - blank, - notSet -} - -class Component extends $pb.GeneratedMessage { - static const $core.Map<$core.int, Component_Component> _Component_ComponentByTag = { - 2 : Component_Component.input, - 3 : Component_Component.output, - 4 : Component_Component.blank, - 0 : Component_Component.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Component', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [2, 3, 4]) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'saltCommitment', $pb.PbFieldType.QY) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'input', subBuilder: InputComponent.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output', subBuilder: OutputComponent.create) - ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blank', subBuilder: BlankComponent.create) - ; - - Component._() : super(); - factory Component({ - $core.List<$core.int>? saltCommitment, - InputComponent? input, - OutputComponent? output, - BlankComponent? blank, - }) { - final _result = create(); - if (saltCommitment != null) { - _result.saltCommitment = saltCommitment; - } - if (input != null) { - _result.input = input; - } - if (output != null) { - _result.output = output; - } - if (blank != null) { - _result.blank = blank; - } - return _result; - } - factory Component.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Component.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Component clone() => Component()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Component copyWith(void Function(Component) updates) => super.copyWith((message) => updates(message as Component)) as Component; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Component create() => Component._(); - Component createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Component getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Component? _defaultInstance; - - Component_Component whichComponent() => _Component_ComponentByTag[$_whichOneof(0)]!; - void clearComponent() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.List<$core.int> get saltCommitment => $_getN(0); - @$pb.TagNumber(1) - set saltCommitment($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasSaltCommitment() => $_has(0); - @$pb.TagNumber(1) - void clearSaltCommitment() => clearField(1); - - @$pb.TagNumber(2) - InputComponent get input => $_getN(1); - @$pb.TagNumber(2) - set input(InputComponent v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasInput() => $_has(1); - @$pb.TagNumber(2) - void clearInput() => clearField(2); - @$pb.TagNumber(2) - InputComponent ensureInput() => $_ensure(1); - - @$pb.TagNumber(3) - OutputComponent get output => $_getN(2); - @$pb.TagNumber(3) - set output(OutputComponent v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasOutput() => $_has(2); - @$pb.TagNumber(3) - void clearOutput() => clearField(3); - @$pb.TagNumber(3) - OutputComponent ensureOutput() => $_ensure(2); - - @$pb.TagNumber(4) - BlankComponent get blank => $_getN(3); - @$pb.TagNumber(4) - set blank(BlankComponent v) { setField(4, v); } - @$pb.TagNumber(4) - $core.bool hasBlank() => $_has(3); - @$pb.TagNumber(4) - void clearBlank() => clearField(4); - @$pb.TagNumber(4) - BlankComponent ensureBlank() => $_ensure(3); -} - -class InitialCommitment extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InitialCommitment', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'saltedComponentHash', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amountCommitment', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'communicationKey', $pb.PbFieldType.QY) - ; - - InitialCommitment._() : super(); - factory InitialCommitment({ - $core.List<$core.int>? saltedComponentHash, - $core.List<$core.int>? amountCommitment, - $core.List<$core.int>? communicationKey, - }) { - final _result = create(); - if (saltedComponentHash != null) { - _result.saltedComponentHash = saltedComponentHash; - } - if (amountCommitment != null) { - _result.amountCommitment = amountCommitment; - } - if (communicationKey != null) { - _result.communicationKey = communicationKey; - } - return _result; - } - factory InitialCommitment.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory InitialCommitment.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - InitialCommitment clone() => InitialCommitment()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - InitialCommitment copyWith(void Function(InitialCommitment) updates) => super.copyWith((message) => updates(message as InitialCommitment)) as InitialCommitment; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static InitialCommitment create() => InitialCommitment._(); - InitialCommitment createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static InitialCommitment getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static InitialCommitment? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get saltedComponentHash => $_getN(0); - @$pb.TagNumber(1) - set saltedComponentHash($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasSaltedComponentHash() => $_has(0); - @$pb.TagNumber(1) - void clearSaltedComponentHash() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get amountCommitment => $_getN(1); - @$pb.TagNumber(2) - set amountCommitment($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasAmountCommitment() => $_has(1); - @$pb.TagNumber(2) - void clearAmountCommitment() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get communicationKey => $_getN(2); - @$pb.TagNumber(3) - set communicationKey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasCommunicationKey() => $_has(2); - @$pb.TagNumber(3) - void clearCommunicationKey() => clearField(3); -} - -class Proof extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Proof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'componentIdx', $pb.PbFieldType.QF3) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'salt', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pedersenNonce', $pb.PbFieldType.QY) - ; - - Proof._() : super(); - factory Proof({ - $core.int? componentIdx, - $core.List<$core.int>? salt, - $core.List<$core.int>? pedersenNonce, - }) { - final _result = create(); - if (componentIdx != null) { - _result.componentIdx = componentIdx; - } - if (salt != null) { - _result.salt = salt; - } - if (pedersenNonce != null) { - _result.pedersenNonce = pedersenNonce; - } - return _result; - } - factory Proof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Proof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Proof clone() => Proof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Proof copyWith(void Function(Proof) updates) => super.copyWith((message) => updates(message as Proof)) as Proof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Proof create() => Proof._(); - Proof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Proof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Proof? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get componentIdx => $_getIZ(0); - @$pb.TagNumber(1) - set componentIdx($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasComponentIdx() => $_has(0); - @$pb.TagNumber(1) - void clearComponentIdx() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get salt => $_getN(1); - @$pb.TagNumber(2) - set salt($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSalt() => $_has(1); - @$pb.TagNumber(2) - void clearSalt() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pedersenNonce => $_getN(2); - @$pb.TagNumber(3) - set pedersenNonce($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPedersenNonce() => $_has(2); - @$pb.TagNumber(3) - void clearPedersenNonce() => clearField(3); -} - -class ClientHello extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ClientHello', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'version', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'genesisHash', $pb.PbFieldType.OY) - ; - - ClientHello._() : super(); - factory ClientHello({ - $core.List<$core.int>? version, - $core.List<$core.int>? genesisHash, - }) { - final _result = create(); - if (version != null) { - _result.version = version; - } - if (genesisHash != null) { - _result.genesisHash = genesisHash; - } - return _result; - } - factory ClientHello.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ClientHello.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ClientHello clone() => ClientHello()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ClientHello copyWith(void Function(ClientHello) updates) => super.copyWith((message) => updates(message as ClientHello)) as ClientHello; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ClientHello create() => ClientHello._(); - ClientHello createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ClientHello getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ClientHello? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get version => $_getN(0); - @$pb.TagNumber(1) - set version($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasVersion() => $_has(0); - @$pb.TagNumber(1) - void clearVersion() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get genesisHash => $_getN(1); - @$pb.TagNumber(2) - set genesisHash($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasGenesisHash() => $_has(1); - @$pb.TagNumber(2) - void clearGenesisHash() => clearField(2); -} - -class ServerHello extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ServerHello', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tiers', $pb.PbFieldType.PU6) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numComponents', $pb.PbFieldType.QU3) - ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'componentFeerate', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minExcessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$fixnum.Int64>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxExcessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..aOS(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'donationAddress') - ; - - ServerHello._() : super(); - factory ServerHello({ - $core.Iterable<$fixnum.Int64>? tiers, - $core.int? numComponents, - $fixnum.Int64? componentFeerate, - $fixnum.Int64? minExcessFee, - $fixnum.Int64? maxExcessFee, - $core.String? donationAddress, - }) { - final _result = create(); - if (tiers != null) { - _result.tiers.addAll(tiers); - } - if (numComponents != null) { - _result.numComponents = numComponents; - } - if (componentFeerate != null) { - _result.componentFeerate = componentFeerate; - } - if (minExcessFee != null) { - _result.minExcessFee = minExcessFee; - } - if (maxExcessFee != null) { - _result.maxExcessFee = maxExcessFee; - } - if (donationAddress != null) { - _result.donationAddress = donationAddress; - } - return _result; - } - factory ServerHello.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ServerHello.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ServerHello clone() => ServerHello()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ServerHello copyWith(void Function(ServerHello) updates) => super.copyWith((message) => updates(message as ServerHello)) as ServerHello; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ServerHello create() => ServerHello._(); - ServerHello createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ServerHello getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ServerHello? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$fixnum.Int64> get tiers => $_getList(0); - - @$pb.TagNumber(2) - $core.int get numComponents => $_getIZ(1); - @$pb.TagNumber(2) - set numComponents($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasNumComponents() => $_has(1); - @$pb.TagNumber(2) - void clearNumComponents() => clearField(2); - - @$pb.TagNumber(4) - $fixnum.Int64 get componentFeerate => $_getI64(2); - @$pb.TagNumber(4) - set componentFeerate($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(4) - $core.bool hasComponentFeerate() => $_has(2); - @$pb.TagNumber(4) - void clearComponentFeerate() => clearField(4); - - @$pb.TagNumber(5) - $fixnum.Int64 get minExcessFee => $_getI64(3); - @$pb.TagNumber(5) - set minExcessFee($fixnum.Int64 v) { $_setInt64(3, v); } - @$pb.TagNumber(5) - $core.bool hasMinExcessFee() => $_has(3); - @$pb.TagNumber(5) - void clearMinExcessFee() => clearField(5); - - @$pb.TagNumber(6) - $fixnum.Int64 get maxExcessFee => $_getI64(4); - @$pb.TagNumber(6) - set maxExcessFee($fixnum.Int64 v) { $_setInt64(4, v); } - @$pb.TagNumber(6) - $core.bool hasMaxExcessFee() => $_has(4); - @$pb.TagNumber(6) - void clearMaxExcessFee() => clearField(6); - - @$pb.TagNumber(15) - $core.String get donationAddress => $_getSZ(5); - @$pb.TagNumber(15) - set donationAddress($core.String v) { $_setString(5, v); } - @$pb.TagNumber(15) - $core.bool hasDonationAddress() => $_has(5); - @$pb.TagNumber(15) - void clearDonationAddress() => clearField(15); -} - -class JoinPools_PoolTag extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinPools.PoolTag', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'limit', $pb.PbFieldType.QU3) - ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'noIp') - ; - - JoinPools_PoolTag._() : super(); - factory JoinPools_PoolTag({ - $core.List<$core.int>? id, - $core.int? limit, - $core.bool? noIp, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (limit != null) { - _result.limit = limit; - } - if (noIp != null) { - _result.noIp = noIp; - } - return _result; - } - factory JoinPools_PoolTag.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory JoinPools_PoolTag.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - JoinPools_PoolTag clone() => JoinPools_PoolTag()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - JoinPools_PoolTag copyWith(void Function(JoinPools_PoolTag) updates) => super.copyWith((message) => updates(message as JoinPools_PoolTag)) as JoinPools_PoolTag; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static JoinPools_PoolTag create() => JoinPools_PoolTag._(); - JoinPools_PoolTag createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static JoinPools_PoolTag getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static JoinPools_PoolTag? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get id => $_getN(0); - @$pb.TagNumber(1) - set id($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.int get limit => $_getIZ(1); - @$pb.TagNumber(2) - set limit($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasLimit() => $_has(1); - @$pb.TagNumber(2) - void clearLimit() => clearField(2); - - @$pb.TagNumber(3) - $core.bool get noIp => $_getBF(2); - @$pb.TagNumber(3) - set noIp($core.bool v) { $_setBool(2, v); } - @$pb.TagNumber(3) - $core.bool hasNoIp() => $_has(2); - @$pb.TagNumber(3) - void clearNoIp() => clearField(3); -} - -class JoinPools extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinPools', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tiers', $pb.PbFieldType.PU6) - ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tags', $pb.PbFieldType.PM, subBuilder: JoinPools_PoolTag.create) - ; - - JoinPools._() : super(); - factory JoinPools({ - $core.Iterable<$fixnum.Int64>? tiers, - $core.Iterable? tags, - }) { - final _result = create(); - if (tiers != null) { - _result.tiers.addAll(tiers); - } - if (tags != null) { - _result.tags.addAll(tags); - } - return _result; - } - factory JoinPools.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory JoinPools.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - JoinPools clone() => JoinPools()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - JoinPools copyWith(void Function(JoinPools) updates) => super.copyWith((message) => updates(message as JoinPools)) as JoinPools; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static JoinPools create() => JoinPools._(); - JoinPools createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static JoinPools getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static JoinPools? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$fixnum.Int64> get tiers => $_getList(0); - - @$pb.TagNumber(2) - $core.List get tags => $_getList(1); -} - -class TierStatusUpdate_TierStatus extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TierStatusUpdate.TierStatus', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'players', $pb.PbFieldType.OU3) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minPlayers', $pb.PbFieldType.OU3) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxPlayers', $pb.PbFieldType.OU3) - ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timeRemaining', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - - TierStatusUpdate_TierStatus._() : super(); - factory TierStatusUpdate_TierStatus({ - $core.int? players, - $core.int? minPlayers, - $core.int? maxPlayers, - $core.int? timeRemaining, - }) { - final _result = create(); - if (players != null) { - _result.players = players; - } - if (minPlayers != null) { - _result.minPlayers = minPlayers; - } - if (maxPlayers != null) { - _result.maxPlayers = maxPlayers; - } - if (timeRemaining != null) { - _result.timeRemaining = timeRemaining; - } - return _result; - } - factory TierStatusUpdate_TierStatus.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TierStatusUpdate_TierStatus.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TierStatusUpdate_TierStatus clone() => TierStatusUpdate_TierStatus()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TierStatusUpdate_TierStatus copyWith(void Function(TierStatusUpdate_TierStatus) updates) => super.copyWith((message) => updates(message as TierStatusUpdate_TierStatus)) as TierStatusUpdate_TierStatus; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TierStatusUpdate_TierStatus create() => TierStatusUpdate_TierStatus._(); - TierStatusUpdate_TierStatus createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TierStatusUpdate_TierStatus getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TierStatusUpdate_TierStatus? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get players => $_getIZ(0); - @$pb.TagNumber(1) - set players($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasPlayers() => $_has(0); - @$pb.TagNumber(1) - void clearPlayers() => clearField(1); - - @$pb.TagNumber(2) - $core.int get minPlayers => $_getIZ(1); - @$pb.TagNumber(2) - set minPlayers($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasMinPlayers() => $_has(1); - @$pb.TagNumber(2) - void clearMinPlayers() => clearField(2); - - @$pb.TagNumber(3) - $core.int get maxPlayers => $_getIZ(2); - @$pb.TagNumber(3) - set maxPlayers($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasMaxPlayers() => $_has(2); - @$pb.TagNumber(3) - void clearMaxPlayers() => clearField(3); - - @$pb.TagNumber(4) - $core.int get timeRemaining => $_getIZ(3); - @$pb.TagNumber(4) - set timeRemaining($core.int v) { $_setUnsignedInt32(3, v); } - @$pb.TagNumber(4) - $core.bool hasTimeRemaining() => $_has(3); - @$pb.TagNumber(4) - void clearTimeRemaining() => clearField(4); -} - -class TierStatusUpdate extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TierStatusUpdate', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..m<$fixnum.Int64, TierStatusUpdate_TierStatus>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'statuses', entryClassName: 'TierStatusUpdate.StatusesEntry', keyFieldType: $pb.PbFieldType.OU6, valueFieldType: $pb.PbFieldType.OM, valueCreator: TierStatusUpdate_TierStatus.create, packageName: const $pb.PackageName('fusion')) - ..hasRequiredFields = false - ; - - TierStatusUpdate._() : super(); - factory TierStatusUpdate({ - $core.Map<$fixnum.Int64, TierStatusUpdate_TierStatus>? statuses, - }) { - final _result = create(); - if (statuses != null) { - _result.statuses.addAll(statuses); - } - return _result; - } - factory TierStatusUpdate.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TierStatusUpdate.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TierStatusUpdate clone() => TierStatusUpdate()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TierStatusUpdate copyWith(void Function(TierStatusUpdate) updates) => super.copyWith((message) => updates(message as TierStatusUpdate)) as TierStatusUpdate; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TierStatusUpdate create() => TierStatusUpdate._(); - TierStatusUpdate createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TierStatusUpdate getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TierStatusUpdate? _defaultInstance; - - @$pb.TagNumber(1) - $core.Map<$fixnum.Int64, TierStatusUpdate_TierStatus> get statuses => $_getMap(0); -} - -class FusionBegin extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FusionBegin', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tier', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertDomain', $pb.PbFieldType.QY) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertPort', $pb.PbFieldType.QU3) - ..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertSsl') - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverTime', $pb.PbFieldType.QF6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - FusionBegin._() : super(); - factory FusionBegin({ - $fixnum.Int64? tier, - $core.List<$core.int>? covertDomain, - $core.int? covertPort, - $core.bool? covertSsl, - $fixnum.Int64? serverTime, - }) { - final _result = create(); - if (tier != null) { - _result.tier = tier; - } - if (covertDomain != null) { - _result.covertDomain = covertDomain; - } - if (covertPort != null) { - _result.covertPort = covertPort; - } - if (covertSsl != null) { - _result.covertSsl = covertSsl; - } - if (serverTime != null) { - _result.serverTime = serverTime; - } - return _result; - } - factory FusionBegin.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FusionBegin.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FusionBegin clone() => FusionBegin()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FusionBegin copyWith(void Function(FusionBegin) updates) => super.copyWith((message) => updates(message as FusionBegin)) as FusionBegin; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FusionBegin create() => FusionBegin._(); - FusionBegin createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FusionBegin getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FusionBegin? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get tier => $_getI64(0); - @$pb.TagNumber(1) - set tier($fixnum.Int64 v) { $_setInt64(0, v); } - @$pb.TagNumber(1) - $core.bool hasTier() => $_has(0); - @$pb.TagNumber(1) - void clearTier() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get covertDomain => $_getN(1); - @$pb.TagNumber(2) - set covertDomain($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasCovertDomain() => $_has(1); - @$pb.TagNumber(2) - void clearCovertDomain() => clearField(2); - - @$pb.TagNumber(3) - $core.int get covertPort => $_getIZ(2); - @$pb.TagNumber(3) - set covertPort($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasCovertPort() => $_has(2); - @$pb.TagNumber(3) - void clearCovertPort() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get covertSsl => $_getBF(3); - @$pb.TagNumber(4) - set covertSsl($core.bool v) { $_setBool(3, v); } - @$pb.TagNumber(4) - $core.bool hasCovertSsl() => $_has(3); - @$pb.TagNumber(4) - void clearCovertSsl() => clearField(4); - - @$pb.TagNumber(5) - $fixnum.Int64 get serverTime => $_getI64(4); - @$pb.TagNumber(5) - set serverTime($fixnum.Int64 v) { $_setInt64(4, v); } - @$pb.TagNumber(5) - $core.bool hasServerTime() => $_has(4); - @$pb.TagNumber(5) - void clearServerTime() => clearField(5); -} - -class StartRound extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'StartRound', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.QY) - ..p<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindNoncePoints', $pb.PbFieldType.PY) - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverTime', $pb.PbFieldType.QF6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - StartRound._() : super(); - factory StartRound({ - $core.List<$core.int>? roundPubkey, - $core.Iterable<$core.List<$core.int>>? blindNoncePoints, - $fixnum.Int64? serverTime, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (blindNoncePoints != null) { - _result.blindNoncePoints.addAll(blindNoncePoints); - } - if (serverTime != null) { - _result.serverTime = serverTime; - } - return _result; - } - factory StartRound.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory StartRound.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - StartRound clone() => StartRound()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - StartRound copyWith(void Function(StartRound) updates) => super.copyWith((message) => updates(message as StartRound)) as StartRound; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static StartRound create() => StartRound._(); - StartRound createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static StartRound getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static StartRound? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.List<$core.int>> get blindNoncePoints => $_getList(1); - - @$pb.TagNumber(5) - $fixnum.Int64 get serverTime => $_getI64(2); - @$pb.TagNumber(5) - set serverTime($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(5) - $core.bool hasServerTime() => $_has(2); - @$pb.TagNumber(5) - void clearServerTime() => clearField(5); -} - -class PlayerCommit extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PlayerCommit', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'initialCommitments', $pb.PbFieldType.PY) - ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'excessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pedersenTotalNonce', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'randomNumberCommitment', $pb.PbFieldType.QY) - ..p<$core.List<$core.int>>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindSigRequests', $pb.PbFieldType.PY) - ; - - PlayerCommit._() : super(); - factory PlayerCommit({ - $core.Iterable<$core.List<$core.int>>? initialCommitments, - $fixnum.Int64? excessFee, - $core.List<$core.int>? pedersenTotalNonce, - $core.List<$core.int>? randomNumberCommitment, - $core.Iterable<$core.List<$core.int>>? blindSigRequests, - }) { - final _result = create(); - if (initialCommitments != null) { - _result.initialCommitments.addAll(initialCommitments); - } - if (excessFee != null) { - _result.excessFee = excessFee; - } - if (pedersenTotalNonce != null) { - _result.pedersenTotalNonce = pedersenTotalNonce; - } - if (randomNumberCommitment != null) { - _result.randomNumberCommitment = randomNumberCommitment; - } - if (blindSigRequests != null) { - _result.blindSigRequests.addAll(blindSigRequests); - } - return _result; - } - factory PlayerCommit.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PlayerCommit.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PlayerCommit clone() => PlayerCommit()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PlayerCommit copyWith(void Function(PlayerCommit) updates) => super.copyWith((message) => updates(message as PlayerCommit)) as PlayerCommit; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PlayerCommit create() => PlayerCommit._(); - PlayerCommit createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PlayerCommit getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static PlayerCommit? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get initialCommitments => $_getList(0); - - @$pb.TagNumber(2) - $fixnum.Int64 get excessFee => $_getI64(1); - @$pb.TagNumber(2) - set excessFee($fixnum.Int64 v) { $_setInt64(1, v); } - @$pb.TagNumber(2) - $core.bool hasExcessFee() => $_has(1); - @$pb.TagNumber(2) - void clearExcessFee() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pedersenTotalNonce => $_getN(2); - @$pb.TagNumber(3) - set pedersenTotalNonce($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPedersenTotalNonce() => $_has(2); - @$pb.TagNumber(3) - void clearPedersenTotalNonce() => clearField(3); - - @$pb.TagNumber(4) - $core.List<$core.int> get randomNumberCommitment => $_getN(3); - @$pb.TagNumber(4) - set randomNumberCommitment($core.List<$core.int> v) { $_setBytes(3, v); } - @$pb.TagNumber(4) - $core.bool hasRandomNumberCommitment() => $_has(3); - @$pb.TagNumber(4) - void clearRandomNumberCommitment() => clearField(4); - - @$pb.TagNumber(5) - $core.List<$core.List<$core.int>> get blindSigRequests => $_getList(4); -} - -class BlindSigResponses extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlindSigResponses', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scalars', $pb.PbFieldType.PY) - ..hasRequiredFields = false - ; - - BlindSigResponses._() : super(); - factory BlindSigResponses({ - $core.Iterable<$core.List<$core.int>>? scalars, - }) { - final _result = create(); - if (scalars != null) { - _result.scalars.addAll(scalars); - } - return _result; - } - factory BlindSigResponses.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlindSigResponses.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlindSigResponses clone() => BlindSigResponses()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlindSigResponses copyWith(void Function(BlindSigResponses) updates) => super.copyWith((message) => updates(message as BlindSigResponses)) as BlindSigResponses; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlindSigResponses create() => BlindSigResponses._(); - BlindSigResponses createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlindSigResponses getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlindSigResponses? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get scalars => $_getList(0); -} - -class AllCommitments extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AllCommitments', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'initialCommitments', $pb.PbFieldType.PY) - ..hasRequiredFields = false - ; - - AllCommitments._() : super(); - factory AllCommitments({ - $core.Iterable<$core.List<$core.int>>? initialCommitments, - }) { - final _result = create(); - if (initialCommitments != null) { - _result.initialCommitments.addAll(initialCommitments); - } - return _result; - } - factory AllCommitments.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AllCommitments.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AllCommitments clone() => AllCommitments()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AllCommitments copyWith(void Function(AllCommitments) updates) => super.copyWith((message) => updates(message as AllCommitments)) as AllCommitments; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static AllCommitments create() => AllCommitments._(); - AllCommitments createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static AllCommitments getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static AllCommitments? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get initialCommitments => $_getList(0); -} - -class CovertComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'component', $pb.PbFieldType.QY) - ; - - CovertComponent._() : super(); - factory CovertComponent({ - $core.List<$core.int>? roundPubkey, - $core.List<$core.int>? signature, - $core.List<$core.int>? component, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (signature != null) { - _result.signature = signature; - } - if (component != null) { - _result.component = component; - } - return _result; - } - factory CovertComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertComponent clone() => CovertComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertComponent copyWith(void Function(CovertComponent) updates) => super.copyWith((message) => updates(message as CovertComponent)) as CovertComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertComponent create() => CovertComponent._(); - CovertComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get signature => $_getN(1); - @$pb.TagNumber(2) - set signature($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSignature() => $_has(1); - @$pb.TagNumber(2) - void clearSignature() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get component => $_getN(2); - @$pb.TagNumber(3) - set component($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasComponent() => $_has(2); - @$pb.TagNumber(3) - void clearComponent() => clearField(3); -} - -class ShareCovertComponents extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ShareCovertComponents', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'components', $pb.PbFieldType.PY) - ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'skipSignatures') - ..a<$core.List<$core.int>>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sessionHash', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - - ShareCovertComponents._() : super(); - factory ShareCovertComponents({ - $core.Iterable<$core.List<$core.int>>? components, - $core.bool? skipSignatures, - $core.List<$core.int>? sessionHash, - }) { - final _result = create(); - if (components != null) { - _result.components.addAll(components); - } - if (skipSignatures != null) { - _result.skipSignatures = skipSignatures; - } - if (sessionHash != null) { - _result.sessionHash = sessionHash; - } - return _result; - } - factory ShareCovertComponents.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ShareCovertComponents.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ShareCovertComponents clone() => ShareCovertComponents()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ShareCovertComponents copyWith(void Function(ShareCovertComponents) updates) => super.copyWith((message) => updates(message as ShareCovertComponents)) as ShareCovertComponents; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ShareCovertComponents create() => ShareCovertComponents._(); - ShareCovertComponents createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ShareCovertComponents getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ShareCovertComponents? _defaultInstance; - - @$pb.TagNumber(4) - $core.List<$core.List<$core.int>> get components => $_getList(0); - - @$pb.TagNumber(5) - $core.bool get skipSignatures => $_getBF(1); - @$pb.TagNumber(5) - set skipSignatures($core.bool v) { $_setBool(1, v); } - @$pb.TagNumber(5) - $core.bool hasSkipSignatures() => $_has(1); - @$pb.TagNumber(5) - void clearSkipSignatures() => clearField(5); - - @$pb.TagNumber(6) - $core.List<$core.int> get sessionHash => $_getN(2); - @$pb.TagNumber(6) - set sessionHash($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(6) - $core.bool hasSessionHash() => $_has(2); - @$pb.TagNumber(6) - void clearSessionHash() => clearField(6); -} - -class CovertTransactionSignature extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertTransactionSignature', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.OY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'whichInput', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txsignature', $pb.PbFieldType.QY) - ; - - CovertTransactionSignature._() : super(); - factory CovertTransactionSignature({ - $core.List<$core.int>? roundPubkey, - $core.int? whichInput, - $core.List<$core.int>? txsignature, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (whichInput != null) { - _result.whichInput = whichInput; - } - if (txsignature != null) { - _result.txsignature = txsignature; - } - return _result; - } - factory CovertTransactionSignature.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertTransactionSignature.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertTransactionSignature clone() => CovertTransactionSignature()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertTransactionSignature copyWith(void Function(CovertTransactionSignature) updates) => super.copyWith((message) => updates(message as CovertTransactionSignature)) as CovertTransactionSignature; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertTransactionSignature create() => CovertTransactionSignature._(); - CovertTransactionSignature createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertTransactionSignature getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertTransactionSignature? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.int get whichInput => $_getIZ(1); - @$pb.TagNumber(2) - set whichInput($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasWhichInput() => $_has(1); - @$pb.TagNumber(2) - void clearWhichInput() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get txsignature => $_getN(2); - @$pb.TagNumber(3) - set txsignature($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasTxsignature() => $_has(2); - @$pb.TagNumber(3) - void clearTxsignature() => clearField(3); -} - -class FusionResult extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FusionResult', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.bool>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ok', $pb.PbFieldType.QB) - ..p<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txsignatures', $pb.PbFieldType.PY) - ..p<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'badComponents', $pb.PbFieldType.PU3) - ; - - FusionResult._() : super(); - factory FusionResult({ - $core.bool? ok, - $core.Iterable<$core.List<$core.int>>? txsignatures, - $core.Iterable<$core.int>? badComponents, - }) { - final _result = create(); - if (ok != null) { - _result.ok = ok; - } - if (txsignatures != null) { - _result.txsignatures.addAll(txsignatures); - } - if (badComponents != null) { - _result.badComponents.addAll(badComponents); - } - return _result; - } - factory FusionResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FusionResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FusionResult clone() => FusionResult()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FusionResult copyWith(void Function(FusionResult) updates) => super.copyWith((message) => updates(message as FusionResult)) as FusionResult; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FusionResult create() => FusionResult._(); - FusionResult createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FusionResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FusionResult? _defaultInstance; - - @$pb.TagNumber(1) - $core.bool get ok => $_getBF(0); - @$pb.TagNumber(1) - set ok($core.bool v) { $_setBool(0, v); } - @$pb.TagNumber(1) - $core.bool hasOk() => $_has(0); - @$pb.TagNumber(1) - void clearOk() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.List<$core.int>> get txsignatures => $_getList(1); - - @$pb.TagNumber(3) - $core.List<$core.int> get badComponents => $_getList(2); -} - -class MyProofsList extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MyProofsList', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'encryptedProofs', $pb.PbFieldType.PY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'randomNumber', $pb.PbFieldType.QY) - ; - - MyProofsList._() : super(); - factory MyProofsList({ - $core.Iterable<$core.List<$core.int>>? encryptedProofs, - $core.List<$core.int>? randomNumber, - }) { - final _result = create(); - if (encryptedProofs != null) { - _result.encryptedProofs.addAll(encryptedProofs); - } - if (randomNumber != null) { - _result.randomNumber = randomNumber; - } - return _result; - } - factory MyProofsList.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory MyProofsList.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - MyProofsList clone() => MyProofsList()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - MyProofsList copyWith(void Function(MyProofsList) updates) => super.copyWith((message) => updates(message as MyProofsList)) as MyProofsList; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static MyProofsList create() => MyProofsList._(); - MyProofsList createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static MyProofsList getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static MyProofsList? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get encryptedProofs => $_getList(0); - - @$pb.TagNumber(2) - $core.List<$core.int> get randomNumber => $_getN(1); - @$pb.TagNumber(2) - set randomNumber($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasRandomNumber() => $_has(1); - @$pb.TagNumber(2) - void clearRandomNumber() => clearField(2); -} - -class TheirProofsList_RelayedProof extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TheirProofsList.RelayedProof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'encryptedProof', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcCommitmentIdx', $pb.PbFieldType.QU3) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstKeyIdx', $pb.PbFieldType.QU3) - ; - - TheirProofsList_RelayedProof._() : super(); - factory TheirProofsList_RelayedProof({ - $core.List<$core.int>? encryptedProof, - $core.int? srcCommitmentIdx, - $core.int? dstKeyIdx, - }) { - final _result = create(); - if (encryptedProof != null) { - _result.encryptedProof = encryptedProof; - } - if (srcCommitmentIdx != null) { - _result.srcCommitmentIdx = srcCommitmentIdx; - } - if (dstKeyIdx != null) { - _result.dstKeyIdx = dstKeyIdx; - } - return _result; - } - factory TheirProofsList_RelayedProof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TheirProofsList_RelayedProof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TheirProofsList_RelayedProof clone() => TheirProofsList_RelayedProof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TheirProofsList_RelayedProof copyWith(void Function(TheirProofsList_RelayedProof) updates) => super.copyWith((message) => updates(message as TheirProofsList_RelayedProof)) as TheirProofsList_RelayedProof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TheirProofsList_RelayedProof create() => TheirProofsList_RelayedProof._(); - TheirProofsList_RelayedProof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TheirProofsList_RelayedProof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TheirProofsList_RelayedProof? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get encryptedProof => $_getN(0); - @$pb.TagNumber(1) - set encryptedProof($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasEncryptedProof() => $_has(0); - @$pb.TagNumber(1) - void clearEncryptedProof() => clearField(1); - - @$pb.TagNumber(2) - $core.int get srcCommitmentIdx => $_getIZ(1); - @$pb.TagNumber(2) - set srcCommitmentIdx($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasSrcCommitmentIdx() => $_has(1); - @$pb.TagNumber(2) - void clearSrcCommitmentIdx() => clearField(2); - - @$pb.TagNumber(3) - $core.int get dstKeyIdx => $_getIZ(2); - @$pb.TagNumber(3) - set dstKeyIdx($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasDstKeyIdx() => $_has(2); - @$pb.TagNumber(3) - void clearDstKeyIdx() => clearField(3); -} - -class TheirProofsList extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TheirProofsList', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'proofs', $pb.PbFieldType.PM, subBuilder: TheirProofsList_RelayedProof.create) - ; - - TheirProofsList._() : super(); - factory TheirProofsList({ - $core.Iterable? proofs, - }) { - final _result = create(); - if (proofs != null) { - _result.proofs.addAll(proofs); - } - return _result; - } - factory TheirProofsList.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TheirProofsList.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TheirProofsList clone() => TheirProofsList()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TheirProofsList copyWith(void Function(TheirProofsList) updates) => super.copyWith((message) => updates(message as TheirProofsList)) as TheirProofsList; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TheirProofsList create() => TheirProofsList._(); - TheirProofsList createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TheirProofsList getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TheirProofsList? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get proofs => $_getList(0); -} - -enum Blames_BlameProof_Decrypter { - sessionKey, - privkey, - notSet -} - -class Blames_BlameProof extends $pb.GeneratedMessage { - static const $core.Map<$core.int, Blames_BlameProof_Decrypter> _Blames_BlameProof_DecrypterByTag = { - 2 : Blames_BlameProof_Decrypter.sessionKey, - 3 : Blames_BlameProof_Decrypter.privkey, - 0 : Blames_BlameProof_Decrypter.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Blames.BlameProof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [2, 3]) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'whichProof', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sessionKey', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'privkey', $pb.PbFieldType.OY) - ..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'needLookupBlockchain') - ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blameReason') - ; - - Blames_BlameProof._() : super(); - factory Blames_BlameProof({ - $core.int? whichProof, - $core.List<$core.int>? sessionKey, - $core.List<$core.int>? privkey, - $core.bool? needLookupBlockchain, - $core.String? blameReason, - }) { - final _result = create(); - if (whichProof != null) { - _result.whichProof = whichProof; - } - if (sessionKey != null) { - _result.sessionKey = sessionKey; - } - if (privkey != null) { - _result.privkey = privkey; - } - if (needLookupBlockchain != null) { - _result.needLookupBlockchain = needLookupBlockchain; - } - if (blameReason != null) { - _result.blameReason = blameReason; - } - return _result; - } - factory Blames_BlameProof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Blames_BlameProof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Blames_BlameProof clone() => Blames_BlameProof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Blames_BlameProof copyWith(void Function(Blames_BlameProof) updates) => super.copyWith((message) => updates(message as Blames_BlameProof)) as Blames_BlameProof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Blames_BlameProof create() => Blames_BlameProof._(); - Blames_BlameProof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Blames_BlameProof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Blames_BlameProof? _defaultInstance; - - Blames_BlameProof_Decrypter whichDecrypter() => _Blames_BlameProof_DecrypterByTag[$_whichOneof(0)]!; - void clearDecrypter() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.int get whichProof => $_getIZ(0); - @$pb.TagNumber(1) - set whichProof($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasWhichProof() => $_has(0); - @$pb.TagNumber(1) - void clearWhichProof() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get sessionKey => $_getN(1); - @$pb.TagNumber(2) - set sessionKey($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSessionKey() => $_has(1); - @$pb.TagNumber(2) - void clearSessionKey() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get privkey => $_getN(2); - @$pb.TagNumber(3) - set privkey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPrivkey() => $_has(2); - @$pb.TagNumber(3) - void clearPrivkey() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get needLookupBlockchain => $_getBF(3); - @$pb.TagNumber(4) - set needLookupBlockchain($core.bool v) { $_setBool(3, v); } - @$pb.TagNumber(4) - $core.bool hasNeedLookupBlockchain() => $_has(3); - @$pb.TagNumber(4) - void clearNeedLookupBlockchain() => clearField(4); - - @$pb.TagNumber(5) - $core.String get blameReason => $_getSZ(4); - @$pb.TagNumber(5) - set blameReason($core.String v) { $_setString(4, v); } - @$pb.TagNumber(5) - $core.bool hasBlameReason() => $_has(4); - @$pb.TagNumber(5) - void clearBlameReason() => clearField(5); -} - -class Blames extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Blames', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blames', $pb.PbFieldType.PM, subBuilder: Blames_BlameProof.create) - ; - - Blames._() : super(); - factory Blames({ - $core.Iterable? blames, - }) { - final _result = create(); - if (blames != null) { - _result.blames.addAll(blames); - } - return _result; - } - factory Blames.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Blames.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Blames clone() => Blames()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Blames copyWith(void Function(Blames) updates) => super.copyWith((message) => updates(message as Blames)) as Blames; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Blames create() => Blames._(); - Blames createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Blames getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Blames? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get blames => $_getList(0); -} - -class RestartRound extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RestartRound', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - RestartRound._() : super(); - factory RestartRound() => create(); - factory RestartRound.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RestartRound.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RestartRound clone() => RestartRound()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RestartRound copyWith(void Function(RestartRound) updates) => super.copyWith((message) => updates(message as RestartRound)) as RestartRound; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RestartRound create() => RestartRound._(); - RestartRound createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RestartRound getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RestartRound? _defaultInstance; -} - -class Error extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Error', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message') - ..hasRequiredFields = false - ; - - Error._() : super(); - factory Error({ - $core.String? message, - }) { - final _result = create(); - if (message != null) { - _result.message = message; - } - return _result; - } - factory Error.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Error.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Error clone() => Error()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Error copyWith(void Function(Error) updates) => super.copyWith((message) => updates(message as Error)) as Error; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Error create() => Error._(); - Error createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Error getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Error? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get message => $_getSZ(0); - @$pb.TagNumber(1) - set message($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasMessage() => $_has(0); - @$pb.TagNumber(1) - void clearMessage() => clearField(1); -} - -class Ping extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Ping', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - Ping._() : super(); - factory Ping() => create(); - factory Ping.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Ping.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Ping clone() => Ping()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Ping copyWith(void Function(Ping) updates) => super.copyWith((message) => updates(message as Ping)) as Ping; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Ping create() => Ping._(); - Ping createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Ping getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Ping? _defaultInstance; -} - -class OK extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OK', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - OK._() : super(); - factory OK() => create(); - factory OK.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory OK.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OK clone() => OK()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OK copyWith(void Function(OK) updates) => super.copyWith((message) => updates(message as OK)) as OK; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OK create() => OK._(); - OK createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OK getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static OK? _defaultInstance; -} - -enum ClientMessage_Msg { - clienthello, - joinpools, - playercommit, - myproofslist, - blames, - notSet -} - -class ClientMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, ClientMessage_Msg> _ClientMessage_MsgByTag = { - 1 : ClientMessage_Msg.clienthello, - 2 : ClientMessage_Msg.joinpools, - 3 : ClientMessage_Msg.playercommit, - 5 : ClientMessage_Msg.myproofslist, - 6 : ClientMessage_Msg.blames, - 0 : ClientMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ClientMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 5, 6]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'clienthello', subBuilder: ClientHello.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'joinpools', subBuilder: JoinPools.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'playercommit', subBuilder: PlayerCommit.create) - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'myproofslist', subBuilder: MyProofsList.create) - ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blames', subBuilder: Blames.create) - ; - - ClientMessage._() : super(); - factory ClientMessage({ - ClientHello? clienthello, - JoinPools? joinpools, - PlayerCommit? playercommit, - MyProofsList? myproofslist, - Blames? blames, - }) { - final _result = create(); - if (clienthello != null) { - _result.clienthello = clienthello; - } - if (joinpools != null) { - _result.joinpools = joinpools; - } - if (playercommit != null) { - _result.playercommit = playercommit; - } - if (myproofslist != null) { - _result.myproofslist = myproofslist; - } - if (blames != null) { - _result.blames = blames; - } - return _result; - } - factory ClientMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ClientMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ClientMessage clone() => ClientMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ClientMessage copyWith(void Function(ClientMessage) updates) => super.copyWith((message) => updates(message as ClientMessage)) as ClientMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ClientMessage create() => ClientMessage._(); - ClientMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ClientMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ClientMessage? _defaultInstance; - - ClientMessage_Msg whichMsg() => _ClientMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - ClientHello get clienthello => $_getN(0); - @$pb.TagNumber(1) - set clienthello(ClientHello v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasClienthello() => $_has(0); - @$pb.TagNumber(1) - void clearClienthello() => clearField(1); - @$pb.TagNumber(1) - ClientHello ensureClienthello() => $_ensure(0); - - @$pb.TagNumber(2) - JoinPools get joinpools => $_getN(1); - @$pb.TagNumber(2) - set joinpools(JoinPools v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasJoinpools() => $_has(1); - @$pb.TagNumber(2) - void clearJoinpools() => clearField(2); - @$pb.TagNumber(2) - JoinPools ensureJoinpools() => $_ensure(1); - - @$pb.TagNumber(3) - PlayerCommit get playercommit => $_getN(2); - @$pb.TagNumber(3) - set playercommit(PlayerCommit v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasPlayercommit() => $_has(2); - @$pb.TagNumber(3) - void clearPlayercommit() => clearField(3); - @$pb.TagNumber(3) - PlayerCommit ensurePlayercommit() => $_ensure(2); - - @$pb.TagNumber(5) - MyProofsList get myproofslist => $_getN(3); - @$pb.TagNumber(5) - set myproofslist(MyProofsList v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasMyproofslist() => $_has(3); - @$pb.TagNumber(5) - void clearMyproofslist() => clearField(5); - @$pb.TagNumber(5) - MyProofsList ensureMyproofslist() => $_ensure(3); - - @$pb.TagNumber(6) - Blames get blames => $_getN(4); - @$pb.TagNumber(6) - set blames(Blames v) { setField(6, v); } - @$pb.TagNumber(6) - $core.bool hasBlames() => $_has(4); - @$pb.TagNumber(6) - void clearBlames() => clearField(6); - @$pb.TagNumber(6) - Blames ensureBlames() => $_ensure(4); -} - -enum ServerMessage_Msg { - serverhello, - tierstatusupdate, - fusionbegin, - startround, - blindsigresponses, - allcommitments, - sharecovertcomponents, - fusionresult, - theirproofslist, - restartround, - error, - notSet -} - -class ServerMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, ServerMessage_Msg> _ServerMessage_MsgByTag = { - 1 : ServerMessage_Msg.serverhello, - 2 : ServerMessage_Msg.tierstatusupdate, - 3 : ServerMessage_Msg.fusionbegin, - 4 : ServerMessage_Msg.startround, - 5 : ServerMessage_Msg.blindsigresponses, - 6 : ServerMessage_Msg.allcommitments, - 7 : ServerMessage_Msg.sharecovertcomponents, - 8 : ServerMessage_Msg.fusionresult, - 9 : ServerMessage_Msg.theirproofslist, - 14 : ServerMessage_Msg.restartround, - 15 : ServerMessage_Msg.error, - 0 : ServerMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ServerMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverhello', subBuilder: ServerHello.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tierstatusupdate', subBuilder: TierStatusUpdate.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fusionbegin', subBuilder: FusionBegin.create) - ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startround', subBuilder: StartRound.create) - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindsigresponses', subBuilder: BlindSigResponses.create) - ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allcommitments', subBuilder: AllCommitments.create) - ..aOM(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sharecovertcomponents', subBuilder: ShareCovertComponents.create) - ..aOM(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fusionresult', subBuilder: FusionResult.create) - ..aOM(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'theirproofslist', subBuilder: TheirProofsList.create) - ..aOM(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'restartround', subBuilder: RestartRound.create) - ..aOM(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: Error.create) - ; - - ServerMessage._() : super(); - factory ServerMessage({ - ServerHello? serverhello, - TierStatusUpdate? tierstatusupdate, - FusionBegin? fusionbegin, - StartRound? startround, - BlindSigResponses? blindsigresponses, - AllCommitments? allcommitments, - ShareCovertComponents? sharecovertcomponents, - FusionResult? fusionresult, - TheirProofsList? theirproofslist, - RestartRound? restartround, - Error? error, - }) { - final _result = create(); - if (serverhello != null) { - _result.serverhello = serverhello; - } - if (tierstatusupdate != null) { - _result.tierstatusupdate = tierstatusupdate; - } - if (fusionbegin != null) { - _result.fusionbegin = fusionbegin; - } - if (startround != null) { - _result.startround = startround; - } - if (blindsigresponses != null) { - _result.blindsigresponses = blindsigresponses; - } - if (allcommitments != null) { - _result.allcommitments = allcommitments; - } - if (sharecovertcomponents != null) { - _result.sharecovertcomponents = sharecovertcomponents; - } - if (fusionresult != null) { - _result.fusionresult = fusionresult; - } - if (theirproofslist != null) { - _result.theirproofslist = theirproofslist; - } - if (restartround != null) { - _result.restartround = restartround; - } - if (error != null) { - _result.error = error; - } - return _result; - } - factory ServerMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ServerMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ServerMessage clone() => ServerMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ServerMessage copyWith(void Function(ServerMessage) updates) => super.copyWith((message) => updates(message as ServerMessage)) as ServerMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ServerMessage create() => ServerMessage._(); - ServerMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ServerMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ServerMessage? _defaultInstance; - - ServerMessage_Msg whichMsg() => _ServerMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - ServerHello get serverhello => $_getN(0); - @$pb.TagNumber(1) - set serverhello(ServerHello v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasServerhello() => $_has(0); - @$pb.TagNumber(1) - void clearServerhello() => clearField(1); - @$pb.TagNumber(1) - ServerHello ensureServerhello() => $_ensure(0); - - @$pb.TagNumber(2) - TierStatusUpdate get tierstatusupdate => $_getN(1); - @$pb.TagNumber(2) - set tierstatusupdate(TierStatusUpdate v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasTierstatusupdate() => $_has(1); - @$pb.TagNumber(2) - void clearTierstatusupdate() => clearField(2); - @$pb.TagNumber(2) - TierStatusUpdate ensureTierstatusupdate() => $_ensure(1); - - @$pb.TagNumber(3) - FusionBegin get fusionbegin => $_getN(2); - @$pb.TagNumber(3) - set fusionbegin(FusionBegin v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasFusionbegin() => $_has(2); - @$pb.TagNumber(3) - void clearFusionbegin() => clearField(3); - @$pb.TagNumber(3) - FusionBegin ensureFusionbegin() => $_ensure(2); - - @$pb.TagNumber(4) - StartRound get startround => $_getN(3); - @$pb.TagNumber(4) - set startround(StartRound v) { setField(4, v); } - @$pb.TagNumber(4) - $core.bool hasStartround() => $_has(3); - @$pb.TagNumber(4) - void clearStartround() => clearField(4); - @$pb.TagNumber(4) - StartRound ensureStartround() => $_ensure(3); - - @$pb.TagNumber(5) - BlindSigResponses get blindsigresponses => $_getN(4); - @$pb.TagNumber(5) - set blindsigresponses(BlindSigResponses v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasBlindsigresponses() => $_has(4); - @$pb.TagNumber(5) - void clearBlindsigresponses() => clearField(5); - @$pb.TagNumber(5) - BlindSigResponses ensureBlindsigresponses() => $_ensure(4); - - @$pb.TagNumber(6) - AllCommitments get allcommitments => $_getN(5); - @$pb.TagNumber(6) - set allcommitments(AllCommitments v) { setField(6, v); } - @$pb.TagNumber(6) - $core.bool hasAllcommitments() => $_has(5); - @$pb.TagNumber(6) - void clearAllcommitments() => clearField(6); - @$pb.TagNumber(6) - AllCommitments ensureAllcommitments() => $_ensure(5); - - @$pb.TagNumber(7) - ShareCovertComponents get sharecovertcomponents => $_getN(6); - @$pb.TagNumber(7) - set sharecovertcomponents(ShareCovertComponents v) { setField(7, v); } - @$pb.TagNumber(7) - $core.bool hasSharecovertcomponents() => $_has(6); - @$pb.TagNumber(7) - void clearSharecovertcomponents() => clearField(7); - @$pb.TagNumber(7) - ShareCovertComponents ensureSharecovertcomponents() => $_ensure(6); - - @$pb.TagNumber(8) - FusionResult get fusionresult => $_getN(7); - @$pb.TagNumber(8) - set fusionresult(FusionResult v) { setField(8, v); } - @$pb.TagNumber(8) - $core.bool hasFusionresult() => $_has(7); - @$pb.TagNumber(8) - void clearFusionresult() => clearField(8); - @$pb.TagNumber(8) - FusionResult ensureFusionresult() => $_ensure(7); - - @$pb.TagNumber(9) - TheirProofsList get theirproofslist => $_getN(8); - @$pb.TagNumber(9) - set theirproofslist(TheirProofsList v) { setField(9, v); } - @$pb.TagNumber(9) - $core.bool hasTheirproofslist() => $_has(8); - @$pb.TagNumber(9) - void clearTheirproofslist() => clearField(9); - @$pb.TagNumber(9) - TheirProofsList ensureTheirproofslist() => $_ensure(8); - - @$pb.TagNumber(14) - RestartRound get restartround => $_getN(9); - @$pb.TagNumber(14) - set restartround(RestartRound v) { setField(14, v); } - @$pb.TagNumber(14) - $core.bool hasRestartround() => $_has(9); - @$pb.TagNumber(14) - void clearRestartround() => clearField(14); - @$pb.TagNumber(14) - RestartRound ensureRestartround() => $_ensure(9); - - @$pb.TagNumber(15) - Error get error => $_getN(10); - @$pb.TagNumber(15) - set error(Error v) { setField(15, v); } - @$pb.TagNumber(15) - $core.bool hasError() => $_has(10); - @$pb.TagNumber(15) - void clearError() => clearField(15); - @$pb.TagNumber(15) - Error ensureError() => $_ensure(10); -} - -enum CovertMessage_Msg { - component, - signature, - ping, - notSet -} - -class CovertMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, CovertMessage_Msg> _CovertMessage_MsgByTag = { - 1 : CovertMessage_Msg.component, - 2 : CovertMessage_Msg.signature, - 3 : CovertMessage_Msg.ping, - 0 : CovertMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'component', subBuilder: CovertComponent.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', subBuilder: CovertTransactionSignature.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ping', subBuilder: Ping.create) - ; - - CovertMessage._() : super(); - factory CovertMessage({ - CovertComponent? component, - CovertTransactionSignature? signature, - Ping? ping, - }) { - final _result = create(); - if (component != null) { - _result.component = component; - } - if (signature != null) { - _result.signature = signature; - } - if (ping != null) { - _result.ping = ping; - } - return _result; - } - factory CovertMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertMessage clone() => CovertMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertMessage copyWith(void Function(CovertMessage) updates) => super.copyWith((message) => updates(message as CovertMessage)) as CovertMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertMessage create() => CovertMessage._(); - CovertMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertMessage? _defaultInstance; - - CovertMessage_Msg whichMsg() => _CovertMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - CovertComponent get component => $_getN(0); - @$pb.TagNumber(1) - set component(CovertComponent v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasComponent() => $_has(0); - @$pb.TagNumber(1) - void clearComponent() => clearField(1); - @$pb.TagNumber(1) - CovertComponent ensureComponent() => $_ensure(0); - - @$pb.TagNumber(2) - CovertTransactionSignature get signature => $_getN(1); - @$pb.TagNumber(2) - set signature(CovertTransactionSignature v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasSignature() => $_has(1); - @$pb.TagNumber(2) - void clearSignature() => clearField(2); - @$pb.TagNumber(2) - CovertTransactionSignature ensureSignature() => $_ensure(1); - - @$pb.TagNumber(3) - Ping get ping => $_getN(2); - @$pb.TagNumber(3) - set ping(Ping v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasPing() => $_has(2); - @$pb.TagNumber(3) - void clearPing() => clearField(3); - @$pb.TagNumber(3) - Ping ensurePing() => $_ensure(2); -} - -enum CovertResponse_Msg { - ok, - error, - notSet -} - -class CovertResponse extends $pb.GeneratedMessage { - static const $core.Map<$core.int, CovertResponse_Msg> _CovertResponse_MsgByTag = { - 1 : CovertResponse_Msg.ok, - 15 : CovertResponse_Msg.error, - 0 : CovertResponse_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 15]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ok', subBuilder: OK.create) - ..aOM(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: Error.create) - ..hasRequiredFields = false - ; - - CovertResponse._() : super(); - factory CovertResponse({ - OK? ok, - Error? error, - }) { - final _result = create(); - if (ok != null) { - _result.ok = ok; - } - if (error != null) { - _result.error = error; - } - return _result; - } - factory CovertResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertResponse clone() => CovertResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertResponse copyWith(void Function(CovertResponse) updates) => super.copyWith((message) => updates(message as CovertResponse)) as CovertResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertResponse create() => CovertResponse._(); - CovertResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertResponse? _defaultInstance; - - CovertResponse_Msg whichMsg() => _CovertResponse_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - OK get ok => $_getN(0); - @$pb.TagNumber(1) - set ok(OK v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasOk() => $_has(0); - @$pb.TagNumber(1) - void clearOk() => clearField(1); - @$pb.TagNumber(1) - OK ensureOk() => $_ensure(0); - - @$pb.TagNumber(15) - Error get error => $_getN(1); - @$pb.TagNumber(15) - set error(Error v) { setField(15, v); } - @$pb.TagNumber(15) - $core.bool hasError() => $_has(1); - @$pb.TagNumber(15) - void clearError() => clearField(15); - @$pb.TagNumber(15) - Error ensureError() => $_ensure(1); -} - diff --git a/lib/services/cashfusion/pedersen.dart b/lib/services/cashfusion/pedersen.dart deleted file mode 100644 index d15ff7800..000000000 --- a/lib/services/cashfusion/pedersen.dart +++ /dev/null @@ -1,195 +0,0 @@ -import 'dart:typed_data'; - -import 'package:pointycastle/ecc/api.dart'; -import 'package:stackwallet/services/cashfusion/util.dart'; - -ECDomainParameters getDefaultParams() { - return ECDomainParameters("secp256k1"); -} - -class NullPointError implements Exception { - String errMsg() => 'NullPointError: Either Hpoint or HGpoint is null.'; -} - -class NonceRangeError implements Exception { - final String message; - NonceRangeError( - [this.message = "Nonce value must be in the range 0 < nonce < order"]); - String toString() => "NonceRangeError: $message"; -} - -class ResultAtInfinity implements Exception { - final String message; - ResultAtInfinity([this.message = "Result is at infinity"]); - String toString() => "ResultAtInfinity: $message"; -} - -class InsecureHPoint implements Exception { - final String message; - InsecureHPoint( - [this.message = - "The H point has a known discrete logarithm, which means the commitment setup is broken"]); - String toString() => "InsecureHPoint: $message"; -} - -class PedersenSetup { - late ECPoint _H; - late ECPoint _HG; - late ECDomainParameters _params; - ECDomainParameters get params => _params; - - PedersenSetup(this._H) { - _params = new ECDomainParameters("secp256k1"); - // validate H point - if (!Util.isPointOnCurve(_H, _params.curve)) { - throw Exception('H is not a valid point on the curve'); - } - _HG = Util.combinePubKeys([_H, _params.G]); - } - - Uint8List get H => _H.getEncoded(false); - Uint8List get HG => _HG.getEncoded(false); - - Commitment commit(BigInt amount, {BigInt? nonce, Uint8List? PUncompressed}) { - return Commitment(this, amount, nonce: nonce, PUncompressed: PUncompressed); - } -} - -class Commitment { - late PedersenSetup setup; // Added setup property to Commitment class - late BigInt amountMod; - late BigInt nonce; - late Uint8List PUncompressed; - - Commitment(this.setup, BigInt amount, - {BigInt? nonce, Uint8List? PUncompressed}) { - this.nonce = nonce ?? Util.secureRandomBigInt(setup.params.n.bitLength); - amountMod = amount % setup.params.n; - - if (this.nonce <= BigInt.zero || this.nonce >= setup.params.n) { - throw NonceRangeError(); - } - - ECPoint? Hpoint = setup._H; - ECPoint? HGpoint = setup._HG; - - if (Hpoint == null || HGpoint == null) { - throw NullPointError(); - } - - BigInt multiplier1 = (amountMod - this.nonce) % setup.params.n; - BigInt multiplier2 = this.nonce; - - ECPoint? HpointMultiplied = Hpoint * multiplier1; - ECPoint? HGpointMultiplied = HGpoint * multiplier2; - - ECPoint? Ppoint = HpointMultiplied != null && HGpointMultiplied != null - ? HpointMultiplied + HGpointMultiplied - : null; - - if (Ppoint == setup.params.curve.infinity) { - throw ResultAtInfinity(); - } - - this.PUncompressed = - PUncompressed ?? Ppoint?.getEncoded(false) ?? Uint8List(0); - } - - void calcInitial(PedersenSetup setup, BigInt amount) { - amountMod = amount % setup.params.n; - nonce = Util.secureRandomBigInt(setup.params.n.bitLength); - - ECPoint? Hpoint = setup._H; - ECPoint? HGpoint = setup._HG; - - if (nonce <= BigInt.zero || nonce >= setup.params.n) { - throw NonceRangeError(); - } - - if (Hpoint == null || HGpoint == null) { - throw NullPointError(); - } - - BigInt multiplier1 = amountMod; - BigInt multiplier2 = nonce; - - ECPoint? HpointMultiplied = Hpoint * multiplier1; - ECPoint? HGpointMultiplied = HGpoint * multiplier2; - - ECPoint? Ppoint = HpointMultiplied != null && HGpointMultiplied != null - ? HpointMultiplied + HGpointMultiplied - : null; - - if (Ppoint == setup.params.curve.infinity) { - throw ResultAtInfinity(); - } - - PUncompressed = Ppoint?.getEncoded(false) ?? Uint8List(0); - } - - static Uint8List add_points(Iterable pointsIterable) { - ECDomainParameters params = - getDefaultParams(); // Using helper function here - var pointList = - pointsIterable.map((pser) => Util.ser_to_point(pser, params)).toList(); - - if (pointList.isEmpty) { - throw ArgumentError('Empty list'); - } - - ECPoint pSum = - pointList.first; // Initialize pSum with the first point in the list - - for (var i = 1; i < pointList.length; i++) { - pSum = (pSum + pointList[i])!; - } - - if (pSum == params.curve.infinity) { - throw Exception('Result is at infinity'); - } - - return Util.point_to_ser(pSum, false); - } - - Commitment addCommitments(Iterable commitmentIterable) { - BigInt ktotal = BigInt.zero; // Changed to BigInt from int - BigInt atotal = BigInt.zero; // Changed to BigInt from int - List points = []; - List setups = []; // Changed Setup to PedersenSetup - for (Commitment c in commitmentIterable) { - ktotal += c.nonce; - atotal += c.amountMod; // Changed from amount to amountMod - points.add(c.PUncompressed); - setups.add(c.setup); - } - - if (points.isEmpty) { - throw ArgumentError('Empty list'); - } - - PedersenSetup setup = setups[0]; // Changed Setup to PedersenSetup - if (!setups.every((s) => s == setup)) { - throw ArgumentError('Mismatched setups'); - } - - ktotal = ktotal % setup.params.n; // Changed order to setup.params.n - - if (ktotal == BigInt.zero) { - // Changed comparison from 0 to BigInt.zero - throw Exception('Nonce range error'); - } - - Uint8List? PUncompressed; - if (points.length < 512) { - try { - PUncompressed = add_points(points); - } on Exception { - PUncompressed = null; - } - } else { - PUncompressed = null; - } - return Commitment(setup, atotal, - nonce: ktotal, PUncompressed: PUncompressed); - } -} diff --git a/lib/services/cashfusion/protobuf/build-proto-fusion.sh b/lib/services/cashfusion/protobuf/build-proto-fusion.sh deleted file mode 100644 index 75be9ab37..000000000 --- a/lib/services/cashfusion/protobuf/build-proto-fusion.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# This script will build the dart files based on fusion.proto. Navigate to the protobuf directory where the fusion.proto is and run this, then copy the needed files to lib. - -# The path to your .proto file. Adjust this if necessary. -PROTO_FILE="fusion.proto" - -# Run the protoc command. -protoc --dart_out=grpc:. $PROTO_FILE - -# After this, You should manually copy any needed dart files that were generated to the lib folder. diff --git a/lib/services/cashfusion/protobuf/fusion.pb.dart b/lib/services/cashfusion/protobuf/fusion.pb.dart deleted file mode 100644 index dac659f95..000000000 --- a/lib/services/cashfusion/protobuf/fusion.pb.dart +++ /dev/null @@ -1,2501 +0,0 @@ -/// -// Generated code. Do not modify. -// source: fusion.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; - -import 'package:fixnum/fixnum.dart' as $fixnum; -import 'package:protobuf/protobuf.dart' as $pb; - -class InputComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InputComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'prevTxid', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'prevIndex', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pubkey', $pb.PbFieldType.QY) - ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amount', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - InputComponent._() : super(); - factory InputComponent({ - $core.List<$core.int>? prevTxid, - $core.int? prevIndex, - $core.List<$core.int>? pubkey, - $fixnum.Int64? amount, - }) { - final _result = create(); - if (prevTxid != null) { - _result.prevTxid = prevTxid; - } - if (prevIndex != null) { - _result.prevIndex = prevIndex; - } - if (pubkey != null) { - _result.pubkey = pubkey; - } - if (amount != null) { - _result.amount = amount; - } - return _result; - } - factory InputComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory InputComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - InputComponent clone() => InputComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - InputComponent copyWith(void Function(InputComponent) updates) => super.copyWith((message) => updates(message as InputComponent)) as InputComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static InputComponent create() => InputComponent._(); - InputComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static InputComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static InputComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get prevTxid => $_getN(0); - @$pb.TagNumber(1) - set prevTxid($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasPrevTxid() => $_has(0); - @$pb.TagNumber(1) - void clearPrevTxid() => clearField(1); - - @$pb.TagNumber(2) - $core.int get prevIndex => $_getIZ(1); - @$pb.TagNumber(2) - set prevIndex($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasPrevIndex() => $_has(1); - @$pb.TagNumber(2) - void clearPrevIndex() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pubkey => $_getN(2); - @$pb.TagNumber(3) - set pubkey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPubkey() => $_has(2); - @$pb.TagNumber(3) - void clearPubkey() => clearField(3); - - @$pb.TagNumber(4) - $fixnum.Int64 get amount => $_getI64(3); - @$pb.TagNumber(4) - set amount($fixnum.Int64 v) { $_setInt64(3, v); } - @$pb.TagNumber(4) - $core.bool hasAmount() => $_has(3); - @$pb.TagNumber(4) - void clearAmount() => clearField(4); -} - -class OutputComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OutputComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scriptpubkey', $pb.PbFieldType.QY) - ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amount', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - OutputComponent._() : super(); - factory OutputComponent({ - $core.List<$core.int>? scriptpubkey, - $fixnum.Int64? amount, - }) { - final _result = create(); - if (scriptpubkey != null) { - _result.scriptpubkey = scriptpubkey; - } - if (amount != null) { - _result.amount = amount; - } - return _result; - } - factory OutputComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory OutputComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OutputComponent clone() => OutputComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OutputComponent copyWith(void Function(OutputComponent) updates) => super.copyWith((message) => updates(message as OutputComponent)) as OutputComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OutputComponent create() => OutputComponent._(); - OutputComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OutputComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static OutputComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get scriptpubkey => $_getN(0); - @$pb.TagNumber(1) - set scriptpubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasScriptpubkey() => $_has(0); - @$pb.TagNumber(1) - void clearScriptpubkey() => clearField(1); - - @$pb.TagNumber(2) - $fixnum.Int64 get amount => $_getI64(1); - @$pb.TagNumber(2) - set amount($fixnum.Int64 v) { $_setInt64(1, v); } - @$pb.TagNumber(2) - $core.bool hasAmount() => $_has(1); - @$pb.TagNumber(2) - void clearAmount() => clearField(2); -} - -class BlankComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlankComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - BlankComponent._() : super(); - factory BlankComponent() => create(); - factory BlankComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlankComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlankComponent clone() => BlankComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlankComponent copyWith(void Function(BlankComponent) updates) => super.copyWith((message) => updates(message as BlankComponent)) as BlankComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlankComponent create() => BlankComponent._(); - BlankComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlankComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlankComponent? _defaultInstance; -} - -enum Component_Component { - input, - output, - blank, - notSet -} - -class Component extends $pb.GeneratedMessage { - static const $core.Map<$core.int, Component_Component> _Component_ComponentByTag = { - 2 : Component_Component.input, - 3 : Component_Component.output, - 4 : Component_Component.blank, - 0 : Component_Component.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Component', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [2, 3, 4]) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'saltCommitment', $pb.PbFieldType.QY) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'input', subBuilder: InputComponent.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'output', subBuilder: OutputComponent.create) - ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blank', subBuilder: BlankComponent.create) - ; - - Component._() : super(); - factory Component({ - $core.List<$core.int>? saltCommitment, - InputComponent? input, - OutputComponent? output, - BlankComponent? blank, - }) { - final _result = create(); - if (saltCommitment != null) { - _result.saltCommitment = saltCommitment; - } - if (input != null) { - _result.input = input; - } - if (output != null) { - _result.output = output; - } - if (blank != null) { - _result.blank = blank; - } - return _result; - } - factory Component.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Component.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Component clone() => Component()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Component copyWith(void Function(Component) updates) => super.copyWith((message) => updates(message as Component)) as Component; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Component create() => Component._(); - Component createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Component getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Component? _defaultInstance; - - Component_Component whichComponent() => _Component_ComponentByTag[$_whichOneof(0)]!; - void clearComponent() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.List<$core.int> get saltCommitment => $_getN(0); - @$pb.TagNumber(1) - set saltCommitment($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasSaltCommitment() => $_has(0); - @$pb.TagNumber(1) - void clearSaltCommitment() => clearField(1); - - @$pb.TagNumber(2) - InputComponent get input => $_getN(1); - @$pb.TagNumber(2) - set input(InputComponent v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasInput() => $_has(1); - @$pb.TagNumber(2) - void clearInput() => clearField(2); - @$pb.TagNumber(2) - InputComponent ensureInput() => $_ensure(1); - - @$pb.TagNumber(3) - OutputComponent get output => $_getN(2); - @$pb.TagNumber(3) - set output(OutputComponent v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasOutput() => $_has(2); - @$pb.TagNumber(3) - void clearOutput() => clearField(3); - @$pb.TagNumber(3) - OutputComponent ensureOutput() => $_ensure(2); - - @$pb.TagNumber(4) - BlankComponent get blank => $_getN(3); - @$pb.TagNumber(4) - set blank(BlankComponent v) { setField(4, v); } - @$pb.TagNumber(4) - $core.bool hasBlank() => $_has(3); - @$pb.TagNumber(4) - void clearBlank() => clearField(4); - @$pb.TagNumber(4) - BlankComponent ensureBlank() => $_ensure(3); -} - -class InitialCommitment extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InitialCommitment', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'saltedComponentHash', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amountCommitment', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'communicationKey', $pb.PbFieldType.QY) - ; - - InitialCommitment._() : super(); - factory InitialCommitment({ - $core.List<$core.int>? saltedComponentHash, - $core.List<$core.int>? amountCommitment, - $core.List<$core.int>? communicationKey, - }) { - final _result = create(); - if (saltedComponentHash != null) { - _result.saltedComponentHash = saltedComponentHash; - } - if (amountCommitment != null) { - _result.amountCommitment = amountCommitment; - } - if (communicationKey != null) { - _result.communicationKey = communicationKey; - } - return _result; - } - factory InitialCommitment.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory InitialCommitment.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - InitialCommitment clone() => InitialCommitment()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - InitialCommitment copyWith(void Function(InitialCommitment) updates) => super.copyWith((message) => updates(message as InitialCommitment)) as InitialCommitment; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static InitialCommitment create() => InitialCommitment._(); - InitialCommitment createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static InitialCommitment getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static InitialCommitment? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get saltedComponentHash => $_getN(0); - @$pb.TagNumber(1) - set saltedComponentHash($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasSaltedComponentHash() => $_has(0); - @$pb.TagNumber(1) - void clearSaltedComponentHash() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get amountCommitment => $_getN(1); - @$pb.TagNumber(2) - set amountCommitment($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasAmountCommitment() => $_has(1); - @$pb.TagNumber(2) - void clearAmountCommitment() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get communicationKey => $_getN(2); - @$pb.TagNumber(3) - set communicationKey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasCommunicationKey() => $_has(2); - @$pb.TagNumber(3) - void clearCommunicationKey() => clearField(3); -} - -class Proof extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Proof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'componentIdx', $pb.PbFieldType.QF3) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'salt', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pedersenNonce', $pb.PbFieldType.QY) - ; - - Proof._() : super(); - factory Proof({ - $core.int? componentIdx, - $core.List<$core.int>? salt, - $core.List<$core.int>? pedersenNonce, - }) { - final _result = create(); - if (componentIdx != null) { - _result.componentIdx = componentIdx; - } - if (salt != null) { - _result.salt = salt; - } - if (pedersenNonce != null) { - _result.pedersenNonce = pedersenNonce; - } - return _result; - } - factory Proof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Proof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Proof clone() => Proof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Proof copyWith(void Function(Proof) updates) => super.copyWith((message) => updates(message as Proof)) as Proof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Proof create() => Proof._(); - Proof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Proof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Proof? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get componentIdx => $_getIZ(0); - @$pb.TagNumber(1) - set componentIdx($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasComponentIdx() => $_has(0); - @$pb.TagNumber(1) - void clearComponentIdx() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get salt => $_getN(1); - @$pb.TagNumber(2) - set salt($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSalt() => $_has(1); - @$pb.TagNumber(2) - void clearSalt() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pedersenNonce => $_getN(2); - @$pb.TagNumber(3) - set pedersenNonce($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPedersenNonce() => $_has(2); - @$pb.TagNumber(3) - void clearPedersenNonce() => clearField(3); -} - -class ClientHello extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ClientHello', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'version', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'genesisHash', $pb.PbFieldType.OY) - ; - - ClientHello._() : super(); - factory ClientHello({ - $core.List<$core.int>? version, - $core.List<$core.int>? genesisHash, - }) { - final _result = create(); - if (version != null) { - _result.version = version; - } - if (genesisHash != null) { - _result.genesisHash = genesisHash; - } - return _result; - } - factory ClientHello.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ClientHello.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ClientHello clone() => ClientHello()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ClientHello copyWith(void Function(ClientHello) updates) => super.copyWith((message) => updates(message as ClientHello)) as ClientHello; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ClientHello create() => ClientHello._(); - ClientHello createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ClientHello getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ClientHello? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get version => $_getN(0); - @$pb.TagNumber(1) - set version($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasVersion() => $_has(0); - @$pb.TagNumber(1) - void clearVersion() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get genesisHash => $_getN(1); - @$pb.TagNumber(2) - set genesisHash($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasGenesisHash() => $_has(1); - @$pb.TagNumber(2) - void clearGenesisHash() => clearField(2); -} - -class ServerHello extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ServerHello', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tiers', $pb.PbFieldType.PU6) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numComponents', $pb.PbFieldType.QU3) - ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'componentFeerate', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minExcessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$fixnum.Int64>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxExcessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..aOS(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'donationAddress') - ; - - ServerHello._() : super(); - factory ServerHello({ - $core.Iterable<$fixnum.Int64>? tiers, - $core.int? numComponents, - $fixnum.Int64? componentFeerate, - $fixnum.Int64? minExcessFee, - $fixnum.Int64? maxExcessFee, - $core.String? donationAddress, - }) { - final _result = create(); - if (tiers != null) { - _result.tiers.addAll(tiers); - } - if (numComponents != null) { - _result.numComponents = numComponents; - } - if (componentFeerate != null) { - _result.componentFeerate = componentFeerate; - } - if (minExcessFee != null) { - _result.minExcessFee = minExcessFee; - } - if (maxExcessFee != null) { - _result.maxExcessFee = maxExcessFee; - } - if (donationAddress != null) { - _result.donationAddress = donationAddress; - } - return _result; - } - factory ServerHello.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ServerHello.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ServerHello clone() => ServerHello()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ServerHello copyWith(void Function(ServerHello) updates) => super.copyWith((message) => updates(message as ServerHello)) as ServerHello; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ServerHello create() => ServerHello._(); - ServerHello createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ServerHello getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ServerHello? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$fixnum.Int64> get tiers => $_getList(0); - - @$pb.TagNumber(2) - $core.int get numComponents => $_getIZ(1); - @$pb.TagNumber(2) - set numComponents($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasNumComponents() => $_has(1); - @$pb.TagNumber(2) - void clearNumComponents() => clearField(2); - - @$pb.TagNumber(4) - $fixnum.Int64 get componentFeerate => $_getI64(2); - @$pb.TagNumber(4) - set componentFeerate($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(4) - $core.bool hasComponentFeerate() => $_has(2); - @$pb.TagNumber(4) - void clearComponentFeerate() => clearField(4); - - @$pb.TagNumber(5) - $fixnum.Int64 get minExcessFee => $_getI64(3); - @$pb.TagNumber(5) - set minExcessFee($fixnum.Int64 v) { $_setInt64(3, v); } - @$pb.TagNumber(5) - $core.bool hasMinExcessFee() => $_has(3); - @$pb.TagNumber(5) - void clearMinExcessFee() => clearField(5); - - @$pb.TagNumber(6) - $fixnum.Int64 get maxExcessFee => $_getI64(4); - @$pb.TagNumber(6) - set maxExcessFee($fixnum.Int64 v) { $_setInt64(4, v); } - @$pb.TagNumber(6) - $core.bool hasMaxExcessFee() => $_has(4); - @$pb.TagNumber(6) - void clearMaxExcessFee() => clearField(6); - - @$pb.TagNumber(15) - $core.String get donationAddress => $_getSZ(5); - @$pb.TagNumber(15) - set donationAddress($core.String v) { $_setString(5, v); } - @$pb.TagNumber(15) - $core.bool hasDonationAddress() => $_has(5); - @$pb.TagNumber(15) - void clearDonationAddress() => clearField(15); -} - -class JoinPools_PoolTag extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinPools.PoolTag', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'limit', $pb.PbFieldType.QU3) - ..aOB(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'noIp') - ; - - JoinPools_PoolTag._() : super(); - factory JoinPools_PoolTag({ - $core.List<$core.int>? id, - $core.int? limit, - $core.bool? noIp, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (limit != null) { - _result.limit = limit; - } - if (noIp != null) { - _result.noIp = noIp; - } - return _result; - } - factory JoinPools_PoolTag.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory JoinPools_PoolTag.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - JoinPools_PoolTag clone() => JoinPools_PoolTag()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - JoinPools_PoolTag copyWith(void Function(JoinPools_PoolTag) updates) => super.copyWith((message) => updates(message as JoinPools_PoolTag)) as JoinPools_PoolTag; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static JoinPools_PoolTag create() => JoinPools_PoolTag._(); - JoinPools_PoolTag createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static JoinPools_PoolTag getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static JoinPools_PoolTag? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get id => $_getN(0); - @$pb.TagNumber(1) - set id($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.int get limit => $_getIZ(1); - @$pb.TagNumber(2) - set limit($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasLimit() => $_has(1); - @$pb.TagNumber(2) - void clearLimit() => clearField(2); - - @$pb.TagNumber(3) - $core.bool get noIp => $_getBF(2); - @$pb.TagNumber(3) - set noIp($core.bool v) { $_setBool(2, v); } - @$pb.TagNumber(3) - $core.bool hasNoIp() => $_has(2); - @$pb.TagNumber(3) - void clearNoIp() => clearField(3); -} - -class JoinPools extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'JoinPools', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tiers', $pb.PbFieldType.PU6) - ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tags', $pb.PbFieldType.PM, subBuilder: JoinPools_PoolTag.create) - ; - - JoinPools._() : super(); - factory JoinPools({ - $core.Iterable<$fixnum.Int64>? tiers, - $core.Iterable? tags, - }) { - final _result = create(); - if (tiers != null) { - _result.tiers.addAll(tiers); - } - if (tags != null) { - _result.tags.addAll(tags); - } - return _result; - } - factory JoinPools.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory JoinPools.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - JoinPools clone() => JoinPools()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - JoinPools copyWith(void Function(JoinPools) updates) => super.copyWith((message) => updates(message as JoinPools)) as JoinPools; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static JoinPools create() => JoinPools._(); - JoinPools createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static JoinPools getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static JoinPools? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$fixnum.Int64> get tiers => $_getList(0); - - @$pb.TagNumber(2) - $core.List get tags => $_getList(1); -} - -class TierStatusUpdate_TierStatus extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TierStatusUpdate.TierStatus', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'players', $pb.PbFieldType.OU3) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minPlayers', $pb.PbFieldType.OU3) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxPlayers', $pb.PbFieldType.OU3) - ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timeRemaining', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - - TierStatusUpdate_TierStatus._() : super(); - factory TierStatusUpdate_TierStatus({ - $core.int? players, - $core.int? minPlayers, - $core.int? maxPlayers, - $core.int? timeRemaining, - }) { - final _result = create(); - if (players != null) { - _result.players = players; - } - if (minPlayers != null) { - _result.minPlayers = minPlayers; - } - if (maxPlayers != null) { - _result.maxPlayers = maxPlayers; - } - if (timeRemaining != null) { - _result.timeRemaining = timeRemaining; - } - return _result; - } - factory TierStatusUpdate_TierStatus.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TierStatusUpdate_TierStatus.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TierStatusUpdate_TierStatus clone() => TierStatusUpdate_TierStatus()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TierStatusUpdate_TierStatus copyWith(void Function(TierStatusUpdate_TierStatus) updates) => super.copyWith((message) => updates(message as TierStatusUpdate_TierStatus)) as TierStatusUpdate_TierStatus; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TierStatusUpdate_TierStatus create() => TierStatusUpdate_TierStatus._(); - TierStatusUpdate_TierStatus createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TierStatusUpdate_TierStatus getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TierStatusUpdate_TierStatus? _defaultInstance; - - @$pb.TagNumber(1) - $core.int get players => $_getIZ(0); - @$pb.TagNumber(1) - set players($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasPlayers() => $_has(0); - @$pb.TagNumber(1) - void clearPlayers() => clearField(1); - - @$pb.TagNumber(2) - $core.int get minPlayers => $_getIZ(1); - @$pb.TagNumber(2) - set minPlayers($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasMinPlayers() => $_has(1); - @$pb.TagNumber(2) - void clearMinPlayers() => clearField(2); - - @$pb.TagNumber(3) - $core.int get maxPlayers => $_getIZ(2); - @$pb.TagNumber(3) - set maxPlayers($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasMaxPlayers() => $_has(2); - @$pb.TagNumber(3) - void clearMaxPlayers() => clearField(3); - - @$pb.TagNumber(4) - $core.int get timeRemaining => $_getIZ(3); - @$pb.TagNumber(4) - set timeRemaining($core.int v) { $_setUnsignedInt32(3, v); } - @$pb.TagNumber(4) - $core.bool hasTimeRemaining() => $_has(3); - @$pb.TagNumber(4) - void clearTimeRemaining() => clearField(4); -} - -class TierStatusUpdate extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TierStatusUpdate', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..m<$fixnum.Int64, TierStatusUpdate_TierStatus>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'statuses', entryClassName: 'TierStatusUpdate.StatusesEntry', keyFieldType: $pb.PbFieldType.OU6, valueFieldType: $pb.PbFieldType.OM, valueCreator: TierStatusUpdate_TierStatus.create, packageName: const $pb.PackageName('fusion')) - ..hasRequiredFields = false - ; - - TierStatusUpdate._() : super(); - factory TierStatusUpdate({ - $core.Map<$fixnum.Int64, TierStatusUpdate_TierStatus>? statuses, - }) { - final _result = create(); - if (statuses != null) { - _result.statuses.addAll(statuses); - } - return _result; - } - factory TierStatusUpdate.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TierStatusUpdate.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TierStatusUpdate clone() => TierStatusUpdate()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TierStatusUpdate copyWith(void Function(TierStatusUpdate) updates) => super.copyWith((message) => updates(message as TierStatusUpdate)) as TierStatusUpdate; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TierStatusUpdate create() => TierStatusUpdate._(); - TierStatusUpdate createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TierStatusUpdate getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TierStatusUpdate? _defaultInstance; - - @$pb.TagNumber(1) - $core.Map<$fixnum.Int64, TierStatusUpdate_TierStatus> get statuses => $_getMap(0); -} - -class FusionBegin extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FusionBegin', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tier', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertDomain', $pb.PbFieldType.QY) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertPort', $pb.PbFieldType.QU3) - ..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'covertSsl') - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverTime', $pb.PbFieldType.QF6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - FusionBegin._() : super(); - factory FusionBegin({ - $fixnum.Int64? tier, - $core.List<$core.int>? covertDomain, - $core.int? covertPort, - $core.bool? covertSsl, - $fixnum.Int64? serverTime, - }) { - final _result = create(); - if (tier != null) { - _result.tier = tier; - } - if (covertDomain != null) { - _result.covertDomain = covertDomain; - } - if (covertPort != null) { - _result.covertPort = covertPort; - } - if (covertSsl != null) { - _result.covertSsl = covertSsl; - } - if (serverTime != null) { - _result.serverTime = serverTime; - } - return _result; - } - factory FusionBegin.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FusionBegin.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FusionBegin clone() => FusionBegin()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FusionBegin copyWith(void Function(FusionBegin) updates) => super.copyWith((message) => updates(message as FusionBegin)) as FusionBegin; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FusionBegin create() => FusionBegin._(); - FusionBegin createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FusionBegin getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FusionBegin? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get tier => $_getI64(0); - @$pb.TagNumber(1) - set tier($fixnum.Int64 v) { $_setInt64(0, v); } - @$pb.TagNumber(1) - $core.bool hasTier() => $_has(0); - @$pb.TagNumber(1) - void clearTier() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get covertDomain => $_getN(1); - @$pb.TagNumber(2) - set covertDomain($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasCovertDomain() => $_has(1); - @$pb.TagNumber(2) - void clearCovertDomain() => clearField(2); - - @$pb.TagNumber(3) - $core.int get covertPort => $_getIZ(2); - @$pb.TagNumber(3) - set covertPort($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasCovertPort() => $_has(2); - @$pb.TagNumber(3) - void clearCovertPort() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get covertSsl => $_getBF(3); - @$pb.TagNumber(4) - set covertSsl($core.bool v) { $_setBool(3, v); } - @$pb.TagNumber(4) - $core.bool hasCovertSsl() => $_has(3); - @$pb.TagNumber(4) - void clearCovertSsl() => clearField(4); - - @$pb.TagNumber(5) - $fixnum.Int64 get serverTime => $_getI64(4); - @$pb.TagNumber(5) - set serverTime($fixnum.Int64 v) { $_setInt64(4, v); } - @$pb.TagNumber(5) - $core.bool hasServerTime() => $_has(4); - @$pb.TagNumber(5) - void clearServerTime() => clearField(5); -} - -class StartRound extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'StartRound', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.QY) - ..p<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindNoncePoints', $pb.PbFieldType.PY) - ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverTime', $pb.PbFieldType.QF6, defaultOrMaker: $fixnum.Int64.ZERO) - ; - - StartRound._() : super(); - factory StartRound({ - $core.List<$core.int>? roundPubkey, - $core.Iterable<$core.List<$core.int>>? blindNoncePoints, - $fixnum.Int64? serverTime, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (blindNoncePoints != null) { - _result.blindNoncePoints.addAll(blindNoncePoints); - } - if (serverTime != null) { - _result.serverTime = serverTime; - } - return _result; - } - factory StartRound.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory StartRound.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - StartRound clone() => StartRound()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - StartRound copyWith(void Function(StartRound) updates) => super.copyWith((message) => updates(message as StartRound)) as StartRound; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static StartRound create() => StartRound._(); - StartRound createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static StartRound getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static StartRound? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.List<$core.int>> get blindNoncePoints => $_getList(1); - - @$pb.TagNumber(5) - $fixnum.Int64 get serverTime => $_getI64(2); - @$pb.TagNumber(5) - set serverTime($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(5) - $core.bool hasServerTime() => $_has(2); - @$pb.TagNumber(5) - void clearServerTime() => clearField(5); -} - -class PlayerCommit extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PlayerCommit', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'initialCommitments', $pb.PbFieldType.PY) - ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'excessFee', $pb.PbFieldType.QU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pedersenTotalNonce', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'randomNumberCommitment', $pb.PbFieldType.QY) - ..p<$core.List<$core.int>>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindSigRequests', $pb.PbFieldType.PY) - ; - - PlayerCommit._() : super(); - factory PlayerCommit({ - $core.Iterable<$core.List<$core.int>>? initialCommitments, - $fixnum.Int64? excessFee, - $core.List<$core.int>? pedersenTotalNonce, - $core.List<$core.int>? randomNumberCommitment, - $core.Iterable<$core.List<$core.int>>? blindSigRequests, - }) { - final _result = create(); - if (initialCommitments != null) { - _result.initialCommitments.addAll(initialCommitments); - } - if (excessFee != null) { - _result.excessFee = excessFee; - } - if (pedersenTotalNonce != null) { - _result.pedersenTotalNonce = pedersenTotalNonce; - } - if (randomNumberCommitment != null) { - _result.randomNumberCommitment = randomNumberCommitment; - } - if (blindSigRequests != null) { - _result.blindSigRequests.addAll(blindSigRequests); - } - return _result; - } - factory PlayerCommit.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PlayerCommit.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PlayerCommit clone() => PlayerCommit()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PlayerCommit copyWith(void Function(PlayerCommit) updates) => super.copyWith((message) => updates(message as PlayerCommit)) as PlayerCommit; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PlayerCommit create() => PlayerCommit._(); - PlayerCommit createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PlayerCommit getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static PlayerCommit? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get initialCommitments => $_getList(0); - - @$pb.TagNumber(2) - $fixnum.Int64 get excessFee => $_getI64(1); - @$pb.TagNumber(2) - set excessFee($fixnum.Int64 v) { $_setInt64(1, v); } - @$pb.TagNumber(2) - $core.bool hasExcessFee() => $_has(1); - @$pb.TagNumber(2) - void clearExcessFee() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get pedersenTotalNonce => $_getN(2); - @$pb.TagNumber(3) - set pedersenTotalNonce($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPedersenTotalNonce() => $_has(2); - @$pb.TagNumber(3) - void clearPedersenTotalNonce() => clearField(3); - - @$pb.TagNumber(4) - $core.List<$core.int> get randomNumberCommitment => $_getN(3); - @$pb.TagNumber(4) - set randomNumberCommitment($core.List<$core.int> v) { $_setBytes(3, v); } - @$pb.TagNumber(4) - $core.bool hasRandomNumberCommitment() => $_has(3); - @$pb.TagNumber(4) - void clearRandomNumberCommitment() => clearField(4); - - @$pb.TagNumber(5) - $core.List<$core.List<$core.int>> get blindSigRequests => $_getList(4); -} - -class BlindSigResponses extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlindSigResponses', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scalars', $pb.PbFieldType.PY) - ..hasRequiredFields = false - ; - - BlindSigResponses._() : super(); - factory BlindSigResponses({ - $core.Iterable<$core.List<$core.int>>? scalars, - }) { - final _result = create(); - if (scalars != null) { - _result.scalars.addAll(scalars); - } - return _result; - } - factory BlindSigResponses.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlindSigResponses.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlindSigResponses clone() => BlindSigResponses()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlindSigResponses copyWith(void Function(BlindSigResponses) updates) => super.copyWith((message) => updates(message as BlindSigResponses)) as BlindSigResponses; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlindSigResponses create() => BlindSigResponses._(); - BlindSigResponses createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlindSigResponses getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlindSigResponses? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get scalars => $_getList(0); -} - -class AllCommitments extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AllCommitments', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'initialCommitments', $pb.PbFieldType.PY) - ..hasRequiredFields = false - ; - - AllCommitments._() : super(); - factory AllCommitments({ - $core.Iterable<$core.List<$core.int>>? initialCommitments, - }) { - final _result = create(); - if (initialCommitments != null) { - _result.initialCommitments.addAll(initialCommitments); - } - return _result; - } - factory AllCommitments.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AllCommitments.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AllCommitments clone() => AllCommitments()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AllCommitments copyWith(void Function(AllCommitments) updates) => super.copyWith((message) => updates(message as AllCommitments)) as AllCommitments; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static AllCommitments create() => AllCommitments._(); - AllCommitments createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static AllCommitments getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static AllCommitments? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get initialCommitments => $_getList(0); -} - -class CovertComponent extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertComponent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'component', $pb.PbFieldType.QY) - ; - - CovertComponent._() : super(); - factory CovertComponent({ - $core.List<$core.int>? roundPubkey, - $core.List<$core.int>? signature, - $core.List<$core.int>? component, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (signature != null) { - _result.signature = signature; - } - if (component != null) { - _result.component = component; - } - return _result; - } - factory CovertComponent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertComponent.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertComponent clone() => CovertComponent()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertComponent copyWith(void Function(CovertComponent) updates) => super.copyWith((message) => updates(message as CovertComponent)) as CovertComponent; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertComponent create() => CovertComponent._(); - CovertComponent createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertComponent getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertComponent? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get signature => $_getN(1); - @$pb.TagNumber(2) - set signature($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSignature() => $_has(1); - @$pb.TagNumber(2) - void clearSignature() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get component => $_getN(2); - @$pb.TagNumber(3) - set component($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasComponent() => $_has(2); - @$pb.TagNumber(3) - void clearComponent() => clearField(3); -} - -class ShareCovertComponents extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ShareCovertComponents', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'components', $pb.PbFieldType.PY) - ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'skipSignatures') - ..a<$core.List<$core.int>>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sessionHash', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - - ShareCovertComponents._() : super(); - factory ShareCovertComponents({ - $core.Iterable<$core.List<$core.int>>? components, - $core.bool? skipSignatures, - $core.List<$core.int>? sessionHash, - }) { - final _result = create(); - if (components != null) { - _result.components.addAll(components); - } - if (skipSignatures != null) { - _result.skipSignatures = skipSignatures; - } - if (sessionHash != null) { - _result.sessionHash = sessionHash; - } - return _result; - } - factory ShareCovertComponents.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ShareCovertComponents.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ShareCovertComponents clone() => ShareCovertComponents()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ShareCovertComponents copyWith(void Function(ShareCovertComponents) updates) => super.copyWith((message) => updates(message as ShareCovertComponents)) as ShareCovertComponents; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ShareCovertComponents create() => ShareCovertComponents._(); - ShareCovertComponents createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ShareCovertComponents getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ShareCovertComponents? _defaultInstance; - - @$pb.TagNumber(4) - $core.List<$core.List<$core.int>> get components => $_getList(0); - - @$pb.TagNumber(5) - $core.bool get skipSignatures => $_getBF(1); - @$pb.TagNumber(5) - set skipSignatures($core.bool v) { $_setBool(1, v); } - @$pb.TagNumber(5) - $core.bool hasSkipSignatures() => $_has(1); - @$pb.TagNumber(5) - void clearSkipSignatures() => clearField(5); - - @$pb.TagNumber(6) - $core.List<$core.int> get sessionHash => $_getN(2); - @$pb.TagNumber(6) - set sessionHash($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(6) - $core.bool hasSessionHash() => $_has(2); - @$pb.TagNumber(6) - void clearSessionHash() => clearField(6); -} - -class CovertTransactionSignature extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertTransactionSignature', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'roundPubkey', $pb.PbFieldType.OY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'whichInput', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txsignature', $pb.PbFieldType.QY) - ; - - CovertTransactionSignature._() : super(); - factory CovertTransactionSignature({ - $core.List<$core.int>? roundPubkey, - $core.int? whichInput, - $core.List<$core.int>? txsignature, - }) { - final _result = create(); - if (roundPubkey != null) { - _result.roundPubkey = roundPubkey; - } - if (whichInput != null) { - _result.whichInput = whichInput; - } - if (txsignature != null) { - _result.txsignature = txsignature; - } - return _result; - } - factory CovertTransactionSignature.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertTransactionSignature.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertTransactionSignature clone() => CovertTransactionSignature()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertTransactionSignature copyWith(void Function(CovertTransactionSignature) updates) => super.copyWith((message) => updates(message as CovertTransactionSignature)) as CovertTransactionSignature; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertTransactionSignature create() => CovertTransactionSignature._(); - CovertTransactionSignature createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertTransactionSignature getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertTransactionSignature? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get roundPubkey => $_getN(0); - @$pb.TagNumber(1) - set roundPubkey($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasRoundPubkey() => $_has(0); - @$pb.TagNumber(1) - void clearRoundPubkey() => clearField(1); - - @$pb.TagNumber(2) - $core.int get whichInput => $_getIZ(1); - @$pb.TagNumber(2) - set whichInput($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasWhichInput() => $_has(1); - @$pb.TagNumber(2) - void clearWhichInput() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get txsignature => $_getN(2); - @$pb.TagNumber(3) - set txsignature($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasTxsignature() => $_has(2); - @$pb.TagNumber(3) - void clearTxsignature() => clearField(3); -} - -class FusionResult extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FusionResult', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.bool>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ok', $pb.PbFieldType.QB) - ..p<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txsignatures', $pb.PbFieldType.PY) - ..p<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'badComponents', $pb.PbFieldType.PU3) - ; - - FusionResult._() : super(); - factory FusionResult({ - $core.bool? ok, - $core.Iterable<$core.List<$core.int>>? txsignatures, - $core.Iterable<$core.int>? badComponents, - }) { - final _result = create(); - if (ok != null) { - _result.ok = ok; - } - if (txsignatures != null) { - _result.txsignatures.addAll(txsignatures); - } - if (badComponents != null) { - _result.badComponents.addAll(badComponents); - } - return _result; - } - factory FusionResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory FusionResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - FusionResult clone() => FusionResult()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - FusionResult copyWith(void Function(FusionResult) updates) => super.copyWith((message) => updates(message as FusionResult)) as FusionResult; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static FusionResult create() => FusionResult._(); - FusionResult createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static FusionResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static FusionResult? _defaultInstance; - - @$pb.TagNumber(1) - $core.bool get ok => $_getBF(0); - @$pb.TagNumber(1) - set ok($core.bool v) { $_setBool(0, v); } - @$pb.TagNumber(1) - $core.bool hasOk() => $_has(0); - @$pb.TagNumber(1) - void clearOk() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.List<$core.int>> get txsignatures => $_getList(1); - - @$pb.TagNumber(3) - $core.List<$core.int> get badComponents => $_getList(2); -} - -class MyProofsList extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MyProofsList', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..p<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'encryptedProofs', $pb.PbFieldType.PY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'randomNumber', $pb.PbFieldType.QY) - ; - - MyProofsList._() : super(); - factory MyProofsList({ - $core.Iterable<$core.List<$core.int>>? encryptedProofs, - $core.List<$core.int>? randomNumber, - }) { - final _result = create(); - if (encryptedProofs != null) { - _result.encryptedProofs.addAll(encryptedProofs); - } - if (randomNumber != null) { - _result.randomNumber = randomNumber; - } - return _result; - } - factory MyProofsList.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory MyProofsList.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - MyProofsList clone() => MyProofsList()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - MyProofsList copyWith(void Function(MyProofsList) updates) => super.copyWith((message) => updates(message as MyProofsList)) as MyProofsList; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static MyProofsList create() => MyProofsList._(); - MyProofsList createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static MyProofsList getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static MyProofsList? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.List<$core.int>> get encryptedProofs => $_getList(0); - - @$pb.TagNumber(2) - $core.List<$core.int> get randomNumber => $_getN(1); - @$pb.TagNumber(2) - set randomNumber($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasRandomNumber() => $_has(1); - @$pb.TagNumber(2) - void clearRandomNumber() => clearField(2); -} - -class TheirProofsList_RelayedProof extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TheirProofsList.RelayedProof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'encryptedProof', $pb.PbFieldType.QY) - ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcCommitmentIdx', $pb.PbFieldType.QU3) - ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstKeyIdx', $pb.PbFieldType.QU3) - ; - - TheirProofsList_RelayedProof._() : super(); - factory TheirProofsList_RelayedProof({ - $core.List<$core.int>? encryptedProof, - $core.int? srcCommitmentIdx, - $core.int? dstKeyIdx, - }) { - final _result = create(); - if (encryptedProof != null) { - _result.encryptedProof = encryptedProof; - } - if (srcCommitmentIdx != null) { - _result.srcCommitmentIdx = srcCommitmentIdx; - } - if (dstKeyIdx != null) { - _result.dstKeyIdx = dstKeyIdx; - } - return _result; - } - factory TheirProofsList_RelayedProof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TheirProofsList_RelayedProof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TheirProofsList_RelayedProof clone() => TheirProofsList_RelayedProof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TheirProofsList_RelayedProof copyWith(void Function(TheirProofsList_RelayedProof) updates) => super.copyWith((message) => updates(message as TheirProofsList_RelayedProof)) as TheirProofsList_RelayedProof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TheirProofsList_RelayedProof create() => TheirProofsList_RelayedProof._(); - TheirProofsList_RelayedProof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TheirProofsList_RelayedProof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TheirProofsList_RelayedProof? _defaultInstance; - - @$pb.TagNumber(1) - $core.List<$core.int> get encryptedProof => $_getN(0); - @$pb.TagNumber(1) - set encryptedProof($core.List<$core.int> v) { $_setBytes(0, v); } - @$pb.TagNumber(1) - $core.bool hasEncryptedProof() => $_has(0); - @$pb.TagNumber(1) - void clearEncryptedProof() => clearField(1); - - @$pb.TagNumber(2) - $core.int get srcCommitmentIdx => $_getIZ(1); - @$pb.TagNumber(2) - set srcCommitmentIdx($core.int v) { $_setUnsignedInt32(1, v); } - @$pb.TagNumber(2) - $core.bool hasSrcCommitmentIdx() => $_has(1); - @$pb.TagNumber(2) - void clearSrcCommitmentIdx() => clearField(2); - - @$pb.TagNumber(3) - $core.int get dstKeyIdx => $_getIZ(2); - @$pb.TagNumber(3) - set dstKeyIdx($core.int v) { $_setUnsignedInt32(2, v); } - @$pb.TagNumber(3) - $core.bool hasDstKeyIdx() => $_has(2); - @$pb.TagNumber(3) - void clearDstKeyIdx() => clearField(3); -} - -class TheirProofsList extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TheirProofsList', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'proofs', $pb.PbFieldType.PM, subBuilder: TheirProofsList_RelayedProof.create) - ; - - TheirProofsList._() : super(); - factory TheirProofsList({ - $core.Iterable? proofs, - }) { - final _result = create(); - if (proofs != null) { - _result.proofs.addAll(proofs); - } - return _result; - } - factory TheirProofsList.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory TheirProofsList.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TheirProofsList clone() => TheirProofsList()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TheirProofsList copyWith(void Function(TheirProofsList) updates) => super.copyWith((message) => updates(message as TheirProofsList)) as TheirProofsList; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TheirProofsList create() => TheirProofsList._(); - TheirProofsList createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TheirProofsList getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static TheirProofsList? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get proofs => $_getList(0); -} - -enum Blames_BlameProof_Decrypter { - sessionKey, - privkey, - notSet -} - -class Blames_BlameProof extends $pb.GeneratedMessage { - static const $core.Map<$core.int, Blames_BlameProof_Decrypter> _Blames_BlameProof_DecrypterByTag = { - 2 : Blames_BlameProof_Decrypter.sessionKey, - 3 : Blames_BlameProof_Decrypter.privkey, - 0 : Blames_BlameProof_Decrypter.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Blames.BlameProof', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [2, 3]) - ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'whichProof', $pb.PbFieldType.QU3) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sessionKey', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'privkey', $pb.PbFieldType.OY) - ..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'needLookupBlockchain') - ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blameReason') - ; - - Blames_BlameProof._() : super(); - factory Blames_BlameProof({ - $core.int? whichProof, - $core.List<$core.int>? sessionKey, - $core.List<$core.int>? privkey, - $core.bool? needLookupBlockchain, - $core.String? blameReason, - }) { - final _result = create(); - if (whichProof != null) { - _result.whichProof = whichProof; - } - if (sessionKey != null) { - _result.sessionKey = sessionKey; - } - if (privkey != null) { - _result.privkey = privkey; - } - if (needLookupBlockchain != null) { - _result.needLookupBlockchain = needLookupBlockchain; - } - if (blameReason != null) { - _result.blameReason = blameReason; - } - return _result; - } - factory Blames_BlameProof.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Blames_BlameProof.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Blames_BlameProof clone() => Blames_BlameProof()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Blames_BlameProof copyWith(void Function(Blames_BlameProof) updates) => super.copyWith((message) => updates(message as Blames_BlameProof)) as Blames_BlameProof; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Blames_BlameProof create() => Blames_BlameProof._(); - Blames_BlameProof createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Blames_BlameProof getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Blames_BlameProof? _defaultInstance; - - Blames_BlameProof_Decrypter whichDecrypter() => _Blames_BlameProof_DecrypterByTag[$_whichOneof(0)]!; - void clearDecrypter() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.int get whichProof => $_getIZ(0); - @$pb.TagNumber(1) - set whichProof($core.int v) { $_setUnsignedInt32(0, v); } - @$pb.TagNumber(1) - $core.bool hasWhichProof() => $_has(0); - @$pb.TagNumber(1) - void clearWhichProof() => clearField(1); - - @$pb.TagNumber(2) - $core.List<$core.int> get sessionKey => $_getN(1); - @$pb.TagNumber(2) - set sessionKey($core.List<$core.int> v) { $_setBytes(1, v); } - @$pb.TagNumber(2) - $core.bool hasSessionKey() => $_has(1); - @$pb.TagNumber(2) - void clearSessionKey() => clearField(2); - - @$pb.TagNumber(3) - $core.List<$core.int> get privkey => $_getN(2); - @$pb.TagNumber(3) - set privkey($core.List<$core.int> v) { $_setBytes(2, v); } - @$pb.TagNumber(3) - $core.bool hasPrivkey() => $_has(2); - @$pb.TagNumber(3) - void clearPrivkey() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get needLookupBlockchain => $_getBF(3); - @$pb.TagNumber(4) - set needLookupBlockchain($core.bool v) { $_setBool(3, v); } - @$pb.TagNumber(4) - $core.bool hasNeedLookupBlockchain() => $_has(3); - @$pb.TagNumber(4) - void clearNeedLookupBlockchain() => clearField(4); - - @$pb.TagNumber(5) - $core.String get blameReason => $_getSZ(4); - @$pb.TagNumber(5) - set blameReason($core.String v) { $_setString(4, v); } - @$pb.TagNumber(5) - $core.bool hasBlameReason() => $_has(4); - @$pb.TagNumber(5) - void clearBlameReason() => clearField(5); -} - -class Blames extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Blames', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blames', $pb.PbFieldType.PM, subBuilder: Blames_BlameProof.create) - ; - - Blames._() : super(); - factory Blames({ - $core.Iterable? blames, - }) { - final _result = create(); - if (blames != null) { - _result.blames.addAll(blames); - } - return _result; - } - factory Blames.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Blames.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Blames clone() => Blames()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Blames copyWith(void Function(Blames) updates) => super.copyWith((message) => updates(message as Blames)) as Blames; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Blames create() => Blames._(); - Blames createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Blames getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Blames? _defaultInstance; - - @$pb.TagNumber(1) - $core.List get blames => $_getList(0); -} - -class RestartRound extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RestartRound', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - RestartRound._() : super(); - factory RestartRound() => create(); - factory RestartRound.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RestartRound.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RestartRound clone() => RestartRound()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RestartRound copyWith(void Function(RestartRound) updates) => super.copyWith((message) => updates(message as RestartRound)) as RestartRound; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RestartRound create() => RestartRound._(); - RestartRound createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RestartRound getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static RestartRound? _defaultInstance; -} - -class Error extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Error', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message') - ..hasRequiredFields = false - ; - - Error._() : super(); - factory Error({ - $core.String? message, - }) { - final _result = create(); - if (message != null) { - _result.message = message; - } - return _result; - } - factory Error.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Error.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Error clone() => Error()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Error copyWith(void Function(Error) updates) => super.copyWith((message) => updates(message as Error)) as Error; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Error create() => Error._(); - Error createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Error getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Error? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get message => $_getSZ(0); - @$pb.TagNumber(1) - set message($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasMessage() => $_has(0); - @$pb.TagNumber(1) - void clearMessage() => clearField(1); -} - -class Ping extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Ping', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - Ping._() : super(); - factory Ping() => create(); - factory Ping.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Ping.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Ping clone() => Ping()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Ping copyWith(void Function(Ping) updates) => super.copyWith((message) => updates(message as Ping)) as Ping; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Ping create() => Ping._(); - Ping createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Ping getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Ping? _defaultInstance; -} - -class OK extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OK', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - OK._() : super(); - factory OK() => create(); - factory OK.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory OK.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OK clone() => OK()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OK copyWith(void Function(OK) updates) => super.copyWith((message) => updates(message as OK)) as OK; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OK create() => OK._(); - OK createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OK getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static OK? _defaultInstance; -} - -enum ClientMessage_Msg { - clienthello, - joinpools, - playercommit, - myproofslist, - blames, - notSet -} - -class ClientMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, ClientMessage_Msg> _ClientMessage_MsgByTag = { - 1 : ClientMessage_Msg.clienthello, - 2 : ClientMessage_Msg.joinpools, - 3 : ClientMessage_Msg.playercommit, - 5 : ClientMessage_Msg.myproofslist, - 6 : ClientMessage_Msg.blames, - 0 : ClientMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ClientMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 5, 6]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'clienthello', subBuilder: ClientHello.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'joinpools', subBuilder: JoinPools.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'playercommit', subBuilder: PlayerCommit.create) - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'myproofslist', subBuilder: MyProofsList.create) - ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blames', subBuilder: Blames.create) - ; - - ClientMessage._() : super(); - factory ClientMessage({ - ClientHello? clienthello, - JoinPools? joinpools, - PlayerCommit? playercommit, - MyProofsList? myproofslist, - Blames? blames, - }) { - final _result = create(); - if (clienthello != null) { - _result.clienthello = clienthello; - } - if (joinpools != null) { - _result.joinpools = joinpools; - } - if (playercommit != null) { - _result.playercommit = playercommit; - } - if (myproofslist != null) { - _result.myproofslist = myproofslist; - } - if (blames != null) { - _result.blames = blames; - } - return _result; - } - factory ClientMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ClientMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ClientMessage clone() => ClientMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ClientMessage copyWith(void Function(ClientMessage) updates) => super.copyWith((message) => updates(message as ClientMessage)) as ClientMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ClientMessage create() => ClientMessage._(); - ClientMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ClientMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ClientMessage? _defaultInstance; - - ClientMessage_Msg whichMsg() => _ClientMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - ClientHello get clienthello => $_getN(0); - @$pb.TagNumber(1) - set clienthello(ClientHello v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasClienthello() => $_has(0); - @$pb.TagNumber(1) - void clearClienthello() => clearField(1); - @$pb.TagNumber(1) - ClientHello ensureClienthello() => $_ensure(0); - - @$pb.TagNumber(2) - JoinPools get joinpools => $_getN(1); - @$pb.TagNumber(2) - set joinpools(JoinPools v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasJoinpools() => $_has(1); - @$pb.TagNumber(2) - void clearJoinpools() => clearField(2); - @$pb.TagNumber(2) - JoinPools ensureJoinpools() => $_ensure(1); - - @$pb.TagNumber(3) - PlayerCommit get playercommit => $_getN(2); - @$pb.TagNumber(3) - set playercommit(PlayerCommit v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasPlayercommit() => $_has(2); - @$pb.TagNumber(3) - void clearPlayercommit() => clearField(3); - @$pb.TagNumber(3) - PlayerCommit ensurePlayercommit() => $_ensure(2); - - @$pb.TagNumber(5) - MyProofsList get myproofslist => $_getN(3); - @$pb.TagNumber(5) - set myproofslist(MyProofsList v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasMyproofslist() => $_has(3); - @$pb.TagNumber(5) - void clearMyproofslist() => clearField(5); - @$pb.TagNumber(5) - MyProofsList ensureMyproofslist() => $_ensure(3); - - @$pb.TagNumber(6) - Blames get blames => $_getN(4); - @$pb.TagNumber(6) - set blames(Blames v) { setField(6, v); } - @$pb.TagNumber(6) - $core.bool hasBlames() => $_has(4); - @$pb.TagNumber(6) - void clearBlames() => clearField(6); - @$pb.TagNumber(6) - Blames ensureBlames() => $_ensure(4); -} - -enum ServerMessage_Msg { - serverhello, - tierstatusupdate, - fusionbegin, - startround, - blindsigresponses, - allcommitments, - sharecovertcomponents, - fusionresult, - theirproofslist, - restartround, - error, - notSet -} - -class ServerMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, ServerMessage_Msg> _ServerMessage_MsgByTag = { - 1 : ServerMessage_Msg.serverhello, - 2 : ServerMessage_Msg.tierstatusupdate, - 3 : ServerMessage_Msg.fusionbegin, - 4 : ServerMessage_Msg.startround, - 5 : ServerMessage_Msg.blindsigresponses, - 6 : ServerMessage_Msg.allcommitments, - 7 : ServerMessage_Msg.sharecovertcomponents, - 8 : ServerMessage_Msg.fusionresult, - 9 : ServerMessage_Msg.theirproofslist, - 14 : ServerMessage_Msg.restartround, - 15 : ServerMessage_Msg.error, - 0 : ServerMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ServerMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'serverhello', subBuilder: ServerHello.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'tierstatusupdate', subBuilder: TierStatusUpdate.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fusionbegin', subBuilder: FusionBegin.create) - ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startround', subBuilder: StartRound.create) - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blindsigresponses', subBuilder: BlindSigResponses.create) - ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allcommitments', subBuilder: AllCommitments.create) - ..aOM(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sharecovertcomponents', subBuilder: ShareCovertComponents.create) - ..aOM(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fusionresult', subBuilder: FusionResult.create) - ..aOM(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'theirproofslist', subBuilder: TheirProofsList.create) - ..aOM(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'restartround', subBuilder: RestartRound.create) - ..aOM(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: Error.create) - ; - - ServerMessage._() : super(); - factory ServerMessage({ - ServerHello? serverhello, - TierStatusUpdate? tierstatusupdate, - FusionBegin? fusionbegin, - StartRound? startround, - BlindSigResponses? blindsigresponses, - AllCommitments? allcommitments, - ShareCovertComponents? sharecovertcomponents, - FusionResult? fusionresult, - TheirProofsList? theirproofslist, - RestartRound? restartround, - Error? error, - }) { - final _result = create(); - if (serverhello != null) { - _result.serverhello = serverhello; - } - if (tierstatusupdate != null) { - _result.tierstatusupdate = tierstatusupdate; - } - if (fusionbegin != null) { - _result.fusionbegin = fusionbegin; - } - if (startround != null) { - _result.startround = startround; - } - if (blindsigresponses != null) { - _result.blindsigresponses = blindsigresponses; - } - if (allcommitments != null) { - _result.allcommitments = allcommitments; - } - if (sharecovertcomponents != null) { - _result.sharecovertcomponents = sharecovertcomponents; - } - if (fusionresult != null) { - _result.fusionresult = fusionresult; - } - if (theirproofslist != null) { - _result.theirproofslist = theirproofslist; - } - if (restartround != null) { - _result.restartround = restartround; - } - if (error != null) { - _result.error = error; - } - return _result; - } - factory ServerMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ServerMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ServerMessage clone() => ServerMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ServerMessage copyWith(void Function(ServerMessage) updates) => super.copyWith((message) => updates(message as ServerMessage)) as ServerMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ServerMessage create() => ServerMessage._(); - ServerMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ServerMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ServerMessage? _defaultInstance; - - ServerMessage_Msg whichMsg() => _ServerMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - ServerHello get serverhello => $_getN(0); - @$pb.TagNumber(1) - set serverhello(ServerHello v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasServerhello() => $_has(0); - @$pb.TagNumber(1) - void clearServerhello() => clearField(1); - @$pb.TagNumber(1) - ServerHello ensureServerhello() => $_ensure(0); - - @$pb.TagNumber(2) - TierStatusUpdate get tierstatusupdate => $_getN(1); - @$pb.TagNumber(2) - set tierstatusupdate(TierStatusUpdate v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasTierstatusupdate() => $_has(1); - @$pb.TagNumber(2) - void clearTierstatusupdate() => clearField(2); - @$pb.TagNumber(2) - TierStatusUpdate ensureTierstatusupdate() => $_ensure(1); - - @$pb.TagNumber(3) - FusionBegin get fusionbegin => $_getN(2); - @$pb.TagNumber(3) - set fusionbegin(FusionBegin v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasFusionbegin() => $_has(2); - @$pb.TagNumber(3) - void clearFusionbegin() => clearField(3); - @$pb.TagNumber(3) - FusionBegin ensureFusionbegin() => $_ensure(2); - - @$pb.TagNumber(4) - StartRound get startround => $_getN(3); - @$pb.TagNumber(4) - set startround(StartRound v) { setField(4, v); } - @$pb.TagNumber(4) - $core.bool hasStartround() => $_has(3); - @$pb.TagNumber(4) - void clearStartround() => clearField(4); - @$pb.TagNumber(4) - StartRound ensureStartround() => $_ensure(3); - - @$pb.TagNumber(5) - BlindSigResponses get blindsigresponses => $_getN(4); - @$pb.TagNumber(5) - set blindsigresponses(BlindSigResponses v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasBlindsigresponses() => $_has(4); - @$pb.TagNumber(5) - void clearBlindsigresponses() => clearField(5); - @$pb.TagNumber(5) - BlindSigResponses ensureBlindsigresponses() => $_ensure(4); - - @$pb.TagNumber(6) - AllCommitments get allcommitments => $_getN(5); - @$pb.TagNumber(6) - set allcommitments(AllCommitments v) { setField(6, v); } - @$pb.TagNumber(6) - $core.bool hasAllcommitments() => $_has(5); - @$pb.TagNumber(6) - void clearAllcommitments() => clearField(6); - @$pb.TagNumber(6) - AllCommitments ensureAllcommitments() => $_ensure(5); - - @$pb.TagNumber(7) - ShareCovertComponents get sharecovertcomponents => $_getN(6); - @$pb.TagNumber(7) - set sharecovertcomponents(ShareCovertComponents v) { setField(7, v); } - @$pb.TagNumber(7) - $core.bool hasSharecovertcomponents() => $_has(6); - @$pb.TagNumber(7) - void clearSharecovertcomponents() => clearField(7); - @$pb.TagNumber(7) - ShareCovertComponents ensureSharecovertcomponents() => $_ensure(6); - - @$pb.TagNumber(8) - FusionResult get fusionresult => $_getN(7); - @$pb.TagNumber(8) - set fusionresult(FusionResult v) { setField(8, v); } - @$pb.TagNumber(8) - $core.bool hasFusionresult() => $_has(7); - @$pb.TagNumber(8) - void clearFusionresult() => clearField(8); - @$pb.TagNumber(8) - FusionResult ensureFusionresult() => $_ensure(7); - - @$pb.TagNumber(9) - TheirProofsList get theirproofslist => $_getN(8); - @$pb.TagNumber(9) - set theirproofslist(TheirProofsList v) { setField(9, v); } - @$pb.TagNumber(9) - $core.bool hasTheirproofslist() => $_has(8); - @$pb.TagNumber(9) - void clearTheirproofslist() => clearField(9); - @$pb.TagNumber(9) - TheirProofsList ensureTheirproofslist() => $_ensure(8); - - @$pb.TagNumber(14) - RestartRound get restartround => $_getN(9); - @$pb.TagNumber(14) - set restartround(RestartRound v) { setField(14, v); } - @$pb.TagNumber(14) - $core.bool hasRestartround() => $_has(9); - @$pb.TagNumber(14) - void clearRestartround() => clearField(14); - @$pb.TagNumber(14) - RestartRound ensureRestartround() => $_ensure(9); - - @$pb.TagNumber(15) - Error get error => $_getN(10); - @$pb.TagNumber(15) - set error(Error v) { setField(15, v); } - @$pb.TagNumber(15) - $core.bool hasError() => $_has(10); - @$pb.TagNumber(15) - void clearError() => clearField(15); - @$pb.TagNumber(15) - Error ensureError() => $_ensure(10); -} - -enum CovertMessage_Msg { - component, - signature, - ping, - notSet -} - -class CovertMessage extends $pb.GeneratedMessage { - static const $core.Map<$core.int, CovertMessage_Msg> _CovertMessage_MsgByTag = { - 1 : CovertMessage_Msg.component, - 2 : CovertMessage_Msg.signature, - 3 : CovertMessage_Msg.ping, - 0 : CovertMessage_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 2, 3]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'component', subBuilder: CovertComponent.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', subBuilder: CovertTransactionSignature.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ping', subBuilder: Ping.create) - ; - - CovertMessage._() : super(); - factory CovertMessage({ - CovertComponent? component, - CovertTransactionSignature? signature, - Ping? ping, - }) { - final _result = create(); - if (component != null) { - _result.component = component; - } - if (signature != null) { - _result.signature = signature; - } - if (ping != null) { - _result.ping = ping; - } - return _result; - } - factory CovertMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertMessage clone() => CovertMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertMessage copyWith(void Function(CovertMessage) updates) => super.copyWith((message) => updates(message as CovertMessage)) as CovertMessage; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertMessage create() => CovertMessage._(); - CovertMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertMessage? _defaultInstance; - - CovertMessage_Msg whichMsg() => _CovertMessage_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - CovertComponent get component => $_getN(0); - @$pb.TagNumber(1) - set component(CovertComponent v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasComponent() => $_has(0); - @$pb.TagNumber(1) - void clearComponent() => clearField(1); - @$pb.TagNumber(1) - CovertComponent ensureComponent() => $_ensure(0); - - @$pb.TagNumber(2) - CovertTransactionSignature get signature => $_getN(1); - @$pb.TagNumber(2) - set signature(CovertTransactionSignature v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasSignature() => $_has(1); - @$pb.TagNumber(2) - void clearSignature() => clearField(2); - @$pb.TagNumber(2) - CovertTransactionSignature ensureSignature() => $_ensure(1); - - @$pb.TagNumber(3) - Ping get ping => $_getN(2); - @$pb.TagNumber(3) - set ping(Ping v) { setField(3, v); } - @$pb.TagNumber(3) - $core.bool hasPing() => $_has(2); - @$pb.TagNumber(3) - void clearPing() => clearField(3); - @$pb.TagNumber(3) - Ping ensurePing() => $_ensure(2); -} - -enum CovertResponse_Msg { - ok, - error, - notSet -} - -class CovertResponse extends $pb.GeneratedMessage { - static const $core.Map<$core.int, CovertResponse_Msg> _CovertResponse_MsgByTag = { - 1 : CovertResponse_Msg.ok, - 15 : CovertResponse_Msg.error, - 0 : CovertResponse_Msg.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CovertResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'fusion'), createEmptyInstance: create) - ..oo(0, [1, 15]) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ok', subBuilder: OK.create) - ..aOM(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: Error.create) - ..hasRequiredFields = false - ; - - CovertResponse._() : super(); - factory CovertResponse({ - OK? ok, - Error? error, - }) { - final _result = create(); - if (ok != null) { - _result.ok = ok; - } - if (error != null) { - _result.error = error; - } - return _result; - } - factory CovertResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CovertResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CovertResponse clone() => CovertResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CovertResponse copyWith(void Function(CovertResponse) updates) => super.copyWith((message) => updates(message as CovertResponse)) as CovertResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CovertResponse create() => CovertResponse._(); - CovertResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CovertResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CovertResponse? _defaultInstance; - - CovertResponse_Msg whichMsg() => _CovertResponse_MsgByTag[$_whichOneof(0)]!; - void clearMsg() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - OK get ok => $_getN(0); - @$pb.TagNumber(1) - set ok(OK v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasOk() => $_has(0); - @$pb.TagNumber(1) - void clearOk() => clearField(1); - @$pb.TagNumber(1) - OK ensureOk() => $_ensure(0); - - @$pb.TagNumber(15) - Error get error => $_getN(1); - @$pb.TagNumber(15) - set error(Error v) { setField(15, v); } - @$pb.TagNumber(15) - $core.bool hasError() => $_has(1); - @$pb.TagNumber(15) - void clearError() => clearField(15); - @$pb.TagNumber(15) - Error ensureError() => $_ensure(1); -} - diff --git a/lib/services/cashfusion/protobuf/fusion.pbenum.dart b/lib/services/cashfusion/protobuf/fusion.pbenum.dart deleted file mode 100644 index fb5c0d734..000000000 --- a/lib/services/cashfusion/protobuf/fusion.pbenum.dart +++ /dev/null @@ -1,7 +0,0 @@ -/// -// Generated code. Do not modify. -// source: fusion.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - diff --git a/lib/services/cashfusion/protobuf/fusion.pbjson.dart b/lib/services/cashfusion/protobuf/fusion.pbjson.dart deleted file mode 100644 index 7735f5acf..000000000 --- a/lib/services/cashfusion/protobuf/fusion.pbjson.dart +++ /dev/null @@ -1,427 +0,0 @@ -/// -// Generated code. Do not modify. -// source: fusion.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; -import 'dart:convert' as $convert; -import 'dart:typed_data' as $typed_data; -@$core.Deprecated('Use inputComponentDescriptor instead') -const InputComponent$json = const { - '1': 'InputComponent', - '2': const [ - const {'1': 'prev_txid', '3': 1, '4': 2, '5': 12, '10': 'prevTxid'}, - const {'1': 'prev_index', '3': 2, '4': 2, '5': 13, '10': 'prevIndex'}, - const {'1': 'pubkey', '3': 3, '4': 2, '5': 12, '10': 'pubkey'}, - const {'1': 'amount', '3': 4, '4': 2, '5': 4, '10': 'amount'}, - ], -}; - -/// Descriptor for `InputComponent`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List inputComponentDescriptor = $convert.base64Decode('Cg5JbnB1dENvbXBvbmVudBIbCglwcmV2X3R4aWQYASACKAxSCHByZXZUeGlkEh0KCnByZXZfaW5kZXgYAiACKA1SCXByZXZJbmRleBIWCgZwdWJrZXkYAyACKAxSBnB1YmtleRIWCgZhbW91bnQYBCACKARSBmFtb3VudA=='); -@$core.Deprecated('Use outputComponentDescriptor instead') -const OutputComponent$json = const { - '1': 'OutputComponent', - '2': const [ - const {'1': 'scriptpubkey', '3': 1, '4': 2, '5': 12, '10': 'scriptpubkey'}, - const {'1': 'amount', '3': 2, '4': 2, '5': 4, '10': 'amount'}, - ], -}; - -/// Descriptor for `OutputComponent`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List outputComponentDescriptor = $convert.base64Decode('Cg9PdXRwdXRDb21wb25lbnQSIgoMc2NyaXB0cHVia2V5GAEgAigMUgxzY3JpcHRwdWJrZXkSFgoGYW1vdW50GAIgAigEUgZhbW91bnQ='); -@$core.Deprecated('Use blankComponentDescriptor instead') -const BlankComponent$json = const { - '1': 'BlankComponent', -}; - -/// Descriptor for `BlankComponent`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blankComponentDescriptor = $convert.base64Decode('Cg5CbGFua0NvbXBvbmVudA=='); -@$core.Deprecated('Use componentDescriptor instead') -const Component$json = const { - '1': 'Component', - '2': const [ - const {'1': 'salt_commitment', '3': 1, '4': 2, '5': 12, '10': 'saltCommitment'}, - const {'1': 'input', '3': 2, '4': 1, '5': 11, '6': '.fusion.InputComponent', '9': 0, '10': 'input'}, - const {'1': 'output', '3': 3, '4': 1, '5': 11, '6': '.fusion.OutputComponent', '9': 0, '10': 'output'}, - const {'1': 'blank', '3': 4, '4': 1, '5': 11, '6': '.fusion.BlankComponent', '9': 0, '10': 'blank'}, - ], - '8': const [ - const {'1': 'component'}, - ], -}; - -/// Descriptor for `Component`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List componentDescriptor = $convert.base64Decode('CglDb21wb25lbnQSJwoPc2FsdF9jb21taXRtZW50GAEgAigMUg5zYWx0Q29tbWl0bWVudBIuCgVpbnB1dBgCIAEoCzIWLmZ1c2lvbi5JbnB1dENvbXBvbmVudEgAUgVpbnB1dBIxCgZvdXRwdXQYAyABKAsyFy5mdXNpb24uT3V0cHV0Q29tcG9uZW50SABSBm91dHB1dBIuCgVibGFuaxgEIAEoCzIWLmZ1c2lvbi5CbGFua0NvbXBvbmVudEgAUgVibGFua0ILCgljb21wb25lbnQ='); -@$core.Deprecated('Use initialCommitmentDescriptor instead') -const InitialCommitment$json = const { - '1': 'InitialCommitment', - '2': const [ - const {'1': 'salted_component_hash', '3': 1, '4': 2, '5': 12, '10': 'saltedComponentHash'}, - const {'1': 'amount_commitment', '3': 2, '4': 2, '5': 12, '10': 'amountCommitment'}, - const {'1': 'communication_key', '3': 3, '4': 2, '5': 12, '10': 'communicationKey'}, - ], -}; - -/// Descriptor for `InitialCommitment`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List initialCommitmentDescriptor = $convert.base64Decode('ChFJbml0aWFsQ29tbWl0bWVudBIyChVzYWx0ZWRfY29tcG9uZW50X2hhc2gYASACKAxSE3NhbHRlZENvbXBvbmVudEhhc2gSKwoRYW1vdW50X2NvbW1pdG1lbnQYAiACKAxSEGFtb3VudENvbW1pdG1lbnQSKwoRY29tbXVuaWNhdGlvbl9rZXkYAyACKAxSEGNvbW11bmljYXRpb25LZXk='); -@$core.Deprecated('Use proofDescriptor instead') -const Proof$json = const { - '1': 'Proof', - '2': const [ - const {'1': 'component_idx', '3': 1, '4': 2, '5': 7, '10': 'componentIdx'}, - const {'1': 'salt', '3': 2, '4': 2, '5': 12, '10': 'salt'}, - const {'1': 'pedersen_nonce', '3': 3, '4': 2, '5': 12, '10': 'pedersenNonce'}, - ], -}; - -/// Descriptor for `Proof`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List proofDescriptor = $convert.base64Decode('CgVQcm9vZhIjCg1jb21wb25lbnRfaWR4GAEgAigHUgxjb21wb25lbnRJZHgSEgoEc2FsdBgCIAIoDFIEc2FsdBIlCg5wZWRlcnNlbl9ub25jZRgDIAIoDFINcGVkZXJzZW5Ob25jZQ=='); -@$core.Deprecated('Use clientHelloDescriptor instead') -const ClientHello$json = const { - '1': 'ClientHello', - '2': const [ - const {'1': 'version', '3': 1, '4': 2, '5': 12, '10': 'version'}, - const {'1': 'genesis_hash', '3': 2, '4': 1, '5': 12, '10': 'genesisHash'}, - ], -}; - -/// Descriptor for `ClientHello`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List clientHelloDescriptor = $convert.base64Decode('CgtDbGllbnRIZWxsbxIYCgd2ZXJzaW9uGAEgAigMUgd2ZXJzaW9uEiEKDGdlbmVzaXNfaGFzaBgCIAEoDFILZ2VuZXNpc0hhc2g='); -@$core.Deprecated('Use serverHelloDescriptor instead') -const ServerHello$json = const { - '1': 'ServerHello', - '2': const [ - const {'1': 'tiers', '3': 1, '4': 3, '5': 4, '10': 'tiers'}, - const {'1': 'num_components', '3': 2, '4': 2, '5': 13, '10': 'numComponents'}, - const {'1': 'component_feerate', '3': 4, '4': 2, '5': 4, '10': 'componentFeerate'}, - const {'1': 'min_excess_fee', '3': 5, '4': 2, '5': 4, '10': 'minExcessFee'}, - const {'1': 'max_excess_fee', '3': 6, '4': 2, '5': 4, '10': 'maxExcessFee'}, - const {'1': 'donation_address', '3': 15, '4': 1, '5': 9, '10': 'donationAddress'}, - ], -}; - -/// Descriptor for `ServerHello`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List serverHelloDescriptor = $convert.base64Decode('CgtTZXJ2ZXJIZWxsbxIUCgV0aWVycxgBIAMoBFIFdGllcnMSJQoObnVtX2NvbXBvbmVudHMYAiACKA1SDW51bUNvbXBvbmVudHMSKwoRY29tcG9uZW50X2ZlZXJhdGUYBCACKARSEGNvbXBvbmVudEZlZXJhdGUSJAoObWluX2V4Y2Vzc19mZWUYBSACKARSDG1pbkV4Y2Vzc0ZlZRIkCg5tYXhfZXhjZXNzX2ZlZRgGIAIoBFIMbWF4RXhjZXNzRmVlEikKEGRvbmF0aW9uX2FkZHJlc3MYDyABKAlSD2RvbmF0aW9uQWRkcmVzcw=='); -@$core.Deprecated('Use joinPoolsDescriptor instead') -const JoinPools$json = const { - '1': 'JoinPools', - '2': const [ - const {'1': 'tiers', '3': 1, '4': 3, '5': 4, '10': 'tiers'}, - const {'1': 'tags', '3': 2, '4': 3, '5': 11, '6': '.fusion.JoinPools.PoolTag', '10': 'tags'}, - ], - '3': const [JoinPools_PoolTag$json], -}; - -@$core.Deprecated('Use joinPoolsDescriptor instead') -const JoinPools_PoolTag$json = const { - '1': 'PoolTag', - '2': const [ - const {'1': 'id', '3': 1, '4': 2, '5': 12, '10': 'id'}, - const {'1': 'limit', '3': 2, '4': 2, '5': 13, '10': 'limit'}, - const {'1': 'no_ip', '3': 3, '4': 1, '5': 8, '10': 'noIp'}, - ], -}; - -/// Descriptor for `JoinPools`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List joinPoolsDescriptor = $convert.base64Decode('CglKb2luUG9vbHMSFAoFdGllcnMYASADKARSBXRpZXJzEi0KBHRhZ3MYAiADKAsyGS5mdXNpb24uSm9pblBvb2xzLlBvb2xUYWdSBHRhZ3MaRAoHUG9vbFRhZxIOCgJpZBgBIAIoDFICaWQSFAoFbGltaXQYAiACKA1SBWxpbWl0EhMKBW5vX2lwGAMgASgIUgRub0lw'); -@$core.Deprecated('Use tierStatusUpdateDescriptor instead') -const TierStatusUpdate$json = const { - '1': 'TierStatusUpdate', - '2': const [ - const {'1': 'statuses', '3': 1, '4': 3, '5': 11, '6': '.fusion.TierStatusUpdate.StatusesEntry', '10': 'statuses'}, - ], - '3': const [TierStatusUpdate_TierStatus$json, TierStatusUpdate_StatusesEntry$json], -}; - -@$core.Deprecated('Use tierStatusUpdateDescriptor instead') -const TierStatusUpdate_TierStatus$json = const { - '1': 'TierStatus', - '2': const [ - const {'1': 'players', '3': 1, '4': 1, '5': 13, '10': 'players'}, - const {'1': 'min_players', '3': 2, '4': 1, '5': 13, '10': 'minPlayers'}, - const {'1': 'max_players', '3': 3, '4': 1, '5': 13, '10': 'maxPlayers'}, - const {'1': 'time_remaining', '3': 4, '4': 1, '5': 13, '10': 'timeRemaining'}, - ], -}; - -@$core.Deprecated('Use tierStatusUpdateDescriptor instead') -const TierStatusUpdate_StatusesEntry$json = const { - '1': 'StatusesEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 4, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.fusion.TierStatusUpdate.TierStatus', '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `TierStatusUpdate`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List tierStatusUpdateDescriptor = $convert.base64Decode('ChBUaWVyU3RhdHVzVXBkYXRlEkIKCHN0YXR1c2VzGAEgAygLMiYuZnVzaW9uLlRpZXJTdGF0dXNVcGRhdGUuU3RhdHVzZXNFbnRyeVIIc3RhdHVzZXMajwEKClRpZXJTdGF0dXMSGAoHcGxheWVycxgBIAEoDVIHcGxheWVycxIfCgttaW5fcGxheWVycxgCIAEoDVIKbWluUGxheWVycxIfCgttYXhfcGxheWVycxgDIAEoDVIKbWF4UGxheWVycxIlCg50aW1lX3JlbWFpbmluZxgEIAEoDVINdGltZVJlbWFpbmluZxpgCg1TdGF0dXNlc0VudHJ5EhAKA2tleRgBIAEoBFIDa2V5EjkKBXZhbHVlGAIgASgLMiMuZnVzaW9uLlRpZXJTdGF0dXNVcGRhdGUuVGllclN0YXR1c1IFdmFsdWU6AjgB'); -@$core.Deprecated('Use fusionBeginDescriptor instead') -const FusionBegin$json = const { - '1': 'FusionBegin', - '2': const [ - const {'1': 'tier', '3': 1, '4': 2, '5': 4, '10': 'tier'}, - const {'1': 'covert_domain', '3': 2, '4': 2, '5': 12, '10': 'covertDomain'}, - const {'1': 'covert_port', '3': 3, '4': 2, '5': 13, '10': 'covertPort'}, - const {'1': 'covert_ssl', '3': 4, '4': 1, '5': 8, '10': 'covertSsl'}, - const {'1': 'server_time', '3': 5, '4': 2, '5': 6, '10': 'serverTime'}, - ], -}; - -/// Descriptor for `FusionBegin`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List fusionBeginDescriptor = $convert.base64Decode('CgtGdXNpb25CZWdpbhISCgR0aWVyGAEgAigEUgR0aWVyEiMKDWNvdmVydF9kb21haW4YAiACKAxSDGNvdmVydERvbWFpbhIfCgtjb3ZlcnRfcG9ydBgDIAIoDVIKY292ZXJ0UG9ydBIdCgpjb3ZlcnRfc3NsGAQgASgIUgljb3ZlcnRTc2wSHwoLc2VydmVyX3RpbWUYBSACKAZSCnNlcnZlclRpbWU='); -@$core.Deprecated('Use startRoundDescriptor instead') -const StartRound$json = const { - '1': 'StartRound', - '2': const [ - const {'1': 'round_pubkey', '3': 1, '4': 2, '5': 12, '10': 'roundPubkey'}, - const {'1': 'blind_nonce_points', '3': 2, '4': 3, '5': 12, '10': 'blindNoncePoints'}, - const {'1': 'server_time', '3': 5, '4': 2, '5': 6, '10': 'serverTime'}, - ], -}; - -/// Descriptor for `StartRound`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List startRoundDescriptor = $convert.base64Decode('CgpTdGFydFJvdW5kEiEKDHJvdW5kX3B1YmtleRgBIAIoDFILcm91bmRQdWJrZXkSLAoSYmxpbmRfbm9uY2VfcG9pbnRzGAIgAygMUhBibGluZE5vbmNlUG9pbnRzEh8KC3NlcnZlcl90aW1lGAUgAigGUgpzZXJ2ZXJUaW1l'); -@$core.Deprecated('Use playerCommitDescriptor instead') -const PlayerCommit$json = const { - '1': 'PlayerCommit', - '2': const [ - const {'1': 'initial_commitments', '3': 1, '4': 3, '5': 12, '10': 'initialCommitments'}, - const {'1': 'excess_fee', '3': 2, '4': 2, '5': 4, '10': 'excessFee'}, - const {'1': 'pedersen_total_nonce', '3': 3, '4': 2, '5': 12, '10': 'pedersenTotalNonce'}, - const {'1': 'random_number_commitment', '3': 4, '4': 2, '5': 12, '10': 'randomNumberCommitment'}, - const {'1': 'blind_sig_requests', '3': 5, '4': 3, '5': 12, '10': 'blindSigRequests'}, - ], -}; - -/// Descriptor for `PlayerCommit`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List playerCommitDescriptor = $convert.base64Decode('CgxQbGF5ZXJDb21taXQSLwoTaW5pdGlhbF9jb21taXRtZW50cxgBIAMoDFISaW5pdGlhbENvbW1pdG1lbnRzEh0KCmV4Y2Vzc19mZWUYAiACKARSCWV4Y2Vzc0ZlZRIwChRwZWRlcnNlbl90b3RhbF9ub25jZRgDIAIoDFIScGVkZXJzZW5Ub3RhbE5vbmNlEjgKGHJhbmRvbV9udW1iZXJfY29tbWl0bWVudBgEIAIoDFIWcmFuZG9tTnVtYmVyQ29tbWl0bWVudBIsChJibGluZF9zaWdfcmVxdWVzdHMYBSADKAxSEGJsaW5kU2lnUmVxdWVzdHM='); -@$core.Deprecated('Use blindSigResponsesDescriptor instead') -const BlindSigResponses$json = const { - '1': 'BlindSigResponses', - '2': const [ - const {'1': 'scalars', '3': 1, '4': 3, '5': 12, '10': 'scalars'}, - ], -}; - -/// Descriptor for `BlindSigResponses`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blindSigResponsesDescriptor = $convert.base64Decode('ChFCbGluZFNpZ1Jlc3BvbnNlcxIYCgdzY2FsYXJzGAEgAygMUgdzY2FsYXJz'); -@$core.Deprecated('Use allCommitmentsDescriptor instead') -const AllCommitments$json = const { - '1': 'AllCommitments', - '2': const [ - const {'1': 'initial_commitments', '3': 1, '4': 3, '5': 12, '10': 'initialCommitments'}, - ], -}; - -/// Descriptor for `AllCommitments`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List allCommitmentsDescriptor = $convert.base64Decode('Cg5BbGxDb21taXRtZW50cxIvChNpbml0aWFsX2NvbW1pdG1lbnRzGAEgAygMUhJpbml0aWFsQ29tbWl0bWVudHM='); -@$core.Deprecated('Use covertComponentDescriptor instead') -const CovertComponent$json = const { - '1': 'CovertComponent', - '2': const [ - const {'1': 'round_pubkey', '3': 1, '4': 1, '5': 12, '10': 'roundPubkey'}, - const {'1': 'signature', '3': 2, '4': 2, '5': 12, '10': 'signature'}, - const {'1': 'component', '3': 3, '4': 2, '5': 12, '10': 'component'}, - ], -}; - -/// Descriptor for `CovertComponent`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List covertComponentDescriptor = $convert.base64Decode('Cg9Db3ZlcnRDb21wb25lbnQSIQoMcm91bmRfcHVia2V5GAEgASgMUgtyb3VuZFB1YmtleRIcCglzaWduYXR1cmUYAiACKAxSCXNpZ25hdHVyZRIcCgljb21wb25lbnQYAyACKAxSCWNvbXBvbmVudA=='); -@$core.Deprecated('Use shareCovertComponentsDescriptor instead') -const ShareCovertComponents$json = const { - '1': 'ShareCovertComponents', - '2': const [ - const {'1': 'components', '3': 4, '4': 3, '5': 12, '10': 'components'}, - const {'1': 'skip_signatures', '3': 5, '4': 1, '5': 8, '10': 'skipSignatures'}, - const {'1': 'session_hash', '3': 6, '4': 1, '5': 12, '10': 'sessionHash'}, - ], -}; - -/// Descriptor for `ShareCovertComponents`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List shareCovertComponentsDescriptor = $convert.base64Decode('ChVTaGFyZUNvdmVydENvbXBvbmVudHMSHgoKY29tcG9uZW50cxgEIAMoDFIKY29tcG9uZW50cxInCg9za2lwX3NpZ25hdHVyZXMYBSABKAhSDnNraXBTaWduYXR1cmVzEiEKDHNlc3Npb25faGFzaBgGIAEoDFILc2Vzc2lvbkhhc2g='); -@$core.Deprecated('Use covertTransactionSignatureDescriptor instead') -const CovertTransactionSignature$json = const { - '1': 'CovertTransactionSignature', - '2': const [ - const {'1': 'round_pubkey', '3': 1, '4': 1, '5': 12, '10': 'roundPubkey'}, - const {'1': 'which_input', '3': 2, '4': 2, '5': 13, '10': 'whichInput'}, - const {'1': 'txsignature', '3': 3, '4': 2, '5': 12, '10': 'txsignature'}, - ], -}; - -/// Descriptor for `CovertTransactionSignature`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List covertTransactionSignatureDescriptor = $convert.base64Decode('ChpDb3ZlcnRUcmFuc2FjdGlvblNpZ25hdHVyZRIhCgxyb3VuZF9wdWJrZXkYASABKAxSC3JvdW5kUHVia2V5Eh8KC3doaWNoX2lucHV0GAIgAigNUgp3aGljaElucHV0EiAKC3R4c2lnbmF0dXJlGAMgAigMUgt0eHNpZ25hdHVyZQ=='); -@$core.Deprecated('Use fusionResultDescriptor instead') -const FusionResult$json = const { - '1': 'FusionResult', - '2': const [ - const {'1': 'ok', '3': 1, '4': 2, '5': 8, '10': 'ok'}, - const {'1': 'txsignatures', '3': 2, '4': 3, '5': 12, '10': 'txsignatures'}, - const {'1': 'bad_components', '3': 3, '4': 3, '5': 13, '10': 'badComponents'}, - ], -}; - -/// Descriptor for `FusionResult`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List fusionResultDescriptor = $convert.base64Decode('CgxGdXNpb25SZXN1bHQSDgoCb2sYASACKAhSAm9rEiIKDHR4c2lnbmF0dXJlcxgCIAMoDFIMdHhzaWduYXR1cmVzEiUKDmJhZF9jb21wb25lbnRzGAMgAygNUg1iYWRDb21wb25lbnRz'); -@$core.Deprecated('Use myProofsListDescriptor instead') -const MyProofsList$json = const { - '1': 'MyProofsList', - '2': const [ - const {'1': 'encrypted_proofs', '3': 1, '4': 3, '5': 12, '10': 'encryptedProofs'}, - const {'1': 'random_number', '3': 2, '4': 2, '5': 12, '10': 'randomNumber'}, - ], -}; - -/// Descriptor for `MyProofsList`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List myProofsListDescriptor = $convert.base64Decode('CgxNeVByb29mc0xpc3QSKQoQZW5jcnlwdGVkX3Byb29mcxgBIAMoDFIPZW5jcnlwdGVkUHJvb2ZzEiMKDXJhbmRvbV9udW1iZXIYAiACKAxSDHJhbmRvbU51bWJlcg=='); -@$core.Deprecated('Use theirProofsListDescriptor instead') -const TheirProofsList$json = const { - '1': 'TheirProofsList', - '2': const [ - const {'1': 'proofs', '3': 1, '4': 3, '5': 11, '6': '.fusion.TheirProofsList.RelayedProof', '10': 'proofs'}, - ], - '3': const [TheirProofsList_RelayedProof$json], -}; - -@$core.Deprecated('Use theirProofsListDescriptor instead') -const TheirProofsList_RelayedProof$json = const { - '1': 'RelayedProof', - '2': const [ - const {'1': 'encrypted_proof', '3': 1, '4': 2, '5': 12, '10': 'encryptedProof'}, - const {'1': 'src_commitment_idx', '3': 2, '4': 2, '5': 13, '10': 'srcCommitmentIdx'}, - const {'1': 'dst_key_idx', '3': 3, '4': 2, '5': 13, '10': 'dstKeyIdx'}, - ], -}; - -/// Descriptor for `TheirProofsList`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List theirProofsListDescriptor = $convert.base64Decode('Cg9UaGVpclByb29mc0xpc3QSPAoGcHJvb2ZzGAEgAygLMiQuZnVzaW9uLlRoZWlyUHJvb2ZzTGlzdC5SZWxheWVkUHJvb2ZSBnByb29mcxqFAQoMUmVsYXllZFByb29mEicKD2VuY3J5cHRlZF9wcm9vZhgBIAIoDFIOZW5jcnlwdGVkUHJvb2YSLAoSc3JjX2NvbW1pdG1lbnRfaWR4GAIgAigNUhBzcmNDb21taXRtZW50SWR4Eh4KC2RzdF9rZXlfaWR4GAMgAigNUglkc3RLZXlJZHg='); -@$core.Deprecated('Use blamesDescriptor instead') -const Blames$json = const { - '1': 'Blames', - '2': const [ - const {'1': 'blames', '3': 1, '4': 3, '5': 11, '6': '.fusion.Blames.BlameProof', '10': 'blames'}, - ], - '3': const [Blames_BlameProof$json], -}; - -@$core.Deprecated('Use blamesDescriptor instead') -const Blames_BlameProof$json = const { - '1': 'BlameProof', - '2': const [ - const {'1': 'which_proof', '3': 1, '4': 2, '5': 13, '10': 'whichProof'}, - const {'1': 'session_key', '3': 2, '4': 1, '5': 12, '9': 0, '10': 'sessionKey'}, - const {'1': 'privkey', '3': 3, '4': 1, '5': 12, '9': 0, '10': 'privkey'}, - const {'1': 'need_lookup_blockchain', '3': 4, '4': 1, '5': 8, '10': 'needLookupBlockchain'}, - const {'1': 'blame_reason', '3': 5, '4': 1, '5': 9, '10': 'blameReason'}, - ], - '8': const [ - const {'1': 'decrypter'}, - ], -}; - -/// Descriptor for `Blames`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blamesDescriptor = $convert.base64Decode('CgZCbGFtZXMSMQoGYmxhbWVzGAEgAygLMhkuZnVzaW9uLkJsYW1lcy5CbGFtZVByb29mUgZibGFtZXMa0gEKCkJsYW1lUHJvb2YSHwoLd2hpY2hfcHJvb2YYASACKA1SCndoaWNoUHJvb2YSIQoLc2Vzc2lvbl9rZXkYAiABKAxIAFIKc2Vzc2lvbktleRIaCgdwcml2a2V5GAMgASgMSABSB3ByaXZrZXkSNAoWbmVlZF9sb29rdXBfYmxvY2tjaGFpbhgEIAEoCFIUbmVlZExvb2t1cEJsb2NrY2hhaW4SIQoMYmxhbWVfcmVhc29uGAUgASgJUgtibGFtZVJlYXNvbkILCglkZWNyeXB0ZXI='); -@$core.Deprecated('Use restartRoundDescriptor instead') -const RestartRound$json = const { - '1': 'RestartRound', -}; - -/// Descriptor for `RestartRound`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List restartRoundDescriptor = $convert.base64Decode('CgxSZXN0YXJ0Um91bmQ='); -@$core.Deprecated('Use errorDescriptor instead') -const Error$json = const { - '1': 'Error', - '2': const [ - const {'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'}, - ], -}; - -/// Descriptor for `Error`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List errorDescriptor = $convert.base64Decode('CgVFcnJvchIYCgdtZXNzYWdlGAEgASgJUgdtZXNzYWdl'); -@$core.Deprecated('Use pingDescriptor instead') -const Ping$json = const { - '1': 'Ping', -}; - -/// Descriptor for `Ping`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List pingDescriptor = $convert.base64Decode('CgRQaW5n'); -@$core.Deprecated('Use oKDescriptor instead') -const OK$json = const { - '1': 'OK', -}; - -/// Descriptor for `OK`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List oKDescriptor = $convert.base64Decode('CgJPSw=='); -@$core.Deprecated('Use clientMessageDescriptor instead') -const ClientMessage$json = const { - '1': 'ClientMessage', - '2': const [ - const {'1': 'clienthello', '3': 1, '4': 1, '5': 11, '6': '.fusion.ClientHello', '9': 0, '10': 'clienthello'}, - const {'1': 'joinpools', '3': 2, '4': 1, '5': 11, '6': '.fusion.JoinPools', '9': 0, '10': 'joinpools'}, - const {'1': 'playercommit', '3': 3, '4': 1, '5': 11, '6': '.fusion.PlayerCommit', '9': 0, '10': 'playercommit'}, - const {'1': 'myproofslist', '3': 5, '4': 1, '5': 11, '6': '.fusion.MyProofsList', '9': 0, '10': 'myproofslist'}, - const {'1': 'blames', '3': 6, '4': 1, '5': 11, '6': '.fusion.Blames', '9': 0, '10': 'blames'}, - ], - '8': const [ - const {'1': 'msg'}, - ], -}; - -/// Descriptor for `ClientMessage`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List clientMessageDescriptor = $convert.base64Decode('Cg1DbGllbnRNZXNzYWdlEjcKC2NsaWVudGhlbGxvGAEgASgLMhMuZnVzaW9uLkNsaWVudEhlbGxvSABSC2NsaWVudGhlbGxvEjEKCWpvaW5wb29scxgCIAEoCzIRLmZ1c2lvbi5Kb2luUG9vbHNIAFIJam9pbnBvb2xzEjoKDHBsYXllcmNvbW1pdBgDIAEoCzIULmZ1c2lvbi5QbGF5ZXJDb21taXRIAFIMcGxheWVyY29tbWl0EjoKDG15cHJvb2ZzbGlzdBgFIAEoCzIULmZ1c2lvbi5NeVByb29mc0xpc3RIAFIMbXlwcm9vZnNsaXN0EigKBmJsYW1lcxgGIAEoCzIOLmZ1c2lvbi5CbGFtZXNIAFIGYmxhbWVzQgUKA21zZw=='); -@$core.Deprecated('Use serverMessageDescriptor instead') -const ServerMessage$json = const { - '1': 'ServerMessage', - '2': const [ - const {'1': 'serverhello', '3': 1, '4': 1, '5': 11, '6': '.fusion.ServerHello', '9': 0, '10': 'serverhello'}, - const {'1': 'tierstatusupdate', '3': 2, '4': 1, '5': 11, '6': '.fusion.TierStatusUpdate', '9': 0, '10': 'tierstatusupdate'}, - const {'1': 'fusionbegin', '3': 3, '4': 1, '5': 11, '6': '.fusion.FusionBegin', '9': 0, '10': 'fusionbegin'}, - const {'1': 'startround', '3': 4, '4': 1, '5': 11, '6': '.fusion.StartRound', '9': 0, '10': 'startround'}, - const {'1': 'blindsigresponses', '3': 5, '4': 1, '5': 11, '6': '.fusion.BlindSigResponses', '9': 0, '10': 'blindsigresponses'}, - const {'1': 'allcommitments', '3': 6, '4': 1, '5': 11, '6': '.fusion.AllCommitments', '9': 0, '10': 'allcommitments'}, - const {'1': 'sharecovertcomponents', '3': 7, '4': 1, '5': 11, '6': '.fusion.ShareCovertComponents', '9': 0, '10': 'sharecovertcomponents'}, - const {'1': 'fusionresult', '3': 8, '4': 1, '5': 11, '6': '.fusion.FusionResult', '9': 0, '10': 'fusionresult'}, - const {'1': 'theirproofslist', '3': 9, '4': 1, '5': 11, '6': '.fusion.TheirProofsList', '9': 0, '10': 'theirproofslist'}, - const {'1': 'restartround', '3': 14, '4': 1, '5': 11, '6': '.fusion.RestartRound', '9': 0, '10': 'restartround'}, - const {'1': 'error', '3': 15, '4': 1, '5': 11, '6': '.fusion.Error', '9': 0, '10': 'error'}, - ], - '8': const [ - const {'1': 'msg'}, - ], -}; - -/// Descriptor for `ServerMessage`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List serverMessageDescriptor = $convert.base64Decode('Cg1TZXJ2ZXJNZXNzYWdlEjcKC3NlcnZlcmhlbGxvGAEgASgLMhMuZnVzaW9uLlNlcnZlckhlbGxvSABSC3NlcnZlcmhlbGxvEkYKEHRpZXJzdGF0dXN1cGRhdGUYAiABKAsyGC5mdXNpb24uVGllclN0YXR1c1VwZGF0ZUgAUhB0aWVyc3RhdHVzdXBkYXRlEjcKC2Z1c2lvbmJlZ2luGAMgASgLMhMuZnVzaW9uLkZ1c2lvbkJlZ2luSABSC2Z1c2lvbmJlZ2luEjQKCnN0YXJ0cm91bmQYBCABKAsyEi5mdXNpb24uU3RhcnRSb3VuZEgAUgpzdGFydHJvdW5kEkkKEWJsaW5kc2lncmVzcG9uc2VzGAUgASgLMhkuZnVzaW9uLkJsaW5kU2lnUmVzcG9uc2VzSABSEWJsaW5kc2lncmVzcG9uc2VzEkAKDmFsbGNvbW1pdG1lbnRzGAYgASgLMhYuZnVzaW9uLkFsbENvbW1pdG1lbnRzSABSDmFsbGNvbW1pdG1lbnRzElUKFXNoYXJlY292ZXJ0Y29tcG9uZW50cxgHIAEoCzIdLmZ1c2lvbi5TaGFyZUNvdmVydENvbXBvbmVudHNIAFIVc2hhcmVjb3ZlcnRjb21wb25lbnRzEjoKDGZ1c2lvbnJlc3VsdBgIIAEoCzIULmZ1c2lvbi5GdXNpb25SZXN1bHRIAFIMZnVzaW9ucmVzdWx0EkMKD3RoZWlycHJvb2ZzbGlzdBgJIAEoCzIXLmZ1c2lvbi5UaGVpclByb29mc0xpc3RIAFIPdGhlaXJwcm9vZnNsaXN0EjoKDHJlc3RhcnRyb3VuZBgOIAEoCzIULmZ1c2lvbi5SZXN0YXJ0Um91bmRIAFIMcmVzdGFydHJvdW5kEiUKBWVycm9yGA8gASgLMg0uZnVzaW9uLkVycm9ySABSBWVycm9yQgUKA21zZw=='); -@$core.Deprecated('Use covertMessageDescriptor instead') -const CovertMessage$json = const { - '1': 'CovertMessage', - '2': const [ - const {'1': 'component', '3': 1, '4': 1, '5': 11, '6': '.fusion.CovertComponent', '9': 0, '10': 'component'}, - const {'1': 'signature', '3': 2, '4': 1, '5': 11, '6': '.fusion.CovertTransactionSignature', '9': 0, '10': 'signature'}, - const {'1': 'ping', '3': 3, '4': 1, '5': 11, '6': '.fusion.Ping', '9': 0, '10': 'ping'}, - ], - '8': const [ - const {'1': 'msg'}, - ], -}; - -/// Descriptor for `CovertMessage`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List covertMessageDescriptor = $convert.base64Decode('Cg1Db3ZlcnRNZXNzYWdlEjcKCWNvbXBvbmVudBgBIAEoCzIXLmZ1c2lvbi5Db3ZlcnRDb21wb25lbnRIAFIJY29tcG9uZW50EkIKCXNpZ25hdHVyZRgCIAEoCzIiLmZ1c2lvbi5Db3ZlcnRUcmFuc2FjdGlvblNpZ25hdHVyZUgAUglzaWduYXR1cmUSIgoEcGluZxgDIAEoCzIMLmZ1c2lvbi5QaW5nSABSBHBpbmdCBQoDbXNn'); -@$core.Deprecated('Use covertResponseDescriptor instead') -const CovertResponse$json = const { - '1': 'CovertResponse', - '2': const [ - const {'1': 'ok', '3': 1, '4': 1, '5': 11, '6': '.fusion.OK', '9': 0, '10': 'ok'}, - const {'1': 'error', '3': 15, '4': 1, '5': 11, '6': '.fusion.Error', '9': 0, '10': 'error'}, - ], - '8': const [ - const {'1': 'msg'}, - ], -}; - -/// Descriptor for `CovertResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List covertResponseDescriptor = $convert.base64Decode('Cg5Db3ZlcnRSZXNwb25zZRIcCgJvaxgBIAEoCzIKLmZ1c2lvbi5PS0gAUgJvaxIlCgVlcnJvchgPIAEoCzINLmZ1c2lvbi5FcnJvckgAUgVlcnJvckIFCgNtc2c='); diff --git a/lib/services/cashfusion/protobuf/fusion.proto b/lib/services/cashfusion/protobuf/fusion.proto deleted file mode 100644 index f2273f78f..000000000 --- a/lib/services/cashfusion/protobuf/fusion.proto +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Electron Cash - a lightweight Bitcoin Cash client - * CashFusion - an advanced coin anonymizer - * - * Copyright (C) 2020 Mark B. Lundeberg - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -syntax = "proto2"; - -package fusion; - -// Some primitives - -message InputComponent { - required bytes prev_txid = 1; // in 'reverse' order, just like in tx - required uint32 prev_index = 2; - required bytes pubkey = 3; - required uint64 amount = 4; - } - -message OutputComponent { - required bytes scriptpubkey = 1; - required uint64 amount = 2; - } - -message BlankComponent { - } - -message Component { - required bytes salt_commitment = 1; // 32 bytes - oneof component { - InputComponent input = 2; - OutputComponent output = 3; - BlankComponent blank = 4; - } - } - -message InitialCommitment { - required bytes salted_component_hash = 1; // 32 byte hash - required bytes amount_commitment = 2; // uncompressed point - required bytes communication_key = 3; // compressed point - } - -message Proof { - // During blame phase, messages of this form are encrypted and sent - // to a different player. It is already known which commitment this - // should apply to, so we only need to point at the component. - required fixed32 component_idx = 1; - required bytes salt = 2; // 32 bytes - required bytes pedersen_nonce = 3; // 32 bytes -} - - - -// Primary communication message types (and flow) - -// Setup phase - -message ClientHello { // from client - required bytes version = 1; - optional bytes genesis_hash = 2; // 32 byte hash (bitcoind little-endian memory order) -} - -message ServerHello { // from server - repeated uint64 tiers = 1; - required uint32 num_components = 2; - required uint64 component_feerate = 4; // sats/kB - required uint64 min_excess_fee = 5; // sats - required uint64 max_excess_fee = 6; // sats - - optional string donation_address = 15; // BCH Address "bitcoincash:qpx..." -} - -message JoinPools { // from client - message PoolTag { - // These tags can be used to client to stop the server from including - // the client too many times in the same fusion. Thus, the client can - // connect many times without fear of fusing with themselves. - required bytes id = 1; // allowed up to 20 bytes - required uint32 limit = 2; // between 1 and 5 inclusive - optional bool no_ip = 3; // whether to do an IP-less tag -- this will collide with all other users, make sure it's random so you can't get DoSed. - } - repeated uint64 tiers = 1; - repeated PoolTag tags = 2; // at most five tags. -} - -message TierStatusUpdate { // from server - message TierStatus { - // in future, we will want server to indicate 'remaining time' and mask number of players. - // note: if player is in queue then a status will be ommitted. - optional uint32 players = 1; - optional uint32 min_players = 2; // minimum required to start (may have delay to allow extra) - optional uint32 max_players = 3; // maximum allowed (immediate start) - optional uint32 time_remaining = 4; - } - map statuses = 1; -} - -message FusionBegin { // from server - required uint64 tier = 1; - required bytes covert_domain = 2; - required uint32 covert_port = 3; - optional bool covert_ssl = 4; - required fixed64 server_time = 5; // server unix time when sending this message; can't be too far off from recipient's clock. -} - - -// Fusion round (repeatable multiple times per connection) - -message StartRound { // from server - required bytes round_pubkey = 1; - repeated bytes blind_nonce_points = 2; - required fixed64 server_time = 5; // server unix time when sending this message; can't be too far off from recipient's clock. - } - -// Phase 3 -message PlayerCommit { // from client - repeated bytes initial_commitments = 1; // serialized InitialCommitment messages; server will repeat them later, verbatim. - required uint64 excess_fee = 2; - required bytes pedersen_total_nonce = 3; // 32 bytes - required bytes random_number_commitment = 4; // 32 bytes - repeated bytes blind_sig_requests = 5; // 32 byte scalars - } - -// Phase 4 -message BlindSigResponses { // from server - repeated bytes scalars = 1; // 32 byte scalars -} - -message AllCommitments { - // All the commitments from all players. At ~140 bytes per commitment and hundreds of commitments, this can be quite large, so it gets sent in its own message during the covert phase. - repeated bytes initial_commitments = 1; - } - -//Phase 5 -message CovertComponent { // from covert client - // The round key is used to identify the pool if needed - optional bytes round_pubkey = 1; - required bytes signature = 2; - required bytes component = 3; // bytes so that it can be signed and hashed verbatim - } - -//Phase 6 -message ShareCovertComponents { // from server - // This is a large message! 168 bytes per initial commitment, ~112 bytes per input component. - // Can easily reach 100 kB or more. - repeated bytes components = 4; - optional bool skip_signatures = 5; // if the server already sees a problem in submitted components - optional bytes session_hash = 6; // the server's calculation of session hash, so clients can crosscheck. -} - -// Phase 7A -message CovertTransactionSignature { // from covert client - // The round key is used to identify the pool if needed - optional bytes round_pubkey = 1; - required uint32 which_input = 2; - required bytes txsignature = 3; - } - -// Phase 8 -message FusionResult { // from server - required bool ok = 1; - repeated bytes txsignatures = 2; // if ok - repeated uint32 bad_components = 3; // if not ok - } - -// Phase 9 -message MyProofsList { // from client - repeated bytes encrypted_proofs = 1; - required bytes random_number = 2; // the number we committed to, back in phase 3 - } - -message TheirProofsList { // from server - message RelayedProof { - required bytes encrypted_proof = 1; - required uint32 src_commitment_idx = 2; // which of the commitments is being proven (index in full list) - required uint32 dst_key_idx = 3; // which of the recipient's keys will unlock the encryption (index in player list) - } - repeated RelayedProof proofs = 1; - } - -// Phase 10 -message Blames { // from client - message BlameProof { - required uint32 which_proof = 1; - oneof decrypter { - bytes session_key = 2; // 32 byte, preferred if the proof decryption works at all - bytes privkey = 3; // 32 byte scalar - } - - // Some errors can only be discovered by checking the blockchain, - // Namely, if an input UTXO is missing/spent/unconfirmed/different - // scriptpubkey/different amount, than indicated. - optional bool need_lookup_blockchain = 4; - - // The client can indicate why it thinks the blame is deserved. In - // case the server finds no issue, this string might help for debugging. - optional string blame_reason = 5; - } - repeated BlameProof blames = 1; - } - -// Final message of the round -message RestartRound { -} - -// Fatal error from server, likely we did something wrong (it will disconnect us, but the message may help debugging). -message Error { - optional string message = 1; -} - -// Simple ping, as a keepalive. -message Ping { -} - -// Simple acknowledgement, nothing more to say. -message OK { -} - -// Primary communication channel types - -message ClientMessage { - oneof msg { - ClientHello clienthello = 1; - JoinPools joinpools = 2; - PlayerCommit playercommit = 3; - MyProofsList myproofslist = 5; - Blames blames = 6; - } - } - -message ServerMessage { - oneof msg { - ServerHello serverhello = 1; - TierStatusUpdate tierstatusupdate = 2; - FusionBegin fusionbegin = 3; - StartRound startround = 4; - BlindSigResponses blindsigresponses = 5; - AllCommitments allcommitments = 6; - ShareCovertComponents sharecovertcomponents = 7; - FusionResult fusionresult = 8; - TheirProofsList theirproofslist = 9; - - RestartRound restartround = 14; - Error error = 15; - } - } - -message CovertMessage { // client -> server, covertly - oneof msg { - CovertComponent component = 1; - CovertTransactionSignature signature = 2; - Ping ping = 3; - } - } - -message CovertResponse { // server -> a covert client - oneof msg { - OK ok = 1; - Error error = 15; - } -} diff --git a/lib/services/cashfusion/protocol.dart b/lib/services/cashfusion/protocol.dart deleted file mode 100644 index 65abb965c..000000000 --- a/lib/services/cashfusion/protocol.dart +++ /dev/null @@ -1,55 +0,0 @@ -class Protocol { - static const VERSION = 'alpha13'; - - static const FUSE_ID = 'FUZ\x00'; - -// Safety limits to prevent loss of funds / limit fees: - //(Note that if we enter multiply into the same fusion, our limits apply - //separately for each "player".) - // - //Deny server that asks for more than this component feerate (sat/kbyte). - static const MAX_COMPONENT_FEERATE = 5000; - //The largest 'excess fee' that we are willing to pay in a fusion (fees beyond - //those needed to pay for our components' inclusion) - static const MAX_EXCESS_FEE = 10000; - // Even if the server allows more, put at most this many inputs+outputs+blanks - static const MAX_COMPONENTS = 40; - // The largest total fee we are willing to pay (our contribution to transaction - // size should not exceed 7 kB even with 40 largest components). - static const MAX_FEE = MAX_COMPONENT_FEERATE * 7 + MAX_EXCESS_FEE; - // For privacy reasons, don't submit less than this many distinct tx components. - // (distinct tx inputs, and tx outputs) - static const MIN_TX_COMPONENTS = 11; - - static const MIN_OUTPUT = 10000; - - static const COVERT_CONNECT_TIMEOUT = 15.0; - static const COVERT_CONNECT_WINDOW = 15.0; - static const COVERT_SUBMIT_TIMEOUT = 3.0; - static const COVERT_SUBMIT_WINDOW = 5.0; - - static const COVERT_CONNECT_SPARES = 6; - - static const MAX_CLOCK_DISCREPANCY = 5.0; - - static const WARMUP_TIME = 30.0; - static const WARMUP_SLOP = 3.0; - - static const TS_EXPECTING_COMMITMENTS = 3.0; - - static const T_START_COMPS = 5.0; - - static const TS_EXPECTING_COVERT_COMPONENTS = 15.0; - - static const T_START_SIGS = 20.0; - - static const TS_EXPECTING_COVERT_SIGNATURES = 30.0; - - static const T_EXPECTING_CONCLUSION = 35.0; - - static const T_START_CLOSE = 45.0; - static const T_START_CLOSE_BLAME = 80.0; - - static const STANDARD_TIMEOUT = 3.0; - static const BLAME_VERIFY_TIME = 5.0; -} diff --git a/lib/services/cashfusion/socketwrapper.dart b/lib/services/cashfusion/socketwrapper.dart deleted file mode 100644 index 0a20670ab..000000000 --- a/lib/services/cashfusion/socketwrapper.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'dart:io'; - -class SocketWrapper { - late Socket _socket; - final String serverIP; - final int serverPort; - - late Stream> - _receiveStream; // create a field for the broadcast stream - - SocketWrapper(this.serverIP, this.serverPort); - Socket get socket => _socket; - - Stream> get receiveStream => - _receiveStream; // expose the stream with a getter - - Future connect() async { - _socket = await Socket.connect(serverIP, serverPort); - _receiveStream = - _socket.asBroadcastStream(); // initialize the broadcast stream - _socket.done.then((_) { - print('......Socket has been closed'); - }); - _socket.handleError((error) { - print('Socket error: $error'); - }); - } - - void status() { - if (_socket != null) { - print( - "Socket connected to ${_socket.remoteAddress.address}:${_socket.remotePort}"); - } else { - print("Socket is not connected"); - } - } - - Future send(List data) async { - if (_socket != null) { - _socket.add(data); - await _socket.flush(); - } else { - // handle error - } - } - - void close() { - _socket.close(); - } -} diff --git a/lib/services/cashfusion/util.dart b/lib/services/cashfusion/util.dart deleted file mode 100644 index f8cf75404..000000000 --- a/lib/services/cashfusion/util.dart +++ /dev/null @@ -1,329 +0,0 @@ -import 'dart:convert'; -import 'dart:math'; -import 'dart:typed_data'; - -import 'package:crypto/crypto.dart' as crypto; -import 'package:pointycastle/ecc/api.dart'; - -import 'fusion.pb.dart'; -import 'protocol.dart'; - -class Address { - String addr = ""; - - Address( - {required this.addr}); // Constructor updated to accept addr as a named parameter - - Address._create({required this.addr}); - - static Address fromScriptPubKey(List scriptPubKey) { - // This is just a placeholder code - String addr = ""; // This should be computed from the scriptPubKey - return Address(addr: addr); - } - - // Public constructor for testing - static Address fromString(String address) { - return Address._create(addr: address); - } - - List toScript() { - return []; - } -} - -class Tuple { - T1 item1; - T2 item2; - - Tuple(this.item1, this.item2); - - set setItem1(T1 value) { - this.item1 = value; - } - - set setItem2(T2 value) { - this.item2 = value; - } -} - -class Util { - static Uint8List hexToBytes(String hex) { - var result = new Uint8List(hex.length ~/ 2); - for (var i = 0; i < hex.length; i += 2) { - var byte = int.parse(hex.substring(i, i + 2), radix: 16); - result[i ~/ 2] = byte; - } - return result; - } - - static void checkInputElectrumX(InputComponent inputComponent) { - // Implementation needed here - // - } - - static int randPosition(Uint8List seed, int numPositions, int counter) { - // counter to bytes - var counterBytes = Uint8List(4); - var counterByteData = ByteData.sublistView(counterBytes); - counterByteData.setInt32(0, counter, Endian.big); - - // hash the seed and counter - var digest = crypto.sha256.convert([...seed, ...counterBytes]); - - // take the first 8 bytes - var first8Bytes = digest.bytes.take(8).toList(); - var int64 = ByteData.sublistView(Uint8List.fromList(first8Bytes)) - .getUint64(0, Endian.big); - - // perform the modulo operation - return ((int64 * numPositions) >> 64).toInt(); - } - - static List pubkeysFromPrivkey(String privkey) { - // This is a placeholder implementation. - return ['public_key1_dummy', 'public_key2_dummy']; - } - - static int dustLimit(int length) { - // This is a dummy implementation. - return 500; - } - - static Address getAddressFromOutputScript(Uint8List scriptpubkey) { - // Dummy implementation... - - // Throw exception if this is not a standard P2PKH address! - - return Address.fromString('dummy_address'); - } - - static bool schnorrVerify( - ECPoint pubkey, List signature, Uint8List messageHash) { - // Implementation needed: actual Schnorr signature verification - return true; - } - - static String formatSatoshis(sats, {int numZeros = 8}) { - // To implement - return ""; - } - - static void updateWalletLabel(String txid, String label) { - // Call the wallet layer. - } - - static Uint8List getRandomBytes(int length) { - final rand = Random.secure(); - final bytes = Uint8List(length); - for (int i = 0; i < length; i++) { - bytes[i] = rand.nextInt(256); - } - return bytes; - } - - static List> zip(List list1, List list2) { - int length = min(list1.length, list2.length); - return List>.generate(length, (i) => [list1[i], list2[i]]); - } - - static List calcInitialHash(int tier, Uint8List covertDomainB, - int covertPort, bool covertSsl, double beginTime) { - // Converting int to bytes in BigEndian order - var tierBytes = ByteData(8)..setInt64(0, tier, Endian.big); - var covertPortBytes = ByteData(4)..setInt32(0, covertPort, Endian.big); - var beginTimeBytes = ByteData(8) - ..setInt64(0, beginTime.toInt(), Endian.big); - - // Define constants - const version = Protocol.VERSION; - const cashFusionSession = "Cash Fusion Session"; - - // Creating the list of bytes - List elements = []; - elements.addAll(utf8.encode(cashFusionSession)); - elements.addAll(utf8.encode(version)); - elements.addAll(tierBytes.buffer.asInt8List()); - elements.addAll(covertDomainB); - elements.addAll(covertPortBytes.buffer.asInt8List()); - elements.add(covertSsl ? 1 : 0); - elements.addAll(beginTimeBytes.buffer.asInt8List()); - - // Hashing the concatenated elements - var digest = crypto.sha256.convert(elements); - - return digest.bytes; - } - - static List calcRoundHash( - List lastHash, - List roundPubkey, - int roundTime, - List> allCommitments, - List> allComponents) { - return listHash([ - utf8.encode('Cash Fusion Round'), - lastHash, - roundPubkey, - bigIntToBytes(BigInt.from(roundTime)), - listHash(allCommitments), - listHash(allComponents), - ]); - } - - static List listHash(Iterable> iterable) { - var bytes = []; - - for (var x in iterable) { - var length = ByteData(4)..setUint32(0, x.length, Endian.big); - bytes.addAll(length.buffer.asUint8List()); - bytes.addAll(x); - } - return crypto.sha256.convert(bytes).bytes; - } - - static Uint8List get_current_genesis_hash() { - var GENESIS = - "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"; - var _lastGenesisHash = hexToBytes(GENESIS).reversed.toList(); - return Uint8List.fromList(_lastGenesisHash); - } - - static List
unreserve_change_address(Address addr) { - //implement later based on wallet. - return []; - } - - static List
reserve_change_addresses(int number_addresses) { - //implement later based on wallet. - return []; - } - - static bool walletHasTransaction(String txid) { - // implement later based on wallet. - return true; - } - - static Uint8List bigIntToBytes(BigInt bigInt) { - return Uint8List.fromList( - bigInt.toRadixString(16).padLeft(32, '0').codeUnits); - } - - static Tuple genKeypair() { - var params = ECDomainParameters('secp256k1'); - var privKeyBigInt = _generatePrivateKey(params.n.bitLength); - var pubKeyPoint = params.G * privKeyBigInt; - - if (pubKeyPoint == null) { - throw Exception("Error generating public key."); - } - - Uint8List privKey = bigIntToBytes(privKeyBigInt); - Uint8List pubKey = pubKeyPoint.getEncoded(true); - - return Tuple(privKey, pubKey); - } - -// Generates a cryptographically secure private key - static BigInt _generatePrivateKey(int bitLength) { - final random = Random.secure(); - var bytes = bitLength ~/ 8; // floor division - var remBit = bitLength % 8; - - // Generate random BigInt - List rnd = List.generate(bytes, (_) => random.nextInt(256)); - var rndBit = random.nextInt(1 << remBit); - rnd.add(rndBit); - var privateKey = BigInt.parse( - rnd.map((x) => x.toRadixString(16).padLeft(2, '0')).join(), - radix: 16); - - return privateKey; - } - - // Additional helper function to convert bytes to hex - static String bytesToHex(Uint8List bytes) { - return bytes.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join(); - } - - static BigInt bytesToBigInt(Uint8List bytes) { - String hexString = bytesToHex(bytes); - return BigInt.parse(hexString, radix: 16); - } - - static Uint8List sha256(Uint8List bytes) { - crypto.Digest digest = crypto.sha256.convert(bytes); - return Uint8List.fromList(digest.bytes); - } - - static Uint8List tokenBytes([int nbytes = 32]) { - final Random _random = Random.secure(); - - return Uint8List.fromList( - List.generate(nbytes, (i) => _random.nextInt(256))); - } - - static int componentFee(int size, int feerate) { - // feerate in sat/kB - // size and feerate should both be integer - // fee is always rounded up - return ((size * feerate) + 999) ~/ 1000; - } - - static ECPoint ser_to_point( - Uint8List serializedPoint, ECDomainParameters params) { - var point = params.curve.decodePoint(serializedPoint); - if (point == null) { - throw FormatException('Point decoding failed'); - } - return point; - } - - static Uint8List point_to_ser(ECPoint point, bool compress) { - return point.getEncoded(compress); - } - - static BigInt secureRandomBigInt(int bitLength) { - final random = Random.secure(); - final bytes = (bitLength + 7) ~/ 8; // ceil division - final Uint8List randomBytes = Uint8List(bytes); - - for (int i = 0; i < bytes; i++) { - randomBytes[i] = random.nextInt(256); - } - - BigInt randomNumber = BigInt.parse( - randomBytes.map((e) => e.toRadixString(16).padLeft(2, '0')).join(), - radix: 16); - return randomNumber; - } - - static ECPoint combinePubKeys(List pubKeys) { - if (pubKeys.isEmpty) throw ArgumentError('pubKeys cannot be empty'); - - ECPoint combined = pubKeys.first.curve.infinity!; - for (var pubKey in pubKeys) { - combined = (combined + pubKey)!; - } - - if (combined.isInfinity) { - throw Exception('Combined point is at infinity'); - } - - return combined; - } - - static bool isPointOnCurve(ECPoint point, ECCurve curve) { - var x = point.x!.toBigInteger()!; - var y = point.y!.toBigInteger()!; - var a = curve.a!.toBigInteger()!; - var b = curve.b!.toBigInteger()!; - - // Calculate the left and right sides of the equation - var left = y * y; - var right = (x * x * x) + (a * x) + b; - - // Check if the point is on the curve - return left == right; - } -} // END OF CLASS diff --git a/lib/services/cashfusion/validation.dart b/lib/services/cashfusion/validation.dart deleted file mode 100644 index 95c2a6f5e..000000000 --- a/lib/services/cashfusion/validation.dart +++ /dev/null @@ -1,301 +0,0 @@ -import 'dart:typed_data'; - -import 'package:pointycastle/export.dart'; - -import 'encrypt.dart' as Encrypt; -import 'fusion.dart'; -import 'fusion.pb.dart' as pb; -import 'pedersen.dart'; -import 'util.dart'; - -class ValidationError implements Exception { - final String message; - ValidationError(this.message); - @override - String toString() => 'Validation error: $message'; -} - -int componentContrib(pb.Component component, int feerate) { - if (component.hasInput()) { - var inp = Input.fromInputComponent(component.input); - return inp.amount.toInt() - Util.componentFee(inp.sizeOfInput(), feerate); - } else if (component.hasOutput()) { - var out = Output.fromOutputComponent(component.output); - return -out.amount.toInt() - Util.componentFee(out.sizeOfOutput(), feerate); - } else if (component.hasBlank()) { - return 0; - } else { - throw ValidationError('Invalid component type'); - } -} - -void check(bool condition, String failMessage) { - if (!condition) { - throw ValidationError(failMessage); - } -} - -dynamic protoStrictParse(dynamic msg, List blob) { - try { - if (msg.mergeFromBuffer(blob) != blob.length) { - throw ArgumentError('DecodeError'); - } - } catch (e) { - throw ArgumentError('ValidationError: decode error'); - } - - if (!msg.isInitialized()) { - throw ArgumentError('missing fields'); - } - - // Protobuf in dart does not support 'unknownFields' method - // if (!msg.unknownFields.isEmpty) { - // throw ArgumentError('has extra fields'); - // } - - if (msg.writeToBuffer().length != blob.length) { - throw ArgumentError('encoding too long'); - } - - return msg; -} - -List checkPlayerCommit(pb.PlayerCommit msg, - int minExcessFee, int maxExcessFee, int numComponents) { - check(msg.initialCommitments.length == numComponents, - "wrong number of component commitments"); - check(msg.blindSigRequests.length == numComponents, - "wrong number of blind sig requests"); - - check( - minExcessFee <= msg.excessFee.toInt() && - msg.excessFee.toInt() <= maxExcessFee, - "bad excess fee"); - - check(msg.randomNumberCommitment.length == 32, "bad random commit"); - check(msg.pedersenTotalNonce.length == 32, "bad nonce"); - check(msg.blindSigRequests.every((r) => r.length == 32), - "bad blind sig request"); - - List commitMessages = []; - for (var cblob in msg.initialCommitments) { - pb.InitialCommitment cmsg = protoStrictParse(pb.InitialCommitment(), cblob); - check(cmsg.saltedComponentHash.length == 32, "bad salted hash"); - var P = cmsg.amountCommitment; - check(P.length == 65 && P[0] == 4, "bad commitment point"); - check( - cmsg.communicationKey.length == 33 && - (cmsg.communicationKey[0] == 2 || cmsg.communicationKey[0] == 3), - "bad communication key"); - commitMessages.add(cmsg); - } - - Uint8List HBytes = - Uint8List.fromList([0x02] + 'CashFusion gives us fungibility.'.codeUnits); - ECDomainParameters params = ECDomainParameters('secp256k1'); - ECPoint? HMaybe = params.curve.decodePoint(HBytes); - if (HMaybe == null) { - throw Exception('Failed to decode point'); - } - ECPoint H = HMaybe; - PedersenSetup setup = PedersenSetup(H); - - var claimedCommit; - var pointsum; - // Verify pedersen commitment - try { - pointsum = Commitment.add_points(commitMessages - .map((m) => Uint8List.fromList(m.amountCommitment)) - .toList()); - claimedCommit = setup.commit(BigInt.from(msg.excessFee.toInt()), - nonce: Util.bytesToBigInt(Uint8List.fromList(msg.pedersenTotalNonce))); - - check(pointsum == claimedCommit.PUncompressed, - "pedersen commitment mismatch"); - } catch (e) { - throw ValidationError("pedersen commitment verification error"); - } - check( - pointsum == claimedCommit.PUncompressed, "pedersen commitment mismatch"); - return commitMessages; -} - -Tuple checkCovertComponent( - pb.CovertComponent msg, ECPoint roundPubkey, int componentFeerate) { - var messageHash = Util.sha256(Uint8List.fromList(msg.component)); - - check(msg.signature.length == 64, "bad message signature"); - check(Util.schnorrVerify(roundPubkey, msg.signature, messageHash), - "bad message signature"); - - var cmsg = protoStrictParse(pb.Component(), msg.component); - check(cmsg.saltCommitment.length == 32, "bad salt commitment"); - - String sortKey; - - if (cmsg.hasInput()) { - var inp = cmsg.input; - check(inp.prevTxid.length == 32, "bad txid"); - check( - (inp.pubkey.length == 33 && - (inp.pubkey[0] == 2 || inp.pubkey[0] == 3)) || - (inp.pubkey.length == 65 && inp.pubkey[0] == 4), - "bad pubkey"); - sortKey = 'i' + - String.fromCharCodes(inp.prevTxid.reversed) + - inp.prevIndex.toString() + - String.fromCharCodes(cmsg.saltCommitment); - } else if (cmsg.hasOutput()) { - var out = cmsg.output; - Address addr; - // Basically just checks if its ok address. should throw error if not. - addr = Util.getAddressFromOutputScript(out.scriptpubkey); - - check(out.amount >= Util.dustLimit(out.scriptpubkey.length), "dust output"); - sortKey = 'o' + - out.amount.toString() + - String.fromCharCodes(out.scriptpubkey) + - String.fromCharCodes(cmsg.saltCommitment); - } else if (cmsg.hasBlank()) { - sortKey = 'b' + String.fromCharCodes(cmsg.saltCommitment); - } else { - throw ValidationError('missing component details'); - } - - return Tuple(sortKey, componentContrib(cmsg, componentFeerate)); -} - -pb.InputComponent? validateProofInternal( - Uint8List proofBlob, - pb.InitialCommitment commitment, - List allComponents, - List badComponents, - int componentFeerate, -) { - Uint8List HBytes = - Uint8List.fromList([0x02] + 'CashFusion gives us fungibility.'.codeUnits); - ECDomainParameters params = ECDomainParameters('secp256k1'); - ECPoint? HMaybe = params.curve.decodePoint(HBytes); - if (HMaybe == null) { - throw Exception('Failed to decode point'); - } - ECPoint H = HMaybe; - PedersenSetup setup = PedersenSetup(H); - - var msg = protoStrictParse(pb.Proof(), proofBlob); - - Uint8List componentBlob; - try { - componentBlob = allComponents[msg.componentIdx]; - } catch (e) { - throw ValidationError("component index out of range"); - } - - check(!badComponents.contains(msg.componentIdx), "component in bad list"); - - var comp = pb.Component(); - comp.mergeFromBuffer(componentBlob); - assert(comp.isInitialized()); - - check(msg.salt.length == 32, "salt wrong length"); - check( - Util.sha256(msg.salt) == comp.saltCommitment, - "salt commitment mismatch", - ); - check( - Util.sha256(Uint8List.fromList([...msg.salt, ...componentBlob])) == - commitment.saltedComponentHash, - "salted component hash mismatch", - ); - - var contrib = componentContrib(comp, componentFeerate); - - var PCommitted = commitment.amountCommitment; - - var claimedCommit = setup.commit( - BigInt.from(contrib), - nonce: Util.bytesToBigInt(msg.pedersenNonce), - ); - - check( - Uint8List.fromList(PCommitted) == claimedCommit.PUncompressed, - "pedersen commitment mismatch", - ); - - if (comp.hasInput()) { - return comp.input; - } else { - return null; - } -} - -Future validateBlame( - pb.Blames_BlameProof blame, - Uint8List encProof, - Uint8List srcCommitBlob, - Uint8List destCommitBlob, - List allComponents, - List badComponents, - int componentFeerate, -) async { - var destCommit = pb.InitialCommitment(); - destCommit.mergeFromBuffer(destCommitBlob); - var destPubkey = destCommit.communicationKey; - - var srcCommit = pb.InitialCommitment(); - srcCommit.mergeFromBuffer(srcCommitBlob); - - var decrypter = blame.whichDecrypter(); - ECDomainParameters params = ECDomainParameters('secp256k1'); - if (decrypter == pb.Blames_BlameProof_Decrypter.privkey) { - var privkey = Uint8List.fromList(blame.privkey); - check(privkey.length == 32, 'bad blame privkey'); - var privkeyHexStr = - Util.bytesToHex(privkey); // Convert bytes to hex string. - var privkeyBigInt = - BigInt.parse(privkeyHexStr, radix: 16); // Convert hex string to BigInt. - var privateKey = ECPrivateKey(privkeyBigInt, params); // Create ECPrivateKey - var pubkeys = Util.pubkeysFromPrivkey(privkeyHexStr); - check(destCommit.communicationKey == pubkeys[1], 'bad blame privkey'); - try { - Encrypt.decrypt(encProof, privateKey); - } catch (e) { - return 'undecryptable'; - } - throw ValidationError('blame gave privkey but decryption worked'); - } else if (decrypter != pb.Blames_BlameProof_Decrypter.sessionKey) { - throw ValidationError('unknown blame decrypter'); - } - var key = Uint8List.fromList(blame.sessionKey); - check(key.length == 32, 'bad blame session key'); - Uint8List proofBlob; - try { - proofBlob = await Encrypt.decryptWithSymmkey(encProof, key); - } catch (e) { - throw ValidationError('bad blame session key'); - } - pb.InputComponent? inpComp; - try { - inpComp = validateProofInternal( - proofBlob, - srcCommit, - allComponents, - badComponents, - componentFeerate, - ); - } catch (e) { - return e.toString(); - } - - if (!blame.needLookupBlockchain) { - throw ValidationError( - 'blame indicated internal inconsistency, none found!'); - } - - if (inpComp == null) { - throw ValidationError( - 'blame indicated blockchain error on a non-input component'); - } - - return inpComp; -} diff --git a/lib/services/mixins/fusion_interface.dart b/lib/services/mixins/fusion_interface.dart index 55c675940..d221f9c50 100644 --- a/lib/services/mixins/fusion_interface.dart +++ b/lib/services/mixins/fusion_interface.dart @@ -1,9 +1,9 @@ import 'dart:io'; +import 'package:fusiondart/fusion.dart'; import 'package:isar/isar.dart'; import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart'; -import 'package:stackwallet/services/cashfusion/fusion.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; mixin FusionInterface { @@ -130,6 +130,7 @@ mixin FusionInterface { Future refreshFusion() { // TODO - throw UnimplementedError("TODO refreshFusion eg look up number of fusion participants connected/coordinating"); + throw UnimplementedError( + "TODO refreshFusion eg look up number of fusion participants connected/coordinating"); } } diff --git a/pubspec.lock b/pubspec.lock index cfdf7a710..c8f7267b2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -761,6 +761,13 @@ packages: description: flutter source: sdk version: "0.0.0" + fusiondart: + dependency: "direct main" + description: + path: fusiondart + relative: true + source: path + version: "0.0.1" glob: dependency: transitive description: @@ -1870,5 +1877,5 @@ packages: source: hosted version: "1.0.0" sdks: - dart: ">=3.0.2 <4.0.0" + dart: ">=3.0.3 <4.0.0" flutter: ">=3.10.3" diff --git a/pubspec.yaml b/pubspec.yaml index d3c93e77a..08403e18a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -139,6 +139,9 @@ dependencies: nanodart: ^2.0.0 basic_utils: ^5.5.4 stellar_flutter_sdk: ^1.6.0 + fusiondart: + path: ./fusiondart + dev_dependencies: flutter_test: