Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func DecodeOffer(datahex string) (map[string]interface{}) {
- responce, _ := rpcClient.Call("decoderawexchange", datahex)
- var d = make(map[string]interface{})
- err := responce.GetObject(&d)
- if err != nil || d == nil {
- panic(err)
- }
- return d
- }
- {
- "ask": {
- "amount": 0,
- "assets": [
- {
- "assetref": "74-266-27408",
- "name": "USD",
- "qty": 5000
- }
- ]
- },
- "cancomplete": true,
- "candisable": true,
- "complete": false,
- "offer": {
- "amount": 0,
- "assets": [
- {
- "assetref": "73-266-61482",
- "name": "BTC",
- "qty": 1
- }
- ]
- },
- "requiredfee": 0
- }
- type DecodedOffer struct {
- ask []Ask `json:"ask"`
- cancomplete bool `json:"cancomplete"`
- candisable bool `json:"candisable"`
- complete bool `json:"complete"`
- offer []Offer `json:"offer"`
- requiredfee int `json:"requiredfee"`
- }
- type Ask struct {
- ammount string `json:"ammount"`
- assets []Assets `json:"assets"`
- }
- type Offer struct {
- ammount string `json:"ammount"`
- assets []Assets `json:"assets"`
- }
- type Assets struct {
- assetref string `json:"ammount"`
- name string `json:"name"`
- qty float64 `json:"qty"`
- }
- var d = DecodedOffer{ask: make([]Ask, 0), offer: make([]Offer, 0)}
Add Comment
Please, Sign In to add comment