fix: ltc wallets not syncing (address generation issue) (#2676)

* fix: ltc freezing and address generation

* revert: go back to network (fixme), feeRatePerKb
This commit is contained in:
cyan
2025-11-25 17:59:55 +01:00
committed by GitHub
parent efc99c14f6
commit 98babacce0
12 changed files with 605 additions and 676 deletions
+5 -1
View File
@@ -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!;
}
+1
View File
@@ -2442,6 +2442,7 @@ abstract class ElectrumWalletBase
Future<ElectrumBalance> fetchBalances() async {
final addresses = walletAddresses.allAddresses
.where((address) => address.address.isNotEmpty)
.where((address) => RegexUtils.addressTypeFromStr(address.address, network) is! MwebAddress)
.toList();
final balanceFutures = <Future<Map<String, dynamic>>>[];
+2 -2
View File
@@ -185,9 +185,9 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
final String? scanSecretOverride;
final String? spendPubkeyOverride;
List<int> get scanSecret => scanSecretOverride != null
List<int> 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<int> get spendSecret =>
mwebHd?.childKey(Bip32KeyIndex(0x80000001)).privateKey.privKey.raw ?? List.filled(32, 0);
@@ -50,12 +50,12 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with
final String? scanSecretOverride;
final String? spendPubkeyOverride;
List<int> get scanSecret => scanSecretOverride != null
List<int> get scanSecret => (scanSecretOverride != null && scanSecretOverride?.isNotEmpty == true)
? hex.decode(scanSecretOverride!)
: mwebHd!.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw;
List<int> get spendPubkey => spendPubkeyOverride != null
: mwebHd?.childKey(Bip32KeyIndex(0x80000000)).privateKey.privKey.raw ?? List.filled(32, 0);
List<int> 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<void> init() async {
@@ -70,10 +70,11 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with
}
Future<void> 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];
}
+10
View File
@@ -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
'
+2 -4
View File
@@ -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
+4 -4
View File
@@ -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=
+3 -2
View File
@@ -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
+1 -2
View File
@@ -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!");
},
+386 -539
View File
File diff suppressed because it is too large Load Diff
+182 -116
View File
@@ -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);
}
$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);
}
+2
View File
@@ -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: