Skip to content

Commit 2aedb15

Browse files
Merge pull request #1117 from Tritonn204/xelis-patch
Xelis Patch
2 parents b435838 + aa53690 commit 2aedb15

File tree

5 files changed

+69
-55
lines changed

5 files changed

+69
-55
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# is commented out by default.
2121
#.vscode/
2222

23+
#CppWinRT manual install
24+
Microsoft.Windows*
25+
2326
# Flutter/Dart/Pub related
2427
**/doc/api/
2528
.dart_tool/

lib/wallets/wallet/impl/xelis_wallet.dart

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class XelisWallet extends LibXelisWallet {
416416
asset: xelis_sdk.xelisAsset,
417417
);
418418

419-
fee = Amount(rawValue: BigInt.zero, fractionDigits: decimals);
419+
fee = Amount(rawValue: BigInt.zero, fractionDigits: cryptoCurrency.fractionDigits);
420420

421421
outputs.add(
422422
OutputV2.isarCantDoRequiredInDefaultConstructor(
@@ -426,6 +426,7 @@ class XelisWallet extends LibXelisWallet {
426426
walletOwns: true,
427427
),
428428
);
429+
otherData['overrideFee'] = fee.toJsonString();
429430
} else if (entryType is xelis_sdk.BurnEntry) {
430431
final burn = entryType;
431432
txType = TransactionType.outgoing;
@@ -436,7 +437,7 @@ class XelisWallet extends LibXelisWallet {
436437

437438
fee = Amount(
438439
rawValue: BigInt.from(burn.fee),
439-
fractionDigits: decimals,
440+
fractionDigits: cryptoCurrency.fractionDigits,
440441
);
441442

442443
inputs.add(
@@ -476,7 +477,7 @@ class XelisWallet extends LibXelisWallet {
476477
asset: transfer.asset,
477478
);
478479

479-
fee = Amount(rawValue: BigInt.zero, fractionDigits: decimals);
480+
fee = Amount(rawValue: BigInt.zero, fractionDigits: cryptoCurrency.fractionDigits);
480481

481482
outputs.add(
482483
OutputV2.isarCantDoRequiredInDefaultConstructor(
@@ -492,30 +493,42 @@ class XelisWallet extends LibXelisWallet {
492493
otherData['extraData_${transfer.asset}'] =
493494
transfer.extraData!.toJson();
494495
}
496+
otherData['overrideFee'] = fee.toJsonString();
495497
}
496498
} else if (entryType is xelis_sdk.OutgoingEntry) {
497499
final outgoing = entryType;
498500
txType = TransactionType.outgoing;
499501
nonce = outgoing.nonce;
500502

501-
for (final transfer in outgoing.transfers) {
502-
final int decimals = await libXelisWallet!.getAssetDecimals(
503-
asset: transfer.asset,
504-
);
503+
fee = Amount(
504+
rawValue: BigInt.from(outgoing.fee),
505+
fractionDigits: cryptoCurrency.fractionDigits,
506+
);
505507

506-
fee = Amount(
507-
rawValue: BigInt.from(outgoing.fee),
508-
fractionDigits: decimals,
509-
);
508+
inputs.add(
509+
InputV2.isarCantDoRequiredInDefaultConstructor(
510+
scriptSigHex: null,
511+
scriptSigAsm: null,
512+
sequence: null,
513+
outpoint: null,
514+
addresses: [thisAddress],
515+
valueStringSats: (outgoing.fee).toString(),
516+
witness: null,
517+
innerRedeemScriptAsm: null,
518+
coinbase: null,
519+
walletOwns: true,
520+
),
521+
);
510522

523+
for (final transfer in outgoing.transfers) {
511524
inputs.add(
512525
InputV2.isarCantDoRequiredInDefaultConstructor(
513526
scriptSigHex: null,
514527
scriptSigAsm: null,
515528
sequence: null,
516529
outpoint: null,
517530
addresses: [thisAddress],
518-
valueStringSats: (transfer.amount + outgoing.fee).toString(),
531+
valueStringSats: (transfer.amount).toString(),
519532
witness: null,
520533
innerRedeemScriptAsm: null,
521534
coinbase: null,
@@ -534,7 +547,6 @@ class XelisWallet extends LibXelisWallet {
534547

535548
otherData['asset_${transfer.asset}_amount'] =
536549
transfer.amount.toString();
537-
otherData['asset_${transfer.asset}_fee'] = fee.raw.toString();
538550
if (transfer.extraData != null) {
539551
otherData['extraData_${transfer.asset}'] =
540552
transfer.extraData!.toJson();
@@ -561,7 +573,6 @@ class XelisWallet extends LibXelisWallet {
561573
otherData: jsonEncode({
562574
...otherData,
563575
if (nonce != null) 'nonce': nonce,
564-
'overrideFee': fee.toJsonString(),
565576
}),
566577
);
567578

pubspec.lock

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,10 @@ packages:
588588
dependency: transitive
589589
description:
590590
name: dbus
591-
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
591+
sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
592592
url: "https://pub.dev"
593593
source: hosted
594-
version: "0.7.10"
594+
version: "0.7.11"
595595
decimal:
596596
dependency: "direct main"
597597
description:
@@ -628,10 +628,10 @@ packages:
628628
dependency: transitive
629629
description:
630630
name: device_info_plus_platform_interface
631-
sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba"
631+
sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2"
632632
url: "https://pub.dev"
633633
source: hosted
634-
version: "7.0.1"
634+
version: "7.0.2"
635635
devicelocale:
636636
dependency: "direct main"
637637
description:
@@ -653,18 +653,18 @@ packages:
653653
dependency: transitive
654654
description:
655655
name: dio
656-
sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260"
656+
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"
657657
url: "https://pub.dev"
658658
source: hosted
659-
version: "5.7.0"
659+
version: "5.8.0+1"
660660
dio_web_adapter:
661661
dependency: transitive
662662
description:
663663
name: dio_web_adapter
664-
sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8"
664+
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
665665
url: "https://pub.dev"
666666
source: hosted
667-
version: "2.0.0"
667+
version: "2.1.1"
668668
dropdown_button2:
669669
dependency: "direct main"
670670
description:
@@ -718,10 +718,10 @@ packages:
718718
dependency: "direct main"
719719
description:
720720
name: equatable
721-
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
721+
sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7"
722722
url: "https://pub.dev"
723723
source: hosted
724-
version: "2.0.5"
724+
version: "2.0.7"
725725
ethereum_addresses:
726726
dependency: "direct main"
727727
description:
@@ -1268,10 +1268,10 @@ packages:
12681268
dependency: transitive
12691269
description:
12701270
name: local_auth_android
1271-
sha256: "6763aaf8965f21822624cb2fd3c03d2a8b3791037b5efb0fe4b13e110f5afc92"
1271+
sha256: "0abe4e72f55c785b28900de52a2522c86baba0988838b5dc22241b072ecccd74"
12721272
url: "https://pub.dev"
12731273
source: hosted
1274-
version: "1.0.46"
1274+
version: "1.0.48"
12751275
local_auth_darwin:
12761276
dependency: transitive
12771277
description:
@@ -1462,18 +1462,18 @@ packages:
14621462
dependency: "direct main"
14631463
description:
14641464
name: package_info_plus
1465-
sha256: "739e0a5c3c4055152520fa321d0645ee98e932718b4c8efeeb51451968fe0790"
1465+
sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191"
14661466
url: "https://pub.dev"
14671467
source: hosted
1468-
version: "8.1.3"
1468+
version: "8.3.0"
14691469
package_info_plus_platform_interface:
14701470
dependency: transitive
14711471
description:
14721472
name: package_info_plus_platform_interface
1473-
sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b
1473+
sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c"
14741474
url: "https://pub.dev"
14751475
source: hosted
1476-
version: "3.0.2"
1476+
version: "3.2.0"
14771477
path:
14781478
dependency: transitive
14791479
description:
@@ -1542,42 +1542,42 @@ packages:
15421542
dependency: "direct main"
15431543
description:
15441544
name: permission_handler
1545-
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
1545+
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
15461546
url: "https://pub.dev"
15471547
source: hosted
1548-
version: "11.3.1"
1548+
version: "11.4.0"
15491549
permission_handler_android:
15501550
dependency: transitive
15511551
description:
15521552
name: permission_handler_android
1553-
sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1"
1553+
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
15541554
url: "https://pub.dev"
15551555
source: hosted
1556-
version: "12.0.13"
1556+
version: "12.1.0"
15571557
permission_handler_apple:
15581558
dependency: transitive
15591559
description:
15601560
name: permission_handler_apple
1561-
sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
1561+
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
15621562
url: "https://pub.dev"
15631563
source: hosted
1564-
version: "9.4.5"
1564+
version: "9.4.7"
15651565
permission_handler_html:
15661566
dependency: transitive
15671567
description:
15681568
name: permission_handler_html
1569-
sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
1569+
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
15701570
url: "https://pub.dev"
15711571
source: hosted
1572-
version: "0.1.3+2"
1572+
version: "0.1.3+5"
15731573
permission_handler_platform_interface:
15741574
dependency: transitive
15751575
description:
15761576
name: permission_handler_platform_interface
1577-
sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9
1577+
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
15781578
url: "https://pub.dev"
15791579
source: hosted
1580-
version: "4.2.3"
1580+
version: "4.3.0"
15811581
permission_handler_windows:
15821582
dependency: transitive
15831583
description:
@@ -2088,10 +2088,10 @@ packages:
20882088
dependency: transitive
20892089
description:
20902090
name: url_launcher_ios
2091-
sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626"
2091+
sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
20922092
url: "https://pub.dev"
20932093
source: hosted
2094-
version: "6.3.2"
2094+
version: "6.3.3"
20952095
url_launcher_linux:
20962096
dependency: transitive
20972097
description:
@@ -2144,10 +2144,10 @@ packages:
21442144
dependency: transitive
21452145
description:
21462146
name: vector_graphics
2147-
sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7"
2147+
sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de"
21482148
url: "https://pub.dev"
21492149
source: hosted
2150-
version: "1.1.15"
2150+
version: "1.1.18"
21512151
vector_graphics_codec:
21522152
dependency: transitive
21532153
description:
@@ -2200,18 +2200,18 @@ packages:
22002200
dependency: "direct main"
22012201
description:
22022202
name: wakelock_plus
2203-
sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484
2203+
sha256: b90fbcc8d7bdf3b883ea9706d9d76b9978cb1dfa4351fcc8014d6ec31a493354
22042204
url: "https://pub.dev"
22052205
source: hosted
2206-
version: "1.2.8"
2206+
version: "1.2.11"
22072207
wakelock_plus_platform_interface:
22082208
dependency: transitive
22092209
description:
22102210
name: wakelock_plus_platform_interface
2211-
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
2211+
sha256: "70e780bc99796e1db82fe764b1e7dcb89a86f1e5b3afb1db354de50f2e41eb7a"
22122212
url: "https://pub.dev"
22132213
source: hosted
2214-
version: "1.2.1"
2214+
version: "1.2.2"
22152215
wakelock_windows:
22162216
dependency: "direct overridden"
22172217
description:
@@ -2338,11 +2338,11 @@ packages:
23382338
dependency: "direct main"
23392339
description:
23402340
path: "."
2341-
ref: "v0.1.0"
2342-
resolved-ref: c685c5d3550cca414ec30d4b61259761f129dda6
2343-
url: "https://github.com/Tritonn204/xelis_flutter_ffi.git"
2341+
ref: "v0.1.1"
2342+
resolved-ref: ee7a5756f5f403e6a371990c2817f38eb21a97b2
2343+
url: "https://github.com/xelis-project/xelis-flutter-ffi.git"
23442344
source: git
2345-
version: "0.1.0"
2345+
version: "0.1.1"
23462346
xml:
23472347
dependency: transitive
23482348
description:

scripts/app_config/templates/pubspec.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ dependencies:
3232

3333
xelis_flutter:
3434
git:
35-
url: https://github.com/Tritonn204/xelis_flutter_ffi.git
36-
ref: v0.1.0
35+
url: https://github.com/xelis-project/xelis-flutter-ffi.git
36+
ref: v0.1.1
3737

3838
flutter_libsparkmobile:
3939
git:

scripts/linux/build_secp256k1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ cmake ..
1111
cmake --build .
1212
mkdir -p ../../../../../build
1313
cp lib/libsecp256k1.so.2.2.2 "../../../../../build/libsecp256k1.so"
14-
cd ../../../
14+
cd ../../../

0 commit comments

Comments
 (0)