|
3 | 3 |
|
4 | 4 | class Transactions(Resource): |
5 | 5 |
|
6 | | - def all(self, page=None, limit=100, **kwargs): |
7 | | - extra_params = {name: kwargs[name] for name in kwargs if kwargs[name] is not None} |
8 | | - params = { |
9 | | - 'page': page, |
10 | | - 'limit': limit, |
11 | | - **extra_params |
12 | | - } |
13 | | - return self.with_endpoint('api').request_get('transactions', params) |
| 6 | + def all(self, query={}): |
| 7 | + return self.with_endpoint('api').request_get( |
| 8 | + 'transactions', query |
| 9 | + ) |
14 | 10 |
|
15 | 11 | def create(self, transactions): |
16 | | - return self.with_endpoint('transactions').request_post('transactions', data={'transactions': transactions}) |
| 12 | + return self.with_endpoint('transactions').request_post( |
| 13 | + 'transactions', data={'transactions': transactions} |
| 14 | + ) |
17 | 15 |
|
18 | 16 | def get(self, transaction_id): |
19 | | - return self.with_endpoint('api').request_get(f'transactions/{transaction_id}') |
| 17 | + return self.with_endpoint('api').request_get( |
| 18 | + f'transactions/{transaction_id}' |
| 19 | + ) |
20 | 20 |
|
21 | | - def all_unconfirmed(self, limit=100, offset=None, **kwargs): |
22 | | - extra_params = {name: kwargs[name] for name in kwargs if kwargs[name] is not None} |
23 | | - params = { |
24 | | - 'limit': limit, |
25 | | - 'offset': offset, |
26 | | - **extra_params |
27 | | - } |
28 | | - return self.with_endpoint('api').request_get('transactions/unconfirmed', params) |
| 21 | + def all_unconfirmed(self, query={}): |
| 22 | + return self.with_endpoint('api').request_get( |
| 23 | + 'transactions/unconfirmed', query |
| 24 | + ) |
29 | 25 |
|
30 | 26 | def get_unconfirmed(self, transaction_id): |
31 | | - return self.with_endpoint('api').request_get(f'transactions/unconfirmed/{transaction_id}') |
| 27 | + return self.with_endpoint('api').request_get( |
| 28 | + f'transactions/unconfirmed/{transaction_id}' |
| 29 | + ) |
32 | 30 |
|
33 | 31 | def configuration(self): |
34 | | - return self.with_endpoint('transactions').request_get('configuration') |
| 32 | + return self.with_endpoint('transactions').request_get( |
| 33 | + 'configuration' |
| 34 | + ) |
0 commit comments