mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-25 13:09:32 +00:00
8084f490b5
* CW-490 Use native Coin Freeze * CW-467 Code cleanup * CW-467 Fix native Code * CW-467 Extend Unspend * CW-467 Add isChange * CW-467 Minor Fixes * CW-467 Add isChange to Electrum Unspents * CW-467 Localize Change Tag * CW-467 Fix frozen balance showing on other monero wallets * CW-467 Fix frozen balance showing on other monero wallets
35 lines
1.1 KiB
Dart
35 lines
1.1 KiB
Dart
import 'dart:ffi';
|
|
import 'package:cw_monero/api/signatures.dart';
|
|
import 'package:cw_monero/api/structs/coins_info_row.dart';
|
|
import 'package:cw_monero/api/types.dart';
|
|
import 'package:cw_monero/api/monero_api.dart';
|
|
|
|
final refreshCoinsNative = moneroApi
|
|
.lookup<NativeFunction<refresh_coins>>('refresh_coins')
|
|
.asFunction<RefreshCoins>();
|
|
|
|
final coinsCountNative = moneroApi
|
|
.lookup<NativeFunction<coins_count>>('coins_count')
|
|
.asFunction<CoinsCount>();
|
|
|
|
final coinNative = moneroApi
|
|
.lookup<NativeFunction<coin>>('coin')
|
|
.asFunction<GetCoin>();
|
|
|
|
final freezeCoinNative = moneroApi
|
|
.lookup<NativeFunction<freeze_coin>>('freeze_coin')
|
|
.asFunction<FreezeCoin>();
|
|
|
|
final thawCoinNative = moneroApi
|
|
.lookup<NativeFunction<thaw_coin>>('thaw_coin')
|
|
.asFunction<ThawCoin>();
|
|
|
|
void refreshCoins(int accountIndex) => refreshCoinsNative(accountIndex);
|
|
|
|
int countOfCoins() => coinsCountNative();
|
|
|
|
CoinsInfoRow getCoin(int index) => coinNative(index).ref;
|
|
|
|
void freezeCoin(int index) => freezeCoinNative(index);
|
|
|
|
void thawCoin(int index) => thawCoinNative(index);
|