mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
b3d579c24a
* chore: Initial setup for polygon package * feat: Add polygon node urls * feat: Add Polygon(MATIC) wallet WIP * feat: Add Polygon(MATIC) wallet WIP * feat: Add Polygon MATIC wallet [skip ci] * fix: Issue with create/restore wallet for polygon * feat: Add erc20 tokens for polygon * feat: Adding Polygon MATIC Wallet * fix: Add build command for polygon to workflow file to fix failing action * fix: Switch evm to not display additional balance * chore: Sync with remote * fix: Revert change to inject app script * feat: Add polygon erc20 tokens * feat: Increase migration version * fix: Restore from QR address validator fix * fix: Adjust wallet connect connection flow to adapt to wallet type * fix: Make wallet fetch nfts based on the current wallet type * fix: Make wallet fetch nfts based on the current wallet type * fix: Try fetching transactions with moralis * fix: Requested review changes * fix: Error creating new wallet * fix: Revert script * fix: Exclude spam NFTs from nft listing API response * Update default_erc20_tokens.dart * replace matic with matic poly * Add polygon wallet scheme to app links * style: reformat default_settings_migration.dart * minor enhancement * fix using different wallet function for setting the transaction priorities * fix: Add chain to calls * Add USDC.e to initial coins * Add other default polygon node * Use Polygon scan some UI fixes * Add polygon scan api key to secrets generation code --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
49 lines
1.6 KiB
Dart
49 lines
1.6 KiB
Dart
import 'package:cw_ethereum/ethereum_transaction_model.dart';
|
|
|
|
class PolygonTransactionModel extends EthereumTransactionModel {
|
|
PolygonTransactionModel({
|
|
required DateTime date,
|
|
required String hash,
|
|
required String from,
|
|
required String to,
|
|
required BigInt amount,
|
|
required int gasUsed,
|
|
required BigInt gasPrice,
|
|
required String contractAddress,
|
|
required int confirmations,
|
|
required int blockNumber,
|
|
required String? tokenSymbol,
|
|
required int? tokenDecimal,
|
|
required bool isError,
|
|
}) : super(
|
|
amount: amount,
|
|
date: date,
|
|
hash: hash,
|
|
from: from,
|
|
to: to,
|
|
gasPrice: gasPrice,
|
|
gasUsed: gasUsed,
|
|
confirmations: confirmations,
|
|
contractAddress: contractAddress,
|
|
blockNumber: blockNumber,
|
|
tokenDecimal: tokenDecimal,
|
|
tokenSymbol: tokenSymbol,
|
|
isError: isError,
|
|
);
|
|
|
|
factory PolygonTransactionModel.fromJson(Map<String, dynamic> json) => PolygonTransactionModel(
|
|
date: DateTime.fromMillisecondsSinceEpoch(int.parse(json["timeStamp"]) * 1000),
|
|
hash: json["hash"],
|
|
from: json["from"],
|
|
to: json["to"],
|
|
amount: BigInt.parse(json["value"]),
|
|
gasUsed: int.parse(json["gasUsed"]),
|
|
gasPrice: BigInt.parse(json["gasPrice"]),
|
|
contractAddress: json["contractAddress"],
|
|
confirmations: int.parse(json["confirmations"]),
|
|
blockNumber: int.parse(json["blockNumber"]),
|
|
tokenSymbol: json["tokenSymbol"] ?? "MATIC",
|
|
tokenDecimal: int.tryParse(json["tokenDecimal"] ?? ""),
|
|
isError: json["isError"] == "1",
|
|
);
|
|
}
|