{"action":"created","comment":{"url":"https://api.github.com/repos/polkadot-js/api/pulls/comments/224383043","pull_request_review_id":163731831,"id":224383043,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDM4MzA0Mw==","diff_hunk":"@@ -0,0 +1,117 @@\n+// Copyright 2017-2018 @polkadot/api authors & contributors\n+// This software may be modified and distributed under the terms\n+// of the ISC license. See the LICENSE file for details.\n+\n+import { ApiPromiseInterface, QueryableStorageFunction, QueryableModuleStorage, QueryableStorage, SubmittableExtrinsics, SubmittableModuleExtrinsics, SubmittableExtrinsicFunction } from './types';\n+\n+import WsProvider from '@polkadot/rpc-provider/ws';\n+import Rpc from '@polkadot/rpc-core/index';\n+import { Extrinsics, ExtrinsicFunction } from '@polkadot/extrinsics/types';\n+import { Storage } from '@polkadot/storage/types';\n+import { Base } from '@polkadot/types/codec';\n+\n+import ApiBase from '../Base';\n+import SubmittableExtrinsic from './SubmittableExtrinsic';\n+import { StorageFunction } from '@polkadot/types/StorageKey';\n+\n+export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, SubmittableExtrinsics> implements ApiPromiseInterface {\n+  private _isReady: Promise<ApiPromise>;\n+\n+  /**\n+   * @description Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.\n+   * @param wsProvider Optional WebSocket provider that is passed to the class contructor\n+   * @example\n+   * <BR>\n+   *\n+   * ```javascript\n+   * import Api from '@polkadot/api/promise';\n+   *\n+   * Api.create().then(async (api) => {\n+   *   const timestamp = await api.st.timestamp.now();\n+   *\n+   *   console.log(`lastest block timestamp ${timestamp}`);\n+   * });\n+   * ```\n+   */\n+  static create (wsProvider?: WsProvider): Promise<ApiPromise> {","path":"packages/api/src/promise/index.ts","position":36,"original_position":36,"commit_id":"df4d81e5c546796d2f25a021d535fd19d7eb364d","original_commit_id":"95f97941ed6475087403d036e8e209e0ba752818","user":{"login":"ltfschoen","id":6226175,"node_id":"MDQ6VXNlcjYyMjYxNzU=","avatar_url":"https://avatars0.githubusercontent.com/u/6226175?v=4","gravatar_id":"","url":"https://api.github.com/users/ltfschoen","html_url":"https://github.com/ltfschoen","followers_url":"https://api.github.com/users/ltfschoen/followers","following_url":"https://api.github.com/users/ltfschoen/following{/other_user}","gists_url":"https://api.github.com/users/ltfschoen/gists{/gist_id}","starred_url":"https://api.github.com/users/ltfschoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltfschoen/subscriptions","organizations_url":"https://api.github.com/users/ltfschoen/orgs","repos_url":"https://api.github.com/users/ltfschoen/repos","events_url":"https://api.github.com/users/ltfschoen/events{/privacy}","received_events_url":"https://api.github.com/users/ltfschoen/received_events","type":"User","site_admin":false},"body":"could we update the example to show how to use the optional `wsProvider` parameter.\r\ni think it'd be used as follows:\r\n```\r\n   * ```javascript\r\n   * import Api from '@polkadot/api/promise';\r\n   * import Ws from '@polkadot/rpc-provider/ws';\r\n   *\r\n   * const wsProvider = new Ws('ws://127.0.0.1:9944');\r\n   * \r\n   * Api.create(wsProvider).then(async (api) => {\r\n   *   const timestamp = await api.st.timestamp.now();\r\n   *\r\n   *   console.log(`lastest block timestamp ${timestamp}`);\r\n   * });\r\n   * ```\r\n```","created_at":"2018-10-11T09:43:11Z","updated_at":"2018-10-11T09:43:12Z","html_url":"https://github.com/polkadot-js/api/pull/251#discussion_r224383043","pull_request_url":"https://api.github.com/repos/polkadot-js/api/pulls/251","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/comments/224383043"},"html":{"href":"https://github.com/polkadot-js/api/pull/251#discussion_r224383043"},"pull_request":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/polkadot-js/api/pulls/251","id":222057684,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMDU3Njg0","html_url":"https://github.com/polkadot-js/api/pull/251","diff_url":"https://github.com/polkadot-js/api/pull/251.diff","patch_url":"https://github.com/polkadot-js/api/pull/251.patch","issue_url":"https://api.github.com/repos/polkadot-js/api/issues/251","number":251,"state":"open","locked":false,"title":"Add api/promise","user":{"login":"jacogr","id":1424473,"node_id":"MDQ6VXNlcjE0MjQ0NzM=","avatar_url":"https://avatars2.githubusercontent.com/u/1424473?v=4","gravatar_id":"","url":"https://api.github.com/users/jacogr","html_url":"https://github.com/jacogr","followers_url":"https://api.github.com/users/jacogr/followers","following_url":"https://api.github.com/users/jacogr/following{/other_user}","gists_url":"https://api.github.com/users/jacogr/gists{/gist_id}","starred_url":"https://api.github.com/users/jacogr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacogr/subscriptions","organizations_url":"https://api.github.com/users/jacogr/orgs","repos_url":"https://api.github.com/users/jacogr/repos","events_url":"https://api.github.com/users/jacogr/events{/privacy}","received_events_url":"https://api.github.com/users/jacogr/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-11T09:00:23Z","updated_at":"2018-10-11T09:43:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9238918b6578a5a15f29a81501409f0cff428cf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/polkadot-js/api/pulls/251/commits","review_comments_url":"https://api.github.com/repos/polkadot-js/api/pulls/251/comments","review_comment_url":"https://api.github.com/repos/polkadot-js/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/polkadot-js/api/issues/251/comments","statuses_url":"https://api.github.com/repos/polkadot-js/api/statuses/df4d81e5c546796d2f25a021d535fd19d7eb364d","head":{"label":"polkadot-js:jg-api-promise","ref":"jg-api-promise","sha":"df4d81e5c546796d2f25a021d535fd19d7eb364d","user":{"login":"polkadot-js","id":33775474,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNzc1NDc0","avatar_url":"https://avatars2.githubusercontent.com/u/33775474?v=4","gravatar_id":"","url":"https://api.github.com/users/polkadot-js","html_url":"https://github.com/polkadot-js","followers_url":"https://api.github.com/users/polkadot-js/followers","following_url":"https://api.github.com/users/polkadot-js/following{/other_user}","gists_url":"https://api.github.com/users/polkadot-js/gists{/gist_id}","starred_url":"https://api.github.com/users/polkadot-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polkadot-js/subscriptions","organizations_url":"https://api.github.com/users/polkadot-js/orgs","repos_url":"https://api.github.com/users/polkadot-js/repos","events_url":"https://api.github.com/users/polkadot-js/events{/privacy}","received_events_url":"https://api.github.com/users/polkadot-js/received_events","type":"Organization","site_admin":false},"repo":{"id":111184073,"node_id":"MDEwOlJlcG9zaXRvcnkxMTExODQwNzM=","name":"api","full_name":"polkadot-js/api","private":false,"owner":{"login":"polkadot-js","id":33775474,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNzc1NDc0","avatar_url":"https://avatars2.githubusercontent.com/u/33775474?v=4","gravatar_id":"","url":"https://api.github.com/users/polkadot-js","html_url":"https://github.com/polkadot-js","followers_url":"https://api.github.com/users/polkadot-js/followers","following_url":"https://api.github.com/users/polkadot-js/following{/other_user}","gists_url":"https://api.github.com/users/polkadot-js/gists{/gist_id}","starred_url":"https://api.github.com/users/polkadot-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polkadot-js/subscriptions","organizations_url":"https://api.github.com/users/polkadot-js/orgs","repos_url":"https://api.github.com/users/polkadot-js/repos","events_url":"https://api.github.com/users/polkadot-js/events{/privacy}","received_events_url":"https://api.github.com/users/polkadot-js/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/polkadot-js/api","description":"Type definitions, Promise- and Reactive-based APIs around Substrate RPC calls","fork":false,"url":"https://api.github.com/repos/polkadot-js/api","forks_url":"https://api.github.com/repos/polkadot-js/api/forks","keys_url":"https://api.github.com/repos/polkadot-js/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polkadot-js/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polkadot-js/api/teams","hooks_url":"https://api.github.com/repos/polkadot-js/api/hooks","issue_events_url":"https://api.github.com/repos/polkadot-js/api/issues/events{/number}","events_url":"https://api.github.com/repos/polkadot-js/api/events","assignees_url":"https://api.github.com/repos/polkadot-js/api/assignees{/user}","branches_url":"https://api.github.com/repos/polkadot-js/api/branches{/branch}","tags_url":"https://api.github.com/repos/polkadot-js/api/tags","blobs_url":"https://api.github.com/repos/polkadot-js/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polkadot-js/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polkadot-js/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/polkadot-js/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polkadot-js/api/statuses/{sha}","languages_url":"https://api.github.com/repos/polkadot-js/api/languages","stargazers_url":"https://api.github.com/repos/polkadot-js/api/stargazers","contributors_url":"https://api.github.com/repos/polkadot-js/api/contributors","subscribers_url":"https://api.github.com/repos/polkadot-js/api/subscribers","subscription_url":"https://api.github.com/repos/polkadot-js/api/subscription","commits_url":"https://api.github.com/repos/polkadot-js/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/polkadot-js/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/polkadot-js/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/polkadot-js/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/polkadot-js/api/contents/{+path}","compare_url":"https://api.github.com/repos/polkadot-js/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polkadot-js/api/merges","archive_url":"https://api.github.com/repos/polkadot-js/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polkadot-js/api/downloads","issues_url":"https://api.github.com/repos/polkadot-js/api/issues{/number}","pulls_url":"https://api.github.com/repos/polkadot-js/api/pulls{/number}","milestones_url":"https://api.github.com/repos/polkadot-js/api/milestones{/number}","notifications_url":"https://api.github.com/repos/polkadot-js/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polkadot-js/api/labels{/name}","releases_url":"https://api.github.com/repos/polkadot-js/api/releases{/id}","deployments_url":"https://api.github.com/repos/polkadot-js/api/deployments","created_at":"2017-11-18T06:56:55Z","updated_at":"2018-10-11T08:25:28Z","pushed_at":"2018-10-11T09:37:17Z","git_url":"git://github.com/polkadot-js/api.git","ssh_url":"git@github.com:polkadot-js/api.git","clone_url":"https://github.com/polkadot-js/api.git","svn_url":"https://github.com/polkadot-js/api","homepage":"","size":4905,"stargazers_count":13,"watchers_count":13,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":5,"open_issues":27,"watchers":13,"default_branch":"master"}},"base":{"label":"polkadot-js:master","ref":"master","sha":"e91547476323345946626bc03a3ba6421ba92636","user":{"login":"polkadot-js","id":33775474,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNzc1NDc0","avatar_url":"https://avatars2.githubusercontent.com/u/33775474?v=4","gravatar_id":"","url":"https://api.github.com/users/polkadot-js","html_url":"https://github.com/polkadot-js","followers_url":"https://api.github.com/users/polkadot-js/followers","following_url":"https://api.github.com/users/polkadot-js/following{/other_user}","gists_url":"https://api.github.com/users/polkadot-js/gists{/gist_id}","starred_url":"https://api.github.com/users/polkadot-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polkadot-js/subscriptions","organizations_url":"https://api.github.com/users/polkadot-js/orgs","repos_url":"https://api.github.com/users/polkadot-js/repos","events_url":"https://api.github.com/users/polkadot-js/events{/privacy}","received_events_url":"https://api.github.com/users/polkadot-js/received_events","type":"Organization","site_admin":false},"repo":{"id":111184073,"node_id":"MDEwOlJlcG9zaXRvcnkxMTExODQwNzM=","name":"api","full_name":"polkadot-js/api","private":false,"owner":{"login":"polkadot-js","id":33775474,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNzc1NDc0","avatar_url":"https://avatars2.githubusercontent.com/u/33775474?v=4","gravatar_id":"","url":"https://api.github.com/users/polkadot-js","html_url":"https://github.com/polkadot-js","followers_url":"https://api.github.com/users/polkadot-js/followers","following_url":"https://api.github.com/users/polkadot-js/following{/other_user}","gists_url":"https://api.github.com/users/polkadot-js/gists{/gist_id}","starred_url":"https://api.github.com/users/polkadot-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polkadot-js/subscriptions","organizations_url":"https://api.github.com/users/polkadot-js/orgs","repos_url":"https://api.github.com/users/polkadot-js/repos","events_url":"https://api.github.com/users/polkadot-js/events{/privacy}","received_events_url":"https://api.github.com/users/polkadot-js/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/polkadot-js/api","description":"Type definitions, Promise- and Reactive-based APIs around Substrate RPC calls","fork":false,"url":"https://api.github.com/repos/polkadot-js/api","forks_url":"https://api.github.com/repos/polkadot-js/api/forks","keys_url":"https://api.github.com/repos/polkadot-js/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polkadot-js/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polkadot-js/api/teams","hooks_url":"https://api.github.com/repos/polkadot-js/api/hooks","issue_events_url":"https://api.github.com/repos/polkadot-js/api/issues/events{/number}","events_url":"https://api.github.com/repos/polkadot-js/api/events","assignees_url":"https://api.github.com/repos/polkadot-js/api/assignees{/user}","branches_url":"https://api.github.com/repos/polkadot-js/api/branches{/branch}","tags_url":"https://api.github.com/repos/polkadot-js/api/tags","blobs_url":"https://api.github.com/repos/polkadot-js/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polkadot-js/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polkadot-js/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/polkadot-js/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polkadot-js/api/statuses/{sha}","languages_url":"https://api.github.com/repos/polkadot-js/api/languages","stargazers_url":"https://api.github.com/repos/polkadot-js/api/stargazers","contributors_url":"https://api.github.com/repos/polkadot-js/api/contributors","subscribers_url":"https://api.github.com/repos/polkadot-js/api/subscribers","subscription_url":"https://api.github.com/repos/polkadot-js/api/subscription","commits_url":"https://api.github.com/repos/polkadot-js/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/polkadot-js/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/polkadot-js/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/polkadot-js/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/polkadot-js/api/contents/{+path}","compare_url":"https://api.github.com/repos/polkadot-js/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polkadot-js/api/merges","archive_url":"https://api.github.com/repos/polkadot-js/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polkadot-js/api/downloads","issues_url":"https://api.github.com/repos/polkadot-js/api/issues{/number}","pulls_url":"https://api.github.com/repos/polkadot-js/api/pulls{/number}","milestones_url":"https://api.github.com/repos/polkadot-js/api/milestones{/number}","notifications_url":"https://api.github.com/repos/polkadot-js/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polkadot-js/api/labels{/name}","releases_url":"https://api.github.com/repos/polkadot-js/api/releases{/id}","deployments_url":"https://api.github.com/repos/polkadot-js/api/deployments","created_at":"2017-11-18T06:56:55Z","updated_at":"2018-10-11T08:25:28Z","pushed_at":"2018-10-11T09:37:17Z","git_url":"git://github.com/polkadot-js/api.git","ssh_url":"git@github.com:polkadot-js/api.git","clone_url":"https://github.com/polkadot-js/api.git","svn_url":"https://github.com/polkadot-js/api","homepage":"","size":4905,"stargazers_count":13,"watchers_count":13,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":5,"open_issues":27,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/251"},"html":{"href":"https://github.com/polkadot-js/api/pull/251"},"issue":{"href":"https://api.github.com/repos/polkadot-js/api/issues/251"},"comments":{"href":"https://api.github.com/repos/polkadot-js/api/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/polkadot-js/api/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/polkadot-js/api/statuses/df4d81e5c546796d2f25a021d535fd19d7eb364d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ltfschoen"}}