cake_wallet/cw_monero/lib/api/coins_info.dart
Konstantin Ullrich 8084f490b5
Cw 467 mark change outputs in unspent outputs list (#1137)
* 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
2023-11-16 01:12:23 +02:00

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);