fibercrypto / fibercrypto/skyxcommons
Create balance observation API endpoint
- Dominant language
- No language data
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
[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
```py
@api.route('/balances//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 ""
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.