{"action":"created","issue":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/315","repository_url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/315/comments","events_url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/315/events","html_url":"https://github.com/libbitcoin/libbitcoin-explorer/issues/315","id":130455542,"number":315,"title":"Invalid JSON output for fetch-history (duplicate keys)","user":{"login":"tmsrjs","id":865075,"avatar_url":"https://avatars.githubusercontent.com/u/865075?v=3","gravatar_id":"","url":"https://api.github.com/users/tmsrjs","html_url":"https://github.com/tmsrjs","followers_url":"https://api.github.com/users/tmsrjs/followers","following_url":"https://api.github.com/users/tmsrjs/following{/other_user}","gists_url":"https://api.github.com/users/tmsrjs/gists{/gist_id}","starred_url":"https://api.github.com/users/tmsrjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmsrjs/subscriptions","organizations_url":"https://api.github.com/users/tmsrjs/orgs","repos_url":"https://api.github.com/users/tmsrjs/repos","events_url":"https://api.github.com/users/tmsrjs/events{/privacy}","received_events_url":"https://api.github.com/users/tmsrjs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-02-01T19:17:18Z","updated_at":"2016-03-22T18:45:00Z","closed_at":"2016-03-21T00:02:11Z","body":"When querying for an address' history in JSON format, the output contains a \"transfer\" key for each transaction affecting the address.\r\n<pre>$ bx fetch-history -f json 1ducYz8pB86cYUqj8jhyqqZCQU6KH6qXQ\r\n{\r\n    \"transfers\":\r\n    {\r\n        \"transfer\":\r\n        {\r\n            \"received\":\r\n            {\r\n                \"hash\": \"72d267b1a4d84c1f182f8fc1652e8c6a15e1a5e1b804bd9a7c6a17b6c456512e\",\r\n                \"height\": \"396180\",\r\n                \"index\": \"0\"\r\n            },\r\n            \"value\": \"20000000000\"\r\n        },\r\n        \"transfer\":\r\n        {\r\n            \"received\":\r\n            {\r\n                \"hash\": \"6ce05ea54f0d24e94215d8a193d9e29f729b06729e8897e2222b9c6e9b58dcd3\",\r\n                \"height\": \"396179\",\r\n                \"index\": \"0\"\r\n            },\r\n            \"value\": \"20000000000\"\r\n        },\r\n        \"transfer\":\r\n        {\r\n            \"received\":\r\n            {\r\n                \"hash\": \"a9e9c0164a5b51c309ab9ae9c8b9bffabd3dc85f0de7ec34877af1f5bda16db2\",\r\n                \"height\": \"396171\",\r\n                \"index\": \"0\"\r\n            },\r\n            \"spent\":\r\n            {\r\n                \"hash\": \"e1be603ef3cccabcb169f1f75db6079d04c1d7b770f2dcbc0971f95707895874\",\r\n                \"height\": \"396173\",\r\n                \"index\": \"0\"\r\n            },\r\n            \"value\": \"20000000000\"\r\n        }\r\n    },\r\n    ...\r\n}</pre>\r\nWhen parsing this output, you get an associative array with only **one** \"transfer\" key (most likely the last entry).\r\n<pre>\r\n{\"transfers\"=>\r\n    {\"transfer\"=>\r\n        {\"received\"=>\r\n            {\"hash\"=>\"100ec36d9ca8891fb34e00f8999656b4273e4dd1d3084cf0df9656f7ebaabb79\", \r\n             \"height\"=>\"395325\", \"index\"=>\"0\"},\r\n         \"spent\"=>\r\n            {\"hash\"=>\"a0a1be73e1ee4d1c6526b641a8139364c9140786cf958f91513a81743fb83a5f\",\r\n             \"height\"=>\"395337\", \"index\"=>\"0\"},\r\n         \"value\"=>\"100000000000\"\r\n        }\r\n    }\r\n}\r\n</pre>\r\nI think the desired output would be an array of associative arrays representing each transaction.\r\n\r\nWhat do you guys think?"},"comment":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/comments/199958014","html_url":"https://github.com/libbitcoin/libbitcoin-explorer/issues/315#issuecomment-199958014","issue_url":"https://api.github.com/repos/libbitcoin/libbitcoin-explorer/issues/315","id":199958014,"user":{"login":"HamishMacEwan","id":388061,"avatar_url":"https://avatars.githubusercontent.com/u/388061?v=3","gravatar_id":"","url":"https://api.github.com/users/HamishMacEwan","html_url":"https://github.com/HamishMacEwan","followers_url":"https://api.github.com/users/HamishMacEwan/followers","following_url":"https://api.github.com/users/HamishMacEwan/following{/other_user}","gists_url":"https://api.github.com/users/HamishMacEwan/gists{/gist_id}","starred_url":"https://api.github.com/users/HamishMacEwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HamishMacEwan/subscriptions","organizations_url":"https://api.github.com/users/HamishMacEwan/orgs","repos_url":"https://api.github.com/users/HamishMacEwan/repos","events_url":"https://api.github.com/users/HamishMacEwan/events{/privacy}","received_events_url":"https://api.github.com/users/HamishMacEwan/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T18:45:00Z","updated_at":"2016-03-22T18:45:00Z","body":"Serious independence, and nice to see interoperable reimplementations of those functions, with the earlier caveats."}}