ledger

Retrieve information about the public ledger.

Parameters

Field

Type

Description

ledger_hash

String

(Optional) A 20-byte hex string for the ledger version to use. (See Specifying Ledgers).

ledger_index

String or Unsigned Integer

(Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers)

full

Boolean

(Optional) Admin required If true, return full information on the entire ledger. Ignored if you did not specify a ledger version. Defaults to false. (Equivalent to enabling transactions, accounts, and expand.) Caution: This is a very large amount of data -- on the order of several hundred megabytes!

accounts

Boolean

(Optional) Admin required. If true, return information on accounts in the ledger. Ignored if you did not specify a ledger version. Defaults to false. Caution: This returns a very large amount of data!

transactions

Boolean

(Optional) If true, return information on transactions in the specified ledger version. Defaults to false. Ignored if you did not specify a ledger version.

expand

Boolean

(Optional) Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to false. Ignored unless you request transactions, accounts, or both.

owner_funds

Boolean

(Optional) If true, include owner_funds field in the metadata of OfferCreate transactions in the response. Defaults to false. Ignored unless transactions are included and expand is true.

binary

Boolean

(Optional) If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.

queue

Boolean

(Optional) If true, and the command is requesting the current ledger, includes an array of queued transactions in the results.

Returns

Information about the public ledger

Example

//Request
curl -H 'Content-Type: application/json' -d '{"method":"ledger","params":[{"ledger_index":"validated","full":false,"accounts":false,"transactions":false,"expand":false,"owner_funds":false}]}' http://<your-app-id>.ankr.com
//Response
{
"id": 14,
"result": {
"ledger": {
"accepted": true,
"account_hash": "96C790B1B8A90B5FBD957A8D600B3A52AB42F55F520AB36C05E56E98EF37797B",
"close_flags": 0,
"close_time": 661326740,
"close_time_human": "2020-Dec-15 05:52:20.000000000 UTC",
"close_time_resolution": 10,
"closed": true,
"hash": "098863ABCFB9AD65527980E991B2A9772040E628CB6064D0F2EE3453487C4BEC",
"ledger_hash": "098863ABCFB9AD65527980E991B2A9772040E628CB6064D0F2EE3453487C4BEC",
"ledger_index": "60228439",
"parent_close_time": 661326731,
"parent_hash": "0F82B614CF017C4E0E3FB274B87D1B719C25B4D89B5506751DE6DC6BC97FDA5C",
"seqNum": "60228439",
"totalCoins": "99990816547566000",
"total_coins": "99990816547566000",
"transaction_hash": "03BD2652622AE332DFF577A05D7BDC3362EFEB6AE48DD49FAB5B6F750815D620"
},
"ledger_hash": "098863ABCFB9AD65527980E991B2A9772040E628CB6064D0F2EE3453487C4BEC",
"ledger_index": 60228439,
"validated": true
},
"status": "success",
"type": "response"
}