Skip to content

Commit

Permalink
chore:
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Dec 30, 2024
1 parent 4606d74 commit 566ce75
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/src/domain/models/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ enum Environment {
mainnet(
label: 'Archethic Mainnet',
endpoint: 'https://mainnet.archethic.net',
displayName: 'Archethic Main Network',
),

/// The test network (Testnet) of Archethic.
testnet(
label: 'Archethic Testnet',
endpoint: 'https://testnet.archethic.net',
displayName: 'Archethic Test Network',
),

/// The development network (Devnet) for local testing.
devnet(
label: 'Archethic Devnet',
endpoint: 'http://localhost:4000',
displayName: 'Archethic Dev Network',
);

/// Creates an [Environment] with a specific [label] and [endpoint].
const Environment({
required this.label,
required this.endpoint,
required this.displayName,
});

/// The human-readable name of the environment.
Expand All @@ -44,6 +48,9 @@ enum Environment {
/// The URL endpoint for the environment.
final String endpoint;

/// The name of the environment.
final String displayName;

/// Retrieves the [Environment] corresponding to the given [endpoint].
///
/// Throws a [StateError] if no environment matches the provided endpoint.
Expand All @@ -53,4 +60,12 @@ enum Environment {
orElse: () =>
throw StateError('No environment found for endpoint $endpoint'),
);

String get notificationBackendUrl {
return 'https://push.archethic.net';
}

String get aeHostingUri {
return '$endpoint/api/web_hosting/';
}
}

0 comments on commit 566ce75

Please sign in to comment.