def change_password(requester, new_password):
     headers = get_headers(requester["email"],
         requester["password"])
     data = {"email": requester["email"],
             "password":requester["password"],
             "new_password": new_password}
     return requests.get(CHANGE_PASSWORD, data=json.dumps(data))
    async def get_shares_on_receive_secrets(self, requester, receive_secret_address):
        headers = get_headers(requester["email"],
                        requester["password"])

        data = {"receive_secret_address": receive_secret_address}
        return requests.post(GET_SHARES_ON_RECEIVE_SECRETS,
                    data=json.dumps(data),
                    headers=headers)
    async def share_mnemonic(requester, receive_secret_addresess):
        headers = get_headers(requester["email"],
                        requester["password"])

        data = {"receive_secret_addresess": receive_secret_addresess,
                "minimum_required": 3}
        logging.info(headers)
        return requests.post(SHARE_MNEMONIC,
                                data=json.dumps(data), headers=headers)
    async def execute_share_secret(self, requester, receive_secret_address, share_secret_address):
        headers = get_headers(requester["email"],
                        requester["password"])

        data = {"receive_secret_address": receive_secret_address,
                "share_secret_address": share_secret_address}
        return requests.post(EXECUTE_SHARE_SECRET,
                    data=json.dumps(data),
                    headers=headers)
    def register_organization(requester, organization):
        headers = get_headers(requester["email"],
                        requester["password"])

        ##creating account for Master organization
        if headers:
            return requests.post(CREATE_ORGANIZATION_ACCOUNT,
                data=json.dumps({"pancard": organization["pancard"],
                    "phone_number": organization["phone_number"],
                    "email": organization["email"],
                    "role": organization["role"],
                    "org_name": organization["org_name"]}), headers=headers)
        else:
            return False
 def get_float_accounts(requester):
     headers = get_headers(requester["email"],
                     requester["password"])
     return requests.get(GET_FLOAT_ACCOUNTS,
         headers=headers)
 def get_organization_account(requester):
     headers = get_headers(requester["email"],
                     requester["password"])
     return requests.get(GET_ORGANIZATION_ACCOUNT,
         headers=headers)
 def get_children(requester):
     headers = get_headers(requester["email"],
                     requester["password"])
     return requests.get(GET_CHILDREN,
         headers=headers)
    def register_child(requester, child):
        headers = get_headers(requester["email"],
                        requester["password"])

        return requests.post("http://localhost:8000/accounts/create_child",
                                data=json.dumps(child), headers=headers)
    async def get_account(self, requester):
        headers = get_headers(requester["email"],
                        requester["password"])

        return requests.get(GET_ACCOUNT, headers=headers)
    async def all_share_secrets(self, requester):
        headers = get_headers(requester["email"],
                        requester["password"])

        return requests.get(ALL_SHARE_SECRETS, headers=headers)
 async def get_receive_secrets(self, requester):
     headers = get_headers(requester["email"],
                     requester["password"])
     return requests.post(GET_RECEIVE_SECRETS,
                 headers=headers)
 async def create_receive_secret(self, requester):
     headers = get_headers(requester["email"],
                     requester["password"])
     return requests.post(CREATE_RECEIVE_SECRET,
                 headers=headers)