Action class

A class representing different types of actions related to wallet operations.

It implements the Comparable interface, allowing Actions to be compared based on their timestamps.

Implemented types
Implementers
Annotations
  • @Freezed(unionKey: 'name')

Constructors

Action.createWallet({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('createWallet') String name, String? txHash, required String status, @Default(0) int? blockNumber})
const
factory
Action.fiatDeposit({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('fiat-deposit') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, String? from, required String to, required BigInt value, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory
Action.fromJson(dynamic json)
Creates an Action from a JSON object.
factory
Action.receive({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('receiveTokens') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, required String from, required String to, required BigInt value, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory
Action.receiveNFT({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('receiveNFT') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, required String from, required String to, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory
Action.send({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('sendTokens') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, required String from, required String to, required BigInt value, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory
Action.stakeTokens({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('stakeTokens') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, required String from, required String to, required BigInt value, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory
Action.swap({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('swapTokens') String name, String? txHash, required String status, @Default(0) int? blockNumber})
const
factory
Action.unstakeTokens({@Default(0) int timestamp, @JsonKey(name: '_id') required String id, @Default('unstakeTokens') String name, String? txHash, required String status, @Default(0) int? blockNumber, required String tokenAddress, required String from, required String to, required BigInt value, required String tokenName, required String tokenSymbol, required int tokenDecimal})
const
factory

Properties

blockNumber int?
no setterinherited
copyWith → $ActionCopyWith<Action>
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
no setterinherited
name String
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status String
no setterinherited
timestamp int
no setterinherited
txHash String?
no setterinherited

Methods

compareTo(Action? other) int
Compares this Action to other, based on their timestamps.
override
getRecipient() String
getSender() String
isConfirmed() bool
isFailed() bool
isGenerateWallet() bool
isNFTAction() bool
isPending() bool
isStakeAction() bool
isSwapAction() bool
map<TResult extends Object?>({required TResult createWallet(CreateWallet value), required TResult fiatDeposit(FiatDeposit value), required TResult send(Send value), required TResult receive(Receive value), required TResult swap(Swap value), required TResult receiveNFT(ReceiveNFT value), required TResult stakeTokens(StakeTokens value), required TResult unstakeTokens(UnstakeTokens value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? createWallet(CreateWallet value)?, TResult? fiatDeposit(FiatDeposit value)?, TResult? send(Send value)?, TResult? receive(Receive value)?, TResult? swap(Swap value)?, TResult? receiveNFT(ReceiveNFT value)?, TResult? stakeTokens(StakeTokens value)?, TResult? unstakeTokens(UnstakeTokens value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult createWallet(CreateWallet value)?, TResult fiatDeposit(FiatDeposit value)?, TResult send(Send value)?, TResult receive(Receive value)?, TResult swap(Swap value)?, TResult receiveNFT(ReceiveNFT value)?, TResult stakeTokens(StakeTokens value)?, TResult unstakeTokens(UnstakeTokens value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult createWallet(int timestamp, String id, String name, String? txHash, String status, int? blockNumber)?, TResult fiatDeposit(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String? from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult send(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult receive(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult swap(int timestamp, String id, String name, String? txHash, String status, int? blockNumber)?, TResult receiveNFT(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult stakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult unstakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult createWallet(int timestamp, String id, String name, String? txHash, String status, int? blockNumber), required TResult fiatDeposit(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String? from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal), required TResult send(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal), required TResult receive(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal), required TResult swap(int timestamp, String id, String name, String? txHash, String status, int? blockNumber), required TResult receiveNFT(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, String tokenName, String tokenSymbol, int tokenDecimal), required TResult stakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal), required TResult unstakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? createWallet(int timestamp, String id, String name, String? txHash, String status, int? blockNumber)?, TResult? fiatDeposit(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String? from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult? send(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult? receive(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult? swap(int timestamp, String id, String name, String? txHash, String status, int? blockNumber)?, TResult? receiveNFT(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult? stakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?, TResult? unstakeTokens(int timestamp, String id, String name, String? txHash, String status, int? blockNumber, String tokenAddress, String from, String to, BigInt value, String tokenName, String tokenSymbol, int tokenDecimal)?}) → TResult?
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

actionsFromJson(Iterable docs) List<Action>
Creates a list of Action objects from an iterable of dynamic objects.
create(Map<String, dynamic> json) Action
Creates an Action from a Map of key-value pairs.