Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [DERG 2450] akhil/2450/crypto_transaction_details_page #327

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lib/api/response/cashier_withdrawal_cancel_response_extended.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// ignore_for_file: prefer_single_quotes, unnecessary_import, unused_import

import 'package:deriv_dependency_injector/dependency_injector.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_deriv_api/api/exceptions/base_api_exception.dart';
import 'package:flutter_deriv_api/api/models/base_exception_model.dart';
import 'package:flutter_deriv_api/api/response/cashier_withdrawal_cancel_response_result.dart';
import 'package:flutter_deriv_api/basic_api/generated/cashier_withdrawal_cancel_receive.dart';
import 'package:flutter_deriv_api/basic_api/generated/cashier_withdrawal_cancel_send.dart';

import 'package:flutter_deriv_api/helpers/helpers.dart';
import 'package:flutter_deriv_api/services/connection/api_manager/base_api.dart';

/// The extended version of the [CashierWithdrawalCancelResponseExtended] class to implement
/// the API call methods.
class CashierWithdrawalCancelResponseExtended
extends CashierWithdrawalCancelResponseModel {
static final BaseAPI _api = Injector()<BaseAPI>();

/// Fetches the cashier payments.
static Future<CashierWithdrawalCancelResponse> cancelCasWithdrawl({
required CashierWithdrawalCancelRequest request,
}) async {
final CashierWithdrawalCancelReceive response =
await _api.call(request: request);

checkException(
response: response,
exceptionCreator: ({BaseExceptionModel? baseExceptionModel}) =>
BaseAPIException(baseExceptionModel: baseExceptionModel),
);

return CashierWithdrawalCancelResponse.fromJson(
response.cashierWithdrawalCancel);
}
}
Loading