Documentation ¶
Index ¶
- Variables
- func PostAndSend(w http.ResponseWriter, r *http.Request, body string, payload io.Reader)
- func PostAndSendCA(w http.ResponseWriter, r *http.Request, body string, payload io.Reader)
- func PostRequestCA(body string, payload io.Reader) ([]byte, error)
- func StartServer(portx int, insecure bool)
- func ValidateSeedPwd(w http.ResponseWriter, r *http.Request, encryptedSeed []byte, ...) (string, error)
- type AnchorIntentResponse
- type CAResponse
- type GenAccessTokenReturn
- type GetAnchorResponse
- type KycResponse
- type OpensolarConstReturn
- type PlatformEmailResponse
- type SeedResponse
- type SnUser
- type TwoFAResponse
Constants ¶
This section is empty.
Variables ¶
var AdminRPC = map[int][]string{
1: {"/admin/kill", "POST", "nuke"},
2: {"/admin/freeze", "GET"},
3: {"/admin/gennuke", "POST"},
5: {"/admin/platform/all", "GET"},
6: {"/admin/list"},
7: {"/admin/platform/new", "POST", "name", "code", "timeout"},
8: {"/admin/sendmessage", "POST", "subject", "message", "recipient"},
9: {"/admin/getallusers", "GET"},
10: {"/admin/userverify", "POST", "index"},
11: {"/admin/userunverify", "POST", "index"},
}
AdminRPC is the list of all admin RPC endpoints
var AnchorRPC = map[int][]string{
1: {"/user/anchorusd/deposit/intent", "GET"},
2: {"/user/anchorusd/deposit/kyc", "GET"},
3: {"/user/anchorusd/withdraw/intent", "GET"},
4: {"/user/anchorusd/withdraw/kyc", "GET"},
5: {"/user/anchorusd/kycinfo", "GET"},
6: {"/user/anchorusd/kyc/register", "POST"},
}
AnchorRPC is a collection of all Anchor RPC endpoints and their required params
var CARPC = map[int][]string{
1: {"/user/ca/search", "name", "birthyear"},
2: {"/admin/ca/users/all"},
}
CARPC contains a list of all ComplyAdvantage related RPCs
var KillCode string
KillCode is a code that can immediately shut down the server in case of hacks / crises
var PlatformRPC = map[int][]string{
0: {"/platform/getconsts"},
1: {"/platform/user/retrieve", "key"},
2: {"/platform/user/validate", "username", "token"},
3: {"/platform/user/new", "username", "pwhash", "seedpwd", "email"},
4: {"/platform/user/collision", "username"},
5: {"/platforms/all"},
6: {"/platform/email", "body", "to"},
7: {"/platform/user/confirm", "username", "pwhash", "code"},
}
PlatformRPC is a map that stores all handlers related to the platform
var StablecoinRPC = map[int][]string{
1: {"/stablecoin/get", "GET", "seedpwd", "amount"},
2: {"/anchor/get", "GET"},
}
StablecoinRPC is a collection of all stablecoin RPC endpoints and their required params
var UserRPC = map[int][]string{
0: {"/token"},
1: {"/user/validate", "GET"},
2: {"/user/balances", "GET"},
3: {"/user/balance/xlm", "GET"},
4: {"/user/balance/asset", "GET", "asset"},
5: {"/ipfs/getdata", "GET", "hash"},
6: {"/user/kyc", "GET", "userIndex"},
7: {"/user/sendxlm", "GET", "destination", "amount", "seedpwd"},
8: {"/user/notkycview", "GET"},
9: {"/user/kycview", "GET"},
10: {"/user/askxlm", "GET"},
11: {"/user/trustasset", "GET", "assetCode", "assetIssuer", "limit", "seedpwd"},
12: {"/upload", "POST"},
13: {"/platformemail", "GET"},
17: {"/user/increasetrustlimit", "GET", "trust", "seedpwd"},
19: {"/user/sendrecovery", "GET", "email1", "email2", "email3"},
20: {"/user/seedrecovery", "GET", "secret1", "secret2"},
21: {"/user/newsecrets", "GET", "seedpwd", "email1", "email2", "email3"},
22: {"/user/resetpwd", "GET", "seedpwd", "email"},
23: {"/user/pwdreset", "GET", "pwhash", "email", "verificationCode"},
24: {"/user/sweep", "GET", "seedpwd", "destination"},
25: {"/user/sweepasset", "GET", "seedpwd", "destination", "assetName", "issuerPubkey"},
26: {"/user/verifykyc", "GET", "selfie"},
27: {"/user/giverating", "GET", "feedback", "userIndex"},
28: {"/user/2fa/generate", "GET"},
29: {"/user/2fa/authenticate", "GET", "password"},
31: {"/user/reputation", "GET", "reputation"},
32: {"/user/addseed", "GET", "encryptedseed", "seedpwd", "pubkey"},
33: {"/user/latestblockhash", "GET"},
34: {"/ipfs/putdata", "POST", "data"},
35: {"/user/tc", "POST"},
36: {"/user/progress", "POST", "progress"},
37: {"/user/update", "POST"},
38: {"/user/tellerfile", "GET"},
39: {"/user/logout", "POST"},
40: {"/user/verify", "POST"},
41: {"/user/unverify", "POST"},
30: {"/user/anchorusd/kyc", "GET", "name", "bdaymonth", "bdayday", "bdayyear", "taxcountry",
"taxid", "addrstreet", "addrcity", "addrpostal", "addrregion", "addrcountry", "addrphone", "primaryphone", "gender"},
}
UserRPC is a collection of all user RPC endpoints and their required params
Functions ¶
func PostAndSend ¶
PostAndSend is a handler that POSTs data and returns the response
func PostAndSendCA ¶
PostAndSendCA is a handler that POSTs data and returns the response
func PostRequestCA ¶
PostRequestCA is a handler that makes it easy to send out POST requests
func StartServer ¶
StartServer starts the server on the passed port and mode (http / https)
func ValidateSeedPwd ¶
func ValidateSeedPwd(w http.ResponseWriter, r *http.Request, encryptedSeed []byte, userPublickey string) (string, error)
ValidateSeedPwd validates only the seedpwd and not the username / pwhash
Types ¶
type AnchorIntentResponse ¶
type AnchorIntentResponse struct { Type string `json:"type"` URL string `json:"url"` Identifier string `json:"identifier"` }
AnchorIntentResponse defines the intent response struct for AnchorUSD
func GetAndReturnIdentifier ¶
func GetAndReturnIdentifier(w http.ResponseWriter, r *http.Request, body string) (AnchorIntentResponse, error)
GetAndReturnIdentifier is a handler that makes a get request and returns json data
type CAResponse ¶
type CAResponse struct { Code int `json:"code"` Status string `json:"string"` Content struct { Data struct { ID int64 `json:"id"` Ref string `json:"ref"` Searcherid int64 `json:"searcher_id"` Assigneeid int64 `json:"assignee_id"` Filters struct { Birthyear int64 `json:"birth_year"` Countrycodes []int `json:"country_codes"` Removedeceased int `json:"remove_deceased"` Types []string `json:"types"` Exactmatch bool `json:"exact_match"` Fuzziness float64 `json:"fuzziness"` } Matchstatus string `json:"match_status"` Risklevel string `json:"risk_level"` Searchterm string `json:"search_term"` Submittedterm string `json:"submitted_term"` Clientref string `json:"client_ref"` Totalhits int `json:"total_hits"` Updatedat string `json:"updated_at"` Createdat string `json:"created_at"` Tags []string `json:"tags"` Limit int `json:"limit"` Offset int `json:"offset"` Shareurl string `json:"share_url"` Hits []struct { Doc struct { Aka []struct { Name string `json:"name"` } `json:"aka"` Assets []struct { Publicurl string `json:"public_url"` Source string `json:"source"` Type string `json:"type"` } `json:"assets"` Entitytype string `json:"entity_type"` Fields []struct { Name string `json:"name"` Source string `json:"source"` Tag string `json:"tag"` Value string `json:"value"` } `json:"fields"` ID string Media []struct { Date string `json:"date"` Snippet string `json:"snippet"` Title string `json:"title"` URL string `json:"url"` } `json:"media"` Name string `json:"name"` Sources []string `json:"sources"` Types []string `json:"types"` } `json:"doc"` Matchtypes []string `json:"match_types"` Score float64 `json:"score"` Matchstatus string `json:"match_status"` Iswhitelisted bool `json:"is_whitelisted"` } `json:"hits"` } `json:"data"` } `json:"content"` }
CAResponse defines a struct that ComplyAdvantage returns
type GenAccessTokenReturn ¶
type GenAccessTokenReturn struct {
Token string
}
GenAccessTokenReturn is the struct defined for returning access tokens
type GetAnchorResponse ¶
type GetAnchorResponse struct {
Txhash string // this tx hash is for the sent xlm, not for the received anchorUSD
}
GetAnchorResponse is a wrapper around the txhash for sent XLM
type KycResponse ¶
type KycResponse struct { Status string // the status whether the kyc verification request was succcessful or not Reason string // the reason why the person was rejected (OFAC blacklist, sanctioned individual, etc) }
KycResponse is a wrapper around status and reason for KYC responses
type OpensolarConstReturn ¶
type OpensolarConstReturn struct { PlatformPublicKey string PlatformSeed string PlatformEmail string PlatformEmailPass string StablecoinCode string StablecoinPublicKey string AnchorUSDCode string AnchorUSDAddress string AnchorUSDTrustLimit float64 AnchorAPI string Mainnet bool DbDir string }
OpensolarConstReturn is a struct that can be used to export consts from openx
type PlatformEmailResponse ¶
type PlatformEmailResponse struct {
Email string
}
PlatformEmailResponse is a structure used to contain the platform's email response
type SeedResponse ¶
type SeedResponse struct {
Seed string
}
SeedResponse is a wrapper around the Seed
type TwoFAResponse ¶
type TwoFAResponse struct {
ImageData string
}
TwoFAResponse is a wrapper around the QRCode data