StarTransaction constructor

const StarTransaction({
  1. @JsonKey(name: 'id') required String id,
  2. @JsonKey(name: 'amount') required int amount,
  3. @JsonKey(name: 'date') required int date,
  4. @JsonKey(name: 'source') TransactionPartner? source,
  5. @JsonKey(name: 'receiver') TransactionPartner? receiver,
  6. @JsonKey(name: 'nanostar_amount') int? nanostarAmount,
})

Creates a new StarTransaction object.

Implementation

const factory StarTransaction({
  /// Unique identifier of the transaction. Coincides with the identifier of
  /// the original transaction for refund transactions. Coincides with
  /// `SuccessfulPayment` for successful incoming
  /// payments from users.
  @JsonKey(name: 'id') required String id,

  /// Number of Telegram Stars transferred by the transaction.
  @JsonKey(name: 'amount') required int amount,

  /// Date the transaction was created in Unix time.
  @JsonKey(name: 'date') required int date,

  /// Optional. Source of an incoming transaction (e.g., a user purchasing
  /// goods or services, Fragment refunding a failed withdrawal). Only for
  /// incoming transactions.
  @JsonKey(name: 'source') TransactionPartner? source,

  /// Optional. Receiver of an outgoing transaction (e.g., a user for a
  /// purchase refund, Fragment for a withdrawal). Only for outgoing
  /// transactions.
  @JsonKey(name: 'receiver') TransactionPartner? receiver,

  /// Optional. The number of 1/1000000000 shares of Telegram Stars
  /// transferred by the transaction; from 0 to 999999999
  @JsonKey(name: 'nanostar_amount') int? nanostarAmount,
}) = _StarTransaction;