mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Create map of all RPC labels #163

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

... and apply a consistent naming scheme.

Right now there is no consistent style. Starting with the RPC commands that end with _MP capitalized vs. all-lower-caps of standard Bitcoin calls. This is arguable, but the first occurance.

The second was use of non-lower-case parameter such as propertyID while every other parameter was all-lower-case.

Next up are labels (or what you'd like to call it): there are some with and some without underscore, e.g. tokensperunit, sendingaddress vs. inverse_unit_price, currency_desired_divisible and sometimes conflicts such as unitprice vs. unit_price.

I'm really not sure which style is the best, but consistency is important imho. I tend to like the use of underscores, because it's more readable.

At last what also fits into this are values which are sometimes capitalized or with a space: Crowdsale Purchase, New, etc.

dexX7 commented 9 years ago

I believe those are most of them:

"accepts"
"action"
"active"
"addedissuertokens"
"address"
"amount"
"amount_desired"
"amount_original"
"amountaccepted"
"amountavailable"
"amountbought"
"amountpaid"
"amountraised"
"amountsent"
"balance"
"bitcoindesired"
"block"
"blocktime"
"buyer"
"category"
"closedearly"
"closetx"
"confirmations"
"creationtxid"
"currency_desired"
"currency_desired_divisible"
"currency_owned"
"currency_owned_divisible"
"data"
"deadline"
"divisible"
"earlybonus"
"ecosystem"
"endedtime"
"fee"
"feerequired"
"fixedissuance"
"grant"
"inverse_unit_price"
"ismine"
"issuances"
"issuer"
"issuertokens"
"maxtokens"
"minimumfee"
"name"
"participanttokens"
"participanttransactions"
"percenttoissuer"
"propertyid"
"propertyiddesired"
"propertyname"
"purchasedpropertydivisible"
"purchasedpropertyid"
"purchasedpropertyname"
"purchasedtokens"
"purchases"
"referenceaddress"
"reserved"
"revoke"
"seller"
"sendingaddress"
"starttime"
"subaction"
"subcategory"
"timelimit"
"tokensissued"
"tokensperunit"
"totaltokens"
"txid"
"type"
"unit_price"
"unitprice"
"url"
"valid"
"vout"

strprintf("%lu.%.8s", invprice[0], boost::lexical_cast<std::string>(invprice[1]))
strprintf("%lu.%.8s", price[0],  boost::lexical_cast<std::string>(price[1]))

"Main"
"Test"

"New"
"Update"
"Cancel"

"* unknown type *"
"Automatic Dispensary"
"Change Issuer Address"
"Close Crowdsale"
"Create Property - Fixed"
"Create Property - Manual"
"Create Property - Variable"
"Crowdsale Purchase"
"DEx Accept Offer"
"DEx Purchase"
"DEx Sell Offer"
"Grant Property Tokens"
"MetaDEx: Offer/Accept one Master Protocol Coins for another"
"Notification"
"Promote Property"
"Rate-Limiting"
"Restricted Send"
"Revoke Property Tokens"
"Savings COMPROMISED"
"Savings"
"Send To Owners"
"Simple Send"
dexX7 commented 9 years ago

I "vote" for underscores and converting all "currency" into "property" and where applicable "propertyid" simply to "property". There are a few fields that are somewhat tricky, e.g. purchasedpropertydivisible. Furthermore is_mine would not match the standard that is used for Bitcoin Core, ... hm.

dexX7 commented 9 years ago

Not really resolved, but closing it for now. Related: #165