UNPKG

532 BJavaScriptView Raw
1var ref = require('ssb-ref')
2
3exports.follow = function (id) {
4 return {
5 type: 'contact', contact: id, following: true
6 }
7}
8exports.unfollow = function (id) {
9 return {
10 type: 'contact', contact: id, following: false
11 }
12}
13exports.block = function unfollow(id) {
14 return {
15 type: 'contact', contact: id, flagged: true
16 }
17}
18
19exports.pub = function (address) {
20 return {
21 type: 'pub',
22 address: ref.parseAddress(address)
23 }
24}
25
26exports.file = function (hash) {
27 return {
28 type: 'file',
29 file: hash
30 }
31}
32