OperationResponse.fromJson constructor

OperationResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory OperationResponse.fromJson(Map<String, dynamic> json) {
  int? type = convertInt(json["type_i"]);
  switch (type) {
    case 0:
      return CreateAccountOperationResponse.fromJson(json);
    case 1:
      return PaymentOperationResponse.fromJson(json);
    case 2:
      return PathPaymentStrictReceiveOperationResponse.fromJson(json);
    case 3:
      return ManageSellOfferOperationResponse.fromJson(json);
    case 4:
      return CreatePassiveSellOfferOperationResponse.fromJson(json);
    case 5:
      return SetOptionsOperationResponse.fromJson(json);
    case 6:
      return ChangeTrustOperationResponse.fromJson(json);
    case 7:
      return AllowTrustOperationResponse.fromJson(json);
    case 8:
      return AccountMergeOperationResponse.fromJson(json);
    case 9:
      return InflationOperationResponse.fromJson(json);
    case 10:
      return ManageDataOperationResponse.fromJson(json);
    case 11:
      return BumpSequenceOperationResponse.fromJson(json);
    case 12:
      return ManageBuyOfferOperationResponse.fromJson(json);
    case 13:
      return PathPaymentStrictSendOperationResponse.fromJson(json);
    case 14:
      return CreateClaimableBalanceOperationResponse.fromJson(json);
    case 15:
      return ClaimClaimableBalanceOperationResponse.fromJson(json);
    case 16:
      return BeginSponsoringFutureReservesOperationResponse.fromJson(json);
    case 17:
      return EndSponsoringFutureReservesOperationResponse.fromJson(json);
    case 18:
      return RevokeSponsorshipOperationResponse.fromJson(json);
    case 19:
      return ClawbackOperationResponse.fromJson(json);
    case 20:
      return ClawbackClaimableBalanceOperationResponse.fromJson(json);
    case 21:
      return SetTrustlineFlagsOperationResponse.fromJson(json);
    case 22:
      return LiquidityPoolDepositOperationResponse.fromJson(json);
    case 23:
      return LiquidityPoolWithdrawOperationResponse.fromJson(json);
    case 24:
      return InvokeHostFunctionOperationResponse.fromJson(json);
    case 25:
      return ExtendFootprintTTLOperationResponse.fromJson(json);
    case 26:
      return RestoreFootprintOperationResponse.fromJson(json);
    default:
      throw Exception("Invalid operation type");
  }
}