getBalance RPC 方法
返回提供的 Pubkey 所对应账户的 lamport 余额。
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getBalance",> "params": [> "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",> {> "commitment": "finalized"> }> ]> }> '
params
stringrequired
要查询账户的 Pubkey,使用 base-58 编码的字符串。
objectoptional
配置对象。
result
Response
{"jsonrpc": "2.0","result": {"context": { "slot": 1 },"value": 0},"id": 1}
u64
RpcResponse JSON 对象,其 value 字段设置为余额。
Is this page helpful?