mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
@@ -0,0 +1,11 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class AccountRow extends Struct {
|
||||
@Int64()
|
||||
int id;
|
||||
Pointer<Utf8> label;
|
||||
|
||||
String getLabel() => Utf8.fromUtf8(label);
|
||||
int getId() => id;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class HavenBalanceRow extends Struct {
|
||||
@Int64()
|
||||
int amount;
|
||||
Pointer<Utf8> assetType;
|
||||
|
||||
int getAmount() => amount;
|
||||
String getAssetType() => Utf8.fromUtf8(assetType);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class HavenRate extends Struct {
|
||||
@Int64()
|
||||
int rate;
|
||||
Pointer<Utf8> assetType;
|
||||
|
||||
int getRate() => rate;
|
||||
String getAssetType() => Utf8.fromUtf8(assetType);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class PendingTransactionRaw extends Struct {
|
||||
@Int64()
|
||||
int amount;
|
||||
|
||||
@Int64()
|
||||
int fee;
|
||||
|
||||
Pointer<Utf8> hash;
|
||||
|
||||
String getHash() => Utf8.fromUtf8(hash);
|
||||
}
|
||||
|
||||
class PendingTransactionDescription {
|
||||
PendingTransactionDescription({this.amount, this.fee, this.hash, this.pointerAddress});
|
||||
|
||||
final int amount;
|
||||
final int fee;
|
||||
final String hash;
|
||||
final int pointerAddress;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class SubaddressRow extends Struct {
|
||||
@Int64()
|
||||
int id;
|
||||
Pointer<Utf8> address;
|
||||
Pointer<Utf8> label;
|
||||
|
||||
String getLabel() => Utf8.fromUtf8(label);
|
||||
String getAddress() => Utf8.fromUtf8(address);
|
||||
int getId() => id;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class TransactionInfoRow extends Struct {
|
||||
@Uint64()
|
||||
int amount;
|
||||
|
||||
@Uint64()
|
||||
int fee;
|
||||
|
||||
@Uint64()
|
||||
int blockHeight;
|
||||
|
||||
@Uint64()
|
||||
int confirmations;
|
||||
|
||||
@Uint32()
|
||||
int subaddrAccount;
|
||||
|
||||
@Int8()
|
||||
int direction;
|
||||
|
||||
@Int8()
|
||||
int isPending;
|
||||
|
||||
@Uint32()
|
||||
int subaddrIndex;
|
||||
|
||||
Pointer<Utf8> hash;
|
||||
|
||||
Pointer<Utf8> paymentId;
|
||||
|
||||
Pointer<Utf8> assetType;
|
||||
|
||||
@Int64()
|
||||
int datetime;
|
||||
|
||||
int getDatetime() => datetime;
|
||||
int getAmount() => amount >= 0 ? amount : amount * -1;
|
||||
bool getIsPending() => isPending != 0;
|
||||
String getHash() => Utf8.fromUtf8(hash);
|
||||
String getPaymentId() => Utf8.fromUtf8(paymentId);
|
||||
String getAssetType() => Utf8.fromUtf8(assetType);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'dart:ffi';
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
class Utf8Box extends Struct {
|
||||
Pointer<Utf8> value;
|
||||
|
||||
String getValue() => Utf8.fromUtf8(value);
|
||||
}
|
||||
Reference in New Issue
Block a user