{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/comments/47026223","id":47026223,"diff_hunk":"@@ -0,0 +1,68 @@\n+'use strict';\n+\n+// Library for arbitrary precision in numbers\n+const BigNumber = require('bignumber.js');\n+// Ensure precision\n+BigNumber.config({ DECIMAL_PLACES: 24 });\n+BigNumber.config({ EXPONENTIAL_AT: 1e+9 });\n+// Display # of decimals\n+const DISPLAY_DECIMALS = 2;\n+\n+// Catch if BigNumber, property object, or anything else is passed in\n+function interpret(thing) {\n+\tif (typeof thing === 'object') {\n+\t\tthing = thing.value;\n+\t}\n+\treturn new BigNumber(thing).toNumber();\n+}","path":"plugins/Hosting/js/siaMath.js","position":17,"original_position":17,"commit_id":"a39d4d89d9378f1d1fb1dbdc75d14bd1fc3b4c00","original_commit_id":"a39d4d89d9378f1d1fb1dbdc75d14bd1fc3b4c00","user":{"login":"Mingling94","id":4606838,"avatar_url":"https://avatars.githubusercontent.com/u/4606838?v=3","gravatar_id":"","url":"https://api.github.com/users/Mingling94","html_url":"https://github.com/Mingling94","followers_url":"https://api.github.com/users/Mingling94/followers","following_url":"https://api.github.com/users/Mingling94/following{/other_user}","gists_url":"https://api.github.com/users/Mingling94/gists{/gist_id}","starred_url":"https://api.github.com/users/Mingling94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mingling94/subscriptions","organizations_url":"https://api.github.com/users/Mingling94/orgs","repos_url":"https://api.github.com/users/Mingling94/repos","events_url":"https://api.github.com/users/Mingling94/events{/privacy}","received_events_url":"https://api.github.com/users/Mingling94/received_events","type":"User","site_admin":false},"body":"It's important to read them with the context of hostData.js, But I'll try to make the file more explicit","created_at":"2015-12-08T22:45:17Z","updated_at":"2015-12-08T22:45:17Z","html_url":"https://github.com/NebulousLabs/Sia-UI/pull/146#discussion_r47026223","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/comments/47026223"},"html":{"href":"https://github.com/NebulousLabs/Sia-UI/pull/146#discussion_r47026223"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146","id":52947064,"html_url":"https://github.com/NebulousLabs/Sia-UI/pull/146","diff_url":"https://github.com/NebulousLabs/Sia-UI/pull/146.diff","patch_url":"https://github.com/NebulousLabs/Sia-UI/pull/146.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/146","number":146,"state":"open","locked":false,"title":"Hosting","user":{"login":"Mingling94","id":4606838,"avatar_url":"https://avatars.githubusercontent.com/u/4606838?v=3","gravatar_id":"","url":"https://api.github.com/users/Mingling94","html_url":"https://github.com/Mingling94","followers_url":"https://api.github.com/users/Mingling94/followers","following_url":"https://api.github.com/users/Mingling94/following{/other_user}","gists_url":"https://api.github.com/users/Mingling94/gists{/gist_id}","starred_url":"https://api.github.com/users/Mingling94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mingling94/subscriptions","organizations_url":"https://api.github.com/users/Mingling94/orgs","repos_url":"https://api.github.com/users/Mingling94/repos","events_url":"https://api.github.com/users/Mingling94/events{/privacy}","received_events_url":"https://api.github.com/users/Mingling94/received_events","type":"User","site_admin":false},"body":"On top of #145 \r\n\r\nUpdated the Hosting plugin to the new API. While I was at it, I wanted to make the plugin as OOP as possible. This was enabled by requiring the daemonManager and no longer relying on IPC for api calls.\r\n\r\nThis demonstrates that the daemonManager could be successfully used as an npm package.","created_at":"2015-12-08T07:31:36Z","updated_at":"2015-12-08T22:45:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d515a72e7fd3bc699e2f19ae880a884959de9cb6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/146/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/statuses/a39d4d89d9378f1d1fb1dbdc75d14bd1fc3b4c00","head":{"label":"Mingling94:hosting","ref":"hosting","sha":"a39d4d89d9378f1d1fb1dbdc75d14bd1fc3b4c00","user":{"login":"Mingling94","id":4606838,"avatar_url":"https://avatars.githubusercontent.com/u/4606838?v=3","gravatar_id":"","url":"https://api.github.com/users/Mingling94","html_url":"https://github.com/Mingling94","followers_url":"https://api.github.com/users/Mingling94/followers","following_url":"https://api.github.com/users/Mingling94/following{/other_user}","gists_url":"https://api.github.com/users/Mingling94/gists{/gist_id}","starred_url":"https://api.github.com/users/Mingling94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mingling94/subscriptions","organizations_url":"https://api.github.com/users/Mingling94/orgs","repos_url":"https://api.github.com/users/Mingling94/repos","events_url":"https://api.github.com/users/Mingling94/events{/privacy}","received_events_url":"https://api.github.com/users/Mingling94/received_events","type":"User","site_admin":false},"repo":{"id":39596342,"name":"Sia-UI","full_name":"Mingling94/Sia-UI","owner":{"login":"Mingling94","id":4606838,"avatar_url":"https://avatars.githubusercontent.com/u/4606838?v=3","gravatar_id":"","url":"https://api.github.com/users/Mingling94","html_url":"https://github.com/Mingling94","followers_url":"https://api.github.com/users/Mingling94/followers","following_url":"https://api.github.com/users/Mingling94/following{/other_user}","gists_url":"https://api.github.com/users/Mingling94/gists{/gist_id}","starred_url":"https://api.github.com/users/Mingling94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mingling94/subscriptions","organizations_url":"https://api.github.com/users/Mingling94/orgs","repos_url":"https://api.github.com/users/Mingling94/repos","events_url":"https://api.github.com/users/Mingling94/events{/privacy}","received_events_url":"https://api.github.com/users/Mingling94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mingling94/Sia-UI","description":"Sia-UI rewritten to be plugin friendly.","fork":true,"url":"https://api.github.com/repos/Mingling94/Sia-UI","forks_url":"https://api.github.com/repos/Mingling94/Sia-UI/forks","keys_url":"https://api.github.com/repos/Mingling94/Sia-UI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mingling94/Sia-UI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mingling94/Sia-UI/teams","hooks_url":"https://api.github.com/repos/Mingling94/Sia-UI/hooks","issue_events_url":"https://api.github.com/repos/Mingling94/Sia-UI/issues/events{/number}","events_url":"https://api.github.com/repos/Mingling94/Sia-UI/events","assignees_url":"https://api.github.com/repos/Mingling94/Sia-UI/assignees{/user}","branches_url":"https://api.github.com/repos/Mingling94/Sia-UI/branches{/branch}","tags_url":"https://api.github.com/repos/Mingling94/Sia-UI/tags","blobs_url":"https://api.github.com/repos/Mingling94/Sia-UI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mingling94/Sia-UI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mingling94/Sia-UI/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mingling94/Sia-UI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mingling94/Sia-UI/statuses/{sha}","languages_url":"https://api.github.com/repos/Mingling94/Sia-UI/languages","stargazers_url":"https://api.github.com/repos/Mingling94/Sia-UI/stargazers","contributors_url":"https://api.github.com/repos/Mingling94/Sia-UI/contributors","subscribers_url":"https://api.github.com/repos/Mingling94/Sia-UI/subscribers","subscription_url":"https://api.github.com/repos/Mingling94/Sia-UI/subscription","commits_url":"https://api.github.com/repos/Mingling94/Sia-UI/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mingling94/Sia-UI/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mingling94/Sia-UI/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mingling94/Sia-UI/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mingling94/Sia-UI/contents/{+path}","compare_url":"https://api.github.com/repos/Mingling94/Sia-UI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mingling94/Sia-UI/merges","archive_url":"https://api.github.com/repos/Mingling94/Sia-UI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mingling94/Sia-UI/downloads","issues_url":"https://api.github.com/repos/Mingling94/Sia-UI/issues{/number}","pulls_url":"https://api.github.com/repos/Mingling94/Sia-UI/pulls{/number}","milestones_url":"https://api.github.com/repos/Mingling94/Sia-UI/milestones{/number}","notifications_url":"https://api.github.com/repos/Mingling94/Sia-UI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mingling94/Sia-UI/labels{/name}","releases_url":"https://api.github.com/repos/Mingling94/Sia-UI/releases{/id}","created_at":"2015-07-23T22:15:41Z","updated_at":"2015-10-08T14:36:54Z","pushed_at":"2015-12-08T21:09:54Z","git_url":"git://github.com/Mingling94/Sia-UI.git","ssh_url":"git@github.com:Mingling94/Sia-UI.git","clone_url":"https://github.com/Mingling94/Sia-UI.git","svn_url":"https://github.com/Mingling94/Sia-UI","homepage":"","size":9298,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"NebulousLabs:master","ref":"master","sha":"d8aa390b32364d999f1113b08d3578c5ec43a91a","user":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":35702241,"name":"Sia-UI","full_name":"NebulousLabs/Sia-UI","owner":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NebulousLabs/Sia-UI","description":"Sia-UI rewritten to be plugin friendly.","fork":false,"url":"https://api.github.com/repos/NebulousLabs/Sia-UI","forks_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/forks","keys_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/teams","hooks_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/hooks","issue_events_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/events{/number}","events_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/events","assignees_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/assignees{/user}","branches_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/branches{/branch}","tags_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/tags","blobs_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/git/refs{/sha}","trees_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/statuses/{sha}","languages_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/languages","stargazers_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/stargazers","contributors_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/contributors","subscribers_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/subscribers","subscription_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/subscription","commits_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/commits{/sha}","git_commits_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/git/commits{/sha}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/comments{/number}","issue_comment_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/comments{/number}","contents_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/contents/{+path}","compare_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/merges","archive_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/downloads","issues_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues{/number}","pulls_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls{/number}","milestones_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/milestones{/number}","notifications_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/labels{/name}","releases_url":"https://api.github.com/repos/NebulousLabs/Sia-UI/releases{/id}","created_at":"2015-05-15T23:48:43Z","updated_at":"2015-12-08T15:32:39Z","pushed_at":"2015-12-08T21:09:54Z","git_url":"git://github.com/NebulousLabs/Sia-UI.git","ssh_url":"git@github.com:NebulousLabs/Sia-UI.git","clone_url":"https://github.com/NebulousLabs/Sia-UI.git","svn_url":"https://github.com/NebulousLabs/Sia-UI","homepage":"","size":9488,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146"},"html":{"href":"https://github.com/NebulousLabs/Sia-UI/pull/146"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/146"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia-UI/statuses/a39d4d89d9378f1d1fb1dbdc75d14bd1fc3b4c00"}}}}