kuon.bitskins.api.interfaces.cashout   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
eloc 13
dl 0
loc 35
ccs 6
cts 10
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ICashout.__init__() 0 7 1
A ICashout.request_withdrawal() 0 16 1
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