|
28 | 28 | from .AccountToWalletsConnection import ( |
29 | 29 | from_json as AccountToWalletsConnection_from_json, |
30 | 30 | ) |
| 31 | +from .AccountToWithdrawalRequestsConnection import AccountToWithdrawalRequestsConnection |
| 32 | +from .AccountToWithdrawalRequestsConnection import ( |
| 33 | + from_json as AccountToWithdrawalRequestsConnection_from_json, |
| 34 | +) |
31 | 35 | from .BitcoinNetwork import BitcoinNetwork |
32 | 36 | from .BlockchainBalance import BlockchainBalance |
33 | 37 | from .BlockchainBalance import from_json as BlockchainBalance_from_json |
|
38 | 42 | from .TransactionFailures import TransactionFailures |
39 | 43 | from .TransactionStatus import TransactionStatus |
40 | 44 | from .TransactionType import TransactionType |
| 45 | +from .WithdrawalRequestStatus import WithdrawalRequestStatus |
41 | 46 |
|
42 | 47 |
|
43 | 48 | @dataclass |
@@ -1687,6 +1692,97 @@ def get_payment_requests( |
1687 | 1692 | connection = json["entity"]["payment_requests"] |
1688 | 1693 | return AccountToPaymentRequestsConnection_from_json(self.requester, connection) |
1689 | 1694 |
|
| 1695 | + def get_withdrawal_requests( |
| 1696 | + self, |
| 1697 | + first: Optional[int] = None, |
| 1698 | + after: Optional[str] = None, |
| 1699 | + bitcoin_networks: Optional[List[BitcoinNetwork]] = None, |
| 1700 | + statuses: Optional[List[WithdrawalRequestStatus]] = None, |
| 1701 | + node_ids: Optional[List[str]] = None, |
| 1702 | + after_date: Optional[datetime] = None, |
| 1703 | + before_date: Optional[datetime] = None, |
| 1704 | + ) -> AccountToWithdrawalRequestsConnection: |
| 1705 | + json = self.requester.execute_graphql( |
| 1706 | + """ |
| 1707 | +query FetchAccountToWithdrawalRequestsConnection($entity_id: ID!, $first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $after_date: DateTime, $before_date: DateTime) { |
| 1708 | + entity(id: $entity_id) { |
| 1709 | + ... on Account { |
| 1710 | + withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, after_date: $after_date, before_date: $before_date) { |
| 1711 | + __typename |
| 1712 | + account_to_withdrawal_requests_connection_count: count |
| 1713 | + account_to_withdrawal_requests_connection_page_info: page_info { |
| 1714 | + __typename |
| 1715 | + page_info_has_next_page: has_next_page |
| 1716 | + page_info_has_previous_page: has_previous_page |
| 1717 | + page_info_start_cursor: start_cursor |
| 1718 | + page_info_end_cursor: end_cursor |
| 1719 | + } |
| 1720 | + account_to_withdrawal_requests_connection_entities: entities { |
| 1721 | + __typename |
| 1722 | + withdrawal_request_id: id |
| 1723 | + withdrawal_request_created_at: created_at |
| 1724 | + withdrawal_request_updated_at: updated_at |
| 1725 | + withdrawal_request_requested_amount: requested_amount { |
| 1726 | + __typename |
| 1727 | + currency_amount_original_value: original_value |
| 1728 | + currency_amount_original_unit: original_unit |
| 1729 | + currency_amount_preferred_currency_unit: preferred_currency_unit |
| 1730 | + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded |
| 1731 | + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx |
| 1732 | + } |
| 1733 | + withdrawal_request_amount: amount { |
| 1734 | + __typename |
| 1735 | + currency_amount_original_value: original_value |
| 1736 | + currency_amount_original_unit: original_unit |
| 1737 | + currency_amount_preferred_currency_unit: preferred_currency_unit |
| 1738 | + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded |
| 1739 | + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx |
| 1740 | + } |
| 1741 | + withdrawal_request_estimated_amount: estimated_amount { |
| 1742 | + __typename |
| 1743 | + currency_amount_original_value: original_value |
| 1744 | + currency_amount_original_unit: original_unit |
| 1745 | + currency_amount_preferred_currency_unit: preferred_currency_unit |
| 1746 | + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded |
| 1747 | + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx |
| 1748 | + } |
| 1749 | + withdrawal_request_amount_withdrawn: amount_withdrawn { |
| 1750 | + __typename |
| 1751 | + currency_amount_original_value: original_value |
| 1752 | + currency_amount_original_unit: original_unit |
| 1753 | + currency_amount_preferred_currency_unit: preferred_currency_unit |
| 1754 | + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded |
| 1755 | + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx |
| 1756 | + } |
| 1757 | + withdrawal_request_bitcoin_address: bitcoin_address |
| 1758 | + withdrawal_request_withdrawal_mode: withdrawal_mode |
| 1759 | + withdrawal_request_status: status |
| 1760 | + withdrawal_request_completed_at: completed_at |
| 1761 | + withdrawal_request_withdrawal: withdrawal { |
| 1762 | + id |
| 1763 | + } |
| 1764 | + } |
| 1765 | + } |
| 1766 | + } |
| 1767 | + } |
| 1768 | +} |
| 1769 | + """, |
| 1770 | + { |
| 1771 | + "entity_id": self.id, |
| 1772 | + "first": first, |
| 1773 | + "after": after, |
| 1774 | + "bitcoin_networks": bitcoin_networks, |
| 1775 | + "statuses": statuses, |
| 1776 | + "node_ids": node_ids, |
| 1777 | + "after_date": after_date, |
| 1778 | + "before_date": before_date, |
| 1779 | + }, |
| 1780 | + ) |
| 1781 | + connection = json["entity"]["withdrawal_requests"] |
| 1782 | + return AccountToWithdrawalRequestsConnection_from_json( |
| 1783 | + self.requester, connection |
| 1784 | + ) |
| 1785 | + |
1690 | 1786 | def get_wallets( |
1691 | 1787 | self, |
1692 | 1788 | first: Optional[int] = None, |
|
0 commit comments