From 98babacce0ae2a3a666db6604efa915bb833642e Mon Sep 17 00:00:00 2001 From: cyan Date: Tue, 25 Nov 2025 13:59:55 -0300 Subject: [PATCH] fix: ltc wallets not syncing (address generation issue) (#2676) * fix: ltc freezing and address generation * revert: go back to network (fixme), feeRatePerKb --- cw_bitcoin/lib/bitcoin_address_record.dart | 6 +- cw_bitcoin/lib/electrum_wallet.dart | 1 + cw_bitcoin/lib/litecoin_wallet.dart | 4 +- cw_bitcoin/lib/litecoin_wallet_addresses.dart | 13 +- cw_mweb/gen-protobuf.sh | 10 + cw_mweb/go/go.mod | 6 +- cw_mweb/go/go.sum | 8 +- cw_mweb/go/mweb.go | 5 +- cw_mweb/lib/cw_mweb.dart | 3 +- cw_mweb/lib/mwebd.pb.dart | 925 ++++++++---------- cw_mweb/lib/mwebd.pbgrpc.dart | 298 +++--- cw_mweb/pubspec.yaml | 2 + 12 files changed, 605 insertions(+), 676 deletions(-) create mode 100644 cw_mweb/gen-protobuf.sh diff --git a/cw_bitcoin/lib/bitcoin_address_record.dart b/cw_bitcoin/lib/bitcoin_address_record.dart index 2bc9fdd6c..834cbbb4c 100644 --- a/cw_bitcoin/lib/bitcoin_address_record.dart +++ b/cw_bitcoin/lib/bitcoin_address_record.dart @@ -99,7 +99,11 @@ class BitcoinAddressRecord extends BaseBitcoinAddressRecord { String getScriptHash(BasedUtxoNetwork network) { if (scriptHash != null) return scriptHash!; - scriptHash = BitcoinAddressUtils.scriptHash(address, network: network); + try { + scriptHash = BitcoinAddressUtils.scriptHash(address, network: network); + } catch (e) { + return ''; + } return scriptHash!; } diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index dc611d500..dbd3fe8a0 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -2442,6 +2442,7 @@ abstract class ElectrumWalletBase Future fetchBalances() async { final addresses = walletAddresses.allAddresses + .where((address) => address.address.isNotEmpty) .where((address) => RegexUtils.addressTypeFromStr(address.address, network) is! MwebAddress) .toList(); final balanceFutures = >>[]; diff --git a/cw_bitcoin/lib/litecoin_wallet.dart b/cw_bitcoin/lib/litecoin_wallet.dart index 11636b82d..7b2412d35 100644 --- a/cw_bitcoin/lib/litecoin_wallet.dart +++ b/cw_bitcoin/lib/litecoin_wallet.dart @@ -185,9 +185,9 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { final String? scanSecretOverride; final String? spendPubkeyOverride; - List get scanSecret => scanSecretOverride != null + List get scanSecret => (scanSecretOverride != null && scanSecretOverride?.isNotEmpty == true) ? hex.decode(scanSecretOverride!) - : mwebHd!.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw; + : mwebHd?.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw ?? List.filled(32, 0); List get spendSecret => mwebHd?.childKey(Bip32KeyIndex(0x80000001)).privateKey.privKey.raw ?? List.filled(32, 0); diff --git a/cw_bitcoin/lib/litecoin_wallet_addresses.dart b/cw_bitcoin/lib/litecoin_wallet_addresses.dart index 4968e95c3..fe39ab7cd 100644 --- a/cw_bitcoin/lib/litecoin_wallet_addresses.dart +++ b/cw_bitcoin/lib/litecoin_wallet_addresses.dart @@ -50,12 +50,12 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with final String? scanSecretOverride; final String? spendPubkeyOverride; - List get scanSecret => scanSecretOverride != null + List get scanSecret => (scanSecretOverride != null && scanSecretOverride?.isNotEmpty == true) ? hex.decode(scanSecretOverride!) - : mwebHd!.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw; - List get spendPubkey => spendPubkeyOverride != null + : mwebHd?.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw ?? List.filled(32, 0); + List get spendPubkey => (spendPubkeyOverride != null && spendPubkeyOverride?.isNotEmpty == true) ? hex.decode(spendPubkeyOverride!) - : mwebHd!.childKey(Bip32KeyIndex(0x80000001)).publicKey.pubKey.compressed; + : mwebHd?.childKey(Bip32KeyIndex(0x80000001)).publicKey.pubKey.compressed ?? List.filled(32, 0); @override Future init() async { @@ -70,10 +70,11 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with } Future ensureMwebAddressUpToIndexExists(int index) async { + printV("aaaaaa"); if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) { return null; } - if ((scanSecret.length < 1 || scanSecret.reduce((a, b) => a + b) == 0) || + if ((scanSecret.length < 1 || scanSecret.reduce((a, b) => a + b) == 0) && (spendPubkey.length < 1 || spendPubkey.reduce((a, b) => a + b) == 0)) { return null; } @@ -140,7 +141,7 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with }) { if (addressType == SegwitAddresType.mweb) { if (mwebAddrs.length == 0) { - return "null"; + return ""; } return hd == sideHd ? mwebAddrs[0] : mwebAddrs[index + 1]; } diff --git a/cw_mweb/gen-protobuf.sh b/cw_mweb/gen-protobuf.sh new file mode 100644 index 000000000..6a761f799 --- /dev/null +++ b/cw_mweb/gen-protobuf.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +docker run --platform linux/arm64 --rm \ + -v "$PWD":/work -w /work dart:2.17 bash -c ' + apt-get update && + apt-get install -y protobuf-compiler && + dart pub global activate protoc_plugin 20.0.1 && + export PATH="$PATH:/root/.pub-cache/bin" && + protoc --dart_out=grpc:./ ./lib/mwebd.proto + ' diff --git a/cw_mweb/go/go.mod b/cw_mweb/go/go.mod index e01117a28..37ff16017 100644 --- a/cw_mweb/go/go.mod +++ b/cw_mweb/go/go.mod @@ -2,9 +2,7 @@ module github.com/cake-tech/cake_wallet/cw_mweb/go go 1.24.1 -require github.com/ltcmweb/mwebd v0.1.16 - -require github.com/ltcmweb/mwebd v0.1.16 +require github.com/ltcmweb/mwebd v0.1.17 require ( github.com/Microsoft/go-winio v0.6.2 // indirect @@ -27,7 +25,7 @@ require ( github.com/kkdai/bstream v1.0.0 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/ltcmweb/coinswapd v0.1.0 // indirect - github.com/ltcmweb/ltcd v0.25.11 // indirect + github.com/ltcmweb/ltcd v0.25.12 // indirect github.com/ltcmweb/ltcd/btcec/v2 v2.3.3 // indirect github.com/ltcmweb/ltcd/chaincfg/chainhash v1.0.3 // indirect github.com/ltcmweb/neutrino v0.17.4 // indirect diff --git a/cw_mweb/go/go.sum b/cw_mweb/go/go.sum index f09c4a6ac..a0fdf516f 100644 --- a/cw_mweb/go/go.sum +++ b/cw_mweb/go/go.sum @@ -63,14 +63,14 @@ github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuV github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/ltcmweb/coinswapd v0.1.0 h1:M6eoz4g7fDpsQeNA8wWbBh6PY1xykrihyLU44SgljeI= github.com/ltcmweb/coinswapd v0.1.0/go.mod h1:CY5cVSympaLrMO8fHWXO+e/iuPLs2L0U9daMCRTstEM= -github.com/ltcmweb/ltcd v0.25.11 h1:MI0n/9I0P2Ig+myofegrXXEvh00lY3TUqPk1akYHBxA= -github.com/ltcmweb/ltcd v0.25.11/go.mod h1:jQbvPfnT4bBXJKRwU5SdD9ZUopwmSvhngdjeopv2cIU= +github.com/ltcmweb/ltcd v0.25.12 h1:igeogW2/rQIZ30UxCvd8lNPJuD6++viuRl70Z7xJ9nA= +github.com/ltcmweb/ltcd v0.25.12/go.mod h1:jQbvPfnT4bBXJKRwU5SdD9ZUopwmSvhngdjeopv2cIU= github.com/ltcmweb/ltcd/btcec/v2 v2.3.3 h1:gJc1ljDPCBtwBKFcC4SW44BFoJqoZzkeagndMYdqKKE= github.com/ltcmweb/ltcd/btcec/v2 v2.3.3/go.mod h1:NRr2WtpiSiSO29TkdZhbGNRA/Q16DV2eNbORf+M2ykI= github.com/ltcmweb/ltcd/chaincfg/chainhash v1.0.3 h1:CAPyzHI3bCFRrrVHZkDUR2i3Awj6l/aqAZIEi0E/nfM= github.com/ltcmweb/ltcd/chaincfg/chainhash v1.0.3/go.mod h1:zB+HhI2IbIwTGpdAhdzpm1GVX4ShcWTgN42+ar9HXrg= -github.com/ltcmweb/mwebd v0.1.16 h1:DaOIp/5TDhcDUxjvnWKHXkr6hF4LHe2bbY8I0zo7m9w= -github.com/ltcmweb/mwebd v0.1.16/go.mod h1:GEhTe4RTG4ImmzsyqCzO2NKK11U2Zgb5+leQnwY+u+4= +github.com/ltcmweb/mwebd v0.1.17 h1:PbYV0NuaWzjj5yAzYxYfEzqeZe54ay5mLz06f14UkJk= +github.com/ltcmweb/mwebd v0.1.17/go.mod h1:qY2DgLYbwOh2GWfW44vV/PfzBN84sR0ulphAr51sAPc= github.com/ltcmweb/neutrino v0.17.4 h1:ZsguBvicTM5CtZDsKg+OBFuPUCKjfEJ3lRSGXPjF2oM= github.com/ltcmweb/neutrino v0.17.4/go.mod h1:KktZ+McIwHuTHe0K8JK9Wv4qgv8orkA21a0ZOU4SwJ4= github.com/ltcmweb/neutrino/cache v1.1.0 h1:C0Qn2p8ogcskRPfrBKPUayjn3m/CUJqI7otopNScvhk= diff --git a/cw_mweb/go/mweb.go b/cw_mweb/go/mweb.go index 46e1bee1e..135223384 100644 --- a/cw_mweb/go/mweb.go +++ b/cw_mweb/go/mweb.go @@ -25,13 +25,14 @@ func StartServer(chain *C.char, dataDir *C.char, nodeUri *C.char, errMsg **C.cha return 0 } - err = server.StartUnix(goDataDir + "/mwebd.sock") +// err = server.StartUnix(goDataDir + "/mwebd.sock") + start, err := server.Start(0) if err != nil { *errMsg = C.CString(err.Error()) return 0 } - return 1 + return C.int(start) } //export StopServer diff --git a/cw_mweb/lib/cw_mweb.dart b/cw_mweb/lib/cw_mweb.dart index 681ffe79b..952a5a2e3 100644 --- a/cw_mweb/lib/cw_mweb.dart +++ b/cw_mweb/lib/cw_mweb.dart @@ -64,8 +64,7 @@ class CwMweb { } printV("Attempting to connect to server on port: $_port"); - final address = InternetAddress("${appDir.path}/mwebd.sock", type: InternetAddressType.unix); - _clientChannel = ClientChannel(address, channelShutdownHandler: () { + _clientChannel = ClientChannel('127.0.0.1', port: _port!, channelShutdownHandler: () { _rpcClient = null; printV("Channel is shutting down!"); }, diff --git a/cw_mweb/lib/mwebd.pb.dart b/cw_mweb/lib/mwebd.pb.dart index faf5511c6..500a9b6e8 100644 --- a/cw_mweb/lib/mwebd.pb.dart +++ b/cw_mweb/lib/mwebd.pb.dart @@ -1,13 +1,9 @@ -// +/// // Generated code. Do not modify. -// source: mwebd.proto +// source: lib/mwebd.proto // // @dart = 2.12 - -// ignore_for_file: annotate_overrides, camel_case_types, comment_references -// ignore_for_file: constant_identifier_names, library_prefixes -// ignore_for_file: non_constant_identifier_names, prefer_final_fields -// ignore_for_file: unnecessary_import, unnecessary_this, unused_import +// 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; @@ -15,15 +11,14 @@ import 'package:fixnum/fixnum.dart' as $fixnum; import 'package:protobuf/protobuf.dart' as $pb; class StatusRequest extends $pb.GeneratedMessage { - factory StatusRequest() => create(); - StatusRequest._() : super(); - factory StatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory StatusRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'StatusRequest', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'StatusRequest', createEmptyInstance: create) ..hasRequiredFields = false ; + StatusRequest._() : super(); + factory StatusRequest() => create(); + factory StatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory StatusRequest.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. ' @@ -33,10 +28,8 @@ class StatusRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - StatusRequest copyWith(void Function(StatusRequest) updates) => super.copyWith((message) => updates(message as StatusRequest)) as StatusRequest; - + StatusRequest copyWith(void Function(StatusRequest) updates) => super.copyWith((message) => updates(message as StatusRequest)) as StatusRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static StatusRequest create() => StatusRequest._(); StatusRequest createEmptyInstance() => create(); @@ -47,39 +40,38 @@ class StatusRequest extends $pb.GeneratedMessage { } class StatusResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'StatusResponse', createEmptyInstance: create) + ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockHeaderHeight', $pb.PbFieldType.O3) + ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mwebHeaderHeight', $pb.PbFieldType.O3) + ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mwebUtxosHeight', $pb.PbFieldType.O3) + ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockTime', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + StatusResponse._() : super(); factory StatusResponse({ $core.int? blockHeaderHeight, $core.int? mwebHeaderHeight, $core.int? mwebUtxosHeight, $core.int? blockTime, }) { - final $result = create(); + final _result = create(); if (blockHeaderHeight != null) { - $result.blockHeaderHeight = blockHeaderHeight; + _result.blockHeaderHeight = blockHeaderHeight; } if (mwebHeaderHeight != null) { - $result.mwebHeaderHeight = mwebHeaderHeight; + _result.mwebHeaderHeight = mwebHeaderHeight; } if (mwebUtxosHeight != null) { - $result.mwebUtxosHeight = mwebUtxosHeight; + _result.mwebUtxosHeight = mwebUtxosHeight; } if (blockTime != null) { - $result.blockTime = blockTime; + _result.blockTime = blockTime; } - return $result; + return _result; } - StatusResponse._() : super(); factory StatusResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory StatusResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'StatusResponse', createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'blockHeaderHeight', $pb.PbFieldType.O3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'mwebHeaderHeight', $pb.PbFieldType.O3) - ..a<$core.int>(3, _omitFieldNames ? '' : 'mwebUtxosHeight', $pb.PbFieldType.O3) - ..a<$core.int>(4, _omitFieldNames ? '' : 'blockTime', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -89,10 +81,8 @@ class StatusResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - StatusResponse copyWith(void Function(StatusResponse) updates) => super.copyWith((message) => updates(message as StatusResponse)) as StatusResponse; - + StatusResponse copyWith(void Function(StatusResponse) updates) => super.copyWith((message) => updates(message as StatusResponse)) as StatusResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static StatusResponse create() => StatusResponse._(); StatusResponse createEmptyInstance() => create(); @@ -101,7 +91,6 @@ class StatusResponse extends $pb.GeneratedMessage { static StatusResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static StatusResponse? _defaultInstance; - /// The height of the latest block. @$pb.TagNumber(1) $core.int get blockHeaderHeight => $_getIZ(0); @$pb.TagNumber(1) @@ -111,7 +100,6 @@ class StatusResponse extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearBlockHeaderHeight() => clearField(1); - /// The height of the latest MWEB header. @$pb.TagNumber(2) $core.int get mwebHeaderHeight => $_getIZ(1); @$pb.TagNumber(2) @@ -121,7 +109,6 @@ class StatusResponse extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearMwebHeaderHeight() => clearField(2); - /// The height at which the MWEB utxo set is synced to. @$pb.TagNumber(3) $core.int get mwebUtxosHeight => $_getIZ(2); @$pb.TagNumber(3) @@ -131,7 +118,6 @@ class StatusResponse extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearMwebUtxosHeight() => clearField(3); - /// The timestamp of the latest block. @$pb.TagNumber(4) $core.int get blockTime => $_getIZ(3); @$pb.TagNumber(4) @@ -143,29 +129,28 @@ class StatusResponse extends $pb.GeneratedMessage { } class UtxosRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UtxosRequest', createEmptyInstance: create) + ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fromHeight', $pb.PbFieldType.O3) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + UtxosRequest._() : super(); factory UtxosRequest({ $core.int? fromHeight, $core.List<$core.int>? scanSecret, }) { - final $result = create(); + final _result = create(); if (fromHeight != null) { - $result.fromHeight = fromHeight; + _result.fromHeight = fromHeight; } if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } - return $result; + return _result; } - UtxosRequest._() : super(); factory UtxosRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory UtxosRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'UtxosRequest', createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'fromHeight', $pb.PbFieldType.O3) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -175,10 +160,8 @@ class UtxosRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - UtxosRequest copyWith(void Function(UtxosRequest) updates) => super.copyWith((message) => updates(message as UtxosRequest)) as UtxosRequest; - + UtxosRequest copyWith(void Function(UtxosRequest) updates) => super.copyWith((message) => updates(message as UtxosRequest)) as UtxosRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static UtxosRequest create() => UtxosRequest._(); UtxosRequest createEmptyInstance() => create(); @@ -187,10 +170,6 @@ class UtxosRequest extends $pb.GeneratedMessage { static UtxosRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static UtxosRequest? _defaultInstance; - /// The block height from which to start fetching utxos from. - /// After all mined utxos have been streamed, unconfirmed and - /// newly confirmed utxos will also be streamed. If this is set - /// to 0 then all utxos belonging to the account will be fetched. @$pb.TagNumber(1) $core.int get fromHeight => $_getIZ(0); @$pb.TagNumber(1) @@ -200,8 +179,6 @@ class UtxosRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearFromHeight() => clearField(1); - /// The scan secret or view key represents the account for - /// which utxos should be streamed. @$pb.TagNumber(2) $core.List<$core.int> get scanSecret => $_getN(1); @$pb.TagNumber(2) @@ -213,6 +190,16 @@ class UtxosRequest extends $pb.GeneratedMessage { } class Utxo extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Utxo', createEmptyInstance: create) + ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.O3) + ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') + ..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockTime', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + Utxo._() : super(); factory Utxo({ $core.int? height, $fixnum.Int64? value, @@ -220,37 +207,26 @@ class Utxo extends $pb.GeneratedMessage { $core.String? outputId, $core.int? blockTime, }) { - final $result = create(); + final _result = create(); if (height != null) { - $result.height = height; + _result.height = height; } if (value != null) { - $result.value = value; + _result.value = value; } if (address != null) { - $result.address = address; + _result.address = address; } if (outputId != null) { - $result.outputId = outputId; + _result.outputId = outputId; } if (blockTime != null) { - $result.blockTime = blockTime; + _result.blockTime = blockTime; } - return $result; + return _result; } - Utxo._() : super(); factory Utxo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory Utxo.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Utxo', createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'height', $pb.PbFieldType.O3) - ..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..aOS(3, _omitFieldNames ? '' : 'address') - ..aOS(4, _omitFieldNames ? '' : 'outputId') - ..a<$core.int>(5, _omitFieldNames ? '' : 'blockTime', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -260,10 +236,8 @@ class Utxo extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - Utxo copyWith(void Function(Utxo) updates) => super.copyWith((message) => updates(message as Utxo)) as Utxo; - + Utxo copyWith(void Function(Utxo) updates) => super.copyWith((message) => updates(message as Utxo)) as Utxo; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static Utxo create() => Utxo._(); Utxo createEmptyInstance() => create(); @@ -272,7 +246,6 @@ class Utxo extends $pb.GeneratedMessage { static Utxo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Utxo? _defaultInstance; - /// The block height of the utxo, or 0 for unconfirmed. @$pb.TagNumber(1) $core.int get height => $_getIZ(0); @$pb.TagNumber(1) @@ -282,7 +255,6 @@ class Utxo extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearHeight() => clearField(1); - /// The value of the utxo in litoshis. @$pb.TagNumber(2) $fixnum.Int64 get value => $_getI64(1); @$pb.TagNumber(2) @@ -292,7 +264,6 @@ class Utxo extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearValue() => clearField(2); - /// The MWEB address that the utxo was received on. @$pb.TagNumber(3) $core.String get address => $_getSZ(2); @$pb.TagNumber(3) @@ -302,8 +273,6 @@ class Utxo extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearAddress() => clearField(3); - /// The output ID. This functions like a transaction hash, - /// but is unique to every utxo. @$pb.TagNumber(4) $core.String get outputId => $_getSZ(3); @$pb.TagNumber(4) @@ -313,7 +282,6 @@ class Utxo extends $pb.GeneratedMessage { @$pb.TagNumber(4) void clearOutputId() => clearField(4); - /// The timestamp of the block the utxo was mined in. @$pb.TagNumber(5) $core.int get blockTime => $_getIZ(4); @$pb.TagNumber(5) @@ -325,39 +293,38 @@ class Utxo extends $pb.GeneratedMessage { } class AddressRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AddressRequest', createEmptyInstance: create) + ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fromIndex', $pb.PbFieldType.OU3) + ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'toIndex', $pb.PbFieldType.OU3) + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'spendPubkey', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + AddressRequest._() : super(); factory AddressRequest({ $core.int? fromIndex, $core.int? toIndex, $core.List<$core.int>? scanSecret, $core.List<$core.int>? spendPubkey, }) { - final $result = create(); + final _result = create(); if (fromIndex != null) { - $result.fromIndex = fromIndex; + _result.fromIndex = fromIndex; } if (toIndex != null) { - $result.toIndex = toIndex; + _result.toIndex = toIndex; } if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } if (spendPubkey != null) { - $result.spendPubkey = spendPubkey; + _result.spendPubkey = spendPubkey; } - return $result; + return _result; } - AddressRequest._() : super(); factory AddressRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory AddressRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AddressRequest', createEmptyInstance: create) - ..a<$core.int>(1, _omitFieldNames ? '' : 'fromIndex', $pb.PbFieldType.OU3) - ..a<$core.int>(2, _omitFieldNames ? '' : 'toIndex', $pb.PbFieldType.OU3) - ..a<$core.List<$core.int>>(3, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(4, _omitFieldNames ? '' : 'spendPubkey', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -367,10 +334,8 @@ class AddressRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - AddressRequest copyWith(void Function(AddressRequest) updates) => super.copyWith((message) => updates(message as AddressRequest)) as AddressRequest; - + AddressRequest copyWith(void Function(AddressRequest) updates) => super.copyWith((message) => updates(message as AddressRequest)) as AddressRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static AddressRequest create() => AddressRequest._(); AddressRequest createEmptyInstance() => create(); @@ -379,7 +344,6 @@ class AddressRequest extends $pb.GeneratedMessage { static AddressRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AddressRequest? _defaultInstance; - /// The starting index of the range. @$pb.TagNumber(1) $core.int get fromIndex => $_getIZ(0); @$pb.TagNumber(1) @@ -389,8 +353,6 @@ class AddressRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearFromIndex() => clearField(1); - /// The ending index of the range. The result will contain all - /// addresses up to but not including this index. @$pb.TagNumber(2) $core.int get toIndex => $_getIZ(1); @$pb.TagNumber(2) @@ -400,8 +362,6 @@ class AddressRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearToIndex() => clearField(2); - /// The scan secret or view key represents the account for - /// which addresses should be returned. @$pb.TagNumber(3) $core.List<$core.int> get scanSecret => $_getN(2); @$pb.TagNumber(3) @@ -411,9 +371,6 @@ class AddressRequest extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearScanSecret() => clearField(3); - /// The public key of the spend secret for the account. The spend - /// key is required for spending utxos but is also required - /// for generating addresses. @$pb.TagNumber(4) $core.List<$core.int> get spendPubkey => $_getN(3); @$pb.TagNumber(4) @@ -425,24 +382,23 @@ class AddressRequest extends $pb.GeneratedMessage { } class AddressResponse extends $pb.GeneratedMessage { - factory AddressResponse({ - $core.Iterable<$core.String>? address, - }) { - final $result = create(); - if (address != null) { - $result.address.addAll(address); - } - return $result; - } - AddressResponse._() : super(); - factory AddressResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AddressResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AddressResponse', createEmptyInstance: create) - ..pPS(1, _omitFieldNames ? '' : 'address') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AddressResponse', createEmptyInstance: create) + ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address') ..hasRequiredFields = false ; + AddressResponse._() : super(); + factory AddressResponse({ + $core.Iterable<$core.String>? address, + }) { + final _result = create(); + if (address != null) { + _result.address.addAll(address); + } + return _result; + } + factory AddressResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AddressResponse.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. ' @@ -452,10 +408,8 @@ class AddressResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - AddressResponse copyWith(void Function(AddressResponse) updates) => super.copyWith((message) => updates(message as AddressResponse)) as AddressResponse; - + AddressResponse copyWith(void Function(AddressResponse) updates) => super.copyWith((message) => updates(message as AddressResponse)) as AddressResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static AddressResponse create() => AddressResponse._(); AddressResponse createEmptyInstance() => create(); @@ -464,30 +418,28 @@ class AddressResponse extends $pb.GeneratedMessage { static AddressResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AddressResponse? _defaultInstance; - /// An array of MWEB addresses within the requested range. @$pb.TagNumber(1) $core.List<$core.String> get address => $_getList(0); } class LedgerApdu extends $pb.GeneratedMessage { - factory LedgerApdu({ - $core.List<$core.int>? data, - }) { - final $result = create(); - if (data != null) { - $result.data = data; - } - return $result; - } - LedgerApdu._() : super(); - factory LedgerApdu.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory LedgerApdu.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'LedgerApdu', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'data', $pb.PbFieldType.OY) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'LedgerApdu', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', $pb.PbFieldType.OY) ..hasRequiredFields = false ; + LedgerApdu._() : super(); + factory LedgerApdu({ + $core.List<$core.int>? data, + }) { + final _result = create(); + if (data != null) { + _result.data = data; + } + return _result; + } + factory LedgerApdu.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory LedgerApdu.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. ' @@ -497,10 +449,8 @@ class LedgerApdu extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - LedgerApdu copyWith(void Function(LedgerApdu) updates) => super.copyWith((message) => updates(message as LedgerApdu)) as LedgerApdu; - + LedgerApdu copyWith(void Function(LedgerApdu) updates) => super.copyWith((message) => updates(message as LedgerApdu)) as LedgerApdu; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static LedgerApdu create() => LedgerApdu._(); LedgerApdu createEmptyInstance() => create(); @@ -520,24 +470,23 @@ class LedgerApdu extends $pb.GeneratedMessage { } class SpentRequest extends $pb.GeneratedMessage { - factory SpentRequest({ - $core.Iterable<$core.String>? outputId, - }) { - final $result = create(); - if (outputId != null) { - $result.outputId.addAll(outputId); - } - return $result; - } - SpentRequest._() : super(); - factory SpentRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SpentRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SpentRequest', createEmptyInstance: create) - ..pPS(1, _omitFieldNames ? '' : 'outputId') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SpentRequest', createEmptyInstance: create) + ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') ..hasRequiredFields = false ; + SpentRequest._() : super(); + factory SpentRequest({ + $core.Iterable<$core.String>? outputId, + }) { + final _result = create(); + if (outputId != null) { + _result.outputId.addAll(outputId); + } + return _result; + } + factory SpentRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SpentRequest.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. ' @@ -547,10 +496,8 @@ class SpentRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - SpentRequest copyWith(void Function(SpentRequest) updates) => super.copyWith((message) => updates(message as SpentRequest)) as SpentRequest; - + SpentRequest copyWith(void Function(SpentRequest) updates) => super.copyWith((message) => updates(message as SpentRequest)) as SpentRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static SpentRequest create() => SpentRequest._(); SpentRequest createEmptyInstance() => create(); @@ -559,30 +506,28 @@ class SpentRequest extends $pb.GeneratedMessage { static SpentRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static SpentRequest? _defaultInstance; - /// An array of output IDs to perform checks for. @$pb.TagNumber(1) $core.List<$core.String> get outputId => $_getList(0); } class SpentResponse extends $pb.GeneratedMessage { - factory SpentResponse({ - $core.Iterable<$core.String>? outputId, - }) { - final $result = create(); - if (outputId != null) { - $result.outputId.addAll(outputId); - } - return $result; - } - SpentResponse._() : super(); - factory SpentResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SpentResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SpentResponse', createEmptyInstance: create) - ..pPS(1, _omitFieldNames ? '' : 'outputId') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SpentResponse', createEmptyInstance: create) + ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') ..hasRequiredFields = false ; + SpentResponse._() : super(); + factory SpentResponse({ + $core.Iterable<$core.String>? outputId, + }) { + final _result = create(); + if (outputId != null) { + _result.outputId.addAll(outputId); + } + return _result; + } + factory SpentResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SpentResponse.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. ' @@ -592,10 +537,8 @@ class SpentResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - SpentResponse copyWith(void Function(SpentResponse) updates) => super.copyWith((message) => updates(message as SpentResponse)) as SpentResponse; - + SpentResponse copyWith(void Function(SpentResponse) updates) => super.copyWith((message) => updates(message as SpentResponse)) as SpentResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static SpentResponse create() => SpentResponse._(); SpentResponse createEmptyInstance() => create(); @@ -604,14 +547,21 @@ class SpentResponse extends $pb.GeneratedMessage { static SpentResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static SpentResponse? _defaultInstance; - /// An array of the output IDs that were not found in the - /// unspent set. This means that the outputs are either - /// unconfirmed or were spent. @$pb.TagNumber(1) $core.List<$core.String> get outputId => $_getList(0); } class CreateRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateRequest', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rawTx', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'spendSecret', $pb.PbFieldType.OY) + ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'feeRatePerKb', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..aOB(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dryRun') + ..hasRequiredFields = false + ; + + CreateRequest._() : super(); factory CreateRequest({ $core.List<$core.int>? rawTx, $core.List<$core.int>? scanSecret, @@ -619,37 +569,26 @@ class CreateRequest extends $pb.GeneratedMessage { $fixnum.Int64? feeRatePerKb, $core.bool? dryRun, }) { - final $result = create(); + final _result = create(); if (rawTx != null) { - $result.rawTx = rawTx; + _result.rawTx = rawTx; } if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } if (spendSecret != null) { - $result.spendSecret = spendSecret; + _result.spendSecret = spendSecret; } if (feeRatePerKb != null) { - $result.feeRatePerKb = feeRatePerKb; + _result.feeRatePerKb = feeRatePerKb; } if (dryRun != null) { - $result.dryRun = dryRun; + _result.dryRun = dryRun; } - return $result; + return _result; } - CreateRequest._() : super(); factory CreateRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CreateRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CreateRequest', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'rawTx', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(3, _omitFieldNames ? '' : 'spendSecret', $pb.PbFieldType.OY) - ..a<$fixnum.Int64>(4, _omitFieldNames ? '' : 'feeRatePerKb', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..aOB(5, _omitFieldNames ? '' : 'dryRun') - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -659,10 +598,8 @@ class CreateRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CreateRequest copyWith(void Function(CreateRequest) updates) => super.copyWith((message) => updates(message as CreateRequest)) as CreateRequest; - + CreateRequest copyWith(void Function(CreateRequest) updates) => super.copyWith((message) => updates(message as CreateRequest)) as CreateRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static CreateRequest create() => CreateRequest._(); CreateRequest createEmptyInstance() => create(); @@ -671,16 +608,6 @@ class CreateRequest extends $pb.GeneratedMessage { static CreateRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CreateRequest? _defaultInstance; - /// The raw bytes of the serialized transaction. This will be - /// a template where the non-MWEB inputs will remain unchanged, - /// and the MWEB inputs are specified by TxIns with the outpoint - /// hash set to the output ID of the utxo being spent, and the - /// outpoint index set to the index of the address that the utxo - /// was received on. MWEB outputs are specified by TxOuts with - /// the script pubkey set to the serialized scan and spend pubkeys - /// of the destination MWEB address. Any non-MWEB outputs will be - /// transformed into MWEB peg-outs. If the transaction doesn't - /// contain any MWEB i/o then the result will be unchanged. @$pb.TagNumber(1) $core.List<$core.int> get rawTx => $_getN(0); @$pb.TagNumber(1) @@ -690,8 +617,6 @@ class CreateRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearRawTx() => clearField(1); - /// The scan secret or view key represents the account that - /// the utxos being spent belong to. @$pb.TagNumber(2) $core.List<$core.int> get scanSecret => $_getN(1); @$pb.TagNumber(2) @@ -701,8 +626,6 @@ class CreateRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearScanSecret() => clearField(2); - /// The spend secret is the private key necessary for spending - /// the utxos belonging to the account. @$pb.TagNumber(3) $core.List<$core.int> get spendSecret => $_getN(2); @$pb.TagNumber(3) @@ -712,7 +635,6 @@ class CreateRequest extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearSpendSecret() => clearField(3); - /// The fee rate per KB in litoshis. @$pb.TagNumber(4) $fixnum.Int64 get feeRatePerKb => $_getI64(3); @$pb.TagNumber(4) @@ -722,8 +644,6 @@ class CreateRequest extends $pb.GeneratedMessage { @$pb.TagNumber(4) void clearFeeRatePerKb() => clearField(4); - /// Whether to skip MWEB transaction creation. This is useful - /// for fee estimation. @$pb.TagNumber(5) $core.bool get dryRun => $_getBF(4); @$pb.TagNumber(5) @@ -735,29 +655,28 @@ class CreateRequest extends $pb.GeneratedMessage { } class CreateResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateResponse', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rawTx', $pb.PbFieldType.OY) + ..pPS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') + ..hasRequiredFields = false + ; + + CreateResponse._() : super(); factory CreateResponse({ $core.List<$core.int>? rawTx, $core.Iterable<$core.String>? outputId, }) { - final $result = create(); + final _result = create(); if (rawTx != null) { - $result.rawTx = rawTx; + _result.rawTx = rawTx; } if (outputId != null) { - $result.outputId.addAll(outputId); + _result.outputId.addAll(outputId); } - return $result; + return _result; } - CreateResponse._() : super(); factory CreateResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CreateResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CreateResponse', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'rawTx', $pb.PbFieldType.OY) - ..pPS(2, _omitFieldNames ? '' : 'outputId') - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -767,10 +686,8 @@ class CreateResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CreateResponse copyWith(void Function(CreateResponse) updates) => super.copyWith((message) => updates(message as CreateResponse)) as CreateResponse; - + CreateResponse copyWith(void Function(CreateResponse) updates) => super.copyWith((message) => updates(message as CreateResponse)) as CreateResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static CreateResponse create() => CreateResponse._(); CreateResponse createEmptyInstance() => create(); @@ -779,10 +696,6 @@ class CreateResponse extends $pb.GeneratedMessage { static CreateResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CreateResponse? _defaultInstance; - /// The raw bytes of the serialized transaction. It will contain - /// a single TxOut representing the peg-in required. From this - /// it is possible to determine the addtional fee that was added - /// by the MWEB transaction. @$pb.TagNumber(1) $core.List<$core.int> get rawTx => $_getN(0); @$pb.TagNumber(1) @@ -792,36 +705,33 @@ class CreateResponse extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearRawTx() => clearField(1); - /// The output IDs of any utxos created by the transaction, - /// in the same order as in the template. @$pb.TagNumber(2) $core.List<$core.String> get outputId => $_getList(1); } class PsbtCreateRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtCreateRequest', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rawTx', $pb.PbFieldType.OY) + ..pc(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'witnessUtxo', $pb.PbFieldType.PM, subBuilder: TxOut.create) + ..hasRequiredFields = false + ; + + PsbtCreateRequest._() : super(); factory PsbtCreateRequest({ $core.List<$core.int>? rawTx, $core.Iterable? witnessUtxo, }) { - final $result = create(); + final _result = create(); if (rawTx != null) { - $result.rawTx = rawTx; + _result.rawTx = rawTx; } if (witnessUtxo != null) { - $result.witnessUtxo.addAll(witnessUtxo); + _result.witnessUtxo.addAll(witnessUtxo); } - return $result; + return _result; } - PsbtCreateRequest._() : super(); factory PsbtCreateRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtCreateRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtCreateRequest', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'rawTx', $pb.PbFieldType.OY) - ..pc(2, _omitFieldNames ? '' : 'witnessUtxo', $pb.PbFieldType.PM, subBuilder: TxOut.create) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -831,10 +741,8 @@ class PsbtCreateRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtCreateRequest copyWith(void Function(PsbtCreateRequest) updates) => super.copyWith((message) => updates(message as PsbtCreateRequest)) as PsbtCreateRequest; - + PsbtCreateRequest copyWith(void Function(PsbtCreateRequest) updates) => super.copyWith((message) => updates(message as PsbtCreateRequest)) as PsbtCreateRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtCreateRequest create() => PsbtCreateRequest._(); PsbtCreateRequest createEmptyInstance() => create(); @@ -843,7 +751,6 @@ class PsbtCreateRequest extends $pb.GeneratedMessage { static PsbtCreateRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtCreateRequest? _defaultInstance; - /// The raw bytes of the serialized transaction. @$pb.TagNumber(1) $core.List<$core.int> get rawTx => $_getN(0); @$pb.TagNumber(1) @@ -853,35 +760,33 @@ class PsbtCreateRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearRawTx() => clearField(1); - /// Witness utxos for each input. @$pb.TagNumber(2) $core.List get witnessUtxo => $_getList(1); } class TxOut extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'TxOut', createEmptyInstance: create) + ..aInt64(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value') + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pkScript', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + TxOut._() : super(); factory TxOut({ $fixnum.Int64? value, $core.List<$core.int>? pkScript, }) { - final $result = create(); + final _result = create(); if (value != null) { - $result.value = value; + _result.value = value; } if (pkScript != null) { - $result.pkScript = pkScript; + _result.pkScript = pkScript; } - return $result; + return _result; } - TxOut._() : super(); factory TxOut.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory TxOut.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'TxOut', createEmptyInstance: create) - ..aInt64(1, _omitFieldNames ? '' : 'value') - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'pkScript', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -891,10 +796,8 @@ class TxOut extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - TxOut copyWith(void Function(TxOut) updates) => super.copyWith((message) => updates(message as TxOut)) as TxOut; - + TxOut copyWith(void Function(TxOut) updates) => super.copyWith((message) => updates(message as TxOut)) as TxOut; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static TxOut create() => TxOut._(); TxOut createEmptyInstance() => create(); @@ -923,24 +826,23 @@ class TxOut extends $pb.GeneratedMessage { } class PsbtResponse extends $pb.GeneratedMessage { - factory PsbtResponse({ - $core.String? psbtB64, - }) { - final $result = create(); - if (psbtB64 != null) { - $result.psbtB64 = psbtB64; - } - return $result; - } - PsbtResponse._() : super(); - factory PsbtResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PsbtResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtResponse', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtResponse', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') ..hasRequiredFields = false ; + PsbtResponse._() : super(); + factory PsbtResponse({ + $core.String? psbtB64, + }) { + final _result = create(); + if (psbtB64 != null) { + _result.psbtB64 = psbtB64; + } + return _result; + } + factory PsbtResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PsbtResponse.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. ' @@ -950,10 +852,8 @@ class PsbtResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtResponse copyWith(void Function(PsbtResponse) updates) => super.copyWith((message) => updates(message as PsbtResponse)) as PsbtResponse; - + PsbtResponse copyWith(void Function(PsbtResponse) updates) => super.copyWith((message) => updates(message as PsbtResponse)) as PsbtResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtResponse create() => PsbtResponse._(); PsbtResponse createEmptyInstance() => create(); @@ -962,7 +862,6 @@ class PsbtResponse extends $pb.GeneratedMessage { static PsbtResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtResponse? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -974,39 +873,43 @@ class PsbtResponse extends $pb.GeneratedMessage { } class PsbtAddInputRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtAddInputRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') + ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addressIndex', $pb.PbFieldType.OU3) + ..a<$fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'feeRatePerKb', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false + ; + + PsbtAddInputRequest._() : super(); factory PsbtAddInputRequest({ $core.String? psbtB64, $core.List<$core.int>? scanSecret, $core.String? outputId, $core.int? addressIndex, + $fixnum.Int64? feeRatePerKb, }) { - final $result = create(); + final _result = create(); if (psbtB64 != null) { - $result.psbtB64 = psbtB64; + _result.psbtB64 = psbtB64; } if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } if (outputId != null) { - $result.outputId = outputId; + _result.outputId = outputId; } if (addressIndex != null) { - $result.addressIndex = addressIndex; + _result.addressIndex = addressIndex; } - return $result; + if (feeRatePerKb != null) { + _result.feeRatePerKb = feeRatePerKb; + } + return _result; } - PsbtAddInputRequest._() : super(); factory PsbtAddInputRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtAddInputRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtAddInputRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..aOS(3, _omitFieldNames ? '' : 'outputId') - ..a<$core.int>(4, _omitFieldNames ? '' : 'addressIndex', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1016,10 +919,8 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtAddInputRequest copyWith(void Function(PsbtAddInputRequest) updates) => super.copyWith((message) => updates(message as PsbtAddInputRequest)) as PsbtAddInputRequest; - + PsbtAddInputRequest copyWith(void Function(PsbtAddInputRequest) updates) => super.copyWith((message) => updates(message as PsbtAddInputRequest)) as PsbtAddInputRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtAddInputRequest create() => PsbtAddInputRequest._(); PsbtAddInputRequest createEmptyInstance() => create(); @@ -1028,7 +929,6 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { static PsbtAddInputRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtAddInputRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1038,8 +938,6 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearPsbtB64() => clearField(1); - /// The scan secret or view key represents the account that - /// the utxos being spent belong to. @$pb.TagNumber(2) $core.List<$core.int> get scanSecret => $_getN(1); @$pb.TagNumber(2) @@ -1049,7 +947,6 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearScanSecret() => clearField(2); - /// The output ID of the utxo. @$pb.TagNumber(3) $core.String get outputId => $_getSZ(2); @$pb.TagNumber(3) @@ -1059,7 +956,6 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearOutputId() => clearField(3); - /// The address index of the utxo. @$pb.TagNumber(4) $core.int get addressIndex => $_getIZ(3); @$pb.TagNumber(4) @@ -1068,37 +964,45 @@ class PsbtAddInputRequest extends $pb.GeneratedMessage { $core.bool hasAddressIndex() => $_has(3); @$pb.TagNumber(4) void clearAddressIndex() => clearField(4); + + @$pb.TagNumber(5) + $fixnum.Int64 get feeRatePerKb => $_getI64(4); + @$pb.TagNumber(5) + set feeRatePerKb($fixnum.Int64 v) { $_setInt64(4, v); } + @$pb.TagNumber(5) + $core.bool hasFeeRatePerKb() => $_has(4); + @$pb.TagNumber(5) + void clearFeeRatePerKb() => clearField(5); } class PsbtAddRecipientRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtAddRecipientRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'recipient', subBuilder: PsbtRecipient.create) + ..a<$fixnum.Int64>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'feeRatePerKb', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false + ; + + PsbtAddRecipientRequest._() : super(); factory PsbtAddRecipientRequest({ $core.String? psbtB64, PsbtRecipient? recipient, $fixnum.Int64? feeRatePerKb, }) { - final $result = create(); + final _result = create(); if (psbtB64 != null) { - $result.psbtB64 = psbtB64; + _result.psbtB64 = psbtB64; } if (recipient != null) { - $result.recipient = recipient; + _result.recipient = recipient; } if (feeRatePerKb != null) { - $result.feeRatePerKb = feeRatePerKb; + _result.feeRatePerKb = feeRatePerKb; } - return $result; + return _result; } - PsbtAddRecipientRequest._() : super(); factory PsbtAddRecipientRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtAddRecipientRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtAddRecipientRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') - ..aOM(2, _omitFieldNames ? '' : 'recipient', subBuilder: PsbtRecipient.create) - ..a<$fixnum.Int64>(3, _omitFieldNames ? '' : 'feeRatePerKb', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1108,10 +1012,8 @@ class PsbtAddRecipientRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtAddRecipientRequest copyWith(void Function(PsbtAddRecipientRequest) updates) => super.copyWith((message) => updates(message as PsbtAddRecipientRequest)) as PsbtAddRecipientRequest; - + PsbtAddRecipientRequest copyWith(void Function(PsbtAddRecipientRequest) updates) => super.copyWith((message) => updates(message as PsbtAddRecipientRequest)) as PsbtAddRecipientRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtAddRecipientRequest create() => PsbtAddRecipientRequest._(); PsbtAddRecipientRequest createEmptyInstance() => create(); @@ -1120,7 +1022,6 @@ class PsbtAddRecipientRequest extends $pb.GeneratedMessage { static PsbtAddRecipientRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtAddRecipientRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1141,7 +1042,6 @@ class PsbtAddRecipientRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) PsbtRecipient ensureRecipient() => $_ensure(1); - /// The fee rate per KB in litoshis. @$pb.TagNumber(3) $fixnum.Int64 get feeRatePerKb => $_getI64(2); @$pb.TagNumber(3) @@ -1153,24 +1053,23 @@ class PsbtAddRecipientRequest extends $pb.GeneratedMessage { } class PsbtGetRecipientsRequest extends $pb.GeneratedMessage { - factory PsbtGetRecipientsRequest({ - $core.String? psbtB64, - }) { - final $result = create(); - if (psbtB64 != null) { - $result.psbtB64 = psbtB64; - } - return $result; - } - PsbtGetRecipientsRequest._() : super(); - factory PsbtGetRecipientsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PsbtGetRecipientsRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtGetRecipientsRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtGetRecipientsRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') ..hasRequiredFields = false ; + PsbtGetRecipientsRequest._() : super(); + factory PsbtGetRecipientsRequest({ + $core.String? psbtB64, + }) { + final _result = create(); + if (psbtB64 != null) { + _result.psbtB64 = psbtB64; + } + return _result; + } + factory PsbtGetRecipientsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PsbtGetRecipientsRequest.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. ' @@ -1180,10 +1079,8 @@ class PsbtGetRecipientsRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtGetRecipientsRequest copyWith(void Function(PsbtGetRecipientsRequest) updates) => super.copyWith((message) => updates(message as PsbtGetRecipientsRequest)) as PsbtGetRecipientsRequest; - + PsbtGetRecipientsRequest copyWith(void Function(PsbtGetRecipientsRequest) updates) => super.copyWith((message) => updates(message as PsbtGetRecipientsRequest)) as PsbtGetRecipientsRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtGetRecipientsRequest create() => PsbtGetRecipientsRequest._(); PsbtGetRecipientsRequest createEmptyInstance() => create(); @@ -1192,7 +1089,6 @@ class PsbtGetRecipientsRequest extends $pb.GeneratedMessage { static PsbtGetRecipientsRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtGetRecipientsRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1204,34 +1100,33 @@ class PsbtGetRecipientsRequest extends $pb.GeneratedMessage { } class PsbtGetRecipientsResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtGetRecipientsResponse', createEmptyInstance: create) + ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'recipient', $pb.PbFieldType.PM, subBuilder: PsbtRecipient.create) + ..pPS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'inputAddress') + ..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fee') + ..hasRequiredFields = false + ; + + PsbtGetRecipientsResponse._() : super(); factory PsbtGetRecipientsResponse({ $core.Iterable? recipient, $core.Iterable<$core.String>? inputAddress, $fixnum.Int64? fee, }) { - final $result = create(); + final _result = create(); if (recipient != null) { - $result.recipient.addAll(recipient); + _result.recipient.addAll(recipient); } if (inputAddress != null) { - $result.inputAddress.addAll(inputAddress); + _result.inputAddress.addAll(inputAddress); } if (fee != null) { - $result.fee = fee; + _result.fee = fee; } - return $result; + return _result; } - PsbtGetRecipientsResponse._() : super(); factory PsbtGetRecipientsResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtGetRecipientsResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtGetRecipientsResponse', createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'recipient', $pb.PbFieldType.PM, subBuilder: PsbtRecipient.create) - ..pPS(2, _omitFieldNames ? '' : 'inputAddress') - ..aInt64(3, _omitFieldNames ? '' : 'fee') - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1241,10 +1136,8 @@ class PsbtGetRecipientsResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtGetRecipientsResponse copyWith(void Function(PsbtGetRecipientsResponse) updates) => super.copyWith((message) => updates(message as PsbtGetRecipientsResponse)) as PsbtGetRecipientsResponse; - + PsbtGetRecipientsResponse copyWith(void Function(PsbtGetRecipientsResponse) updates) => super.copyWith((message) => updates(message as PsbtGetRecipientsResponse)) as PsbtGetRecipientsResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtGetRecipientsResponse create() => PsbtGetRecipientsResponse._(); PsbtGetRecipientsResponse createEmptyInstance() => create(); @@ -1270,29 +1163,28 @@ class PsbtGetRecipientsResponse extends $pb.GeneratedMessage { } class PsbtRecipient extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtRecipient', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address') + ..aInt64(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value') + ..hasRequiredFields = false + ; + + PsbtRecipient._() : super(); factory PsbtRecipient({ $core.String? address, $fixnum.Int64? value, }) { - final $result = create(); + final _result = create(); if (address != null) { - $result.address = address; + _result.address = address; } if (value != null) { - $result.value = value; + _result.value = value; } - return $result; + return _result; } - PsbtRecipient._() : super(); factory PsbtRecipient.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtRecipient.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtRecipient', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'address') - ..aInt64(2, _omitFieldNames ? '' : 'value') - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1302,10 +1194,8 @@ class PsbtRecipient extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtRecipient copyWith(void Function(PsbtRecipient) updates) => super.copyWith((message) => updates(message as PsbtRecipient)) as PsbtRecipient; - + PsbtRecipient copyWith(void Function(PsbtRecipient) updates) => super.copyWith((message) => updates(message as PsbtRecipient)) as PsbtRecipient; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtRecipient create() => PsbtRecipient._(); PsbtRecipient createEmptyInstance() => create(); @@ -1334,34 +1224,33 @@ class PsbtRecipient extends $pb.GeneratedMessage { } class PsbtSignRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtSignRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'spendSecret', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + PsbtSignRequest._() : super(); factory PsbtSignRequest({ $core.String? psbtB64, $core.List<$core.int>? scanSecret, $core.List<$core.int>? spendSecret, }) { - final $result = create(); + final _result = create(); if (psbtB64 != null) { - $result.psbtB64 = psbtB64; + _result.psbtB64 = psbtB64; } if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } if (spendSecret != null) { - $result.spendSecret = spendSecret; + _result.spendSecret = spendSecret; } - return $result; + return _result; } - PsbtSignRequest._() : super(); factory PsbtSignRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtSignRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtSignRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(3, _omitFieldNames ? '' : 'spendSecret', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1371,10 +1260,8 @@ class PsbtSignRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtSignRequest copyWith(void Function(PsbtSignRequest) updates) => super.copyWith((message) => updates(message as PsbtSignRequest)) as PsbtSignRequest; - + PsbtSignRequest copyWith(void Function(PsbtSignRequest) updates) => super.copyWith((message) => updates(message as PsbtSignRequest)) as PsbtSignRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtSignRequest create() => PsbtSignRequest._(); PsbtSignRequest createEmptyInstance() => create(); @@ -1383,7 +1270,6 @@ class PsbtSignRequest extends $pb.GeneratedMessage { static PsbtSignRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtSignRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1393,8 +1279,6 @@ class PsbtSignRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearPsbtB64() => clearField(1); - /// The scan secret or view key represents the account that - /// the utxos being spent belong to. @$pb.TagNumber(2) $core.List<$core.int> get scanSecret => $_getN(1); @$pb.TagNumber(2) @@ -1404,8 +1288,6 @@ class PsbtSignRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearScanSecret() => clearField(2); - /// The spend secret is the private key necessary for spending - /// the utxos belonging to the account. @$pb.TagNumber(3) $core.List<$core.int> get spendSecret => $_getN(2); @$pb.TagNumber(3) @@ -1417,34 +1299,33 @@ class PsbtSignRequest extends $pb.GeneratedMessage { } class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtSignNonMwebRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'privKey', $pb.PbFieldType.OY) + ..a<$core.int>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'index', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + PsbtSignNonMwebRequest._() : super(); factory PsbtSignNonMwebRequest({ $core.String? psbtB64, $core.List<$core.int>? privKey, $core.int? index, }) { - final $result = create(); + final _result = create(); if (psbtB64 != null) { - $result.psbtB64 = psbtB64; + _result.psbtB64 = psbtB64; } if (privKey != null) { - $result.privKey = privKey; + _result.privKey = privKey; } if (index != null) { - $result.index = index; + _result.index = index; } - return $result; + return _result; } - PsbtSignNonMwebRequest._() : super(); factory PsbtSignNonMwebRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtSignNonMwebRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtSignNonMwebRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'privKey', $pb.PbFieldType.OY) - ..a<$core.int>(3, _omitFieldNames ? '' : 'index', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1454,10 +1335,8 @@ class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtSignNonMwebRequest copyWith(void Function(PsbtSignNonMwebRequest) updates) => super.copyWith((message) => updates(message as PsbtSignNonMwebRequest)) as PsbtSignNonMwebRequest; - + PsbtSignNonMwebRequest copyWith(void Function(PsbtSignNonMwebRequest) updates) => super.copyWith((message) => updates(message as PsbtSignNonMwebRequest)) as PsbtSignNonMwebRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtSignNonMwebRequest create() => PsbtSignNonMwebRequest._(); PsbtSignNonMwebRequest createEmptyInstance() => create(); @@ -1466,7 +1345,6 @@ class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { static PsbtSignNonMwebRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtSignNonMwebRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1476,7 +1354,6 @@ class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearPsbtB64() => clearField(1); - /// The private key necessary for spending the input. @$pb.TagNumber(2) $core.List<$core.int> get privKey => $_getN(1); @$pb.TagNumber(2) @@ -1486,7 +1363,6 @@ class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearPrivKey() => clearField(2); - /// The index of the input to sign. @$pb.TagNumber(3) $core.int get index => $_getIZ(2); @$pb.TagNumber(3) @@ -1498,29 +1374,28 @@ class PsbtSignNonMwebRequest extends $pb.GeneratedMessage { } class PsbtExtractRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PsbtExtractRequest', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'psbtB64') + ..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unsigned') + ..hasRequiredFields = false + ; + + PsbtExtractRequest._() : super(); factory PsbtExtractRequest({ $core.String? psbtB64, $core.bool? unsigned, }) { - final $result = create(); + final _result = create(); if (psbtB64 != null) { - $result.psbtB64 = psbtB64; + _result.psbtB64 = psbtB64; } if (unsigned != null) { - $result.unsigned = unsigned; + _result.unsigned = unsigned; } - return $result; + return _result; } - PsbtExtractRequest._() : super(); factory PsbtExtractRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory PsbtExtractRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PsbtExtractRequest', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'psbtB64') - ..aOB(2, _omitFieldNames ? '' : 'unsigned') - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1530,10 +1405,8 @@ class PsbtExtractRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PsbtExtractRequest copyWith(void Function(PsbtExtractRequest) updates) => super.copyWith((message) => updates(message as PsbtExtractRequest)) as PsbtExtractRequest; - + PsbtExtractRequest copyWith(void Function(PsbtExtractRequest) updates) => super.copyWith((message) => updates(message as PsbtExtractRequest)) as PsbtExtractRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static PsbtExtractRequest create() => PsbtExtractRequest._(); PsbtExtractRequest createEmptyInstance() => create(); @@ -1542,7 +1415,6 @@ class PsbtExtractRequest extends $pb.GeneratedMessage { static PsbtExtractRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PsbtExtractRequest? _defaultInstance; - /// The PSBT in base64 encoding. @$pb.TagNumber(1) $core.String get psbtB64 => $_getSZ(0); @$pb.TagNumber(1) @@ -1552,7 +1424,6 @@ class PsbtExtractRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearPsbtB64() => clearField(1); - /// Extract the unsigned transaction. @$pb.TagNumber(2) $core.bool get unsigned => $_getBF(1); @$pb.TagNumber(2) @@ -1564,24 +1435,23 @@ class PsbtExtractRequest extends $pb.GeneratedMessage { } class BroadcastRequest extends $pb.GeneratedMessage { - factory BroadcastRequest({ - $core.List<$core.int>? rawTx, - }) { - final $result = create(); - if (rawTx != null) { - $result.rawTx = rawTx; - } - return $result; - } - BroadcastRequest._() : super(); - factory BroadcastRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BroadcastRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BroadcastRequest', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'rawTx', $pb.PbFieldType.OY) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BroadcastRequest', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'rawTx', $pb.PbFieldType.OY) ..hasRequiredFields = false ; + BroadcastRequest._() : super(); + factory BroadcastRequest({ + $core.List<$core.int>? rawTx, + }) { + final _result = create(); + if (rawTx != null) { + _result.rawTx = rawTx; + } + return _result; + } + factory BroadcastRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BroadcastRequest.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. ' @@ -1591,10 +1461,8 @@ class BroadcastRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - BroadcastRequest copyWith(void Function(BroadcastRequest) updates) => super.copyWith((message) => updates(message as BroadcastRequest)) as BroadcastRequest; - + BroadcastRequest copyWith(void Function(BroadcastRequest) updates) => super.copyWith((message) => updates(message as BroadcastRequest)) as BroadcastRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static BroadcastRequest create() => BroadcastRequest._(); BroadcastRequest createEmptyInstance() => create(); @@ -1603,7 +1471,6 @@ class BroadcastRequest extends $pb.GeneratedMessage { static BroadcastRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BroadcastRequest? _defaultInstance; - /// The raw bytes of the serialized transaction. @$pb.TagNumber(1) $core.List<$core.int> get rawTx => $_getN(0); @$pb.TagNumber(1) @@ -1615,24 +1482,23 @@ class BroadcastRequest extends $pb.GeneratedMessage { } class BroadcastResponse extends $pb.GeneratedMessage { - factory BroadcastResponse({ - $core.String? txid, - }) { - final $result = create(); - if (txid != null) { - $result.txid = txid; - } - return $result; - } - BroadcastResponse._() : super(); - factory BroadcastResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BroadcastResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BroadcastResponse', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'txid') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BroadcastResponse', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'txid') ..hasRequiredFields = false ; + BroadcastResponse._() : super(); + factory BroadcastResponse({ + $core.String? txid, + }) { + final _result = create(); + if (txid != null) { + _result.txid = txid; + } + return _result; + } + factory BroadcastResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BroadcastResponse.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. ' @@ -1642,10 +1508,8 @@ class BroadcastResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - BroadcastResponse copyWith(void Function(BroadcastResponse) updates) => super.copyWith((message) => updates(message as BroadcastResponse)) as BroadcastResponse; - + BroadcastResponse copyWith(void Function(BroadcastResponse) updates) => super.copyWith((message) => updates(message as BroadcastResponse)) as BroadcastResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static BroadcastResponse create() => BroadcastResponse._(); BroadcastResponse createEmptyInstance() => create(); @@ -1654,7 +1518,6 @@ class BroadcastResponse extends $pb.GeneratedMessage { static BroadcastResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static BroadcastResponse? _defaultInstance; - /// The transaction ID. @$pb.TagNumber(1) $core.String get txid => $_getSZ(0); @$pb.TagNumber(1) @@ -1666,39 +1529,38 @@ class BroadcastResponse extends $pb.GeneratedMessage { } class CoinswapRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CoinswapRequest', createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scanSecret', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'spendSecret', $pb.PbFieldType.OY) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') + ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addrIndex', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + CoinswapRequest._() : super(); factory CoinswapRequest({ $core.List<$core.int>? scanSecret, $core.List<$core.int>? spendSecret, $core.String? outputId, $core.int? addrIndex, }) { - final $result = create(); + final _result = create(); if (scanSecret != null) { - $result.scanSecret = scanSecret; + _result.scanSecret = scanSecret; } if (spendSecret != null) { - $result.spendSecret = spendSecret; + _result.spendSecret = spendSecret; } if (outputId != null) { - $result.outputId = outputId; + _result.outputId = outputId; } if (addrIndex != null) { - $result.addrIndex = addrIndex; + _result.addrIndex = addrIndex; } - return $result; + return _result; } - CoinswapRequest._() : super(); factory CoinswapRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CoinswapRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CoinswapRequest', createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'scanSecret', $pb.PbFieldType.OY) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'spendSecret', $pb.PbFieldType.OY) - ..aOS(3, _omitFieldNames ? '' : 'outputId') - ..a<$core.int>(4, _omitFieldNames ? '' : 'addrIndex', $pb.PbFieldType.OU3) - ..hasRequiredFields = false - ; - @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' @@ -1708,10 +1570,8 @@ class CoinswapRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CoinswapRequest copyWith(void Function(CoinswapRequest) updates) => super.copyWith((message) => updates(message as CoinswapRequest)) as CoinswapRequest; - + CoinswapRequest copyWith(void Function(CoinswapRequest) updates) => super.copyWith((message) => updates(message as CoinswapRequest)) as CoinswapRequest; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static CoinswapRequest create() => CoinswapRequest._(); CoinswapRequest createEmptyInstance() => create(); @@ -1720,8 +1580,6 @@ class CoinswapRequest extends $pb.GeneratedMessage { static CoinswapRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CoinswapRequest? _defaultInstance; - /// The scan secret or view key represents the account that - /// the utxo belongs to. @$pb.TagNumber(1) $core.List<$core.int> get scanSecret => $_getN(0); @$pb.TagNumber(1) @@ -1731,8 +1589,6 @@ class CoinswapRequest extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearScanSecret() => clearField(1); - /// The spend secret is the private key necessary for spending - /// the utxos belonging to the account. @$pb.TagNumber(2) $core.List<$core.int> get spendSecret => $_getN(1); @$pb.TagNumber(2) @@ -1742,7 +1598,6 @@ class CoinswapRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearSpendSecret() => clearField(2); - /// Output ID of the utxo to request a coinswap for. @$pb.TagNumber(3) $core.String get outputId => $_getSZ(2); @$pb.TagNumber(3) @@ -1752,7 +1607,6 @@ class CoinswapRequest extends $pb.GeneratedMessage { @$pb.TagNumber(3) void clearOutputId() => clearField(3); - /// Address index of the utxo. @$pb.TagNumber(4) $core.int get addrIndex => $_getIZ(3); @$pb.TagNumber(4) @@ -1764,24 +1618,23 @@ class CoinswapRequest extends $pb.GeneratedMessage { } class CoinswapResponse extends $pb.GeneratedMessage { - factory CoinswapResponse({ - $core.String? outputId, - }) { - final $result = create(); - if (outputId != null) { - $result.outputId = outputId; - } - return $result; - } - CoinswapResponse._() : super(); - factory CoinswapResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CoinswapResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CoinswapResponse', createEmptyInstance: create) - ..aOS(1, _omitFieldNames ? '' : 'outputId') + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CoinswapResponse', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'outputId') ..hasRequiredFields = false ; + CoinswapResponse._() : super(); + factory CoinswapResponse({ + $core.String? outputId, + }) { + final _result = create(); + if (outputId != null) { + _result.outputId = outputId; + } + return _result; + } + factory CoinswapResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CoinswapResponse.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. ' @@ -1791,10 +1644,8 @@ class CoinswapResponse extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CoinswapResponse copyWith(void Function(CoinswapResponse) updates) => super.copyWith((message) => updates(message as CoinswapResponse)) as CoinswapResponse; - + CoinswapResponse copyWith(void Function(CoinswapResponse) updates) => super.copyWith((message) => updates(message as CoinswapResponse)) as CoinswapResponse; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') static CoinswapResponse create() => CoinswapResponse._(); CoinswapResponse createEmptyInstance() => create(); @@ -1803,7 +1654,6 @@ class CoinswapResponse extends $pb.GeneratedMessage { static CoinswapResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CoinswapResponse? _defaultInstance; - /// Output ID of the utxo created by the transaction. @$pb.TagNumber(1) $core.String get outputId => $_getSZ(0); @$pb.TagNumber(1) @@ -1814,6 +1664,3 @@ class CoinswapResponse extends $pb.GeneratedMessage { void clearOutputId() => clearField(1); } - -const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); \ No newline at end of file diff --git a/cw_mweb/lib/mwebd.pbgrpc.dart b/cw_mweb/lib/mwebd.pbgrpc.dart index b5a2852f7..e52a5117c 100644 --- a/cw_mweb/lib/mwebd.pbgrpc.dart +++ b/cw_mweb/lib/mwebd.pbgrpc.dart @@ -1,155 +1,185 @@ -// +/// // Generated code. Do not modify. -// source: mwebd.proto +// source: lib/mwebd.proto // // @dart = 2.12 - -// ignore_for_file: annotate_overrides, camel_case_types, comment_references -// ignore_for_file: constant_identifier_names, library_prefixes -// ignore_for_file: non_constant_identifier_names, prefer_final_fields -// ignore_for_file: unnecessary_import, unnecessary_this, unused_import +// 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:async' as $async; + import 'dart:core' as $core; import 'package:grpc/service_api.dart' as $grpc; -import 'package:protobuf/protobuf.dart' as $pb; - import 'mwebd.pb.dart' as $0; - export 'mwebd.pb.dart'; -@$pb.GrpcServiceName('Rpc') class RpcClient extends $grpc.Client { - static final _$status = $grpc.ClientMethod<$0.StatusRequest, $0.StatusResponse>( - '/Rpc/Status', - ($0.StatusRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.StatusResponse.fromBuffer(value)); + static final _$status = + $grpc.ClientMethod<$0.StatusRequest, $0.StatusResponse>( + '/Rpc/Status', + ($0.StatusRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.StatusResponse.fromBuffer(value)); static final _$utxos = $grpc.ClientMethod<$0.UtxosRequest, $0.Utxo>( '/Rpc/Utxos', ($0.UtxosRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.Utxo.fromBuffer(value)); - static final _$addresses = $grpc.ClientMethod<$0.AddressRequest, $0.AddressResponse>( - '/Rpc/Addresses', - ($0.AddressRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.AddressResponse.fromBuffer(value)); + static final _$addresses = + $grpc.ClientMethod<$0.AddressRequest, $0.AddressResponse>( + '/Rpc/Addresses', + ($0.AddressRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.AddressResponse.fromBuffer(value)); static final _$spent = $grpc.ClientMethod<$0.SpentRequest, $0.SpentResponse>( '/Rpc/Spent', ($0.SpentRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.SpentResponse.fromBuffer(value)); - static final _$create = $grpc.ClientMethod<$0.CreateRequest, $0.CreateResponse>( - '/Rpc/Create', - ($0.CreateRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.CreateResponse.fromBuffer(value)); - static final _$psbtCreate = $grpc.ClientMethod<$0.PsbtCreateRequest, $0.PsbtResponse>( - '/Rpc/PsbtCreate', - ($0.PsbtCreateRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); - static final _$psbtAddInput = $grpc.ClientMethod<$0.PsbtAddInputRequest, $0.PsbtResponse>( - '/Rpc/PsbtAddInput', - ($0.PsbtAddInputRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); - static final _$psbtAddRecipient = $grpc.ClientMethod<$0.PsbtAddRecipientRequest, $0.PsbtResponse>( - '/Rpc/PsbtAddRecipient', - ($0.PsbtAddRecipientRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); - static final _$psbtGetRecipients = $grpc.ClientMethod<$0.PsbtGetRecipientsRequest, $0.PsbtGetRecipientsResponse>( + static final _$create = + $grpc.ClientMethod<$0.CreateRequest, $0.CreateResponse>( + '/Rpc/Create', + ($0.CreateRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.CreateResponse.fromBuffer(value)); + static final _$psbtCreate = + $grpc.ClientMethod<$0.PsbtCreateRequest, $0.PsbtResponse>( + '/Rpc/PsbtCreate', + ($0.PsbtCreateRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); + static final _$psbtAddInput = + $grpc.ClientMethod<$0.PsbtAddInputRequest, $0.PsbtResponse>( + '/Rpc/PsbtAddInput', + ($0.PsbtAddInputRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); + static final _$psbtAddRecipient = + $grpc.ClientMethod<$0.PsbtAddRecipientRequest, $0.PsbtResponse>( + '/Rpc/PsbtAddRecipient', + ($0.PsbtAddRecipientRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); + static final _$psbtGetRecipients = $grpc.ClientMethod< + $0.PsbtGetRecipientsRequest, $0.PsbtGetRecipientsResponse>( '/Rpc/PsbtGetRecipients', ($0.PsbtGetRecipientsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtGetRecipientsResponse.fromBuffer(value)); - static final _$psbtSign = $grpc.ClientMethod<$0.PsbtSignRequest, $0.PsbtResponse>( - '/Rpc/PsbtSign', - ($0.PsbtSignRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); - static final _$psbtSignNonMweb = $grpc.ClientMethod<$0.PsbtSignNonMwebRequest, $0.PsbtResponse>( - '/Rpc/PsbtSignNonMweb', - ($0.PsbtSignNonMwebRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); - static final _$psbtExtract = $grpc.ClientMethod<$0.PsbtExtractRequest, $0.CreateResponse>( - '/Rpc/PsbtExtract', - ($0.PsbtExtractRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.CreateResponse.fromBuffer(value)); - static final _$ledgerExchange = $grpc.ClientMethod<$0.LedgerApdu, $0.LedgerApdu>( - '/Rpc/LedgerExchange', - ($0.LedgerApdu value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.LedgerApdu.fromBuffer(value)); - static final _$broadcast = $grpc.ClientMethod<$0.BroadcastRequest, $0.BroadcastResponse>( - '/Rpc/Broadcast', - ($0.BroadcastRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.BroadcastResponse.fromBuffer(value)); - static final _$coinswap = $grpc.ClientMethod<$0.CoinswapRequest, $0.CoinswapResponse>( - '/Rpc/Coinswap', - ($0.CoinswapRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.CoinswapResponse.fromBuffer(value)); + ($core.List<$core.int> value) => + $0.PsbtGetRecipientsResponse.fromBuffer(value)); + static final _$psbtSign = + $grpc.ClientMethod<$0.PsbtSignRequest, $0.PsbtResponse>( + '/Rpc/PsbtSign', + ($0.PsbtSignRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); + static final _$psbtSignNonMweb = + $grpc.ClientMethod<$0.PsbtSignNonMwebRequest, $0.PsbtResponse>( + '/Rpc/PsbtSignNonMweb', + ($0.PsbtSignNonMwebRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.PsbtResponse.fromBuffer(value)); + static final _$psbtExtract = + $grpc.ClientMethod<$0.PsbtExtractRequest, $0.CreateResponse>( + '/Rpc/PsbtExtract', + ($0.PsbtExtractRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.CreateResponse.fromBuffer(value)); + static final _$ledgerExchange = + $grpc.ClientMethod<$0.LedgerApdu, $0.LedgerApdu>( + '/Rpc/LedgerExchange', + ($0.LedgerApdu value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.LedgerApdu.fromBuffer(value)); + static final _$broadcast = + $grpc.ClientMethod<$0.BroadcastRequest, $0.BroadcastResponse>( + '/Rpc/Broadcast', + ($0.BroadcastRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.BroadcastResponse.fromBuffer(value)); + static final _$coinswap = + $grpc.ClientMethod<$0.CoinswapRequest, $0.CoinswapResponse>( + '/Rpc/Coinswap', + ($0.CoinswapRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.CoinswapResponse.fromBuffer(value)); RpcClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, - interceptors: interceptors); + : super(channel, options: options, interceptors: interceptors); - $grpc.ResponseFuture<$0.StatusResponse> status($0.StatusRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.StatusResponse> status($0.StatusRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$status, request, options: options); } - $grpc.ResponseStream<$0.Utxo> utxos($0.UtxosRequest request, {$grpc.CallOptions? options}) { - return $createStreamingCall(_$utxos, $async.Stream.fromIterable([request]), options: options); + $grpc.ResponseStream<$0.Utxo> utxos($0.UtxosRequest request, + {$grpc.CallOptions? options}) { + return $createStreamingCall(_$utxos, $async.Stream.fromIterable([request]), + options: options); } - $grpc.ResponseFuture<$0.AddressResponse> addresses($0.AddressRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.AddressResponse> addresses($0.AddressRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$addresses, request, options: options); } - $grpc.ResponseFuture<$0.SpentResponse> spent($0.SpentRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.SpentResponse> spent($0.SpentRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$spent, request, options: options); } - $grpc.ResponseFuture<$0.CreateResponse> create($0.CreateRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.CreateResponse> create($0.CreateRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$create, request, options: options); } - $grpc.ResponseFuture<$0.PsbtResponse> psbtCreate($0.PsbtCreateRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtResponse> psbtCreate($0.PsbtCreateRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtCreate, request, options: options); } - $grpc.ResponseFuture<$0.PsbtResponse> psbtAddInput($0.PsbtAddInputRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtResponse> psbtAddInput( + $0.PsbtAddInputRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtAddInput, request, options: options); } - $grpc.ResponseFuture<$0.PsbtResponse> psbtAddRecipient($0.PsbtAddRecipientRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtResponse> psbtAddRecipient( + $0.PsbtAddRecipientRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtAddRecipient, request, options: options); } - $grpc.ResponseFuture<$0.PsbtGetRecipientsResponse> psbtGetRecipients($0.PsbtGetRecipientsRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtGetRecipientsResponse> psbtGetRecipients( + $0.PsbtGetRecipientsRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtGetRecipients, request, options: options); } - $grpc.ResponseFuture<$0.PsbtResponse> psbtSign($0.PsbtSignRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtResponse> psbtSign($0.PsbtSignRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtSign, request, options: options); } - $grpc.ResponseFuture<$0.PsbtResponse> psbtSignNonMweb($0.PsbtSignNonMwebRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PsbtResponse> psbtSignNonMweb( + $0.PsbtSignNonMwebRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtSignNonMweb, request, options: options); } - $grpc.ResponseFuture<$0.CreateResponse> psbtExtract($0.PsbtExtractRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.CreateResponse> psbtExtract( + $0.PsbtExtractRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$psbtExtract, request, options: options); } - $grpc.ResponseFuture<$0.LedgerApdu> ledgerExchange($0.LedgerApdu request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.LedgerApdu> ledgerExchange($0.LedgerApdu request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$ledgerExchange, request, options: options); } - $grpc.ResponseFuture<$0.BroadcastResponse> broadcast($0.BroadcastRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.BroadcastResponse> broadcast( + $0.BroadcastRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$broadcast, request, options: options); } - $grpc.ResponseFuture<$0.CoinswapResponse> coinswap($0.CoinswapRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.CoinswapResponse> coinswap($0.CoinswapRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$coinswap, request, options: options); } } -@$pb.GrpcServiceName('Rpc') abstract class RpcServiceBase extends $grpc.Service { $core.String get $name => 'Rpc'; @@ -201,21 +231,25 @@ abstract class RpcServiceBase extends $grpc.Service { psbtAddInput_Pre, false, false, - ($core.List<$core.int> value) => $0.PsbtAddInputRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.PsbtAddInputRequest.fromBuffer(value), ($0.PsbtResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.PsbtAddRecipientRequest, $0.PsbtResponse>( 'PsbtAddRecipient', psbtAddRecipient_Pre, false, false, - ($core.List<$core.int> value) => $0.PsbtAddRecipientRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.PsbtAddRecipientRequest.fromBuffer(value), ($0.PsbtResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.PsbtGetRecipientsRequest, $0.PsbtGetRecipientsResponse>( + $addMethod($grpc.ServiceMethod<$0.PsbtGetRecipientsRequest, + $0.PsbtGetRecipientsResponse>( 'PsbtGetRecipients', psbtGetRecipients_Pre, false, false, - ($core.List<$core.int> value) => $0.PsbtGetRecipientsRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.PsbtGetRecipientsRequest.fromBuffer(value), ($0.PsbtGetRecipientsResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.PsbtSignRequest, $0.PsbtResponse>( 'PsbtSign', @@ -229,14 +263,16 @@ abstract class RpcServiceBase extends $grpc.Service { psbtSignNonMweb_Pre, false, false, - ($core.List<$core.int> value) => $0.PsbtSignNonMwebRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.PsbtSignNonMwebRequest.fromBuffer(value), ($0.PsbtResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.PsbtExtractRequest, $0.CreateResponse>( 'PsbtExtract', psbtExtract_Pre, false, false, - ($core.List<$core.int> value) => $0.PsbtExtractRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.PsbtExtractRequest.fromBuffer(value), ($0.CreateResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.LedgerApdu, $0.LedgerApdu>( 'LedgerExchange', @@ -261,79 +297,109 @@ abstract class RpcServiceBase extends $grpc.Service { ($0.CoinswapResponse value) => value.writeToBuffer())); } - $async.Future<$0.StatusResponse> status_Pre($grpc.ServiceCall call, $async.Future<$0.StatusRequest> request) async { + $async.Future<$0.StatusResponse> status_Pre( + $grpc.ServiceCall call, $async.Future<$0.StatusRequest> request) async { return status(call, await request); } - $async.Stream<$0.Utxo> utxos_Pre($grpc.ServiceCall call, $async.Future<$0.UtxosRequest> request) async* { + $async.Stream<$0.Utxo> utxos_Pre( + $grpc.ServiceCall call, $async.Future<$0.UtxosRequest> request) async* { yield* utxos(call, await request); } - $async.Future<$0.AddressResponse> addresses_Pre($grpc.ServiceCall call, $async.Future<$0.AddressRequest> request) async { + $async.Future<$0.AddressResponse> addresses_Pre( + $grpc.ServiceCall call, $async.Future<$0.AddressRequest> request) async { return addresses(call, await request); } - $async.Future<$0.SpentResponse> spent_Pre($grpc.ServiceCall call, $async.Future<$0.SpentRequest> request) async { + $async.Future<$0.SpentResponse> spent_Pre( + $grpc.ServiceCall call, $async.Future<$0.SpentRequest> request) async { return spent(call, await request); } - $async.Future<$0.CreateResponse> create_Pre($grpc.ServiceCall call, $async.Future<$0.CreateRequest> request) async { + $async.Future<$0.CreateResponse> create_Pre( + $grpc.ServiceCall call, $async.Future<$0.CreateRequest> request) async { return create(call, await request); } - $async.Future<$0.PsbtResponse> psbtCreate_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtCreateRequest> request) async { + $async.Future<$0.PsbtResponse> psbtCreate_Pre($grpc.ServiceCall call, + $async.Future<$0.PsbtCreateRequest> request) async { return psbtCreate(call, await request); } - $async.Future<$0.PsbtResponse> psbtAddInput_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtAddInputRequest> request) async { + $async.Future<$0.PsbtResponse> psbtAddInput_Pre($grpc.ServiceCall call, + $async.Future<$0.PsbtAddInputRequest> request) async { return psbtAddInput(call, await request); } - $async.Future<$0.PsbtResponse> psbtAddRecipient_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtAddRecipientRequest> request) async { + $async.Future<$0.PsbtResponse> psbtAddRecipient_Pre($grpc.ServiceCall call, + $async.Future<$0.PsbtAddRecipientRequest> request) async { return psbtAddRecipient(call, await request); } - $async.Future<$0.PsbtGetRecipientsResponse> psbtGetRecipients_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtGetRecipientsRequest> request) async { + $async.Future<$0.PsbtGetRecipientsResponse> psbtGetRecipients_Pre( + $grpc.ServiceCall call, + $async.Future<$0.PsbtGetRecipientsRequest> request) async { return psbtGetRecipients(call, await request); } - $async.Future<$0.PsbtResponse> psbtSign_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtSignRequest> request) async { + $async.Future<$0.PsbtResponse> psbtSign_Pre( + $grpc.ServiceCall call, $async.Future<$0.PsbtSignRequest> request) async { return psbtSign(call, await request); } - $async.Future<$0.PsbtResponse> psbtSignNonMweb_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtSignNonMwebRequest> request) async { + $async.Future<$0.PsbtResponse> psbtSignNonMweb_Pre($grpc.ServiceCall call, + $async.Future<$0.PsbtSignNonMwebRequest> request) async { return psbtSignNonMweb(call, await request); } - $async.Future<$0.CreateResponse> psbtExtract_Pre($grpc.ServiceCall call, $async.Future<$0.PsbtExtractRequest> request) async { + $async.Future<$0.CreateResponse> psbtExtract_Pre($grpc.ServiceCall call, + $async.Future<$0.PsbtExtractRequest> request) async { return psbtExtract(call, await request); } - $async.Future<$0.LedgerApdu> ledgerExchange_Pre($grpc.ServiceCall call, $async.Future<$0.LedgerApdu> request) async { + $async.Future<$0.LedgerApdu> ledgerExchange_Pre( + $grpc.ServiceCall call, $async.Future<$0.LedgerApdu> request) async { return ledgerExchange(call, await request); } - $async.Future<$0.BroadcastResponse> broadcast_Pre($grpc.ServiceCall call, $async.Future<$0.BroadcastRequest> request) async { + $async.Future<$0.BroadcastResponse> broadcast_Pre($grpc.ServiceCall call, + $async.Future<$0.BroadcastRequest> request) async { return broadcast(call, await request); } - $async.Future<$0.CoinswapResponse> coinswap_Pre($grpc.ServiceCall call, $async.Future<$0.CoinswapRequest> request) async { + $async.Future<$0.CoinswapResponse> coinswap_Pre( + $grpc.ServiceCall call, $async.Future<$0.CoinswapRequest> request) async { return coinswap(call, await request); } - $async.Future<$0.StatusResponse> status($grpc.ServiceCall call, $0.StatusRequest request); + $async.Future<$0.StatusResponse> status( + $grpc.ServiceCall call, $0.StatusRequest request); $async.Stream<$0.Utxo> utxos($grpc.ServiceCall call, $0.UtxosRequest request); - $async.Future<$0.AddressResponse> addresses($grpc.ServiceCall call, $0.AddressRequest request); - $async.Future<$0.SpentResponse> spent($grpc.ServiceCall call, $0.SpentRequest request); - $async.Future<$0.CreateResponse> create($grpc.ServiceCall call, $0.CreateRequest request); - $async.Future<$0.PsbtResponse> psbtCreate($grpc.ServiceCall call, $0.PsbtCreateRequest request); - $async.Future<$0.PsbtResponse> psbtAddInput($grpc.ServiceCall call, $0.PsbtAddInputRequest request); - $async.Future<$0.PsbtResponse> psbtAddRecipient($grpc.ServiceCall call, $0.PsbtAddRecipientRequest request); - $async.Future<$0.PsbtGetRecipientsResponse> psbtGetRecipients($grpc.ServiceCall call, $0.PsbtGetRecipientsRequest request); - $async.Future<$0.PsbtResponse> psbtSign($grpc.ServiceCall call, $0.PsbtSignRequest request); - $async.Future<$0.PsbtResponse> psbtSignNonMweb($grpc.ServiceCall call, $0.PsbtSignNonMwebRequest request); - $async.Future<$0.CreateResponse> psbtExtract($grpc.ServiceCall call, $0.PsbtExtractRequest request); - $async.Future<$0.LedgerApdu> ledgerExchange($grpc.ServiceCall call, $0.LedgerApdu request); - $async.Future<$0.BroadcastResponse> broadcast($grpc.ServiceCall call, $0.BroadcastRequest request); - $async.Future<$0.CoinswapResponse> coinswap($grpc.ServiceCall call, $0.CoinswapRequest request); -} \ No newline at end of file + $async.Future<$0.AddressResponse> addresses( + $grpc.ServiceCall call, $0.AddressRequest request); + $async.Future<$0.SpentResponse> spent( + $grpc.ServiceCall call, $0.SpentRequest request); + $async.Future<$0.CreateResponse> create( + $grpc.ServiceCall call, $0.CreateRequest request); + $async.Future<$0.PsbtResponse> psbtCreate( + $grpc.ServiceCall call, $0.PsbtCreateRequest request); + $async.Future<$0.PsbtResponse> psbtAddInput( + $grpc.ServiceCall call, $0.PsbtAddInputRequest request); + $async.Future<$0.PsbtResponse> psbtAddRecipient( + $grpc.ServiceCall call, $0.PsbtAddRecipientRequest request); + $async.Future<$0.PsbtGetRecipientsResponse> psbtGetRecipients( + $grpc.ServiceCall call, $0.PsbtGetRecipientsRequest request); + $async.Future<$0.PsbtResponse> psbtSign( + $grpc.ServiceCall call, $0.PsbtSignRequest request); + $async.Future<$0.PsbtResponse> psbtSignNonMweb( + $grpc.ServiceCall call, $0.PsbtSignNonMwebRequest request); + $async.Future<$0.CreateResponse> psbtExtract( + $grpc.ServiceCall call, $0.PsbtExtractRequest request); + $async.Future<$0.LedgerApdu> ledgerExchange( + $grpc.ServiceCall call, $0.LedgerApdu request); + $async.Future<$0.BroadcastResponse> broadcast( + $grpc.ServiceCall call, $0.BroadcastRequest request); + $async.Future<$0.CoinswapResponse> coinswap( + $grpc.ServiceCall call, $0.CoinswapRequest request); +} diff --git a/cw_mweb/pubspec.yaml b/cw_mweb/pubspec.yaml index 94342fd8e..ae4f4a2e9 100644 --- a/cw_mweb/pubspec.yaml +++ b/cw_mweb/pubspec.yaml @@ -14,6 +14,8 @@ dependencies: path_provider: ^2.1.2 plugin_platform_interface: ^2.0.2 ffi: ^2.1.0 + protobuf: ^3.1.0 + fixnum: ^1.1.1 dev_dependencies: flutter_test: