{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/ripple-rest/pulls/comments/28797457","id":28797457,"diff_hunk":"@@ -243,36 +259,112 @@ function getNotification(account, identifier, urlBase, callback) {\n   validate.address(account);\n   validate.paymentIdentifier(identifier);\n \n-  getNotificationHelper(this, account, identifier,\n-      function(error, notification) {\n-    if (error) {\n-      return callback(error);\n-    }\n+  return getNotificationHelper(this, account, identifier, urlBase, callback);\n+}\n \n-    var responseBody = {\n-      notification: notification\n+/**\n+ *  Get a notifications corresponding to the specified\n+ *  account.\n+ *\n+ *  This function calls transactions.getAccountTransactions\n+ *  recursively to retrieve results_per_page number of transactions\n+ *  and filters the results using client-specified parameters.\n+ *\n+ *  @param {RippleAddress} account\n+ *  @param {string} urlBase - The url to use for the transaction status URL\n+ *\n+ *  @param {string} options.source_account\n+ *  @param {Number} options.ledger_min\n+ *  @param {Number} options.ledger_max\n+ *  @param {string} [false] options.earliest_first\n+ *  @param {string[]} options.types - @see transactions.getAccountTransactions\n+ *\n+ */\n+// TODO: If given ledger range, check for ledger gaps\n+function getNotifications(account, urlBase, options, callback) {\n+  validate.address(account);\n+\n+  var self = this;\n+\n+  function getTransactions(_callback) {\n+\n+    var resultsPerPage = options.results_per_page ||\n+      transactions.DEFAULT_RESULTS_PER_PAGE;\n+    var offset = resultsPerPage * (options.page || 1 - 1);","path":"api/notifications.js","position":106,"original_position":106,"commit_id":"a09288405707acf1806e0a271216217c04a0227e","original_commit_id":"a09288405707acf1806e0a271216217c04a0227e","user":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"body":"Thanks, forgot a parens","created_at":"2015-04-21T16:44:43Z","updated_at":"2015-04-21T16:44:43Z","html_url":"https://github.com/ripple/ripple-rest/pull/355#discussion_r28797457","pull_request_url":"https://api.github.com/repos/ripple/ripple-rest/pulls/355","_links":{"self":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/comments/28797457"},"html":{"href":"https://github.com/ripple/ripple-rest/pull/355#discussion_r28797457"},"pull_request":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/355"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/ripple-rest/pulls/355","id":33498220,"html_url":"https://github.com/ripple/ripple-rest/pull/355","diff_url":"https://github.com/ripple/ripple-rest/pull/355.diff","patch_url":"https://github.com/ripple/ripple-rest/pull/355.patch","issue_url":"https://api.github.com/repos/ripple/ripple-rest/issues/355","number":355,"state":"open","locked":false,"title":"[FEATURE] Notifications API (RLJS-326)","user":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2015-04-16T22:15:25Z","updated_at":"2015-04-21T16:44:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"833f83365eb887232fa82eb055316bf93b0a9606","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ripple/ripple-rest/pulls/355/commits","review_comments_url":"https://api.github.com/repos/ripple/ripple-rest/pulls/355/comments","review_comment_url":"https://api.github.com/repos/ripple/ripple-rest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/ripple-rest/issues/355/comments","statuses_url":"https://api.github.com/repos/ripple/ripple-rest/statuses/a09288405707acf1806e0a271216217c04a0227e","head":{"label":"lumberj:feature/notifications-api","ref":"feature/notifications-api","sha":"a09288405707acf1806e0a271216217c04a0227e","user":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"repo":{"id":27409911,"name":"ripple-rest","full_name":"lumberj/ripple-rest","owner":{"login":"lumberj","id":1812196,"avatar_url":"https://avatars.githubusercontent.com/u/1812196?v=3","gravatar_id":"","url":"https://api.github.com/users/lumberj","html_url":"https://github.com/lumberj","followers_url":"https://api.github.com/users/lumberj/followers","following_url":"https://api.github.com/users/lumberj/following{/other_user}","gists_url":"https://api.github.com/users/lumberj/gists{/gist_id}","starred_url":"https://api.github.com/users/lumberj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lumberj/subscriptions","organizations_url":"https://api.github.com/users/lumberj/orgs","repos_url":"https://api.github.com/users/lumberj/repos","events_url":"https://api.github.com/users/lumberj/events{/privacy}","received_events_url":"https://api.github.com/users/lumberj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lumberj/ripple-rest","description":"A RESTful API for submitting payments and monitoring accounts on the Ripple Network","fork":true,"url":"https://api.github.com/repos/lumberj/ripple-rest","forks_url":"https://api.github.com/repos/lumberj/ripple-rest/forks","keys_url":"https://api.github.com/repos/lumberj/ripple-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lumberj/ripple-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lumberj/ripple-rest/teams","hooks_url":"https://api.github.com/repos/lumberj/ripple-rest/hooks","issue_events_url":"https://api.github.com/repos/lumberj/ripple-rest/issues/events{/number}","events_url":"https://api.github.com/repos/lumberj/ripple-rest/events","assignees_url":"https://api.github.com/repos/lumberj/ripple-rest/assignees{/user}","branches_url":"https://api.github.com/repos/lumberj/ripple-rest/branches{/branch}","tags_url":"https://api.github.com/repos/lumberj/ripple-rest/tags","blobs_url":"https://api.github.com/repos/lumberj/ripple-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lumberj/ripple-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lumberj/ripple-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/lumberj/ripple-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lumberj/ripple-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/lumberj/ripple-rest/languages","stargazers_url":"https://api.github.com/repos/lumberj/ripple-rest/stargazers","contributors_url":"https://api.github.com/repos/lumberj/ripple-rest/contributors","subscribers_url":"https://api.github.com/repos/lumberj/ripple-rest/subscribers","subscription_url":"https://api.github.com/repos/lumberj/ripple-rest/subscription","commits_url":"https://api.github.com/repos/lumberj/ripple-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/lumberj/ripple-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/lumberj/ripple-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/lumberj/ripple-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/lumberj/ripple-rest/contents/{+path}","compare_url":"https://api.github.com/repos/lumberj/ripple-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lumberj/ripple-rest/merges","archive_url":"https://api.github.com/repos/lumberj/ripple-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lumberj/ripple-rest/downloads","issues_url":"https://api.github.com/repos/lumberj/ripple-rest/issues{/number}","pulls_url":"https://api.github.com/repos/lumberj/ripple-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/lumberj/ripple-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/lumberj/ripple-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lumberj/ripple-rest/labels{/name}","releases_url":"https://api.github.com/repos/lumberj/ripple-rest/releases{/id}","created_at":"2014-12-02T01:53:04Z","updated_at":"2015-03-03T17:31:53Z","pushed_at":"2015-04-21T00:22:08Z","git_url":"git://github.com/lumberj/ripple-rest.git","ssh_url":"git@github.com:lumberj/ripple-rest.git","clone_url":"https://github.com/lumberj/ripple-rest.git","svn_url":"https://github.com/lumberj/ripple-rest","homepage":"","size":3348,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ripple:develop","ref":"develop","sha":"0a2a1a3ee3718c93e4293d68e7a9c13756051917","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":16561603,"name":"ripple-rest","full_name":"ripple/ripple-rest","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/ripple-rest","description":"A RESTful API for submitting payments and monitoring accounts on the Ripple Network","fork":false,"url":"https://api.github.com/repos/ripple/ripple-rest","forks_url":"https://api.github.com/repos/ripple/ripple-rest/forks","keys_url":"https://api.github.com/repos/ripple/ripple-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/ripple-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/ripple-rest/teams","hooks_url":"https://api.github.com/repos/ripple/ripple-rest/hooks","issue_events_url":"https://api.github.com/repos/ripple/ripple-rest/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/ripple-rest/events","assignees_url":"https://api.github.com/repos/ripple/ripple-rest/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/ripple-rest/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/ripple-rest/tags","blobs_url":"https://api.github.com/repos/ripple/ripple-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/ripple-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/ripple-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/ripple-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/ripple-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/ripple-rest/languages","stargazers_url":"https://api.github.com/repos/ripple/ripple-rest/stargazers","contributors_url":"https://api.github.com/repos/ripple/ripple-rest/contributors","subscribers_url":"https://api.github.com/repos/ripple/ripple-rest/subscribers","subscription_url":"https://api.github.com/repos/ripple/ripple-rest/subscription","commits_url":"https://api.github.com/repos/ripple/ripple-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/ripple-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/ripple-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/ripple-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/ripple-rest/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/ripple-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/ripple-rest/merges","archive_url":"https://api.github.com/repos/ripple/ripple-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/ripple-rest/downloads","issues_url":"https://api.github.com/repos/ripple/ripple-rest/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/ripple-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/ripple-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/ripple-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/ripple-rest/labels{/name}","releases_url":"https://api.github.com/repos/ripple/ripple-rest/releases{/id}","created_at":"2014-02-05T22:52:44Z","updated_at":"2015-04-21T00:22:07Z","pushed_at":"2015-04-21T01:12:03Z","git_url":"git://github.com/ripple/ripple-rest.git","ssh_url":"git@github.com:ripple/ripple-rest.git","clone_url":"https://github.com/ripple/ripple-rest.git","svn_url":"https://github.com/ripple/ripple-rest","homepage":"","size":7451,"stargazers_count":65,"watchers_count":65,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":7,"forks":70,"open_issues":7,"watchers":65,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/355"},"html":{"href":"https://github.com/ripple/ripple-rest/pull/355"},"issue":{"href":"https://api.github.com/repos/ripple/ripple-rest/issues/355"},"comments":{"href":"https://api.github.com/repos/ripple/ripple-rest/issues/355/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/355/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/ripple-rest/pulls/355/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/ripple-rest/statuses/a09288405707acf1806e0a271216217c04a0227e"}}}}