Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/lib/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,5 @@ void setFallbackConfigs() {
Globals().newsUrl = '';
Globals().idenfyServiceUrl = '';
Globals().council = false;
Globals().showLockedTokens = false;
}
2 changes: 2 additions & 0 deletions app/lib/helpers/flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Flags {
.toString();
Globals().council =
await Flags().hasFlagValueByFeatureName('council-member');
Globals().showLockedTokens =
await Flags().hasFlagValueByFeatureName('locked-tokens');
Globals().registrarURL =
(await Flags().getFlagValueByFeatureName('registrar-url')).toString();

Expand Down
1 change: 1 addition & 0 deletions app/lib/helpers/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Globals {
String newsUrl = '';
String idenfyServiceUrl = '';
bool council = false;
bool showLockedTokens = false;
String registrarURL = '';
bool isCacheClearedWallet = false;
bool isCacheClearedFarmer = false;
Expand Down
38 changes: 38 additions & 0 deletions app/lib/models/locked_token.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
class LockedToken {
LockedToken({
required this.address,
required this.assetCode,
required this.assetIssuer,
required this.amount,
required this.unlockHash,
required this.unlockFrom,
required this.canBeUnlocked,
});

/// The escrow (locked) Stellar account that holds the tokens.
final String address;

/// The asset code of the locked balance (e.g. `TFT`).
final String assetCode;

/// The issuer of the locked asset.
final String assetIssuer;

/// The locked amount.
final double amount;

/// The `preauth_tx` signer of the escrow account. `null` when the account can
/// be unlocked immediately (no time-lock left).
String? unlockHash;

/// Unix timestamp (seconds) from which the tokens can be unlocked. `null` when
/// there is no time-lock.
final int? unlockFrom;

/// Whether the tokens can currently be unlocked.
bool canBeUnlocked;

DateTime? get unlockFromDate => unlockFrom == null
? null
: DateTime.fromMillisecondsSinceEpoch(unlockFrom! * 1000);
}
4 changes: 3 additions & 1 deletion app/lib/screens/wallets/wallet_assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:threebotlogin/services/stellar_service.dart' as Stellar;
import 'package:threebotlogin/widgets/wallets/activate_wallet.dart';
import 'package:threebotlogin/widgets/wallets/arrow_inward.dart';
import 'package:threebotlogin/widgets/wallets/balance_tile.dart';
import 'package:threebotlogin/widgets/wallets/locked_tokens_card.dart';

class WalletAssetsWidget extends StatefulWidget {
const WalletAssetsWidget({super.key, required this.wallet});
Expand Down Expand Up @@ -231,7 +232,8 @@ class _WalletAssetsWidgetState extends State<WalletAssetsWidget> {
loading: false,
onActivate: _openActivateStellarOverlay,
),
...vestWidgets
...vestWidgets,
if (Globals().showLockedTokens) LockedTokensCard(wallet: widget.wallet),
],
),
);
Expand Down
Loading
Loading