cake_wallet/cw_haven/lib/api/structs/transaction_info_row.dart

45 lines
831 B
Dart
Raw Normal View History

2022-03-30 15:57:04 +00:00
import 'dart:ffi';
import 'package:ffi/ffi.dart';
class TransactionInfoRow extends Struct {
@Uint64()
2022-10-12 17:09:57 +00:00
external int amount;
2022-03-30 15:57:04 +00:00
@Uint64()
2022-10-12 17:09:57 +00:00
external int fee;
2022-03-30 15:57:04 +00:00
@Uint64()
2022-10-12 17:09:57 +00:00
external int blockHeight;
2022-03-30 15:57:04 +00:00
@Uint64()
2022-10-12 17:09:57 +00:00
external int confirmations;
2022-03-30 15:57:04 +00:00
@Uint32()
2022-10-12 17:09:57 +00:00
external int subaddrAccount;
2022-03-30 15:57:04 +00:00
@Int8()
2022-10-12 17:09:57 +00:00
external int direction;
2022-03-30 15:57:04 +00:00
@Int8()
2022-10-12 17:09:57 +00:00
external int isPending;
2022-03-30 15:57:04 +00:00
@Uint32()
2022-10-12 17:09:57 +00:00
external int subaddrIndex;
2022-03-30 15:57:04 +00:00
2022-10-12 17:09:57 +00:00
external Pointer<Utf8> hash;
2022-03-30 15:57:04 +00:00
2022-10-12 17:09:57 +00:00
external Pointer<Utf8> paymentId;
2022-03-30 15:57:04 +00:00
2022-10-12 17:09:57 +00:00
external Pointer<Utf8> assetType;
2022-03-30 15:57:04 +00:00
@Int64()
2022-10-12 17:09:57 +00:00
external int datetime;
2022-03-30 15:57:04 +00:00
int getDatetime() => datetime;
int getAmount() => amount >= 0 ? amount : amount * -1;
bool getIsPending() => isPending != 0;
2022-10-12 17:09:57 +00:00
String getHash() => hash.toDartString();
String getPaymentId() => paymentId.toDartString();
String getAssetType() => assetType.toDartString();
2022-03-30 15:57:04 +00:00
}