fromJson static method

TonWalletTransactionTypeTelegramGiftOfferCreation? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static TonWalletTransactionTypeTelegramGiftOfferCreation? fromJson(
    Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return TonWalletTransactionTypeTelegramGiftOfferCreation(
    nft: TonNft.fromJson(json['nft'] as Map<String, dynamic>?),
    offerAddress: (json['offer_address'] as String?) ?? '',
    counterpartyAddress: (json['counterparty_address'] as String?) ?? '',
    price: (json['price'] is int
            ? json['price'] as int
            : int.tryParse(json['price']?.toString() ?? '')) ??
        0,
    amount: (json['amount'] is int
            ? json['amount'] as int
            : int.tryParse(json['amount']?.toString() ?? '')) ??
        0,
    serviceFeeAmount: (json['service_fee_amount'] is int
            ? json['service_fee_amount'] as int
            : int.tryParse(json['service_fee_amount']?.toString() ?? '')) ??
        0,
    expirationDate: (json['expiration_date'] as int?) ?? 0,
  );
}