app
app copied to clipboard
Core: API Mock
Description
Provide API mocks for the following
- [ ] Post a Transaction
- [ ] Get Address Balance
- [ ] Retrieving an address transactions
- [ ] Buy SMC from exchanges
- [ ] Get SMC current price
- [ ] Get SMC from Tap on testnet
- [ ] Get transaction status by TX id
Describe the solution you'd like
- Mock transaction, should use something similar to Ethereum transaction
- All API calls MUST use the async / await javascript pattern
- Use typed promises
Describe alternatives you've considered
Contribution Guide
Please checkout the contribution guide
@avive Can I take this ?
Please create a component called SpacemeshApiClientMock that mock implements all the methods described in this issue via one or more typescript interfaces. e.g. ISpacemeshApi. For the real app, we'll replace the mock implementation with a real one - e.g. SpacemeshApiClient component.
@avive Can I take this ?
Yes but please see my proposal for next steps in the gitter chat...
Please add
- [ ] Get SMC from Tap on testnet
- [ ] Get transaction status by TX id
done
Please make all API calls async using the async / await javascript pattern. Even methods that can return data immediately should use a typed promise for consistent behavior. e.g. Promise<SomeInterfaceToData>. I think that the ts-lint pattern is to end all methods with Async... this makes working against the API much easier.
@avive Should there be some sort of API auth mechanism?
@avive @samparsky I think Post a Transaction should be broad cast transaction.