{"action":"created","comment":{"url":"https://api.github.com/repos/statechannels/monorepo/pulls/comments/339209566","pull_request_review_id":307412825,"id":339209566,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzOTIwOTU2Ng==","diff_hunk":"@@ -126,3 +138,22 @@ export function createDepositTransaction(destination: string, depositAmount: str\n   }\n   return createNitroDepositTransaction(destination, expectedHeld, depositAmount);\n }\n+\n+export function createTransferAllTransaction(source: string, destination: string, amount: string) {\n+  const allocation: Allocation = [\n+    {\n+      destination: normalizeDestinationAddress(destination),\n+      amount\n+    } as AllocationItem\n+  ];\n+  return createNitroTransferAllTransaction(source, allocation);\n+}\n+\n+function normalizeDestinationAddress(address: string): string {\n+  let normalizedDestinationAddress = address;\n+  // If the address is not already left-padded to be of type byte32\n+  if (normalizedDestinationAddress.length !== 66) {\n+    normalizedDestinationAddress = convertAddressToBytes32(address);\n+  }\n+  return normalizedDestinationAddress;","path":"packages/wallet/src/utils/transaction-generator.ts","position":51,"original_position":51,"commit_id":"fd05df66957760113f53636c6abaf5c2af4c66b0","original_commit_id":"fd05df66957760113f53636c6abaf5c2af4c66b0","user":{"login":"snario","id":1933029,"node_id":"MDQ6VXNlcjE5MzMwMjk=","avatar_url":"https://avatars1.githubusercontent.com/u/1933029?v=4","gravatar_id":"","url":"https://api.github.com/users/snario","html_url":"https://github.com/snario","followers_url":"https://api.github.com/users/snario/followers","following_url":"https://api.github.com/users/snario/following{/other_user}","gists_url":"https://api.github.com/users/snario/gists{/gist_id}","starred_url":"https://api.github.com/users/snario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snario/subscriptions","organizations_url":"https://api.github.com/users/snario/orgs","repos_url":"https://api.github.com/users/snario/repos","events_url":"https://api.github.com/users/snario/events{/privacy}","received_events_url":"https://api.github.com/users/snario/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n  return address.length === 66 ? address : convertAddressToBytes32(address);\r\n```","created_at":"2019-10-25T19:39:36Z","updated_at":"2019-10-25T19:41:29Z","html_url":"https://github.com/statechannels/monorepo/pull/175#discussion_r339209566","pull_request_url":"https://api.github.com/repos/statechannels/monorepo/pulls/175","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/comments/339209566"},"html":{"href":"https://github.com/statechannels/monorepo/pull/175#discussion_r339209566"},"pull_request":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/175"}}},"pull_request":{"url":"https://api.github.com/repos/statechannels/monorepo/pulls/175","id":324093075,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI0MDkzMDc1","html_url":"https://github.com/statechannels/monorepo/pull/175","diff_url":"https://github.com/statechannels/monorepo/pull/175.diff","patch_url":"https://github.com/statechannels/monorepo/pull/175.patch","issue_url":"https://api.github.com/repos/statechannels/monorepo/issues/175","number":175,"state":"open","locked":false,"title":"[wallet] Watch AssetTransferred event","user":{"login":"cf19drofxots","id":38441757,"node_id":"MDQ6VXNlcjM4NDQxNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/38441757?v=4","gravatar_id":"","url":"https://api.github.com/users/cf19drofxots","html_url":"https://github.com/cf19drofxots","followers_url":"https://api.github.com/users/cf19drofxots/followers","following_url":"https://api.github.com/users/cf19drofxots/following{/other_user}","gists_url":"https://api.github.com/users/cf19drofxots/gists{/gist_id}","starred_url":"https://api.github.com/users/cf19drofxots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf19drofxots/subscriptions","organizations_url":"https://api.github.com/users/cf19drofxots/orgs","repos_url":"https://api.github.com/users/cf19drofxots/repos","events_url":"https://api.github.com/users/cf19drofxots/events{/privacy}","received_events_url":"https://api.github.com/users/cf19drofxots/received_events","type":"User","site_admin":false},"body":"Continuation of work done at https://github.com/statechannels/monorepo/pull/168","created_at":"2019-10-03T08:03:26Z","updated_at":"2019-10-25T19:41:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0f9da189367325c82739aabeef3d4a5e2aa9c1e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"andrewgordstewart","id":8432675,"node_id":"MDQ6VXNlcjg0MzI2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/8432675?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewgordstewart","html_url":"https://github.com/andrewgordstewart","followers_url":"https://api.github.com/users/andrewgordstewart/followers","following_url":"https://api.github.com/users/andrewgordstewart/following{/other_user}","gists_url":"https://api.github.com/users/andrewgordstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewgordstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewgordstewart/subscriptions","organizations_url":"https://api.github.com/users/andrewgordstewart/orgs","repos_url":"https://api.github.com/users/andrewgordstewart/repos","events_url":"https://api.github.com/users/andrewgordstewart/events{/privacy}","received_events_url":"https://api.github.com/users/andrewgordstewart/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/statechannels/monorepo/pulls/175/commits","review_comments_url":"https://api.github.com/repos/statechannels/monorepo/pulls/175/comments","review_comment_url":"https://api.github.com/repos/statechannels/monorepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/statechannels/monorepo/issues/175/comments","statuses_url":"https://api.github.com/repos/statechannels/monorepo/statuses/fd05df66957760113f53636c6abaf5c2af4c66b0","head":{"label":"statechannels:asset_transferred_event_handling","ref":"asset_transferred_event_handling","sha":"fd05df66957760113f53636c6abaf5c2af4c66b0","user":{"login":"statechannels","id":36797387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Nzk3Mzg3","avatar_url":"https://avatars0.githubusercontent.com/u/36797387?v=4","gravatar_id":"","url":"https://api.github.com/users/statechannels","html_url":"https://github.com/statechannels","followers_url":"https://api.github.com/users/statechannels/followers","following_url":"https://api.github.com/users/statechannels/following{/other_user}","gists_url":"https://api.github.com/users/statechannels/gists{/gist_id}","starred_url":"https://api.github.com/users/statechannels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statechannels/subscriptions","organizations_url":"https://api.github.com/users/statechannels/orgs","repos_url":"https://api.github.com/users/statechannels/repos","events_url":"https://api.github.com/users/statechannels/events{/privacy}","received_events_url":"https://api.github.com/users/statechannels/received_events","type":"Organization","site_admin":false},"repo":{"id":209829093,"node_id":"MDEwOlJlcG9zaXRvcnkyMDk4MjkwOTM=","name":"monorepo","full_name":"statechannels/monorepo","private":false,"owner":{"login":"statechannels","id":36797387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Nzk3Mzg3","avatar_url":"https://avatars0.githubusercontent.com/u/36797387?v=4","gravatar_id":"","url":"https://api.github.com/users/statechannels","html_url":"https://github.com/statechannels","followers_url":"https://api.github.com/users/statechannels/followers","following_url":"https://api.github.com/users/statechannels/following{/other_user}","gists_url":"https://api.github.com/users/statechannels/gists{/gist_id}","starred_url":"https://api.github.com/users/statechannels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statechannels/subscriptions","organizations_url":"https://api.github.com/users/statechannels/orgs","repos_url":"https://api.github.com/users/statechannels/repos","events_url":"https://api.github.com/users/statechannels/events{/privacy}","received_events_url":"https://api.github.com/users/statechannels/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/statechannels/monorepo","description":null,"fork":false,"url":"https://api.github.com/repos/statechannels/monorepo","forks_url":"https://api.github.com/repos/statechannels/monorepo/forks","keys_url":"https://api.github.com/repos/statechannels/monorepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/statechannels/monorepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/statechannels/monorepo/teams","hooks_url":"https://api.github.com/repos/statechannels/monorepo/hooks","issue_events_url":"https://api.github.com/repos/statechannels/monorepo/issues/events{/number}","events_url":"https://api.github.com/repos/statechannels/monorepo/events","assignees_url":"https://api.github.com/repos/statechannels/monorepo/assignees{/user}","branches_url":"https://api.github.com/repos/statechannels/monorepo/branches{/branch}","tags_url":"https://api.github.com/repos/statechannels/monorepo/tags","blobs_url":"https://api.github.com/repos/statechannels/monorepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/statechannels/monorepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/statechannels/monorepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/statechannels/monorepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/statechannels/monorepo/statuses/{sha}","languages_url":"https://api.github.com/repos/statechannels/monorepo/languages","stargazers_url":"https://api.github.com/repos/statechannels/monorepo/stargazers","contributors_url":"https://api.github.com/repos/statechannels/monorepo/contributors","subscribers_url":"https://api.github.com/repos/statechannels/monorepo/subscribers","subscription_url":"https://api.github.com/repos/statechannels/monorepo/subscription","commits_url":"https://api.github.com/repos/statechannels/monorepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/statechannels/monorepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/statechannels/monorepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/statechannels/monorepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/statechannels/monorepo/contents/{+path}","compare_url":"https://api.github.com/repos/statechannels/monorepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/statechannels/monorepo/merges","archive_url":"https://api.github.com/repos/statechannels/monorepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/statechannels/monorepo/downloads","issues_url":"https://api.github.com/repos/statechannels/monorepo/issues{/number}","pulls_url":"https://api.github.com/repos/statechannels/monorepo/pulls{/number}","milestones_url":"https://api.github.com/repos/statechannels/monorepo/milestones{/number}","notifications_url":"https://api.github.com/repos/statechannels/monorepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/statechannels/monorepo/labels{/name}","releases_url":"https://api.github.com/repos/statechannels/monorepo/releases{/id}","deployments_url":"https://api.github.com/repos/statechannels/monorepo/deployments","created_at":"2019-09-20T15:57:05Z","updated_at":"2019-10-25T14:26:04Z","pushed_at":"2019-10-25T19:25:34Z","git_url":"git://github.com/statechannels/monorepo.git","ssh_url":"git@github.com:statechannels/monorepo.git","clone_url":"https://github.com/statechannels/monorepo.git","svn_url":"https://github.com/statechannels/monorepo","homepage":"https://statechannels.org","size":17821,"stargazers_count":15,"watchers_count":15,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":60,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":60,"watchers":15,"default_branch":"master"}},"base":{"label":"statechannels:master","ref":"master","sha":"c2f35940b9656bed8717734b4201fb05583bbb34","user":{"login":"statechannels","id":36797387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Nzk3Mzg3","avatar_url":"https://avatars0.githubusercontent.com/u/36797387?v=4","gravatar_id":"","url":"https://api.github.com/users/statechannels","html_url":"https://github.com/statechannels","followers_url":"https://api.github.com/users/statechannels/followers","following_url":"https://api.github.com/users/statechannels/following{/other_user}","gists_url":"https://api.github.com/users/statechannels/gists{/gist_id}","starred_url":"https://api.github.com/users/statechannels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statechannels/subscriptions","organizations_url":"https://api.github.com/users/statechannels/orgs","repos_url":"https://api.github.com/users/statechannels/repos","events_url":"https://api.github.com/users/statechannels/events{/privacy}","received_events_url":"https://api.github.com/users/statechannels/received_events","type":"Organization","site_admin":false},"repo":{"id":209829093,"node_id":"MDEwOlJlcG9zaXRvcnkyMDk4MjkwOTM=","name":"monorepo","full_name":"statechannels/monorepo","private":false,"owner":{"login":"statechannels","id":36797387,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2Nzk3Mzg3","avatar_url":"https://avatars0.githubusercontent.com/u/36797387?v=4","gravatar_id":"","url":"https://api.github.com/users/statechannels","html_url":"https://github.com/statechannels","followers_url":"https://api.github.com/users/statechannels/followers","following_url":"https://api.github.com/users/statechannels/following{/other_user}","gists_url":"https://api.github.com/users/statechannels/gists{/gist_id}","starred_url":"https://api.github.com/users/statechannels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statechannels/subscriptions","organizations_url":"https://api.github.com/users/statechannels/orgs","repos_url":"https://api.github.com/users/statechannels/repos","events_url":"https://api.github.com/users/statechannels/events{/privacy}","received_events_url":"https://api.github.com/users/statechannels/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/statechannels/monorepo","description":null,"fork":false,"url":"https://api.github.com/repos/statechannels/monorepo","forks_url":"https://api.github.com/repos/statechannels/monorepo/forks","keys_url":"https://api.github.com/repos/statechannels/monorepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/statechannels/monorepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/statechannels/monorepo/teams","hooks_url":"https://api.github.com/repos/statechannels/monorepo/hooks","issue_events_url":"https://api.github.com/repos/statechannels/monorepo/issues/events{/number}","events_url":"https://api.github.com/repos/statechannels/monorepo/events","assignees_url":"https://api.github.com/repos/statechannels/monorepo/assignees{/user}","branches_url":"https://api.github.com/repos/statechannels/monorepo/branches{/branch}","tags_url":"https://api.github.com/repos/statechannels/monorepo/tags","blobs_url":"https://api.github.com/repos/statechannels/monorepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/statechannels/monorepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/statechannels/monorepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/statechannels/monorepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/statechannels/monorepo/statuses/{sha}","languages_url":"https://api.github.com/repos/statechannels/monorepo/languages","stargazers_url":"https://api.github.com/repos/statechannels/monorepo/stargazers","contributors_url":"https://api.github.com/repos/statechannels/monorepo/contributors","subscribers_url":"https://api.github.com/repos/statechannels/monorepo/subscribers","subscription_url":"https://api.github.com/repos/statechannels/monorepo/subscription","commits_url":"https://api.github.com/repos/statechannels/monorepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/statechannels/monorepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/statechannels/monorepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/statechannels/monorepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/statechannels/monorepo/contents/{+path}","compare_url":"https://api.github.com/repos/statechannels/monorepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/statechannels/monorepo/merges","archive_url":"https://api.github.com/repos/statechannels/monorepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/statechannels/monorepo/downloads","issues_url":"https://api.github.com/repos/statechannels/monorepo/issues{/number}","pulls_url":"https://api.github.com/repos/statechannels/monorepo/pulls{/number}","milestones_url":"https://api.github.com/repos/statechannels/monorepo/milestones{/number}","notifications_url":"https://api.github.com/repos/statechannels/monorepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/statechannels/monorepo/labels{/name}","releases_url":"https://api.github.com/repos/statechannels/monorepo/releases{/id}","deployments_url":"https://api.github.com/repos/statechannels/monorepo/deployments","created_at":"2019-09-20T15:57:05Z","updated_at":"2019-10-25T14:26:04Z","pushed_at":"2019-10-25T19:25:34Z","git_url":"git://github.com/statechannels/monorepo.git","ssh_url":"git@github.com:statechannels/monorepo.git","clone_url":"https://github.com/statechannels/monorepo.git","svn_url":"https://github.com/statechannels/monorepo","homepage":"https://statechannels.org","size":17821,"stargazers_count":15,"watchers_count":15,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":60,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":60,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/175"},"html":{"href":"https://github.com/statechannels/monorepo/pull/175"},"issue":{"href":"https://api.github.com/repos/statechannels/monorepo/issues/175"},"comments":{"href":"https://api.github.com/repos/statechannels/monorepo/issues/175/comments"},"review_comments":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/175/comments"},"review_comment":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/statechannels/monorepo/pulls/175/commits"},"statuses":{"href":"https://api.github.com/repos/statechannels/monorepo/statuses/fd05df66957760113f53636c6abaf5c2af4c66b0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"snario"}}