spacemeshos / app

[DEPRECATED] The cosmic Spacemesh App containing the Spacemesh Wallet and the Spacemesh Dashboard 🏦📊
MIT License
20 stars 12 forks source link

Core: API Mock #28

Open samparsky opened 5 years ago

samparsky commented 5 years ago

Description

Provide API mocks for the following

Describe the solution you'd like

Describe alternatives you've considered

Contribution Guide

Please checkout the contribution guide

ImmanuelSegol commented 5 years ago

@avive Can I take this ?

avive commented 5 years ago

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 commented 5 years ago

@avive Can I take this ?

Yes but please see my proposal for next steps in the gitter chat...

avive commented 5 years ago

Please add

samparsky commented 5 years ago

done

avive commented 5 years ago

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. I think that the ts-lint pattern is to end all methods with Async... this makes working against the API much easier.

samparsky commented 5 years ago

@avive Should there be some sort of API auth mechanism?

ImmanuelSegol commented 5 years ago

@avive @samparsky I think Post a Transaction should be broad cast transaction.