Skip to content

Commit

Permalink
Merge pull request #25 from SynapseFI/CF-571
Browse files Browse the repository at this point in the history
feat: get calls for user doc, entity, node types etc. CF-571
  • Loading branch information
sheilf-synapse authored Nov 29, 2022
2 parents 21ef5fa + 8398b9b commit ac738f2
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Instantiate client
"FINGERPRINT",
)
Examples
# Examples
Enable logging & turn off developer mode (developer mode is true by default)
Expand Down Expand Up @@ -69,7 +69,6 @@ Submit optional query parameters
params := "per_page=3&page=2"
data, err := client.GetUsers(params)
*/
package synapse

Expand Down Expand Up @@ -161,10 +160,10 @@ func (c *Client) GetPublicKey(scope ...string) (map[string]interface{}, error) {
}

qp := []string{"issue_public_key=YES&scope=" + defaultScope}

if len(scope) > 1 {
userId := scope[1]
qp[0] += "&user_id=" + userId
qp[0] += "&user_id=" + userId
}

return c.do("GET", url, "", qp)
Expand All @@ -190,6 +189,14 @@ func (c *Client) GetTradeMarketData(tickerSymbol string) (map[string]interface{}
return c.do("GET", url, "", ts)
}

// GetNodeTypes returns available node types
func (c *Client) GetNodeTypes() (map[string]interface{}, error) {
log.info("========== GET NODE TYPES ==========")
url := buildURL(path["nodes"], "types")

return c.do("GET", url, "", nil)
}

/********** OTHER **********/

// GetCryptoMarketData returns market data for cryptocurrencies
Expand Down Expand Up @@ -340,3 +347,27 @@ func (c *Client) CreateUser(data, fingerprint, ipAddress string, idempotencyKey

return &user, err
}

// GetUserDocumentTypes returns available user document types
func (c *Client) GetUserDocumentTypes() (map[string]interface{}, error) {
log.info("========== GET USER DOCUMENT TYPES ==========")
url := buildURL(path["users"], "document-types")

return c.do("GET", url, "", nil)
}

// GetUserEntityTypes returns available user entity types
func (c *Client) GetUserEntityTypes() (map[string]interface{}, error) {
log.info("========== GET USER ENTITY TYPES ==========")
url := buildURL(path["users"], "entity-types")

return c.do("GET", url, "", nil)
}

// GetUserEntityScopes returns available user entity scopes
func (c *Client) GetUserEntityScopes() (map[string]interface{}, error) {
log.info("========== GET USER ENTITY TYPES ==========")
url := buildURL(path["users"], "entity-scopes")

return c.do("GET", url, "", nil)
}

0 comments on commit ac738f2

Please sign in to comment.