{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/interfaces/issues/16","repository_url":"https://api.github.com/repos/ethereum/interfaces","labels_url":"https://api.github.com/repos/ethereum/interfaces/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/interfaces/issues/16/comments","events_url":"https://api.github.com/repos/ethereum/interfaces/issues/16/events","html_url":"https://github.com/ethereum/interfaces/issues/16","id":218164125,"number":16,"title":"ethereumProvider API","user":{"login":"frozeman","id":232662,"avatar_url":"https://avatars1.githubusercontent.com/u/232662?v=4","gravatar_id":"","url":"https://api.github.com/users/frozeman","html_url":"https://github.com/frozeman","followers_url":"https://api.github.com/users/frozeman/followers","following_url":"https://api.github.com/users/frozeman/following{/other_user}","gists_url":"https://api.github.com/users/frozeman/gists{/gist_id}","starred_url":"https://api.github.com/users/frozeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frozeman/subscriptions","organizations_url":"https://api.github.com/users/frozeman/orgs","repos_url":"https://api.github.com/users/frozeman/repos","events_url":"https://api.github.com/users/frozeman/events{/privacy}","received_events_url":"https://api.github.com/users/frozeman/received_events","type":"User","site_admin":false},"labels":[{"id":596556990,"url":"https://api.github.com/repos/ethereum/interfaces/labels/ERC","name":"ERC","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":75,"created_at":"2017-03-30T11:20:58Z","updated_at":"2018-03-15T21:48:22Z","closed_at":null,"author_association":"MEMBER","body":"### Abstract\r\n\r\nThis draft is to discuss the `ethereum` API, an object exposed by ethereum native browsers and tools like Mist, MetaMask and status.im.\r\n\r\nThe API should be small and clean and allow all kind of libraries to attach to it.\r\n\r\nThe class of the object should be `EthereumProvider`, the object name `ethereum`.\r\n\r\n### API\r\n\r\nThe `ethereum` should inherit from a [EventEmitter](https://nodejs.org/api/events.html) type class, and provide `add/removeListener`, `on/once/off` etc.\r\n\r\n```js\r\n// callback: a error first callback\r\nethereum.send(methodName, params, callback)\r\n> undefined\r\n\r\n// CALLBACK return\r\n> err, result\r\n```\r\n\r\n```js\r\n// returns subscription notification,\r\nethereum.on(subscriptionType, handler)\r\n\r\nsubscriptionType = `notification`\r\n\r\n// HANDLER return\r\n> {\r\n       \"subscription\":\"0x2acffa11d68280c2954daeb77cb849d9\",\r\n       \"result\": {...}\r\n    }\r\n```\r\n\r\n```js\r\n// react on connection start\r\nethereum.on('connect', handler)\r\n\r\n// HANDLER return\r\nnull\r\n```\r\n\r\n```js\r\n// react on connection end\r\nethereum.on('end', handler)\r\n\r\n// HANDLER return\r\nError Object with message (timeout, error, drop, etc)\r\n```"},"comment":{"url":"https://api.github.com/repos/ethereum/interfaces/issues/comments/373533672","html_url":"https://github.com/ethereum/interfaces/issues/16#issuecomment-373533672","issue_url":"https://api.github.com/repos/ethereum/interfaces/issues/16","id":373533672,"user":{"login":"ligi","id":111600,"avatar_url":"https://avatars2.githubusercontent.com/u/111600?v=4","gravatar_id":"","url":"https://api.github.com/users/ligi","html_url":"https://github.com/ligi","followers_url":"https://api.github.com/users/ligi/followers","following_url":"https://api.github.com/users/ligi/following{/other_user}","gists_url":"https://api.github.com/users/ligi/gists{/gist_id}","starred_url":"https://api.github.com/users/ligi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ligi/subscriptions","organizations_url":"https://api.github.com/users/ligi/orgs","repos_url":"https://api.github.com/users/ligi/repos","events_url":"https://api.github.com/users/ligi/events{/privacy}","received_events_url":"https://api.github.com/users/ligi/received_events","type":"User","site_admin":false},"created_at":"2018-03-15T21:48:22Z","updated_at":"2018-03-15T21:48:22Z","author_association":"MEMBER","body":"Really like the idea - just as a note from a mobile side: it would be awesome if EthereumProvider will (as far as I see continue) to consist only of methods. No variables. No nested classes. Then we can use WebView.addJavascriptInterface to add the provider and not have to use hackish workarounds ;-)"}}
{"actor":{"display_login":"ligi"}}