-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'zano-pr' into zano-pr-CW-685-collab
- Loading branch information
Showing
152 changed files
with
5,706 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
android/app/src/main/jniLibs/arm64-v8a/libzano_libwallet2_api_c.so
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../scripts/monero_c/release/zano/aarch64-linux-android_libwallet2_api_c.so |
1 change: 1 addition & 0 deletions
1
android/app/src/main/jniLibs/armeabi-v7a/libzano_libwallet2_api_c.so
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../scripts/monero_c/release/zano/armv7a-linux-androideabi_libwallet2_api_c.so |
1 change: 1 addition & 0 deletions
1
android/app/src/main/jniLibs/x86_64/libzano_libwallet2_api_c.so
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../scripts/monero_c/release/zano/x86_64-linux-android_libwallet2_api_c.so |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- | ||
uri: 37.27.100.59:10500 | ||
is_default: true | ||
useSSL: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import 'package:cw_core/crypto_currency.dart'; | ||
import 'package:cw_core/hive_type_ids.dart'; | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'zano_asset.g.dart'; | ||
|
||
@HiveType(typeId: ZanoAsset.typeId) | ||
class ZanoAsset extends CryptoCurrency with HiveObjectMixin { | ||
@HiveField(0) | ||
final String fullName; | ||
@HiveField(1) | ||
final String ticker; | ||
@HiveField(2) | ||
final String assetId; | ||
@HiveField(3) | ||
final int decimalPoint; | ||
@HiveField(4, defaultValue: true) | ||
bool _enabled; | ||
@HiveField(5) | ||
final String? iconPath; | ||
// @HiveField(6) | ||
// final String? tag; | ||
@HiveField(6) | ||
final String owner; | ||
@HiveField(7) | ||
final String metaInfo; | ||
@HiveField(8) | ||
final BigInt currentSupply; | ||
@HiveField(9) | ||
final bool hiddenSupply; | ||
@HiveField(10) | ||
final BigInt totalMaxSupply; | ||
@HiveField(11) | ||
final bool isInGlobalWhitelist; | ||
|
||
bool get enabled => _enabled; | ||
|
||
set enabled(bool value) => _enabled = value; | ||
|
||
ZanoAsset({ | ||
this.fullName = '', | ||
this.ticker = '', | ||
required this.assetId, | ||
this.decimalPoint = 12, | ||
bool enabled = true, | ||
this.iconPath, | ||
this.owner = defaultOwner, | ||
this.metaInfo = '', | ||
required this.currentSupply, | ||
this.hiddenSupply = false, | ||
required this.totalMaxSupply, | ||
this.isInGlobalWhitelist = false, | ||
}) : _enabled = enabled, | ||
super( | ||
name: fullName, | ||
title: ticker.toUpperCase(), | ||
fullName: fullName, | ||
tag: 'ZANO', | ||
iconPath: iconPath, | ||
decimals: decimalPoint, | ||
); | ||
|
||
ZanoAsset.copyWith(ZanoAsset other, {String? icon, String? assetId, bool enabled = true}) | ||
: this.fullName = other.fullName, | ||
this.ticker = other.ticker, | ||
this.assetId = assetId ?? other.assetId, | ||
this.decimalPoint = other.decimalPoint, | ||
this._enabled = enabled && other.enabled, | ||
this.iconPath = icon, | ||
this.currentSupply = other.currentSupply, | ||
this.hiddenSupply = other.hiddenSupply, | ||
this.metaInfo = other.metaInfo, | ||
this.owner = other.owner, | ||
this.totalMaxSupply = other.totalMaxSupply, | ||
this.isInGlobalWhitelist = other.isInGlobalWhitelist, | ||
super( | ||
name: other.name, | ||
title: other.ticker.toUpperCase(), | ||
fullName: other.name, | ||
tag: 'ZANO', | ||
iconPath: icon, | ||
decimals: other.decimalPoint, | ||
enabled: enabled, | ||
); | ||
|
||
factory ZanoAsset.fromJson(Map<String, dynamic> json, {bool isInGlobalWhitelist = false}) => ZanoAsset( | ||
assetId: json['asset_id'] as String? ?? '', | ||
currentSupply: bigIntFromDynamic(json['current_supply']), | ||
decimalPoint: json['decimal_point'] as int? ?? 12, | ||
fullName: json['full_name'] as String? ?? '', | ||
hiddenSupply: json['hidden_supply'] as bool? ?? false, | ||
metaInfo: json['meta_info'] as String? ?? '', | ||
owner: json['owner'] as String? ?? '', | ||
ticker: json['ticker'] as String? ?? '', | ||
totalMaxSupply: bigIntFromDynamic(json['total_max_supply']), | ||
isInGlobalWhitelist: isInGlobalWhitelist, | ||
); | ||
|
||
|
||
|
||
static const typeId = ZANO_ASSET_TYPE_ID; | ||
static const zanoAssetsBoxName = 'zanoAssetsBox'; | ||
static const defaultOwner = '0000000000000000000000000000000000000000000000000000000000000000'; | ||
} | ||
|
||
BigInt bigIntFromDynamic(dynamic d) { | ||
if (d is int) { | ||
return BigInt.from(d); | ||
} else if (d is BigInt) { | ||
return d; | ||
} else if (d == null) { | ||
return BigInt.zero; | ||
} else { | ||
throw 'cannot cast value of type ${d.runtimeType} to BigInt'; | ||
//return BigInt.zero; | ||
} | ||
} |
Oops, something went wrong.