-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added
web3LoadTransactions
in mirai_web3
to load user trans…
…actions on a specific token
- Loading branch information
1 parent
192ced1
commit 33c469d
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
.../lib/action_parsers/mirai_web3_load_transactions/mirai_web3_load_transactions_parser.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:flutter/widgets.dart'; | ||
import 'package:mirai_framework/mirai_framework.dart'; | ||
import 'package:mirai_web3/services/web_modal_service.dart'; | ||
|
||
class MiraiWeb3LoadTransactionsParser | ||
extends MiraiActionParser<Map<String, dynamic>> { | ||
const MiraiWeb3LoadTransactionsParser(); | ||
|
||
@override | ||
String get actionType => 'web3LoadTransactions'; | ||
|
||
@override | ||
getModel(Map<String, dynamic> json) => json; | ||
|
||
@override | ||
FutureOr<dynamic> onCall( | ||
BuildContext context, Map<String, dynamic> model) async { | ||
return await Web3ModalService.loadTransactions( | ||
tokenAddress: model['token_address']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:mirai_web3/models/token.dart'; | ||
|
||
class TransactionDetails { | ||
TransactionDetails({ | ||
required this.senderAddress, | ||
required this.receiverAddress, | ||
required this.amount, | ||
required this.received, | ||
required this.tranHash, | ||
required this.tranToken, | ||
}); | ||
|
||
final String senderAddress; | ||
final String receiverAddress; | ||
final BigInt amount; | ||
final bool received; | ||
final String tranHash; | ||
final Token tranToken; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters