WidgetQueryType class sealed
This object describes the type of a query sent from a widget. Currently, it can be one of:
WidgetQueryTypeDataWidgetQueryTypeSignDataWidgetQueryTypeSentTransaction
- Available extensions
- Annotations
-
- @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)
Constructors
- WidgetQueryType.data({@JsonKey.new(name: 'type') @Default.new(WidgetQueryTypeType.data) WidgetQueryTypeType type, @JsonKey.new(name: 'wallet_card') TonWalletCard? walletCard})
-
The query contains data for the bot.
constfactory
-
WidgetQueryType.fromJson(Map<
String, dynamic> json) -
Creates a WidgetQueryType from JSON.
factory
- WidgetQueryType.sentTransaction({@JsonKey.new(name: 'type') @Default.new(WidgetQueryTypeType.sentTransaction) WidgetQueryTypeType type, @JsonKey.new(name: 'wallet') required WidgetQueryWallet wallet, @JsonKey.new(name: 'msg_hash') required String msgHash})
-
The query notifies about a transaction sent from a TON wallet of the
user.
constfactory
- WidgetQueryType.signData({@JsonKey.new(name: 'type') @Default.new(WidgetQueryTypeType.signData) WidgetQueryTypeType type, @JsonKey.new(name: 'wallet') required WidgetQueryWallet wallet, @JsonKey.new(name: 'sign_data') required String signData})
-
The query contains data signed by a TON wallet of the user. The data is
signed for the domain
bot<bot_id>.constfactory
Properties
-
copyWith
→ $WidgetQueryTypeCopyWith<
WidgetQueryType> -
Create a copy of WidgetQueryType
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → WidgetQueryTypeType
-
Type of the query, always "data"
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult data(WidgetQueryTypeData value), required TResult signData(WidgetQueryTypeSignData value), required TResult sentTransaction(WidgetQueryTypeSentTransaction value)}) → TResult -
Available on WidgetQueryType, provided by the WidgetQueryTypePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? data(WidgetQueryTypeData value)?, TResult? signData(WidgetQueryTypeSignData value)?, TResult? sentTransaction(WidgetQueryTypeSentTransaction value)?}) → TResult? -
Available on WidgetQueryType, provided by the WidgetQueryTypePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult data(WidgetQueryTypeData value)?, TResult signData(WidgetQueryTypeSignData value)?, TResult sentTransaction(WidgetQueryTypeSentTransaction value)?, required TResult orElse()}) → TResult -
Available on WidgetQueryType, provided by the WidgetQueryTypePatterns extension
A variant ofmapthat fallback to returningorElse. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this WidgetQueryType to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited