-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix transactions #259
Fix transactions #259
Conversation
@@ -38,9 +38,7 @@ sealed class TransactionModel extends Equatable { | |||
required Map<String, dynamic> data, | |||
}) { | |||
return switch (actionName) { | |||
'transfer' | |||
when account == _hyphaTokenAccount || account == _hyphaWrapTokenAccount || account == _systemTokenAccount => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when account == _hyphaTokenAccount || account == _hyphaWrapTokenAccount || account == _systemTokenAccount
Is this needed??
Basically this is never true when it call it for my account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah because we recognize our own wrap token accounts
This is only identifying a transaction as a transfer
system token = TLOS or EOS
hypha token = hypha.hypha
wrap token = this isn't working yet but I think we should keep it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so a transfer is any actions that includes 'transfer' as the action name
Later on we decide which one to show or not. But the model is not the one dictating this, the UI is.
The models just models data.
"code": "$tokenContract", | ||
"symbol": "$symbol", | ||
}'''; | ||
final requestBody = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i removed these fake maps and created using maps.
Seems to work.
@@ -46,7 +46,9 @@ class UserAccountService { | |||
} | |||
|
|||
Future<bool> isUserAccountAvailable(String accountName, Network network) async { | |||
final requestBody = '{ "account_name": "$accountName" }'; | |||
final requestBody = { | |||
'account_name': accountName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, fake map removed
@@ -187,10 +182,10 @@ class TransactionTransfer extends TransactionModel { | |||
String get to => data['to']; | |||
|
|||
/// 3175.00 | |||
num get amount => data['amount']; | |||
String get amount => (data['quantity'] as String).split(' ').first; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@n13 pls review these
@@ -12,8 +12,11 @@ class TransactionHistoryRepository { | |||
|
|||
TransactionHistoryRepository({required this.service}); | |||
|
|||
Future<Result<List<TransactionModel>, HyphaError>> getTransactions(UserProfileData user, bool transferOnly, | |||
{useV1History = false}) async { | |||
Future<Result<List<TransactionModel>, HyphaError>> getTransactions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
} | ||
} | ||
|
||
Future<Result<List<WalletTransactionTileData>, HyphaError>> getTransferTransactionsForToken({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now chose to show transactions for all tokens we support. or only for 1 token the user picks. Token Details page
'code': tokenContract, | ||
'symbol': symbol | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test these?
I guess the library makes proper json strings out of these... ?! the API rejects it if there's not " around all keys and values ... but that is the normal JSON spec so I'd expect it to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i did.
No description provided.