NickChapman / RequestNetwork.py

A python implementation of the Request Network API
MIT License
13 stars 5 forks source link

clean RequestCoreService.getRequestsByAddress data #16

Open ghost opened 6 years ago

ghost commented 6 years ago

RequestCoreService.getRequestsByAddress isn't complete yet, still need to clean the data, which consists of adding timestamp to each request

The original typescript can be found here so I imagine the python would be something like

for payee in eventsCorePayee:
    payee['_meta] = {
        'blockNumber': payee['blockNumber'],
        'timestamp': self._web3Single.getBlockTimestamp(payee['blockNumber']),
        'requestId': payee['returnValues']['requestId']
    }

# and same for eventsCorePayer

Not entirely sure what self._instanceRequestCore.getPastEvents() returns (dictionary or data structure)