Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func getLatestTxs() map[string]interface{}{} {
- fmt.Println("hello")
- resp, err := http.Get("http://api.etherscan.io/api?module=account&action=txlist&address=0x266ac31358d773af8278f625c4d4a35648953341&startblock=0&endblock=99999999&sort=asc&apikey=5UUVIZV5581ENPXKYWAUDGQTHI956A56MU")
- defer resp.Body.Close()
- body, _ := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Errorf("etherscan访问失败")
- }
- ret := map[string]interface{}{}
- json.Unmarshal(body, &ret)
- if ret["status"] == 1 {
- return ret["result"]
- }
- }
- func getLatestTxs() map[string]interface{} {
- fmt.Println("hello")
- resp, err := http.Get("http://api.etherscan.io/api?module=account&action=txlist&address=0x266ac31358d773af8278f625c4d4a35648953341&startblock=0&endblock=99999999&sort=asc&apikey=5UUVIZV5581ENPXKYWAUDGQTHI956A56MU")
- defer resp.Body.Close()
- body, _ := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Errorf("etherscan访问失败")
- }
- ret := map[string]interface{}{}
- json.Unmarshal(body, &ret)
- if ret["status"] == 1 {
- return ret
- }
- return ret
- }
- func getLatestTxs() interface{} {
- fmt.Println("hello")
- // function code .....
- //fmt.Println(ret["result"])
- return ret
- }
- ret.(map[string]interface{})
Add Comment
Please, Sign In to add comment