ICashout.request_withdrawal()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 16
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.4218

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
ccs 1
cts 4
cp 0.25
rs 10
c 0
b 0
f 0
cc 1
nop 3
crap 1.4218
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3 1
from kuon.api_response import APIResponse
4 1
from kuon.bitskins import BitSkins
5 1
from kuon.bitskins.common import *
6
7
8 1
class ICashout(BitSkins):
9
    """Implementation of the API methods related to the cashout on BitSkins"""
10
11 1
    def __init__(self, *args, **kwargs) -> None:
12
        """Initializing function
13
14
        :type args: list
15
        :type kwargs: dict
16
        """
17
        super().__init__(*args, **kwargs)
18
19 1
    def request_withdrawal(self, amount: float, withdrawal_method: str = Processor.PAYPAL) -> APIResponse:
20
        """MoneyWithdrawal v1 implementation
21
        https://bitskins.com/api/#request_withdrawal
22
23
        :type amount: float
24
        :type withdrawal_method: str
25
        :return:
26
        """
27
        api_url = "https://bitskins.com/api/v1/request_withdrawal/"
28
29
        payload = {
30
            'amount': str(amount),
31
            'withdrawal_method': withdrawal_method
32
        }
33
34
        return self.api_request(api_url=api_url, params=payload)
35