Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create balance observation API endpoint #11

Open
olemis opened this issue Feb 24, 2019 · 0 comments
Open

Create balance observation API endpoint #11

olemis opened this issue Feb 24, 2019 · 0 comments

Comments

@olemis
Copy link
Contributor

olemis commented Feb 24, 2019

[POST] /api/balances/{address}/observation

Should remember the wallet address to observe the wallet balance and return it in the [GET] /api/balances , if the balance is non zero.

Errors:
■ 409 Conflict - specified address is already observed.

Python implementation

@api.route('/balances/<string:address>/observation', methods=['POST'])
def add_observation(address):
    """
    Add the specified address to observation list
    """

    if isValidAddress(address):
        result = add_address_observation(address)
    else:
        result = dict(error='Invalid address', status=422)

    # if successfully stored in observation list, return a plain 200
    if "error" in result:
        return make_response(jsonify(build_error(result["error"])), result["status"])
    else:
        return ""
adriantpaez pushed a commit to uhsimelo/skyxcommons that referenced this issue Feb 27, 2019
adriantpaez added a commit to uhsimelo/skyxcommons that referenced this issue Mar 4, 2019
@adriantpaez adriantpaez removed their assignment Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants