{"action":"closed","issue":{"url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream/issues/22","repository_url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream","labels_url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream/issues/22/comments","events_url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream/issues/22/events","html_url":"https://github.com/emschwartz/ilp-protocol-paystream/issues/22","id":300820068,"number":22,"title":"Should the API deal with sending and receiving money instead of min/max balance?","user":{"login":"emschwartz","id":3262610,"avatar_url":"https://avatars3.githubusercontent.com/u/3262610?v=4","gravatar_id":"","url":"https://api.github.com/users/emschwartz","html_url":"https://github.com/emschwartz","followers_url":"https://api.github.com/users/emschwartz/followers","following_url":"https://api.github.com/users/emschwartz/following{/other_user}","gists_url":"https://api.github.com/users/emschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/emschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emschwartz/subscriptions","organizations_url":"https://api.github.com/users/emschwartz/orgs","repos_url":"https://api.github.com/users/emschwartz/repos","events_url":"https://api.github.com/users/emschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/emschwartz/received_events","type":"User","site_admin":false},"labels":[{"id":850962857,"url":"https://api.github.com/repos/emschwartz/ilp-protocol-paystream/labels/api","name":"api","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":{"login":"sentientwaffle","id":461112,"avatar_url":"https://avatars0.githubusercontent.com/u/461112?v=4","gravatar_id":"","url":"https://api.github.com/users/sentientwaffle","html_url":"https://github.com/sentientwaffle","followers_url":"https://api.github.com/users/sentientwaffle/followers","following_url":"https://api.github.com/users/sentientwaffle/following{/other_user}","gists_url":"https://api.github.com/users/sentientwaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/sentientwaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sentientwaffle/subscriptions","organizations_url":"https://api.github.com/users/sentientwaffle/orgs","repos_url":"https://api.github.com/users/sentientwaffle/repos","events_url":"https://api.github.com/users/sentientwaffle/events{/privacy}","received_events_url":"https://api.github.com/users/sentientwaffle/received_events","type":"User","site_admin":false},"assignees":[{"login":"sentientwaffle","id":461112,"avatar_url":"https://avatars0.githubusercontent.com/u/461112?v=4","gravatar_id":"","url":"https://api.github.com/users/sentientwaffle","html_url":"https://github.com/sentientwaffle","followers_url":"https://api.github.com/users/sentientwaffle/followers","following_url":"https://api.github.com/users/sentientwaffle/following{/other_user}","gists_url":"https://api.github.com/users/sentientwaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/sentientwaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sentientwaffle/subscriptions","organizations_url":"https://api.github.com/users/sentientwaffle/orgs","repos_url":"https://api.github.com/users/sentientwaffle/repos","events_url":"https://api.github.com/users/sentientwaffle/events{/privacy}","received_events_url":"https://api.github.com/users/sentientwaffle/received_events","type":"User","site_admin":false},{"login":"sharafian","id":3362563,"avatar_url":"https://avatars0.githubusercontent.com/u/3362563?v=4","gravatar_id":"","url":"https://api.github.com/users/sharafian","html_url":"https://github.com/sharafian","followers_url":"https://api.github.com/users/sharafian/followers","following_url":"https://api.github.com/users/sharafian/following{/other_user}","gists_url":"https://api.github.com/users/sharafian/gists{/gist_id}","starred_url":"https://api.github.com/users/sharafian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharafian/subscriptions","organizations_url":"https://api.github.com/users/sharafian/orgs","repos_url":"https://api.github.com/users/sharafian/repos","events_url":"https://api.github.com/users/sharafian/events{/privacy}","received_events_url":"https://api.github.com/users/sharafian/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-02-27T22:37:06Z","updated_at":"2018-03-23T18:10:01Z","closed_at":"2018-03-23T18:10:01Z","author_association":"OWNER","body":"Instead of using the min/max balance, we could make the API a little more similar to normal sockets (like @adrianhopebailie suggests in https://github.com/emschwartz/ilp-protocol-paystream/issues/19) by having methods like `send` and `receive` on the socket object.\r\n\r\n| Use Case | Min/Max Balance API | Alternative |\r\n|---|---|---|\r\n| Sending | `client.setMinAndMaxBalance(-1000)` | `client.add(1000); client.flush()` (or `client.send(1000)`) |\r\n| Requesting | `server.setMinBalance(1000)` | `server.receive(1000)` |\r\n| Making funds available to be requested | `client.setMinBalance(-1000)` | `client.add(1000)` |\r\n| Enabling refunds | (not modifying the min balance as money is received) | `server.receive(1000); server.on('chunk', (amount) => client.add(amount))` |\r\n\r\nYou would add and remove money from the socket, instead of setting the range you want your balance to end up in. When you call `receive` it would reduce the socket's `balance` by that amount if it's already got that much or it would request more from the sender and wait until it has reached that amount.\r\n\r\nThoughts? Would that be easier or harder to work with?"}}
{"actor":{"display_login":"emschwartz"}}