-
Notifications
You must be signed in to change notification settings - Fork 0
/
assetHandlers.go
59 lines (43 loc) · 1.79 KB
/
assetHandlers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"net/http"
"github.com/vennd/enu/consts"
"github.com/vennd/enu/enulib"
"github.com/vennd/enu/internal/golang.org/x/net/context"
)
func AssetCreate(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "asset")
return handle(c, w, r)
}
func DividendCreate(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "dividend")
return handle(c, w, r)
}
func AssetIssuances(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "issuances") //new
return handle(c, w, r)
}
// Recommended call which summarises the ledger for a particular asset
func AssetLedger(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "ledger")
return handle(c, w, r)
}
func GetDividend(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "getdividend") //new
return handle(c, w, r)
}
func GetAsset(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "getasset") //new
return handle(c, w, r)
}
func GetRippleLedgerStatus(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError {
// Add to the context the RequestType
c = context.WithValue(c, consts.RequestTypeKey, "getrippleledgerstatus") //new
return handle(c, w, r)
}