mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 10:29:23 +00:00
support Adding query params to node url (#1901)
* support Adding query params to node url * minor ui fix [skip ci]
This commit is contained in:
parent
ac1c198940
commit
20d30013d0
2 changed files with 8 additions and 13 deletions
|
@ -22,8 +22,8 @@ class Node extends HiveObject with Keyable {
|
||||||
this.useSSL,
|
this.useSSL,
|
||||||
this.trusted = false,
|
this.trusted = false,
|
||||||
this.socksProxyAddress,
|
this.socksProxyAddress,
|
||||||
|
this.path = '',
|
||||||
String? uri,
|
String? uri,
|
||||||
String? path,
|
|
||||||
WalletType? type,
|
WalletType? type,
|
||||||
}) {
|
}) {
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
|
@ -32,9 +32,6 @@ class Node extends HiveObject with Keyable {
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
if (path != null) {
|
|
||||||
this.path = path;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Node.fromMap(Map<String, Object?> map)
|
Node.fromMap(Map<String, Object?> map)
|
||||||
|
@ -95,19 +92,15 @@ class Node extends HiveObject with Keyable {
|
||||||
case WalletType.bitcoin:
|
case WalletType.bitcoin:
|
||||||
case WalletType.litecoin:
|
case WalletType.litecoin:
|
||||||
case WalletType.bitcoinCash:
|
case WalletType.bitcoinCash:
|
||||||
return createUriFromElectrumAddress(uriRaw, path ?? '');
|
return createUriFromElectrumAddress(uriRaw, path!);
|
||||||
case WalletType.nano:
|
case WalletType.nano:
|
||||||
case WalletType.banano:
|
case WalletType.banano:
|
||||||
if (isSSL) {
|
|
||||||
return Uri.https(uriRaw, path ?? '');
|
|
||||||
} else {
|
|
||||||
return Uri.http(uriRaw, path ?? '');
|
|
||||||
}
|
|
||||||
case WalletType.ethereum:
|
case WalletType.ethereum:
|
||||||
case WalletType.polygon:
|
case WalletType.polygon:
|
||||||
case WalletType.solana:
|
case WalletType.solana:
|
||||||
case WalletType.tron:
|
case WalletType.tron:
|
||||||
return Uri.https(uriRaw, path ?? '');
|
return Uri.parse(
|
||||||
|
"http${isSSL ? "s" : ""}://$uriRaw${path!.startsWith("/") ? path : "/$path"}");
|
||||||
case WalletType.none:
|
case WalletType.none:
|
||||||
throw Exception('Unexpected type ${type.toString()} for Node uri');
|
throw Exception('Unexpected type ${type.toString()} for Node uri');
|
||||||
}
|
}
|
||||||
|
@ -247,7 +240,7 @@ class Node extends HiveObject with Keyable {
|
||||||
if (proxy == null) {
|
if (proxy == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final proxyAddress = proxy!.split(':')[0];
|
final proxyAddress = proxy.split(':')[0];
|
||||||
final proxyPort = int.parse(proxy.split(':')[1]);
|
final proxyPort = int.parse(proxy.split(':')[1]);
|
||||||
try {
|
try {
|
||||||
final socket = await Socket.connect(proxyAddress, proxyPort, timeout: Duration(seconds: 5));
|
final socket = await Socket.connect(proxyAddress, proxyPort, timeout: Duration(seconds: 5));
|
||||||
|
|
|
@ -81,7 +81,9 @@ class SeedVerificationStepView extends StatelessWidget {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isSecondWrongEntry) {
|
if (isSecondWrongEntry) {
|
||||||
Navigator.pop(context);
|
if (context.mounted) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue