submit_transaction
16 response = requests.get(url)
17 return response.json()
18
19 def submit_transaction(self, transaction):20 url = f"{self.base_url}/transactions"
21 headers = {"Content-Type": "application/json"}
22 response = requests.post(url, json=transaction, headers=headers)
get_payment_history
11 response = requests.get(url)
12 return response.json()
13
14 def get_payment_history(self, account_id, limit=20):15 url = f"{self.base_url}/accounts/{account_id}/payments?limit={limit}"
16 response = requests.get(url)
17 return response.json()
get_account_info
6 self.network = network
7 self.base_url = f"https://horizon-{self.network}.stellar.org"
8
9 def get_account_info(self, account_id):10 url = f"{self.base_url}/accounts/{account_id}"
11 response = requests.get(url)
12 return response.json()
update_supply_levels
23 if self.waste_storage >= 1:
24 print("Waste storage is full.")
25
26 def update_supply_levels(self, oxygen_rate, water_rate, food_rate, waste_rate):27 self.consume_resources(oxygen_rate, water_rate, food_rate)
28 self.produce_waste(waste_rate)
29 self.check_supply_levels()
check_supply_levels
13 def produce_waste(self, waste_rate):
14 self.waste_storage += waste_rate
15
16 def check_supply_levels(self):17 if self.oxygen_supply <= 0:
18 print("Oxygen supply is low.")
19 if self.water_supply <= 0:
The module/function docstring is missing.
If you want to ignore this, you can configure this in the .deepsource.toml
file. Please refer to docs for available options.