From 4c7fbfce2577704ed8dd4dfb87b0c7f4396ce6c0 Mon Sep 17 00:00:00 2001 From: alsco77 Date: Tue, 25 Sep 2018 17:34:54 +1000 Subject: [PATCH] Updated client initialisation --- client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client.go b/client.go index e7422cd..92ffe7b 100644 --- a/client.go +++ b/client.go @@ -48,6 +48,17 @@ func New(network Network, APIKey string) *Client { } } +// NewG initialize a new etherscan API client for g cloud +// please use pre-defined network value +func NewG(network Network, APIKey string, httpC *http.Client) *Client { + return &Client{ + coon: httpC, + network: network, + key: APIKey, + baseURL: fmt.Sprintf(`https://%s.etherscan.io/api?`, network.SubDomain()), + } +} + // call does almost all the dirty work. func (c *Client) call(module, action string, param map[string]interface{}, outcome interface{}) (err error) { // fire hooks if in need