Skip to content
This repository has been archived by the owner on Oct 11, 2020. It is now read-only.

Core: API Mock #28

Open
7 tasks
samparsky opened this issue Oct 12, 2018 · 8 comments · May be fixed by #42
Open
7 tasks

Core: API Mock #28

samparsky opened this issue Oct 12, 2018 · 8 comments · May be fixed by #42

Comments

@samparsky
Copy link

samparsky commented Oct 12, 2018

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

@ImmanuelSegol
Copy link
Contributor

@avive Can I take this ?

@avive
Copy link
Contributor

avive commented Oct 18, 2018

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
Copy link
Contributor

avive commented Oct 18, 2018

@avive Can I take this ?

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

@avive
Copy link
Contributor

avive commented Oct 18, 2018

Please add

  • Get SMC from Tap on testnet
  • Get transaction status by TX id

@samparsky
Copy link
Author

done

@avive
Copy link
Contributor

avive commented Oct 18, 2018

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.

@ImmanuelSegol ImmanuelSegol linked a pull request Oct 23, 2018 that will close this issue
6 tasks
@samparsky
Copy link
Author

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

@ImmanuelSegol
Copy link
Contributor

ImmanuelSegol commented Oct 25, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants