From 33edd8eee85f48497440829ea41b30d0e21cf02b Mon Sep 17 00:00:00 2001 From: Mohamad Bastin Date: Tue, 9 Jan 2024 20:16:41 +0100 Subject: [PATCH] add fields to faucet balance serializer --- faucet/serializers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/faucet/serializers.py b/faucet/serializers.py index 4bb68849..b9076ff5 100644 --- a/faucet/serializers.py +++ b/faucet/serializers.py @@ -19,6 +19,8 @@ class FaucetBalanceSerializer(serializers.ModelSerializer): contract_balance = serializers.SerializerMethodField() wallet_balance = serializers.SerializerMethodField() chain = ChainSerializer() + get_has_enough_fees = serializers.SerializerMethodField() + get_wallet_address = serializers.SerializerMethodField() class Meta: model = Faucet @@ -27,8 +29,11 @@ class Meta: "chain", "needs_funding", "has_enough_funds", + "get_has_enough_fees", "contract_balance", "wallet_balance", + "fund_manager_address", + "get_wallet_address", "block_scan_address", ] @@ -38,6 +43,12 @@ def get_contract_balance(self, faucet): def get_wallet_balance(self, faucet): return faucet.chain.wallet_balance + def get_has_enough_fees(self, faucet): + return faucet.chain.has_enough_fees + + def get_wallet_address(self, faucet): + return faucet.chain.wallet.address + class SmallFaucetSerializer(serializers.ModelSerializer): chain = ChainSerializer()