diff --git a/.gitignore b/.gitignore index a71bb538f..b61c79144 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ # is commented out by default. #.vscode/ +#CppWinRT manual install +Microsoft.Windows* + # Flutter/Dart/Pub related **/doc/api/ .dart_tool/ diff --git a/lib/wallets/wallet/impl/xelis_wallet.dart b/lib/wallets/wallet/impl/xelis_wallet.dart index bcbf09f4c..352b076f7 100644 --- a/lib/wallets/wallet/impl/xelis_wallet.dart +++ b/lib/wallets/wallet/impl/xelis_wallet.dart @@ -416,7 +416,7 @@ class XelisWallet extends LibXelisWallet { asset: xelis_sdk.xelisAsset, ); - fee = Amount(rawValue: BigInt.zero, fractionDigits: decimals); + fee = Amount(rawValue: BigInt.zero, fractionDigits: cryptoCurrency.fractionDigits); outputs.add( OutputV2.isarCantDoRequiredInDefaultConstructor( @@ -426,6 +426,7 @@ class XelisWallet extends LibXelisWallet { walletOwns: true, ), ); + otherData['overrideFee'] = fee.toJsonString(); } else if (entryType is xelis_sdk.BurnEntry) { final burn = entryType; txType = TransactionType.outgoing; @@ -436,7 +437,7 @@ class XelisWallet extends LibXelisWallet { fee = Amount( rawValue: BigInt.from(burn.fee), - fractionDigits: decimals, + fractionDigits: cryptoCurrency.fractionDigits, ); inputs.add( @@ -476,7 +477,7 @@ class XelisWallet extends LibXelisWallet { asset: transfer.asset, ); - fee = Amount(rawValue: BigInt.zero, fractionDigits: decimals); + fee = Amount(rawValue: BigInt.zero, fractionDigits: cryptoCurrency.fractionDigits); outputs.add( OutputV2.isarCantDoRequiredInDefaultConstructor( @@ -492,22 +493,34 @@ class XelisWallet extends LibXelisWallet { otherData['extraData_${transfer.asset}'] = transfer.extraData!.toJson(); } + otherData['overrideFee'] = fee.toJsonString(); } } else if (entryType is xelis_sdk.OutgoingEntry) { final outgoing = entryType; txType = TransactionType.outgoing; nonce = outgoing.nonce; - for (final transfer in outgoing.transfers) { - final int decimals = await libXelisWallet!.getAssetDecimals( - asset: transfer.asset, - ); + fee = Amount( + rawValue: BigInt.from(outgoing.fee), + fractionDigits: cryptoCurrency.fractionDigits, + ); - fee = Amount( - rawValue: BigInt.from(outgoing.fee), - fractionDigits: decimals, - ); + inputs.add( + InputV2.isarCantDoRequiredInDefaultConstructor( + scriptSigHex: null, + scriptSigAsm: null, + sequence: null, + outpoint: null, + addresses: [thisAddress], + valueStringSats: (outgoing.fee).toString(), + witness: null, + innerRedeemScriptAsm: null, + coinbase: null, + walletOwns: true, + ), + ); + for (final transfer in outgoing.transfers) { inputs.add( InputV2.isarCantDoRequiredInDefaultConstructor( scriptSigHex: null, @@ -515,7 +528,7 @@ class XelisWallet extends LibXelisWallet { sequence: null, outpoint: null, addresses: [thisAddress], - valueStringSats: (transfer.amount + outgoing.fee).toString(), + valueStringSats: (transfer.amount).toString(), witness: null, innerRedeemScriptAsm: null, coinbase: null, @@ -534,7 +547,6 @@ class XelisWallet extends LibXelisWallet { otherData['asset_${transfer.asset}_amount'] = transfer.amount.toString(); - otherData['asset_${transfer.asset}_fee'] = fee.raw.toString(); if (transfer.extraData != null) { otherData['extraData_${transfer.asset}'] = transfer.extraData!.toJson(); @@ -561,7 +573,6 @@ class XelisWallet extends LibXelisWallet { otherData: jsonEncode({ ...otherData, if (nonce != null) 'nonce': nonce, - 'overrideFee': fee.toJsonString(), }), ); diff --git a/pubspec.lock b/pubspec.lock index b4599310d..ffcc7e9a8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -588,10 +588,10 @@ packages: dependency: transitive description: name: dbus - sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.11" decimal: dependency: "direct main" description: @@ -628,10 +628,10 @@ packages: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba" + sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "7.0.2" devicelocale: dependency: "direct main" description: @@ -653,18 +653,18 @@ packages: dependency: transitive description: name: dio - sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260" + sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9" url: "https://pub.dev" source: hosted - version: "5.7.0" + version: "5.8.0+1" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" dropdown_button2: dependency: "direct main" description: @@ -718,10 +718,10 @@ packages: dependency: "direct main" description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" ethereum_addresses: dependency: "direct main" description: @@ -1268,10 +1268,10 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "6763aaf8965f21822624cb2fd3c03d2a8b3791037b5efb0fe4b13e110f5afc92" + sha256: "0abe4e72f55c785b28900de52a2522c86baba0988838b5dc22241b072ecccd74" url: "https://pub.dev" source: hosted - version: "1.0.46" + version: "1.0.48" local_auth_darwin: dependency: transitive description: @@ -1462,18 +1462,18 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "739e0a5c3c4055152520fa321d0645ee98e932718b4c8efeeb51451968fe0790" + sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" url: "https://pub.dev" source: hosted - version: "8.1.3" + version: "8.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.2.0" path: dependency: transitive description: @@ -1542,42 +1542,42 @@ packages: dependency: "direct main" description: name: permission_handler - sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb" + sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849" url: "https://pub.dev" source: hosted - version: "11.3.1" + version: "11.4.0" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1" + sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc url: "https://pub.dev" source: hosted - version: "12.0.13" + version: "12.1.0" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0 + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 url: "https://pub.dev" source: hosted - version: "9.4.5" + version: "9.4.7" permission_handler_html: dependency: transitive description: name: permission_handler_html - sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851 + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" url: "https://pub.dev" source: hosted - version: "0.1.3+2" + version: "0.1.3+5" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9 + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.3.0" permission_handler_windows: dependency: transitive description: @@ -2088,10 +2088,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.3.3" url_launcher_linux: dependency: transitive description: @@ -2144,10 +2144,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" + sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" url: "https://pub.dev" source: hosted - version: "1.1.15" + version: "1.1.18" vector_graphics_codec: dependency: transitive description: @@ -2200,18 +2200,18 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 + sha256: b90fbcc8d7bdf3b883ea9706d9d76b9978cb1dfa4351fcc8014d6ec31a493354 url: "https://pub.dev" source: hosted - version: "1.2.8" + version: "1.2.11" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16" + sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" wakelock_windows: dependency: "direct overridden" description: @@ -2338,11 +2338,11 @@ packages: dependency: "direct main" description: path: "." - ref: "v0.1.0" - resolved-ref: c685c5d3550cca414ec30d4b61259761f129dda6 - url: "https://github.com/Tritonn204/xelis_flutter_ffi.git" + ref: "v0.1.1" + resolved-ref: ee7a5756f5f403e6a371990c2817f38eb21a97b2 + url: "https://github.com/xelis-project/xelis-flutter-ffi.git" source: git - version: "0.1.0" + version: "0.1.1" xml: dependency: transitive description: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 61918bf7a..9c6c48cb4 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -32,8 +32,8 @@ dependencies: xelis_flutter: git: - url: https://github.com/Tritonn204/xelis_flutter_ffi.git - ref: v0.1.0 + url: https://github.com/xelis-project/xelis-flutter-ffi.git + ref: v0.1.1 flutter_libsparkmobile: git: diff --git a/scripts/linux/build_secp256k1.sh b/scripts/linux/build_secp256k1.sh index f00b6b82b..17bcd32c9 100755 --- a/scripts/linux/build_secp256k1.sh +++ b/scripts/linux/build_secp256k1.sh @@ -11,4 +11,4 @@ cmake .. cmake --build . mkdir -p ../../../../../build cp lib/libsecp256k1.so.2.2.2 "../../../../../build/libsecp256k1.so" -cd ../../../ +cd ../../../ \ No newline at end of file