forked from Fuelet/fuels-dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add transaction simulation to web wallet
- Loading branch information
1 parent
2b395eb
commit cb5824b
Showing
10 changed files
with
421 additions
and
14 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
import 'transaction_receipt.dart'; | ||
|
||
class CallResult { | ||
final List<TransactionReceipt> receipts; | ||
|
||
CallResult({required this.receipts}); | ||
} |
196 changes: 196 additions & 0 deletions
196
packages/flutter_fuels/lib/model/transaction_receipt.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,196 @@ | ||
import 'dart:typed_data'; | ||
|
||
abstract class TransactionReceipt {} | ||
|
||
class ReceiptCall extends TransactionReceipt { | ||
final String from; | ||
final String to; | ||
final BigInt amount; | ||
final String assetId; | ||
final BigInt gas; | ||
final BigInt param1; | ||
final BigInt param2; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptCall({ | ||
required this.from, | ||
required this.to, | ||
required this.amount, | ||
required this.assetId, | ||
required this.gas, | ||
required this.param1, | ||
required this.param2, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptReturn extends TransactionReceipt { | ||
final String id; | ||
final BigInt val; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptReturn({ | ||
required this.id, | ||
required this.val, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptReturnData extends TransactionReceipt { | ||
final String id; | ||
final BigInt ptr; | ||
final BigInt len; | ||
final String digest; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptReturnData({ | ||
required this.id, | ||
required this.ptr, | ||
required this.len, | ||
required this.digest, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptPanic extends TransactionReceipt { | ||
final String id; | ||
final BigInt reason; | ||
final BigInt pc; | ||
final BigInt isField; | ||
final String contractId; | ||
|
||
ReceiptPanic({ | ||
required this.id, | ||
required this.reason, | ||
required this.pc, | ||
required this.isField, | ||
required this.contractId, | ||
}); | ||
} | ||
|
||
class ReceiptRevert extends TransactionReceipt { | ||
final String id; | ||
final BigInt val; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptRevert({ | ||
required this.id, | ||
required this.val, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptLog extends TransactionReceipt { | ||
final String id; | ||
final BigInt val0; | ||
final BigInt val1; | ||
final BigInt val2; | ||
final BigInt val3; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptLog({ | ||
required this.id, | ||
required this.val0, | ||
required this.val1, | ||
required this.val2, | ||
required this.val3, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptLogData extends TransactionReceipt { | ||
final String id; | ||
final BigInt val0; | ||
final BigInt val1; | ||
final BigInt ptr; | ||
final BigInt len; | ||
final String digest; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptLogData({ | ||
required this.id, | ||
required this.val0, | ||
required this.val1, | ||
required this.ptr, | ||
required this.len, | ||
required this.digest, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptTransfer extends TransactionReceipt { | ||
final String from; | ||
final String to; | ||
final BigInt amount; | ||
final String assetId; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptTransfer( | ||
{required this.from, | ||
required this.to, | ||
required this.amount, | ||
required this.assetId, | ||
required this.pc, | ||
required this.isField}); | ||
} | ||
|
||
class ReceiptTransferOut extends TransactionReceipt { | ||
final String from; | ||
final String to; | ||
final BigInt amount; | ||
final String assetId; | ||
final BigInt pc; | ||
final BigInt isField; | ||
|
||
ReceiptTransferOut({ | ||
required this.from, | ||
required this.to, | ||
required this.amount, | ||
required this.assetId, | ||
required this.pc, | ||
required this.isField, | ||
}); | ||
} | ||
|
||
class ReceiptScriptResult extends TransactionReceipt { | ||
final BigInt result; | ||
final BigInt gasUsed; | ||
|
||
ReceiptScriptResult({ | ||
required this.result, | ||
required this.gasUsed, | ||
}); | ||
} | ||
|
||
class ReceiptMessageOut extends TransactionReceipt { | ||
final String messageID; | ||
final String sender; | ||
final String recipient; | ||
final BigInt amount; | ||
final String nonce; | ||
final String digest; | ||
final Uint8List data; | ||
|
||
ReceiptMessageOut({ | ||
required this.messageID, | ||
required this.sender, | ||
required this.recipient, | ||
required this.amount, | ||
required this.nonce, | ||
required this.digest, | ||
required this.data, | ||
}); | ||
} |
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
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
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
Oops, something went wrong.