-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API documentation #780 #1174
API documentation #780 #1174
Conversation
nice job, ill take a look in more detail as soon as i can. |
Thank you very much ! Really appreciate all your efforts and help ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to improve. Thanks anyway.
* @param a Base in pair | ||
* @param b Quote in pair | ||
* @param limit Maximum number of orders to retrieve | ||
* @return A list of orders with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns history, not orders.
* @param bucket_seconds Represents the length in seconds of bucket | ||
* @param start Time in seconds from where buckets begin | ||
* @param end Time in seconds where buckets stop | ||
* @return A list of markets with b:a pair (maximum markets to retrieve is less than 200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns history in one market, not markets. Descriptions of params seems off.
/** | ||
* @brief Get holders for a specific asset | ||
* @param asset_id The specific asset | ||
* @param start The start index of first asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems wrong.
* @param asset_id The specific asset | ||
* @param start The start index of first asset | ||
* @param limit Maximum limit must not exceed 100 | ||
* @return A holders for the specified asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A holders
sounds strange.
|
||
/** | ||
* @brief Get tracked buckets | ||
* @return A list of tracked buckets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps need to explain what's a bucket.
Thank you very much ! Will improve soon ! Sorry for mistakes ! |
improved, but there still maybe some wrong explanations, I will check myself again and will improve/fix what will find wrong.Thank you very much ! |
5fef044
to
e11e75a
Compare
improved and rebased already |
* @brief Get range proof info | ||
* @param proof List of characters | ||
* @return A range proof info structure with exponent, mantissa, min and max values | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you understand how the crypto_api works?
Your documentation provides nothing useful that isn't obvious from the method/variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all details still researching this code in more details ... blind accounts and transactions are the main idea for crypto_api
I will improve this documentation more soon ... |
Guys, thanks for your time and efforts ! Please check my new changes when you will have enough time for it. Should I make any other changes in api documentation or it is ok for now ? Thanks ! |
@@ -343,8 +426,26 @@ namespace graphene { namespace app { | |||
asset_api(graphene::chain::database& db); | |||
~asset_api(); | |||
|
|||
/** | |||
* @brief Get account holders for a specific asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"account holders" doesn't make sense. Either "asset holders" or "accounts holding asset".
vector<account_asset_balance> get_asset_holders( asset_id_type asset_id, uint32_t start, uint32_t limit )const; | ||
|
||
/** | ||
* @brief Get account holders count for a specific asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
vector<order_history_object> get_fill_order_history( asset_id_type a, asset_id_type b, uint32_t limit )const; | ||
|
||
/** | ||
* @brief Get markets with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gets accumulated market history, not current markets
* @param a Base in pair | ||
* @param b Quote in pair | ||
* @param limit Maximum number of orders to retrieve | ||
* @return A history of orders with b:a pair, where a <= b, otherwise a and b will be swaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If always a <= b then it doesn't make sense to call a "Base" and b "Quote". Backend is ignorant of UI market order.
* @param bucket_seconds Represents the length in seconds of bucket | ||
* @param start Time in seconds from where buckets begin | ||
* @param end Time in seconds where buckets stop | ||
* @return A history in market with b:a pair (maximum markets to retrieve is less than 200), where a <= b, otherwise a and b will be swaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
Your formatting changes seem to violate current conventions rather than improve things. (Not that we're very consistent in that regard.) |
I have made that code formatting only for those lines which exceed 130 characters |
Thanks ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I didn't check whether the docs about blinded transfers are correct because I know little about them.
@@ -176,10 +184,34 @@ namespace graphene { namespace app { | |||
uint32_t stop = 0, | |||
unsigned limit = 100, | |||
uint32_t start = 0) const; | |||
|
|||
/** | |||
* @brief Get history of orders with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO "history of orders" is not clear.
* @brief Get history of orders with b:a pair | ||
* @param a asset in pair | ||
* @param b asset in pair | ||
* @param limit Maximum number of orders to retrieve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel "number of orders" here is a bit weird.
vector<order_history_object> get_fill_order_history( asset_id_type a, asset_id_type b, uint32_t limit )const; | ||
|
||
/** | ||
* @brief Gets accumulated market history with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this description is appropriate, but I think we should at least mention OHLC
. Actually, I think we can check other exchanges' API document and write ours accordingly.
* @param a asset in pair | ||
* @param b asset in pair | ||
* @param bucket_seconds Represents the length in seconds of bucket | ||
* @param start Time in seconds from where buckets begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's "Time in seconds"?
* @param bucket_seconds Represents the length in seconds of bucket | ||
* @param start Time in seconds from where buckets begin | ||
* @param end Time in seconds where buckets stop | ||
* @return A history in market with b:a pair (maximum markets to retrieve is less than 200), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "maximum markets"?
* @param start Time in seconds from where buckets begin | ||
* @param end Time in seconds where buckets stop | ||
* @return A history in market with b:a pair (maximum markets to retrieve is less than 200), | ||
* where a <= b, otherwise a and b will be swaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO mentioning the swap here doesn't make sense.
* @brief Gets accumulated market history with b:a pair | ||
* @param a asset in pair | ||
* @param b asset in pair | ||
* @param bucket_seconds Represents the length in seconds of bucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know whether "bucket" is the most commonly used word for this purpose, although it's in our code.
/** | ||
* @brief Get tracked buckets. | ||
* Track market history by grouping orders into buckets of equal size measured in seconds | ||
* specified as a JSON array of numbers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description starts with a verb, thus IMHO is not appropriate for this API. It seems it's copied from the plugin startup options.
/** | ||
* @brief Generates a pedersen commitment: *commit = blind * G + value * G2. | ||
* The commitment is 33 bytes, the blinding factor is 32 bytes. | ||
* (For more information about pederson commitment check please next url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"check please" -> "please check"?
* a "range proof" must be supplied to prove that none of the outputs commit to a negative value. | ||
* The range proofs are computed by library functions in secp256k1-zkp, | ||
* which provides a very flexible and capable range proof library, | ||
* in which a balance can be struck between amount of privacy and compactness of proof. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is more a main description rather than a "brief", because it's long. In the meanwhile there is no main description section here.
@@ -185,11 +185,11 @@ namespace graphene { namespace app { | |||
unsigned limit = 100, | |||
uint32_t start = 0) const; | |||
/** | |||
* @brief Get list of orders with b:a pair | |||
* @brief Get asset pairs with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"asset pairs" doesn't make sense. Please talk to traders to see what should be put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Sure. Thanks !
|
should I use "market history" instead of "asset pairs" ? or "trading pairs" ? or "order book" ?
Thanks ! |
IMHO for me as I understood correctly from Jacob Warlus answer the most makes sense here "market history" |
@cogutvalera apparently you've learnt some. Please talk more with your friend. |
vector<bucket_object> get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, | ||
fc::time_point_sec start, fc::time_point_sec end )const; | ||
|
||
/** | ||
* @brief Get list of seconds for grouping asset pairs in OHLC https://en.wikipedia.org/wiki/Open-high-low-close_chart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"asset pairs" is not suitable here.
In addition, should tell the user where did this list come from.
* Thus supporting OHLC https://www.investopedia.com/terms/o/ohlcchart.asp | ||
* @param a asset in pair | ||
* @param b asset in pair | ||
* @param bucket_seconds Represents the length in seconds of bucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that bucket_seconds
here need to be within result of get_market_history_buckets()
API, otherwise no data will be returned.
* @param b asset in pair | ||
* @param bucket_seconds Represents the length in seconds of bucket | ||
* @param start Time point in seconds from where buckets begin, E.G. "2018-09-12T18:00:00" | ||
* @param end Time point in seconds where buckets stop, E.G. "2018-09-12T18:00:55" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your example here is a bit misleading or confusing. The difference of them is 55 seconds. What will return if the bucket_seconds
passed in is greater than 55 seconds, for example, 1 day? Does start
or end
need to be "divisible" by bucket_seconds
?
IMHO, a better example would be in the main description section, but not after individual parameters, because valid data range of parameters are affected by each other. In short, use most common scenario or most common input data set to make example.
|
||
/** | ||
* @brief Get accumulated market history with b:a pair | ||
* Thus supporting OHLC https://www.investopedia.com/terms/o/ohlcchart.asp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the link is not needed here. Traders know what's OHLC.
@@ -185,30 +185,31 @@ namespace graphene { namespace app { | |||
unsigned limit = 100, | |||
uint32_t start = 0) const; | |||
/** | |||
* @brief Get asset pairs with b:a pair | |||
* @brief Get order book with b:a pair |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is better in your opinion ? Because trader told me this variant with "order book"
is better, but it isn't. Can you please assist me just a bit ?
Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An API querying for history won't return an order book, that's why.
Please try understand the API, then explain it to the trader and get feedback. Modifying code cluelessly is a waste of time.
Sure I can give my opinion or even write the document by myself, however, since you asked to work on this issue, you should try to get it done by yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed "order book" to "trading orders" in my last commit 1 day ago, is it wrong ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, "trading order" is a confusing phrase. Why not ask traders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after our discussion and a lot of efforts trying to figure out the best suitable solution with @abitmore about API doc, fill_order_operation
and after my code researches I've some results for your judgement:
- "matching orders" can be filled partially, so traders will be confused with such API doc description (@abitmore helped me here with more details & examples, thanks a lot !)
- this API method
get_fill_order_history
will returnfilled orders
which also areconfirmed
by blockchain, IMHO the best solution is to use "confirmed orders", thus traders will understand completely what will be returned to them.
Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "confirmed orders" is good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO perhaps next:
- just simply "filled orders"
- or combination "filled and confirmed orders"
2nd version is more accurate and descriptive IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"filled orders" are very similar to "matched orders", and I've said why it's not good use them as is (note: I didn't say they can't be used in a sentence that's clearer). "confirmed" is very confusing. "filled and confirmed" doesn't make sense IMHO.
Can you reword the whole sentence? It's not only about choosing a noun or a phrase, it's the whole sentence that should be clearer. If unable to clearly describe it in 6 words or one sentence, please use more words and more sentences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, understood, sure. Thanks !
* @return A history in market with b:a pair (limit to retrieve is less than 200 buckets) | ||
*/ | ||
vector<bucket_object> get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, | ||
fc::time_point_sec start, fc::time_point_sec end )const; | ||
|
||
/** | ||
* @brief Get list of seconds for grouping asset pairs in OHLC https://en.wikipedia.org/wiki/Open-high-low-close_chart | ||
* @return A list of seconds which are represented as unsigned integers | ||
* @brief Get list of seconds for grouping a book's orders in OHLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong as well.
just for the info: pushed new commit "fixed: (trading orders) -> (matching orders)" |
0a49cfc
to
c6f603e
Compare
changed last commit's message |
I give up. @cogutvalera I think it's better to update the docs about orders as follows (please wrap long lines):
References: |
…ry and get_market_history_buckets methods (Thanks @abitmore)
@abitmore Thanks ! Changes are done. |
Thanks ! |
PR for #780