daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func DecodeOffer(datahex string) (map[string]interface{})   {
  2.     responce, _ := rpcClient.Call("decoderawexchange", datahex)
  3.     var d = make(map[string]interface{})
  4.     err := responce.GetObject(&d)
  5.     if err != nil || d == nil {
  6.     panic(err)
  7.     }
  8.  
  9.     return d
  10. }
  11.    
  12. {
  13.   "ask": {
  14.   "amount": 0,
  15.   "assets": [
  16.     {
  17.       "assetref": "74-266-27408",
  18.       "name": "USD",
  19.       "qty": 5000
  20.     }
  21.   ]
  22.   },
  23.   "cancomplete": true,
  24.   "candisable": true,
  25.   "complete": false,
  26.   "offer": {
  27.   "amount": 0,
  28.   "assets": [
  29.     {
  30.       "assetref": "73-266-61482",
  31.       "name": "BTC",
  32.       "qty": 1
  33.     }
  34.   ]
  35.   },
  36.   "requiredfee": 0
  37. }
  38.    
  39. type DecodedOffer struct {
  40.     ask []Ask `json:"ask"`
  41.     cancomplete bool `json:"cancomplete"`
  42.     candisable bool `json:"candisable"`
  43.     complete bool `json:"complete"`
  44.     offer []Offer `json:"offer"`
  45.     requiredfee int `json:"requiredfee"`
  46. }
  47.  
  48. type Ask struct {
  49.     ammount string `json:"ammount"`
  50.     assets []Assets `json:"assets"`
  51. }
  52.  
  53. type Offer struct {
  54.     ammount string `json:"ammount"`
  55.     assets []Assets `json:"assets"`
  56. }
  57.  
  58. type Assets struct {
  59.     assetref string `json:"ammount"`
  60.     name string `json:"name"`
  61.     qty float64 `json:"qty"`
  62. }
  63.    
  64. var d = DecodedOffer{ask: make([]Ask, 0), offer: make([]Offer, 0)}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top