#1 2018-01-10 18:40:09

ertank
Member
Registered: 2016-03-16
Posts: 168

How to write record for that json?

Hello,

I have following json (cut to make it shorter):

{
	"BTC_BCN": {
		"id": 7,
		"last": "0.00000074",
		"lowestAsk": "0.00000075",
		"highestBid": "0.00000074",
		"percentChange": "-0.19565217",
		"baseVolume": "501.50839619",
		"quoteVolume": "628594122.91910744",
		"isFrozen": "0",
		"high24hr": "0.00000092",
		"low24hr": "0.00000070"
	},
	"BTC_BELA": {
		"id": 8,
		"last": "0.00003080",
		"lowestAsk": "0.00003123",
		"highestBid": "0.00003061",
		"percentChange": "-0.00996464",
		"baseVolume": "30.82899899",
		"quoteVolume": "986053.00991061",
		"isFrozen": "0",
		"high24hr": "0.00003287",
		"low24hr": "0.00002887"
	},
	"BTC_BLK": {
		"id": 10,
		"last": "0.00005982",
		"lowestAsk": "0.00005982",
		"highestBid": "0.00005951",
		"percentChange": "-0.04654128",
		"baseVolume": "37.08548659",
		"quoteVolume": "629307.51359707",
		"isFrozen": "0",
		"high24hr": "0.00006476",
		"low24hr": "0.00005539"
	}
}

I simply could not figure how I should be writing it's record(s). So far, I only put detail record and for master I simply stuck.

  Detail = packed record
    id: Integer;
    last: string;
    lowestAsk: string;
    highestBid: string;
    percentChange: string;
    baseVolume: string;
    quoteVolume: string;
    isFrozen: string;
    high24hr: string;
    low24hr: string;
  end;

  Main = packed record

  end;

Any help is appreciated.

Thanks
-Ertan

Offline

#2 2018-01-10 19:41:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: How to write record for that json?

Something like:

Main = packed record
      BTC_BCN, BTC_BELA, BTC_BLK: Detail;
  end;

Offline

#3 2018-01-10 20:07:37

ertank
Member
Registered: 2016-03-16
Posts: 168

Re: How to write record for that json?

So, I should write a record including everything in this json returning in below link is what I understand.

https://poloniex.com/public?command=returnTicker

Offline

#4 2018-01-11 12:26:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: How to write record for that json?

Indeed.

Offline

Board footer

Powered by FluxBB