<center></center> </center>[Image Credit](https://coincentral.com/what-is-bitshares/)</center> ### Attention Developers: I need help with Openledger Json Trade Data. I'm trying to determine how to convert the following JSON trade fill data, so that I can create an entry into [Cointracking.info](https://cointracking.info?ref=P204019) coin detail. Can anyone help? [4, { "fee":{"amount":2000,"asset_id":"OPEN.EOS"}, "order_id":"1.7.62838114", "account_id":"1.2.2503", "pays":{"amount":4700001,"asset_id":"BTS"}, "receives":{"amount":1000000,"asset_id":"OPEN.EOS"}, "fill_price":{"base":{"amount":157093302,"asset_id":"OPEN.EOS"}, "quote":{"amount":738338519,"asset_id":"BTS"}}, "is_maker":false}] Thanks, [@pairmike](https://steemit.com/@pairmike) Please Remember to UpVote - ReSteem - Comment ---------------- <center><a target="_blank" href="https://www.amazon.com/gp/search?ie=UTF8&tag=lifinvmusande-20&linkCode=ur2&linkId=93907f7fcc9aac485154fd7621f57cb6&camp=1789&creative=9325&index=aps&keywords=gifts">Support Me By Shopping at Amazon</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=lifinvmusande-20&l=ur2&o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></center>
author | pairmike |
---|---|
permlink | attention-developers-i-need-help-with-openledger-json-trade-data |
category | bitshares |
json_metadata | {"tags":["bitshares","trade","openledger","development","json"],"image":["https://lh3.googleusercontent.com/nmlrjIf9F9x4UaZaCVoS60PZX7j6EpGl2tMzMclIR_ntKgkrdISwSR-Pk-nf7jdS9P6R6iywjBKvFw=s300","//ir-na.amazon-adsystem.com/e/ir?t=lifinvmusande-20&l=ur2&o=1"],"links":["https://coincentral.com/what-is-bitshares/","https://cointracking.info?ref=P204019","https://steemit.com/@pairmike","https://www.amazon.com/gp/search?ie=UTF8&tag=lifinvmusande-20&linkCode=ur2&linkId=93907f7fcc9aac485154fd7621f57cb6&camp=1789&creative=9325&index=aps&keywords=gifts"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-04-17 23:40:30 |
last_update | 2018-04-18 01:15:09 |
depth | 0 |
children | 7 |
last_payout | 2018-04-24 23:40:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 6.065 HBD |
curator_payout_value | 1.290 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,385 |
author_reputation | 43,927,661,974,027 |
root_title | "Attention Bitshares Developers: I need help with JSON Trade Data." |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 50,654,729 |
net_rshares | 1,458,065,783,344 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
ajvest | 0 | 188,191,008,468 | 100% | ||
officialfuzzy | 0 | 18,484,057,593 | 3% | ||
pfunk | 0 | 1,091,596,842,512 | 25% | ||
pairmike | 0 | 800,589,766 | 100% | ||
kenny-crane | 0 | 96,504,486,017 | 25% | ||
d3nv3r | 0 | 546,559,408 | 5% | ||
oliverstoney | 0 | 243,172,158 | 5% | ||
sextant | 0 | 74,538,271 | 5% | ||
commenthunter | 0 | 275,689,347 | 5% | ||
steemprentice | 0 | 12,839,063,719 | 10% | ||
taskmanager | 0 | 8,137,457,189 | 7.5% | ||
prizeportal | 0 | 668,658,541 | 5% | ||
gersson | 0 | 874,021,946 | 100% | ||
tmholdings | 0 | 3,921,113,627 | 7.5% | ||
awilix | 0 | 549,167,982 | 5% | ||
sbi2 | 0 | 31,561,439,414 | 17% | ||
blem | 0 | 226,103,563 | 5% | ||
memearmy | 0 | 165,658,757 | 5% | ||
zapped | 0 | 90,177,368 | 5% | ||
t50 | 0 | 89,981,740 | 5% | ||
tm50 | 0 | 1,777,027,455 | 10% | ||
instantvoter | 0 | 236,534,080 | 5% | ||
jedimasteryoda | 0 | 112,534,998 | 5% | ||
presidentialline | 0 | 99,899,425 | 2.5% |
<center><h1>Congratulation</h1><b>Today 2 years ago you joined SteemIt Thank you, for making SteemIt great and Steem on for more years to come!</b> (You are being celebrated [here](/steemit/@anniversary/20180423t030020704z-celebration-post))<br/></center>
author | anniversary |
---|---|
permlink | 20180423t030825944z |
category | bitshares |
json_metadata | {"tags":["comment"],"app":"steemjs/comment"} |
created | 2018-04-23 03:08:27 |
last_update | 2018-04-23 03:08:27 |
depth | 1 |
children | 0 |
last_payout | 2018-04-30 03:08:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 351 |
author_reputation | 1,856,978,117,082 |
root_title | "Attention Bitshares Developers: I need help with JSON Trade Data." |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 51,594,024 |
net_rshares | 0 |
Hiya! Not sure if this is what you are looking for, but first, that is valid JSON. And you can play with it in the console of your browser by hitting F12 and going to the console tab. If you paste in `var arr = [4, { "fee":{"amount":2000,"asset_id":"OPEN.EOS"}, "order_id":"1.7.62838114", "account_id":"1.2.2503", "pays":{"amount":4700001,"asset_id":"BTS"}, "receives":{"amount":1000000,"asset_id":"OPEN.EOS"}, "fill_price":{"base":{"amount":157093302,"asset_id":"OPEN.EOS"}, "quote":{"amount":738338519,"asset_id":"BTS"}}, "is_maker":false}]; arr[1].fee.amount` it will return 2000. I think if you put that json in a validator you will see its structure more clearly: https://jsonlint.com/ If you have any question on how to get to any other value in this json, let me know and I'll get it for you. But basically, assign that to a js variable, like arr, and then get what you need by starting with `arr[1].firstLevel.secondLevel.thirdLevel` replacing firstLevel, etc with the name of the variable.
author | kenny-crane |
---|---|
permlink | re-pairmike-attention-developers-i-need-help-with-openledger-json-trade-data-20180418t000352804z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"links":["https://jsonlint.com/"],"app":"steemit/0.1"} |
created | 2018-04-18 00:03:51 |
last_update | 2018-04-18 00:20:51 |
depth | 1 |
children | 5 |
last_payout | 2018-04-25 00:03:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 2.518 HBD |
curator_payout_value | 0.838 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,010 |
author_reputation | 234,049,185,243,091 |
root_title | "Attention Bitshares Developers: I need help with JSON Trade Data." |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 50,657,175 |
net_rshares | 665,607,830,800 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pfunk | 0 | 665,607,830,800 | 15% |
Hey Kenny, I know it not valid Json. What I'm really looking for is to understand how to convert this info into something like this: Type Buy Cur. Sell Cur. Fee Cur. Exchange Group Comment Date Trade 4.46672378 LTC 978.90708337 USD 2.92793744 USD GDAX 2018-02-15 09:00:44
author | pairmike |
---|---|
permlink | re-kenny-crane-re-pairmike-attention-developers-i-need-help-with-openledger-json-trade-data-20180418t002249082z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-04-18 00:22:48 |
last_update | 2018-04-18 00:22:48 |
depth | 2 |
children | 4 |
last_payout | 2018-04-25 00:22:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.230 HBD |
curator_payout_value | 0.076 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 278 |
author_reputation | 43,927,661,974,027 |
root_title | "Attention Bitshares Developers: I need help with JSON Trade Data." |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 50,659,427 |
net_rshares | 61,598,608,096 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kenny-crane | 0 | 61,598,608,096 | 16% |
Are you getting this data from a javascript program or are you using something else? In js, the Buy Currency would be `arr[1].receives.amount + ' ' + arr[1].receives.asset_id` I would think. cointracking.info says they have "Automatic import via APIs" so I would think there would already be some automatic way to do this, but I'm not familiar with BitShares/OpenLedger APIs. I imagine they have APIs and they probably look like Steemit APIs, but I'd have to look into it. I assume what you show here is the result of a BitShares API call, but maybe cointracking does not support this API?
author | kenny-crane |
---|---|
permlink | re-pairmike-re-kenny-crane-re-pairmike-attention-developers-i-need-help-with-openledger-json-trade-data-20180418t005139223z |
category | bitshares |
json_metadata | {"tags":["bitshares"],"app":"steemit/0.1"} |
created | 2018-04-18 00:51:39 |
last_update | 2018-04-18 00:51:39 |
depth | 3 |
children | 3 |
last_payout | 2018-04-25 00:51:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 598 |
author_reputation | 234,049,185,243,091 |
root_title | "Attention Bitshares Developers: I need help with JSON Trade Data." |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 50,662,691 |
net_rshares | 0 |