-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.go
81 lines (63 loc) · 2.48 KB
/
config.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package handcash
const (
// version is the current package version
version = "v0.3.1"
// defaultUserAgent is the default user agent for all requests
defaultUserAgent string = "go-handcash-connect: " + version
// apiVersion of the Handcash Connect SDK
apiVersion = "v1"
// emptyBody is the default body if nobody is set
emptyBody = "{}"
)
// Environments for Handcash
const (
EnvironmentBeta = "beta"
EnvironmentIAE = "iae"
EnvironmentProduction = "prod"
)
var (
environments = map[string]*Environment{
EnvironmentBeta: {
APIURL: "https://beta-cloud.handcash.io",
ClientURL: "https://beta-app.handcash.io",
Environment: EnvironmentBeta,
},
EnvironmentIAE: {
APIURL: "https://iae.cloud.handcash.io",
ClientURL: "https://iae-app.handcash.io",
Environment: EnvironmentIAE,
},
EnvironmentProduction: {
APIURL: "https://cloud.handcash.io",
ClientURL: "https://app.handcash.io",
Environment: EnvironmentProduction,
},
}
)
// Endpoints for various services
//
// Specs: https://github.com/HandCash/handcash-connect-sdk-js/blob/master/src/api/http_request_factory.js
const (
// endpointProfile is for accessing profile information
endpointProfile = "/" + apiVersion + "/connect/profile"
// endpointProfileCurrent is for getting the current user profile
endpointProfileCurrent = endpointProfile + "/currentUserProfile"
// endpointPublicProfilesByHandle will return profiles given list of handles
// endpointPublicProfilesByHandle = endpointProfile + "/publicUserProfiles"
// endpointGetFriends will return a list of friends
// endpointGetFriends = endpointProfile + "/friends"
// endpointGetPermissions will return a list of permissions for the user
// endpointGetPermissions = endpointProfile + "/permissions"
// endpointGetEncryptionKeypair will return the public key
// endpointGetEncryptionKeypair = endpointProfile + "/encryptionKeypair"
// endpointSignData will sign given data
// endpointSignData = endpointProfile + "/signData"
// endpointWallet is for accessing wallet information
endpointWallet = "/" + apiVersion + "/connect/wallet"
// endpointGetSpendableBalanceRequest will return a spendable balance amount
endpointGetSpendableBalanceRequest = endpointWallet + "/spendableBalance"
// endpointGetPayRequest will create a new pay request
endpointGetPayRequest = endpointWallet + "/pay"
// endpointGetPaymentRequest will create a new payment request
endpointGetPaymentRequest = endpointWallet + "/payment"
)