⚡ We welcome businesses to test our enterprise-grade service

Method: POST ledger

dropdown

方法 RPC ledger 例如 XRP

POST ledger

检索有关公共分类帐的信息。

Parameters

ledger_hash - 细绳

(可选)供分类帐版本使用的 20 字节十六进制字符串。

ledger_index - 字符串或无符号整数

(可选)要使用的分类帐的分类帐索引,或用于自动选择分类帐的快捷字符串。

account - 细绳

帐户的唯一标识符,通常是帐户的地址。

该请求返回此帐户是频道所有者/来源的频道。

transactions - 布尔值

(可选)如果为 true,则包含一系列建议的交易,作为 JSON 对象,您可以签名并提交以解决问题。默认为假。

expand - 布尔值

(可选)为交易/帐户信息提供完整的 JSON 格式信息,而不仅仅是散列。

默认为假。除非您请求交易、帐户或两者,否则忽略。

owner_funds - 布尔值

(可选)如果为 true,则在响应中的 OfferCreate 交易的元数据中包含 owner_funds 字段。

默认为假。除非包含交易且 expand 为真,否则忽略。

binary - 布尔值

(可选)如果为true,且transactions和expand都为true,则以二进制格式(十六进制字符串)而不是JSON格式返回交易信息。

queue - 布尔值

(可选)如果为 true,并且该命令正在请求当前分类帐,则在结果中包含排队交易的数组。

Request

curl --location --request POST 'https://xrp.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "ledger",
"params": [{"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"}],
"id": "getblock.io"}'


Response

{
    "result": {
        "closed": {
            "ledger": {
                "accepted": true,
                "account_hash": "39BF0510635E17CE7A19B14813558818DF398D48930F6AE8BBDBB9143B2BFF5F",
                "close_flags": 0,
                "close_time": 674581032,
                "close_time_human": "2021-May-17 15:37:12.000000000 UTC",
                "close_time_resolution": 10,
                "closed": true,
                "hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "ledger_hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "ledger_index": "63632029",
                "parent_close_time": 674581031,
                "parent_hash": "ED4061A556FDBDD78AAE685C5E4C0BA02A8827E77BE9CD21142F6B4AB9D6828D",
                "seqNum": "63632029",
                "totalCoins": "99990418267097571",
                "total_coins": "99990418267097571",
                "transaction_hash": "67FD5590C4D59835BAD515633365690C28BABF91A262E53BE45DE6B0D8674558"
            }
        },
        "open": {
            "ledger": {
                "closed": false,
                "ledger_index": "63632030",
                "parent_hash": "3A0B41C31B13436610C5961E2C914529CAD3CCC4A7859ED6AABFCD0700847BC1",
                "seqNum": "63632030"
            }
        },
        "status": "success"
    }
}