31 lines
815 B
Python
31 lines
815 B
Python
|
|
import requests
|
||
|
|
import os
|
||
|
|
from dotenv import load_dotenv
|
||
|
|
|
||
|
|
load_dotenv()
|
||
|
|
|
||
|
|
|
||
|
|
class AkahuClient:
|
||
|
|
def __init__(self, token: str, app_id: str):
|
||
|
|
self.token = token
|
||
|
|
self.app_id = app_id
|
||
|
|
self.api_url = "https://api.akahu.io/v1"
|
||
|
|
self.headers = {
|
||
|
|
"Authorization": f"Bearer {self.token}",
|
||
|
|
"X-Akahu-Id": self.app_id,
|
||
|
|
"Accept": "application/json"
|
||
|
|
}
|
||
|
|
|
||
|
|
def get_accounts(self):
|
||
|
|
client = AkahuClient(self.token, self.app_id)
|
||
|
|
return client.get_accounts()
|
||
|
|
|
||
|
|
def get_transactions(self, account_id: str):
|
||
|
|
client = AkahuClient(self.token, self.app_id)
|
||
|
|
return client.get_transactions(account_id)
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
client = AkahuClient(TOKEN, APP_ID)
|
||
|
|
accounts = client.get_accounts()
|
||
|
|
print(accounts)
|