Update themes, use PUBNET instead of testnet

This commit is contained in:
likho 2023-07-26 16:19:40 +02:00
parent f7741fa043
commit 58364a6c88
5 changed files with 219 additions and 565 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -61,7 +61,7 @@ class StellarWallet extends CoinServiceAPI
late final TransactionNotificationTracker txTracker; late final TransactionNotificationTracker txTracker;
late SecureStorageInterface _secureStore; late SecureStorageInterface _secureStore;
final StellarSDK stellarSdk = StellarSDK.TESTNET; final StellarSDK stellarSdk = StellarSDK.PUBLIC;
@override @override
bool get isFavorite => _isFavorite ??= getCachedIsFavorite(); bool get isFavorite => _isFavorite ??= getCachedIsFavorite();
@ -199,7 +199,7 @@ class StellarWallet extends CoinServiceAPI
.build() .build()
).build(); ).build();
} }
transaction.sign(senderKeyPair, Network.TESTNET); transaction.sign(senderKeyPair, Network.PUBLIC);
try { try {
SubmitTransactionResponse response = await stellarSdk.submitTransaction(transaction); SubmitTransactionResponse response = await stellarSdk.submitTransaction(transaction);
@ -256,9 +256,11 @@ class StellarWallet extends CoinServiceAPI
} }
@override @override
Future<void> exit() { Future<void> exit() async {
// TODO: implement exit _hasCalledExit = true;
throw UnimplementedError(); timer?.cancel();
timer = null;
stopNetworkAlivePinging();
} }
NodeModel? _xlmNode; NodeModel? _xlmNode;
@ -427,7 +429,13 @@ class StellarWallet extends CoinServiceAPI
} }
@override @override
Future<void> recoverFromMnemonic({required String mnemonic, String? mnemonicPassphrase, required int maxUnusedAddressGap, required int maxNumberOfIndexesToCheck, required int height}) async { Future<void> recoverFromMnemonic({
required String mnemonic,
String? mnemonicPassphrase,
required int maxUnusedAddressGap,
required int maxNumberOfIndexesToCheck,
required int height
}) async {
if ((await mnemonicString) != null || if ((await mnemonicString) != null ||
(await this.mnemonicPassphrase) != null) { (await this.mnemonicPassphrase) != null) {
throw Exception("Attempted to overwrite mnemonic on restore!"); throw Exception("Attempted to overwrite mnemonic on restore!");
@ -472,7 +480,8 @@ class StellarWallet extends CoinServiceAPI
.order(RequestBuilderOrder.DESC) .order(RequestBuilderOrder.DESC)
.limit(1) .limit(1)
.execute() .execute()
.then((value) => value.records!.first.sequence); .then((value) => value.records!.first.sequence).onError((error, stackTrace) =>
throw("Error getting chain height"));
await updateCachedChainHeight(height); await updateCachedChainHeight(height);
} }
@ -484,8 +493,7 @@ class StellarWallet extends CoinServiceAPI
Page<OperationResponse> payments = await stellarSdk.payments Page<OperationResponse> payments = await stellarSdk.payments
.forAccount(await getAddressSW()).order(RequestBuilderOrder.DESC) .forAccount(await getAddressSW()).order(RequestBuilderOrder.DESC)
.execute().onError((error, stackTrace) => .execute().onError((error, stackTrace) =>
throw("Could not fetch transactions") throw("Could not fetch transactions"));
);
for (OperationResponse response in payments.records!) { for (OperationResponse response in payments.records!) {
// PaymentOperationResponse por; // PaymentOperationResponse por;

View file

@ -182,7 +182,7 @@ abstract class DefaultNodes {
isDown: false); isDown: false);
static NodeModel get stellar => NodeModel( static NodeModel get stellar => NodeModel(
host: "https://horizon-testnet.stellar.org", host: "https://horizon.stellar.org",
port: 443, port: 443,
name: defaultName, name: defaultName,
id: _nodeId(Coin.stellar), id: _nodeId(Coin.stellar),