From e51d4dd9204462140d05b6e7552d426d758fafdc Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sat, 20 Jul 2024 23:13:34 +0700 Subject: [PATCH] Create sidra_chain_service.py --- sidra_chain_integration/sidra_chain_service.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sidra_chain_integration/sidra_chain_service.py diff --git a/sidra_chain_integration/sidra_chain_service.py b/sidra_chain_integration/sidra_chain_service.py new file mode 100644 index 000000000..548983e8e --- /dev/null +++ b/sidra_chain_integration/sidra_chain_service.py @@ -0,0 +1,13 @@ +# sidra_chain_service.py +from sidra_chain_api import SidraChainAPI + +class SidraChainService: + def __init__(self, api_key, api_secret): + self.sidra_chain_api = SidraChainAPI(api_key, api_secret) + + def get_chain_data(self): + access_token = self.sidra_chain_api.authenticate() + if access_token: + return self.sidra_chain_api.get_chain_data(access_token) + else: + return None