{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/web3.js/issues/199","labels_url":"https://api.github.com/repos/ethereum/web3.js/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/web3.js/issues/199/comments","events_url":"https://api.github.com/repos/ethereum/web3.js/issues/199/events","html_url":"https://github.com/ethereum/web3.js/pull/199","id":75274115,"number":199,"title":"web3.eth.contract overhaul","user":{"login":"debris","id":2613714,"avatar_url":"https://avatars.githubusercontent.com/u/2613714?v=3","gravatar_id":"","url":"https://api.github.com/users/debris","html_url":"https://github.com/debris","followers_url":"https://api.github.com/users/debris/followers","following_url":"https://api.github.com/users/debris/following{/other_user}","gists_url":"https://api.github.com/users/debris/gists{/gist_id}","starred_url":"https://api.github.com/users/debris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debris/subscriptions","organizations_url":"https://api.github.com/users/debris/orgs","repos_url":"https://api.github.com/users/debris/repos","events_url":"https://api.github.com/users/debris/events{/privacy}","received_events_url":"https://api.github.com/users/debris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-11T16:13:02Z","updated_at":"2015-05-11T18:53:19Z","closed_at":"2015-05-11T18:53:19Z","pull_request":{"url":"https://api.github.com/repos/ethereum/web3.js/pulls/199","html_url":"https://github.com/ethereum/web3.js/pull/199","diff_url":"https://github.com/ethereum/web3.js/pull/199.diff","patch_url":"https://github.com/ethereum/web3.js/pull/199.patch"},"body":"this pr contains new way of creating contract objects:\r\n\r\n- `param1`, `param2` ... `paramX` - contract constructor params (optional)\r\n- `{code: 0x00...df}` - transaction object (required for method `new`)\r\n- `function (err, contract) {}` - callback object (optional)\r\n\r\n```javascript\r\nvar MyContract = web3.eth.contract(abi);\r\n\r\n// create new contract on a blockchain\r\nvar contract = MyContract.new({code: 0x00...df});\r\nvar contract = MyContract.new(param1, param2, {code: 0x00...df});\r\nMyContract.new({code: 0x00...df}, function (err, contract) {});\r\nMyContract.new(param1, param2, {code: 0x00...df}, function (err, contract) {});\r\n\r\n// reuse existing contract\r\nvar contract = MyContract.at(address);\r\nMyContract.at(address, function (err, contract) {})\r\n```\r\n\r\nthere is also possibility to call && sendTransaction to contract asynchronously:\r\n\r\n```javascript\r\n// myCall is a contract const function\r\nvar result = contract.myCall([3]);\r\nvar result = contract.myCall([3], {from: 0x...ff});\r\ncontract.myCall([3], function (err, result) {});\r\ncontract.myCall([3], {from: 0x...ff}, function (err, result) {});\r\n\r\n// myTransact is a contract function\r\ncontract.myTransact([3]);\r\ncontract.myTransact([3], {from: 0x...ff});\r\ncontract.myTransact([3], function (err) {});\r\ncontract.myTransact([3], {from: 0x...ff}, function (err) {});\r\n```"},"comment":{"url":"https://api.github.com/repos/ethereum/web3.js/issues/comments/101016133","html_url":"https://github.com/ethereum/web3.js/pull/199#issuecomment-101016133","issue_url":"https://api.github.com/repos/ethereum/web3.js/issues/199","id":101016133,"user":{"login":"frozeman","id":232662,"avatar_url":"https://avatars.githubusercontent.com/u/232662?v=3","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},"created_at":"2015-05-11T18:53:18Z","updated_at":"2015-05-11T18:53:18Z","body":"Please re-open with merge to develop not master"}}