accountSubscribe RPC-methode
Abonneer je op een account om meldingen te ontvangen wanneer de lamports of gegevens voor een bepaalde account public key veranderen
{"jsonrpc": "2.0","id": 1,"method": "accountSubscribe","params": ["CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12",{"encoding": "jsonParsed","commitment": "finalized"}]}
params
stringrequired
Account pubkey, als base-58 gecodeerde string
objectoptional
Configuratieobject met de volgende velden:
result
Response
{"jsonrpc": "2.0","result": 23784,"id": 1}
number
Abonnement-id (nodig om het abonnement op te zeggen)
Meldingsformaat:
Het notificatieformaat is hetzelfde als te zien in de getAccountInfo RPC HTTP-methode.
Base58-codering:
{"jsonrpc": "2.0","method": "accountNotification","params": {"result": {"context": {"slot": 5199307},"value": {"data": ["11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR","base58"],"executable": false,"lamports": 33594,"owner": "11111111111111111111111111111111","rentEpoch": 635,"space": 80}},"subscription": 23784}}
Parsed-JSON-codering:
{"jsonrpc": "2.0","method": "accountNotification","params": {"result": {"context": {"slot": 5199307},"value": {"data": {"program": "nonce","parsed": {"type": "initialized","info": {"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX","blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k","feeCalculator": {"lamportsPerSignature": 5000}}}},"executable": false,"lamports": 33594,"owner": "11111111111111111111111111111111","rentEpoch": 635,"space": 80}},"subscription": 23784}}
Is this page helpful?