mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix: properly import and invoke new ledger functions
This commit is contained in:
parent
d342173239
commit
c2e201911a
8 changed files with 16 additions and 16 deletions
|
@ -8,6 +8,7 @@ import 'package:ffi/ffi.dart';
|
||||||
import 'package:ledger_flutter_plus/ledger_flutter_plus.dart';
|
import 'package:ledger_flutter_plus/ledger_flutter_plus.dart';
|
||||||
import 'package:ledger_flutter_plus/ledger_flutter_plus_dart.dart';
|
import 'package:ledger_flutter_plus/ledger_flutter_plus_dart.dart';
|
||||||
import 'package:monero/src/wallet2.dart';
|
import 'package:monero/src/wallet2.dart';
|
||||||
|
import 'package:monero/src/monero.dart' as api;
|
||||||
|
|
||||||
LedgerConnection? gLedger;
|
LedgerConnection? gLedger;
|
||||||
|
|
||||||
|
@ -17,15 +18,15 @@ Timer? _ledgerKeepAlive;
|
||||||
void enableLedgerExchange(Wallet2Wallet wallet, LedgerConnection connection) {
|
void enableLedgerExchange(Wallet2Wallet wallet, LedgerConnection connection) {
|
||||||
_ledgerExchangeTimer?.cancel();
|
_ledgerExchangeTimer?.cancel();
|
||||||
_ledgerExchangeTimer = Timer.periodic(Duration(milliseconds: 1), (_) async {
|
_ledgerExchangeTimer = Timer.periodic(Duration(milliseconds: 1), (_) async {
|
||||||
final ledgerRequestLength = wallet.getSendToDeviceLength();
|
final ledgerRequestLength = api.MoneroWallet.getSendToDeviceLength();
|
||||||
final ledgerRequest = wallet.getSendToDevice()
|
final ledgerRequest = api.MoneroWallet.getSendToDevice()
|
||||||
.cast<Uint8>()
|
.cast<Uint8>()
|
||||||
.asTypedList(ledgerRequestLength);
|
.asTypedList(ledgerRequestLength);
|
||||||
if (ledgerRequestLength > 0) {
|
if (ledgerRequestLength > 0) {
|
||||||
_ledgerKeepAlive?.cancel();
|
_ledgerKeepAlive?.cancel();
|
||||||
|
|
||||||
final Pointer<Uint8> emptyPointer = malloc<Uint8>(0);
|
final Pointer<Uint8> emptyPointer = malloc<Uint8>(0);
|
||||||
wallet.setDeviceSendData(
|
api.MoneroWallet.setDeviceSendData(
|
||||||
emptyPointer.cast<UnsignedChar>(), 0);
|
emptyPointer.cast<UnsignedChar>(), 0);
|
||||||
malloc.free(emptyPointer);
|
malloc.free(emptyPointer);
|
||||||
|
|
||||||
|
@ -44,8 +45,7 @@ void enableLedgerExchange(Wallet2Wallet wallet, LedgerConnection connection) {
|
||||||
for (var i = 0; i < response.length; i++) {
|
for (var i = 0; i < response.length; i++) {
|
||||||
result.asTypedList(response.length)[i] = response[i];
|
result.asTypedList(response.length)[i] = response[i];
|
||||||
}
|
}
|
||||||
|
api.MoneroWallet.setDeviceReceivedData(
|
||||||
wallet.setDeviceReceivedData(
|
|
||||||
result.cast<UnsignedChar>(), response.length);
|
result.cast<UnsignedChar>(), response.length);
|
||||||
malloc.free(result);
|
malloc.free(result);
|
||||||
keepAlive(connection);
|
keepAlive(connection);
|
||||||
|
|
|
@ -573,8 +573,8 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "impls/monero.dart"
|
path: "impls/monero.dart"
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
resolved-ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
resolved-ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
url: "https://github.com/mrcyjanek/monero_c"
|
url: "https://github.com/mrcyjanek/monero_c"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
|
|
@ -27,7 +27,7 @@ dependencies:
|
||||||
monero:
|
monero:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/mrcyjanek/monero_c
|
url: https://github.com/mrcyjanek/monero_c
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
path: impls/monero.dart
|
path: impls/monero.dart
|
||||||
mutex: ^3.1.0
|
mutex: ^3.1.0
|
||||||
ledger_flutter_plus: ^1.4.1
|
ledger_flutter_plus: ^1.4.1
|
||||||
|
|
|
@ -480,8 +480,8 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "impls/monero.dart"
|
path: "impls/monero.dart"
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
resolved-ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
resolved-ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
url: "https://github.com/mrcyjanek/monero_c"
|
url: "https://github.com/mrcyjanek/monero_c"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
|
|
@ -25,7 +25,7 @@ dependencies:
|
||||||
monero:
|
monero:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/mrcyjanek/monero_c
|
url: https://github.com/mrcyjanek/monero_c
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508 # monero_c hash
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2 # monero_c hash
|
||||||
path: impls/monero.dart
|
path: impls/monero.dart
|
||||||
mutex: ^3.1.0
|
mutex: ^3.1.0
|
||||||
|
|
||||||
|
|
|
@ -485,8 +485,8 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "impls/monero.dart"
|
path: "impls/monero.dart"
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
resolved-ref: b335585a7fb94b315eb52bd88f2da6d3489fa508
|
resolved-ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
url: "https://github.com/mrcyjanek/monero_c"
|
url: "https://github.com/mrcyjanek/monero_c"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
@ -842,4 +842,4 @@ packages:
|
||||||
version: "3.1.3"
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.5.0 <4.0.0"
|
dart: ">=3.5.0 <4.0.0"
|
||||||
flutter: ">=3.27.4"
|
flutter: ">=3.24.0"
|
||||||
|
|
|
@ -26,7 +26,7 @@ dependencies:
|
||||||
monero:
|
monero:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/mrcyjanek/monero_c
|
url: https://github.com/mrcyjanek/monero_c
|
||||||
ref: b335585a7fb94b315eb52bd88f2da6d3489fa508 # monero_c hash
|
ref: a27fbcb24d91143715ed930a05aaa4d853fba1f2 # monero_c hash
|
||||||
path: impls/monero.dart
|
path: impls/monero.dart
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -8,7 +8,7 @@ if [[ ! -d "monero_c/.git" ]];
|
||||||
then
|
then
|
||||||
git clone https://github.com/mrcyjanek/monero_c --branch master monero_c
|
git clone https://github.com/mrcyjanek/monero_c --branch master monero_c
|
||||||
cd monero_c
|
cd monero_c
|
||||||
git checkout b335585a7fb94b315eb52bd88f2da6d3489fa508
|
git checkout a27fbcb24d91143715ed930a05aaa4d853fba1f2
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git submodule update --init --force --recursive
|
git submodule update --init --force --recursive
|
||||||
./apply_patches.sh monero
|
./apply_patches.sh monero
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue