{"action":"created","comment":{"url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/comments/261998309","pull_request_review_id":210065947,"id":261998309,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MTk5ODMwOQ==","diff_hunk":"@@ -0,0 +1,49 @@\n+module Cryptoexchange::Exchanges\n+  module Txbit\n+    module Services\n+      class Market < Cryptoexchange::Services::Market\n+        class << self\n+          def supports_individual_ticker_query?\n+            true\n+          end\n+        end\n+\n+        def fetch(market_pair)\n+          output = super(ticker_url(market_pair))\n+          adapt(output, market_pair)\n+        end\n+\n+        def ticker_url(market_pair)\n+          base = market_pair.base\n+          target = market_pair.target\n+          \"#{Cryptoexchange::Exchanges::Txbit::Market::API_URL}/public/getmarketsummary?market=#{target}/#{base}\"\n+        end\n+\n+        def adapt(output, market_pair)\n+          handle_invalid(output)\n+          ticker = Cryptoexchange::Models::Ticker.new\n+          market = output['result']\n+\n+          ticker.base      = market_pair.base\n+          ticker.target    = market_pair.target\n+          ticker.market    = Txbit::Market::NAME\n+          ticker.last      = NumericHelper.to_d(market['Last'])\n+          ticker.high      = NumericHelper.to_d(market['High'])\n+          ticker.low       = NumericHelper.to_d(market['Low'])\n+          ticker.ask       = NumericHelper.to_d(market['Ask'])\n+          ticker.bid       = NumericHelper.to_d(market['Bid'])\n+          ticker.volume    = NumericHelper.to_d(market['BaseVolume'])\n+          ticker.timestamp = NumericHelper.to_d(DateTime.parse(market['TimeStamp']).to_time.to_i)","path":"lib/cryptoexchange/exchanges/txbit/services/market.rb","position":null,"original_position":36,"commit_id":"89a24e03642a2469e1a919fedc081409b0c311ee","original_commit_id":"c7fd575ff13ec4babb14c6899630c22d0bbcc402","user":{"login":"TxbitExchange","id":48020496,"node_id":"MDQ6VXNlcjQ4MDIwNDk2","avatar_url":"https://avatars3.githubusercontent.com/u/48020496?v=4","gravatar_id":"","url":"https://api.github.com/users/TxbitExchange","html_url":"https://github.com/TxbitExchange","followers_url":"https://api.github.com/users/TxbitExchange/followers","following_url":"https://api.github.com/users/TxbitExchange/following{/other_user}","gists_url":"https://api.github.com/users/TxbitExchange/gists{/gist_id}","starred_url":"https://api.github.com/users/TxbitExchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TxbitExchange/subscriptions","organizations_url":"https://api.github.com/users/TxbitExchange/orgs","repos_url":"https://api.github.com/users/TxbitExchange/repos","events_url":"https://api.github.com/users/TxbitExchange/events{/privacy}","received_events_url":"https://api.github.com/users/TxbitExchange/received_events","type":"User","site_admin":false},"body":"Thank you @ElvisLYC I changed the code accordingly","created_at":"2019-03-04T10:23:13Z","updated_at":"2019-03-04T10:23:13Z","html_url":"https://github.com/coingecko/cryptoexchange/pull/1395#discussion_r261998309","pull_request_url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/comments/261998309"},"html":{"href":"https://github.com/coingecko/cryptoexchange/pull/1395#discussion_r261998309"},"pull_request":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395"}},"in_reply_to_id":261123614},"pull_request":{"url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395","id":256354366,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU2MzU0MzY2","html_url":"https://github.com/coingecko/cryptoexchange/pull/1395","diff_url":"https://github.com/coingecko/cryptoexchange/pull/1395.diff","patch_url":"https://github.com/coingecko/cryptoexchange/pull/1395.patch","issue_url":"https://api.github.com/repos/coingecko/cryptoexchange/issues/1395","number":1395,"state":"open","locked":false,"title":"Txbit Exchange Integration","user":{"login":"TxbitExchange","id":48020496,"node_id":"MDQ6VXNlcjQ4MDIwNDk2","avatar_url":"https://avatars3.githubusercontent.com/u/48020496?v=4","gravatar_id":"","url":"https://api.github.com/users/TxbitExchange","html_url":"https://github.com/TxbitExchange","followers_url":"https://api.github.com/users/TxbitExchange/followers","following_url":"https://api.github.com/users/TxbitExchange/following{/other_user}","gists_url":"https://api.github.com/users/TxbitExchange/gists{/gist_id}","starred_url":"https://api.github.com/users/TxbitExchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TxbitExchange/subscriptions","organizations_url":"https://api.github.com/users/TxbitExchange/orgs","repos_url":"https://api.github.com/users/TxbitExchange/repos","events_url":"https://api.github.com/users/TxbitExchange/events{/privacy}","received_events_url":"https://api.github.com/users/TxbitExchange/received_events","type":"User","site_admin":false},"body":"* What is the purpose of this Pull Request?\r\n* Closes #1395\r\n* [x]  I have added Specs\r\n* [x]  (If implementing Market Ticker) I have verified that the `volume` refers to BASE\r\n* [x]  (If implementing Market Ticker) I have verified that the `base` and `target` is assigned correctly\r\n* [x]  I have implemented the `trade_page_url` method that links to the exchange page with the `base` and `target` passed in. If not available, enter the root domain of the exchange website.\r\n* [x]  I have verified at least *ONE** ticker volume matches volume shown on the trading page (use script below)\r\n\r\n\r\nclient = Cryptoexchange::Client.new\r\npairs = client.pairs 'txbit'\r\ntickers = pairs.map do |p| client.ticker p end\r\nsorted_tickers = tickers.sort_by do |t| t.volume end.reverse","created_at":"2019-02-26T16:27:45Z","updated_at":"2019-03-04T10:23:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7bc7df65fb1f12306876eab4d2743523ab28de40","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395/commits","review_comments_url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395/comments","review_comment_url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coingecko/cryptoexchange/issues/1395/comments","statuses_url":"https://api.github.com/repos/coingecko/cryptoexchange/statuses/89a24e03642a2469e1a919fedc081409b0c311ee","head":{"label":"TxbitExchange:master","ref":"master","sha":"89a24e03642a2469e1a919fedc081409b0c311ee","user":{"login":"TxbitExchange","id":48020496,"node_id":"MDQ6VXNlcjQ4MDIwNDk2","avatar_url":"https://avatars3.githubusercontent.com/u/48020496?v=4","gravatar_id":"","url":"https://api.github.com/users/TxbitExchange","html_url":"https://github.com/TxbitExchange","followers_url":"https://api.github.com/users/TxbitExchange/followers","following_url":"https://api.github.com/users/TxbitExchange/following{/other_user}","gists_url":"https://api.github.com/users/TxbitExchange/gists{/gist_id}","starred_url":"https://api.github.com/users/TxbitExchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TxbitExchange/subscriptions","organizations_url":"https://api.github.com/users/TxbitExchange/orgs","repos_url":"https://api.github.com/users/TxbitExchange/repos","events_url":"https://api.github.com/users/TxbitExchange/events{/privacy}","received_events_url":"https://api.github.com/users/TxbitExchange/received_events","type":"User","site_admin":false},"repo":{"id":172720030,"node_id":"MDEwOlJlcG9zaXRvcnkxNzI3MjAwMzA=","name":"coingecko-cryptoexchange","full_name":"TxbitExchange/coingecko-cryptoexchange","private":false,"owner":{"login":"TxbitExchange","id":48020496,"node_id":"MDQ6VXNlcjQ4MDIwNDk2","avatar_url":"https://avatars3.githubusercontent.com/u/48020496?v=4","gravatar_id":"","url":"https://api.github.com/users/TxbitExchange","html_url":"https://github.com/TxbitExchange","followers_url":"https://api.github.com/users/TxbitExchange/followers","following_url":"https://api.github.com/users/TxbitExchange/following{/other_user}","gists_url":"https://api.github.com/users/TxbitExchange/gists{/gist_id}","starred_url":"https://api.github.com/users/TxbitExchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TxbitExchange/subscriptions","organizations_url":"https://api.github.com/users/TxbitExchange/orgs","repos_url":"https://api.github.com/users/TxbitExchange/repos","events_url":"https://api.github.com/users/TxbitExchange/events{/privacy}","received_events_url":"https://api.github.com/users/TxbitExchange/received_events","type":"User","site_admin":false},"html_url":"https://github.com/TxbitExchange/coingecko-cryptoexchange","description":"Ruby library to query market data from cryptocurrency exchanges (https://www.coingecko.com)","fork":true,"url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange","forks_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/forks","keys_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/teams","hooks_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/hooks","issue_events_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/issues/events{/number}","events_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/events","assignees_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/assignees{/user}","branches_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/branches{/branch}","tags_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/tags","blobs_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/git/refs{/sha}","trees_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/statuses/{sha}","languages_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/languages","stargazers_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/stargazers","contributors_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/contributors","subscribers_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/subscribers","subscription_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/subscription","commits_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/commits{/sha}","git_commits_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/git/commits{/sha}","comments_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/comments{/number}","issue_comment_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/issues/comments{/number}","contents_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/contents/{+path}","compare_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/merges","archive_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/downloads","issues_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/issues{/number}","pulls_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/pulls{/number}","milestones_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/milestones{/number}","notifications_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/labels{/name}","releases_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/releases{/id}","deployments_url":"https://api.github.com/repos/TxbitExchange/coingecko-cryptoexchange/deployments","created_at":"2019-02-26T13:47:24Z","updated_at":"2019-03-04T10:20:00Z","pushed_at":"2019-03-04T10:19:58Z","git_url":"git://github.com/TxbitExchange/coingecko-cryptoexchange.git","ssh_url":"git@github.com:TxbitExchange/coingecko-cryptoexchange.git","clone_url":"https://github.com/TxbitExchange/coingecko-cryptoexchange.git","svn_url":"https://github.com/TxbitExchange/coingecko-cryptoexchange","homepage":"https://www.coingecko.com","size":8290,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coingecko:master","ref":"master","sha":"059b021714a4479f432cf4f85ad3f32d38468c5e","user":{"login":"coingecko","id":7111837,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMTE4Mzc=","avatar_url":"https://avatars2.githubusercontent.com/u/7111837?v=4","gravatar_id":"","url":"https://api.github.com/users/coingecko","html_url":"https://github.com/coingecko","followers_url":"https://api.github.com/users/coingecko/followers","following_url":"https://api.github.com/users/coingecko/following{/other_user}","gists_url":"https://api.github.com/users/coingecko/gists{/gist_id}","starred_url":"https://api.github.com/users/coingecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coingecko/subscriptions","organizations_url":"https://api.github.com/users/coingecko/orgs","repos_url":"https://api.github.com/users/coingecko/repos","events_url":"https://api.github.com/users/coingecko/events{/privacy}","received_events_url":"https://api.github.com/users/coingecko/received_events","type":"Organization","site_admin":false},"repo":{"id":96099146,"node_id":"MDEwOlJlcG9zaXRvcnk5NjA5OTE0Ng==","name":"cryptoexchange","full_name":"coingecko/cryptoexchange","private":false,"owner":{"login":"coingecko","id":7111837,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxMTE4Mzc=","avatar_url":"https://avatars2.githubusercontent.com/u/7111837?v=4","gravatar_id":"","url":"https://api.github.com/users/coingecko","html_url":"https://github.com/coingecko","followers_url":"https://api.github.com/users/coingecko/followers","following_url":"https://api.github.com/users/coingecko/following{/other_user}","gists_url":"https://api.github.com/users/coingecko/gists{/gist_id}","starred_url":"https://api.github.com/users/coingecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coingecko/subscriptions","organizations_url":"https://api.github.com/users/coingecko/orgs","repos_url":"https://api.github.com/users/coingecko/repos","events_url":"https://api.github.com/users/coingecko/events{/privacy}","received_events_url":"https://api.github.com/users/coingecko/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/coingecko/cryptoexchange","description":"Ruby library to query market data from cryptocurrency exchanges (https://www.coingecko.com)","fork":false,"url":"https://api.github.com/repos/coingecko/cryptoexchange","forks_url":"https://api.github.com/repos/coingecko/cryptoexchange/forks","keys_url":"https://api.github.com/repos/coingecko/cryptoexchange/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coingecko/cryptoexchange/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coingecko/cryptoexchange/teams","hooks_url":"https://api.github.com/repos/coingecko/cryptoexchange/hooks","issue_events_url":"https://api.github.com/repos/coingecko/cryptoexchange/issues/events{/number}","events_url":"https://api.github.com/repos/coingecko/cryptoexchange/events","assignees_url":"https://api.github.com/repos/coingecko/cryptoexchange/assignees{/user}","branches_url":"https://api.github.com/repos/coingecko/cryptoexchange/branches{/branch}","tags_url":"https://api.github.com/repos/coingecko/cryptoexchange/tags","blobs_url":"https://api.github.com/repos/coingecko/cryptoexchange/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coingecko/cryptoexchange/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coingecko/cryptoexchange/git/refs{/sha}","trees_url":"https://api.github.com/repos/coingecko/cryptoexchange/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coingecko/cryptoexchange/statuses/{sha}","languages_url":"https://api.github.com/repos/coingecko/cryptoexchange/languages","stargazers_url":"https://api.github.com/repos/coingecko/cryptoexchange/stargazers","contributors_url":"https://api.github.com/repos/coingecko/cryptoexchange/contributors","subscribers_url":"https://api.github.com/repos/coingecko/cryptoexchange/subscribers","subscription_url":"https://api.github.com/repos/coingecko/cryptoexchange/subscription","commits_url":"https://api.github.com/repos/coingecko/cryptoexchange/commits{/sha}","git_commits_url":"https://api.github.com/repos/coingecko/cryptoexchange/git/commits{/sha}","comments_url":"https://api.github.com/repos/coingecko/cryptoexchange/comments{/number}","issue_comment_url":"https://api.github.com/repos/coingecko/cryptoexchange/issues/comments{/number}","contents_url":"https://api.github.com/repos/coingecko/cryptoexchange/contents/{+path}","compare_url":"https://api.github.com/repos/coingecko/cryptoexchange/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coingecko/cryptoexchange/merges","archive_url":"https://api.github.com/repos/coingecko/cryptoexchange/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coingecko/cryptoexchange/downloads","issues_url":"https://api.github.com/repos/coingecko/cryptoexchange/issues{/number}","pulls_url":"https://api.github.com/repos/coingecko/cryptoexchange/pulls{/number}","milestones_url":"https://api.github.com/repos/coingecko/cryptoexchange/milestones{/number}","notifications_url":"https://api.github.com/repos/coingecko/cryptoexchange/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coingecko/cryptoexchange/labels{/name}","releases_url":"https://api.github.com/repos/coingecko/cryptoexchange/releases{/id}","deployments_url":"https://api.github.com/repos/coingecko/cryptoexchange/deployments","created_at":"2017-07-03T10:25:10Z","updated_at":"2019-03-04T05:29:11Z","pushed_at":"2019-03-04T10:20:00Z","git_url":"git://github.com/coingecko/cryptoexchange.git","ssh_url":"git@github.com:coingecko/cryptoexchange.git","clone_url":"https://github.com/coingecko/cryptoexchange.git","svn_url":"https://github.com/coingecko/cryptoexchange","homepage":"https://www.coingecko.com","size":8299,"stargazers_count":218,"watchers_count":218,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":263,"mirror_url":null,"archived":false,"open_issues_count":326,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":263,"open_issues":326,"watchers":218,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395"},"html":{"href":"https://github.com/coingecko/cryptoexchange/pull/1395"},"issue":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/issues/1395"},"comments":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/issues/1395/comments"},"review_comments":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395/comments"},"review_comment":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/pulls/1395/commits"},"statuses":{"href":"https://api.github.com/repos/coingecko/cryptoexchange/statuses/89a24e03642a2469e1a919fedc081409b0c311ee"}},"author_association":"NONE"}}
{"actor":{"display_login":"TxbitExchange"}}