{"action":"created","comment":{"url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/comments/245048079","pull_request_review_id":189074349,"id":245048079,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTA0ODA3OQ==","diff_hunk":"@@ -0,0 +1,144 @@\n+import \"ethers/dist/shims.js\";\n+// Note: ethers SHOULD be imported from their main object\n+// shims aren't injected with package import\n+import { ethers } from \"ethers\";\n+\n+class Utils {\n+  static isAddress = address => {\n+    return typeof address === \"string\" && address.match(/^0x[0-9A-Fa-f]{40}$/);\n+  };\n+\n+  static isABI = abi => {\n+    return abi && Array.isArray(abi);\n+  };\n+\n+  // https://github.com/ethers-io/ethers.js/blob/db383a3121bb8cf5c80c5488e853101d8c1df353/src.ts/utils/properties.ts#L20\n+  static isEthersJsSigner = signer => {\n+    return signer && signer._ethersType === \"Signer\";\n+  };\n+}\n+\n+class Subscription {\n+  #txPromise;\n+  #provider;\n+\n+  constructor(txPromise, provider) {\n+    this.#txPromise = txPromise;\n+    this.#provider = provider;\n+  }\n+\n+  on = async (trigger, callback) => {\n+    let blockHeight = 0;\n+\n+    if (trigger === \"confirmation\") blockHeight = 1;\n+    else {\n+      throw new Error(`Invalid subscription trigger, use: [\"confirmation\"]`);\n+    }\n+\n+    if (!callback || typeof callback !== \"function\") {\n+      throw new Error(`Cannot subscribe without a function`);\n+    }\n+\n+    const tx = await this.#txPromise;\n+\n+    this.#provider.on(tx.hash, async receipt => {\n+      const message = {\n+        data: {\n+          confirmations: receipt.confirmations,\n+        },\n+      };\n+\n+      try {\n+        await callback(message);\n+      } catch (error) {\n+        throw new Error(`Callback function with error: ${error.message}`);\n+      }\n+    });\n+  };\n+\n+  removeAllListeners = async () => {\n+    const tx = await this.#txPromise;\n+    this.#provider.removeAllListeners(tx.hash);\n+  };\n+}\n+\n+export class Contract {\n+  address;\n+  #provider;\n+  #contract;\n+\n+  constructor(address, abi, wallet) {\n+    if (!Utils.isAddress(address) || !Utils.isABI(abi))\n+      throw new Error(`Cannot create a Contract without a address and ABI`);\n+\n+    this.#provider = this.#getDefaultProvider();\n+\n+    const signerOrProvider = wallet\n+      ? wallet.connect(this.#provider)\n+      : this.#provider;\n+\n+    this.#contract = new ethers.Contract(address, abi, signerOrProvider);\n+    this.address = this.#contract.address;\n+    this.#addFunctionsToContract();\n+  }\n+\n+  // Note: For now, `tasit-account` creates a wallet object","path":"packages/tasit-action/src/TasitAct.js","position":null,"original_position":85,"commit_id":"83f1105b218fb6779dc49cd6a336e2de7f0baad6","original_commit_id":"f903f97fd04ecd7797a964549bde6db8e06e23b2","user":{"login":"marcelomorgado","id":29674218,"node_id":"MDQ6VXNlcjI5Njc0MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/29674218?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelomorgado","html_url":"https://github.com/marcelomorgado","followers_url":"https://api.github.com/users/marcelomorgado/followers","following_url":"https://api.github.com/users/marcelomorgado/following{/other_user}","gists_url":"https://api.github.com/users/marcelomorgado/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelomorgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelomorgado/subscriptions","organizations_url":"https://api.github.com/users/marcelomorgado/orgs","repos_url":"https://api.github.com/users/marcelomorgado/repos","events_url":"https://api.github.com/users/marcelomorgado/events{/privacy}","received_events_url":"https://api.github.com/users/marcelomorgado/received_events","type":"User","site_admin":false},"body":"It's related to https://github.com/tasitlabs/TasitSDK/pull/71#discussion_r243742850. \r\nMaybe we'll need to expose a kind of `Account` object that encapsulates the `ethers.js` `Wallet` object.","created_at":"2019-01-03T16:07:27Z","updated_at":"2019-01-03T16:07:27Z","html_url":"https://github.com/tasitlabs/TasitSDK/pull/71#discussion_r245048079","pull_request_url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/comments/245048079"},"html":{"href":"https://github.com/tasitlabs/TasitSDK/pull/71#discussion_r245048079"},"pull_request":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71"}},"in_reply_to_id":244827784},"pull_request":{"url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71","id":240208618,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMjA4NjE4","html_url":"https://github.com/tasitlabs/TasitSDK/pull/71","diff_url":"https://github.com/tasitlabs/TasitSDK/pull/71.diff","patch_url":"https://github.com/tasitlabs/TasitSDK/pull/71.patch","issue_url":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/71","number":71,"state":"closed","locked":false,"title":"Tasit Action initial feature set","user":{"login":"marcelomorgado","id":29674218,"node_id":"MDQ6VXNlcjI5Njc0MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/29674218?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelomorgado","html_url":"https://github.com/marcelomorgado","followers_url":"https://api.github.com/users/marcelomorgado/followers","following_url":"https://api.github.com/users/marcelomorgado/following{/other_user}","gists_url":"https://api.github.com/users/marcelomorgado/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelomorgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelomorgado/subscriptions","organizations_url":"https://api.github.com/users/marcelomorgado/orgs","repos_url":"https://api.github.com/users/marcelomorgado/repos","events_url":"https://api.github.com/users/marcelomorgado/events{/privacy}","received_events_url":"https://api.github.com/users/marcelomorgado/received_events","type":"User","site_admin":false},"body":"### Issue link\r\n\r\nhttps://github.com/tasitlabs/TasitSDK/issues/40\r\n\r\n### Auto-close the issue?\r\n\r\nCloses #63 \r\n\r\n### Types of changes\r\n\r\nNew feature (non-breaking change that adds functionality)\r\nDocs (modified documentation or code comments)\r\nMeta (a change that affects future changes to this repo)\r\nTechnical debt (a code change that doesn't fix a bug or add a feature but makes something clearer for devs)","created_at":"2018-12-20T15:27:49Z","updated_at":"2019-01-03T16:07:27Z","closed_at":"2019-01-02T21:48:55Z","merged_at":"2019-01-02T21:48:55Z","merge_commit_sha":"3191d18545caf8d2804ebf50019aa30cfb2bb01f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71/commits","review_comments_url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71/comments","review_comment_url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/71/comments","statuses_url":"https://api.github.com/repos/tasitlabs/TasitSDK/statuses/83f1105b218fb6779dc49cd6a336e2de7f0baad6","head":{"label":"marcelomorgado:feature/tasit-act-contract","ref":"feature/tasit-act-contract","sha":"83f1105b218fb6779dc49cd6a336e2de7f0baad6","user":{"login":"marcelomorgado","id":29674218,"node_id":"MDQ6VXNlcjI5Njc0MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/29674218?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelomorgado","html_url":"https://github.com/marcelomorgado","followers_url":"https://api.github.com/users/marcelomorgado/followers","following_url":"https://api.github.com/users/marcelomorgado/following{/other_user}","gists_url":"https://api.github.com/users/marcelomorgado/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelomorgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelomorgado/subscriptions","organizations_url":"https://api.github.com/users/marcelomorgado/orgs","repos_url":"https://api.github.com/users/marcelomorgado/repos","events_url":"https://api.github.com/users/marcelomorgado/events{/privacy}","received_events_url":"https://api.github.com/users/marcelomorgado/received_events","type":"User","site_admin":false},"repo":{"id":159567533,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk1Njc1MzM=","name":"TasitSDK","full_name":"marcelomorgado/TasitSDK","private":false,"owner":{"login":"marcelomorgado","id":29674218,"node_id":"MDQ6VXNlcjI5Njc0MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/29674218?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelomorgado","html_url":"https://github.com/marcelomorgado","followers_url":"https://api.github.com/users/marcelomorgado/followers","following_url":"https://api.github.com/users/marcelomorgado/following{/other_user}","gists_url":"https://api.github.com/users/marcelomorgado/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelomorgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelomorgado/subscriptions","organizations_url":"https://api.github.com/users/marcelomorgado/orgs","repos_url":"https://api.github.com/users/marcelomorgado/repos","events_url":"https://api.github.com/users/marcelomorgado/events{/privacy}","received_events_url":"https://api.github.com/users/marcelomorgado/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marcelomorgado/TasitSDK","description":"The Tasit SDK is a JavaScript SDK for making mobile Ethereum dapps using React Native.","fork":true,"url":"https://api.github.com/repos/marcelomorgado/TasitSDK","forks_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/forks","keys_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/teams","hooks_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/hooks","issue_events_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/issues/events{/number}","events_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/events","assignees_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/assignees{/user}","branches_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/branches{/branch}","tags_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/tags","blobs_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/languages","stargazers_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/stargazers","contributors_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/contributors","subscribers_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/subscribers","subscription_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/subscription","commits_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/contents/{+path}","compare_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/merges","archive_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/downloads","issues_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/issues{/number}","pulls_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/labels{/name}","releases_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/releases{/id}","deployments_url":"https://api.github.com/repos/marcelomorgado/TasitSDK/deployments","created_at":"2018-11-28T21:28:30Z","updated_at":"2019-01-03T12:56:14Z","pushed_at":"2019-01-03T13:28:28Z","git_url":"git://github.com/marcelomorgado/TasitSDK.git","ssh_url":"git@github.com:marcelomorgado/TasitSDK.git","clone_url":"https://github.com/marcelomorgado/TasitSDK.git","svn_url":"https://github.com/marcelomorgado/TasitSDK","homepage":"","size":498,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"tasitlabs:develop","ref":"develop","sha":"31391ef215cfe451b7e1e50a1cabb1aa14038ba0","user":{"login":"tasitlabs","id":36803202,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2ODAzMjAy","avatar_url":"https://avatars1.githubusercontent.com/u/36803202?v=4","gravatar_id":"","url":"https://api.github.com/users/tasitlabs","html_url":"https://github.com/tasitlabs","followers_url":"https://api.github.com/users/tasitlabs/followers","following_url":"https://api.github.com/users/tasitlabs/following{/other_user}","gists_url":"https://api.github.com/users/tasitlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/tasitlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tasitlabs/subscriptions","organizations_url":"https://api.github.com/users/tasitlabs/orgs","repos_url":"https://api.github.com/users/tasitlabs/repos","events_url":"https://api.github.com/users/tasitlabs/events{/privacy}","received_events_url":"https://api.github.com/users/tasitlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":144420087,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ0MjAwODc=","name":"TasitSDK","full_name":"tasitlabs/TasitSDK","private":false,"owner":{"login":"tasitlabs","id":36803202,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2ODAzMjAy","avatar_url":"https://avatars1.githubusercontent.com/u/36803202?v=4","gravatar_id":"","url":"https://api.github.com/users/tasitlabs","html_url":"https://github.com/tasitlabs","followers_url":"https://api.github.com/users/tasitlabs/followers","following_url":"https://api.github.com/users/tasitlabs/following{/other_user}","gists_url":"https://api.github.com/users/tasitlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/tasitlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tasitlabs/subscriptions","organizations_url":"https://api.github.com/users/tasitlabs/orgs","repos_url":"https://api.github.com/users/tasitlabs/repos","events_url":"https://api.github.com/users/tasitlabs/events{/privacy}","received_events_url":"https://api.github.com/users/tasitlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tasitlabs/TasitSDK","description":"The Tasit SDK is a JavaScript SDK for making mobile Ethereum dapps using React Native.","fork":false,"url":"https://api.github.com/repos/tasitlabs/TasitSDK","forks_url":"https://api.github.com/repos/tasitlabs/TasitSDK/forks","keys_url":"https://api.github.com/repos/tasitlabs/TasitSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tasitlabs/TasitSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tasitlabs/TasitSDK/teams","hooks_url":"https://api.github.com/repos/tasitlabs/TasitSDK/hooks","issue_events_url":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/events{/number}","events_url":"https://api.github.com/repos/tasitlabs/TasitSDK/events","assignees_url":"https://api.github.com/repos/tasitlabs/TasitSDK/assignees{/user}","branches_url":"https://api.github.com/repos/tasitlabs/TasitSDK/branches{/branch}","tags_url":"https://api.github.com/repos/tasitlabs/TasitSDK/tags","blobs_url":"https://api.github.com/repos/tasitlabs/TasitSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tasitlabs/TasitSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tasitlabs/TasitSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/tasitlabs/TasitSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tasitlabs/TasitSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/tasitlabs/TasitSDK/languages","stargazers_url":"https://api.github.com/repos/tasitlabs/TasitSDK/stargazers","contributors_url":"https://api.github.com/repos/tasitlabs/TasitSDK/contributors","subscribers_url":"https://api.github.com/repos/tasitlabs/TasitSDK/subscribers","subscription_url":"https://api.github.com/repos/tasitlabs/TasitSDK/subscription","commits_url":"https://api.github.com/repos/tasitlabs/TasitSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/tasitlabs/TasitSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/tasitlabs/TasitSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/tasitlabs/TasitSDK/contents/{+path}","compare_url":"https://api.github.com/repos/tasitlabs/TasitSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tasitlabs/TasitSDK/merges","archive_url":"https://api.github.com/repos/tasitlabs/TasitSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tasitlabs/TasitSDK/downloads","issues_url":"https://api.github.com/repos/tasitlabs/TasitSDK/issues{/number}","pulls_url":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/tasitlabs/TasitSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/tasitlabs/TasitSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tasitlabs/TasitSDK/labels{/name}","releases_url":"https://api.github.com/repos/tasitlabs/TasitSDK/releases{/id}","deployments_url":"https://api.github.com/repos/tasitlabs/TasitSDK/deployments","created_at":"2018-08-11T21:46:01Z","updated_at":"2019-01-03T15:29:48Z","pushed_at":"2019-01-03T15:29:49Z","git_url":"git://github.com/tasitlabs/TasitSDK.git","ssh_url":"git@github.com:tasitlabs/TasitSDK.git","clone_url":"https://github.com/tasitlabs/TasitSDK.git","svn_url":"https://github.com/tasitlabs/TasitSDK","homepage":"","size":547,"stargazers_count":30,"watchers_count":30,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":21,"watchers":30,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71"},"html":{"href":"https://github.com/tasitlabs/TasitSDK/pull/71"},"issue":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/71"},"comments":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/tasitlabs/TasitSDK/statuses/83f1105b218fb6779dc49cd6a336e2de7f0baad6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"marcelomorgado"}}