{"action":"opened","issue":{"url":"https://api.github.com/repos/gallactic/intergallactic/issues/13","repository_url":"https://api.github.com/repos/gallactic/intergallactic","labels_url":"https://api.github.com/repos/gallactic/intergallactic/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/gallactic/intergallactic/issues/13/comments","events_url":"https://api.github.com/repos/gallactic/intergallactic/issues/13/events","html_url":"https://github.com/gallactic/intergallactic/issues/13","id":388477210,"node_id":"MDU6SXNzdWUzODg0NzcyMTA=","number":13,"title":"Simplify creating new Transaction process","user":{"login":"josefwijaya","id":18253945,"node_id":"MDQ6VXNlcjE4MjUzOTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/18253945?v=4","gravatar_id":"","url":"https://api.github.com/users/josefwijaya","html_url":"https://github.com/josefwijaya","followers_url":"https://api.github.com/users/josefwijaya/followers","following_url":"https://api.github.com/users/josefwijaya/following{/other_user}","gists_url":"https://api.github.com/users/josefwijaya/gists{/gist_id}","starred_url":"https://api.github.com/users/josefwijaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefwijaya/subscriptions","organizations_url":"https://api.github.com/users/josefwijaya/orgs","repos_url":"https://api.github.com/users/josefwijaya/repos","events_url":"https://api.github.com/users/josefwijaya/events{/privacy}","received_events_url":"https://api.github.com/users/josefwijaya/received_events","type":"User","site_admin":false},"labels":[{"id":1009788712,"node_id":"MDU6TGFiZWwxMDA5Nzg4NzEy","url":"https://api.github.com/repos/gallactic/intergallactic/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"open","locked":false,"assignee":{"login":"josefwijaya","id":18253945,"node_id":"MDQ6VXNlcjE4MjUzOTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/18253945?v=4","gravatar_id":"","url":"https://api.github.com/users/josefwijaya","html_url":"https://github.com/josefwijaya","followers_url":"https://api.github.com/users/josefwijaya/followers","following_url":"https://api.github.com/users/josefwijaya/following{/other_user}","gists_url":"https://api.github.com/users/josefwijaya/gists{/gist_id}","starred_url":"https://api.github.com/users/josefwijaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefwijaya/subscriptions","organizations_url":"https://api.github.com/users/josefwijaya/orgs","repos_url":"https://api.github.com/users/josefwijaya/repos","events_url":"https://api.github.com/users/josefwijaya/events{/privacy}","received_events_url":"https://api.github.com/users/josefwijaya/received_events","type":"User","site_admin":false},"assignees":[{"login":"josefwijaya","id":18253945,"node_id":"MDQ6VXNlcjE4MjUzOTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/18253945?v=4","gravatar_id":"","url":"https://api.github.com/users/josefwijaya","html_url":"https://github.com/josefwijaya","followers_url":"https://api.github.com/users/josefwijaya/followers","following_url":"https://api.github.com/users/josefwijaya/following{/other_user}","gists_url":"https://api.github.com/users/josefwijaya/gists{/gist_id}","starred_url":"https://api.github.com/users/josefwijaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefwijaya/subscriptions","organizations_url":"https://api.github.com/users/josefwijaya/orgs","repos_url":"https://api.github.com/users/josefwijaya/repos","events_url":"https://api.github.com/users/josefwijaya/events{/privacy}","received_events_url":"https://api.github.com/users/josefwijaya/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-12-07T02:14:14Z","updated_at":"2018-12-07T02:14:14Z","closed_at":null,"author_association":"COLLABORATOR","body":"**Current way**\r\nThe current way of creating new transaction:\r\n- Send Transaction\r\n```\r\nconst option = {\r\n  type: 1,\r\n  unit: 'boson'\r\n},\r\nconst txn = {\r\n  from: [{\r\n    address: 'acFVrNat8Y8Evid4fcJzN5KxyEAyuHS6Tuu',\r\n    amount: 10\r\n  }],\r\n  to: [{\r\n    address: 'acWmVcNrHzxBF8L25vdiKLsz664ZGkYmPRj',\r\n    amount: 10\r\n  }]\r\n}\r\n\r\nconst newTxn = new igc.Transaction(data.txn, { type: data.txnType });\r\nnewTxn.sign(data.privKey)\r\n  .then(signature => {\r\n    const signatories = [{\r\n      signature, publicKey: data.pubKey\r\n    }]\r\n    return newTxn.call(signatories);\r\n  })\r\n  .then(res => {\r\n  \r\n  });\r\n```\r\n- Call Transaction\r\n```\r\nconst txn = {\r\n  from: {\r\n    address: 'acFVrNat8Y8Evid4fcJzN5KxyEAyuHS6Tuu',\r\n    amount: 10\r\n  },\r\n  to: {\r\n    address: 'acWmVcNrHzxBF8L25vdiKLsz664ZGkYmPRj',\r\n    amount: 10\r\n  },\r\n  gasLimit: 1,\r\n  data: '010203' // currently require an input of byte array\r\n}\r\nconst newTxn = new igc.Transaction(data.txn, { type: data.txnType });\r\nnewTxn.sign(data.privKey)\r\n  .then(signature => {\r\n    const signatories = [{\r\n      signature, publicKey: data.pubKey\r\n    }]\r\n    return newTxn.call(signatories);\r\n  })\r\n  .then(res);\r\n```\r\n- Bond Transaction\r\nconst tx = {\r\n          from: {\r\n            address: testAcc.address,\r\n            amount: 200\r\n          },\r\n          to: {\r\n            address: 'vaBdTQnKWstzbP9rrMCvPP4rxqLU3PDvKHM',\r\n            amount: 100\r\n          },\r\n          publicKey: 'pjDvQc1rF8HhCAK8L8zu3SJQcKtCMroo1rmRWf8o8m111DexqzX'\r\n        }\r\n\r\n**New way** (suggestion)\r\nA suggestion of more simple way of creating transaction\r\n- Send Transaction\r\n```\r\nconst tx = new Transaction({\r\n  to: 'bbb',\r\n  amount: 10\r\n  fee: 1\r\n});\r\n\r\ntx.send(pk)\r\n  .then(res => {\r\n\r\n  })\r\n```\r\n- Call Transaction\r\n```\r\nconst tx = new Transaction({\r\n  to: 'bbb',\r\n  amount: 10\r\n  gasLimit: 1,\r\n  data: '010203'\r\n})\r\n\r\ntx.call(pk)\r\n  .then(res => {\r\n\r\n  })\r\n```\r\n\r\nThe concept will similarly applied to Bond, Unbond and Permission Transaction as well."}}
{"actor":{"display_login":"josefwijaya"}}