update nano default node (#1408)

* update nano default node

* fix node indicator

* Update pr_test_build.yml

* Update pr_test_build.yml

* update default nano node for new wallets

* support extra args on tool script

* remove nano secrets from node.dart

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Matthew Fosse 2024-07-04 21:44:08 +02:00 committed by GitHub
parent 36eacd8698
commit 73492ad865
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 75 additions and 88 deletions

View file

@ -10,7 +10,7 @@ import 'package:nanodart/nanodart.dart';
import 'package:cw_core/node.dart';
import 'package:nanoutil/nanoutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:cw_nano/.secrets.g.dart' as secrets;
import 'package:cw_nano/.secrets.g.dart' as nano_secrets;
class NanoClient {
static const Map<String, String> CAKE_HEADERS = {
@ -54,12 +54,14 @@ class NanoClient {
}
Map<String, String> getHeaders() {
if (_node!.uri == "https://rpc.nano.to") {
return CAKE_HEADERS..addAll({
"key": secrets.nano2ApiKey,
});
final headers = Map<String, String>.from(CAKE_HEADERS);
if (_node!.uri.host == "rpc.nano.to") {
headers["key"] = nano_secrets.nano2ApiKey;
}
return CAKE_HEADERS;
if (_node!.uri.host == "nano.nownodes.io") {
headers["api-key"] = nano_secrets.nanoNowNodesApiKey;
}
return headers;
}
Future<NanoBalance> getBalance(String address) async {