RPC Methods¶
Description¶
We require that the clients interact via JSON RPC. Here we provide a list of available RPC methods that the client MUST implement.
Methods¶
pg_accounts¶
Description¶
Returns the list accounts in the client’s wallet.
Returns¶
string[]
: List of addresses owned by the client.
pg_blockNumber¶
Description¶
Returns the current plasma block number.
Returns¶
number
: Current plasma block number.
pg_sign¶
Description¶
Signs a message with the private key of a specified account.
Parameters¶
account
-string
: Address of the account to sign with.message
-string
: Message to sign.
Returns¶
string
: Signature over the given message.
pg_sendRawTransaction¶
Description¶
Sends a transaction to the client. If the client is not the operator, the transaction will be forwarded to the operator.
Parameters¶
transaction
-string
: Properly encoded transaction to send to the operator.
Returns¶
string
: Receipt for the transaction.
pg_sendQuery¶
Description¶
Sends a state query to the client.
Parameters¶
query
-StateQuery
: A StateQuery object.
Returns¶
any[]
: Result of the state query. Returns one query result for each state object that intersected with the range specified in the StateQuery
.
pg_getTransactionByHash¶
Description¶
Returns a full transaction from a transaction hash.
Parameters¶
hash
-string
: Hash of the transaction to query.
Returns¶
Transaction
: The Transaction object with the given hash.
pg_getProof¶
Description¶
Returns a history proof for a given range.
Parameters¶
query
-HistoryQuery
: A HistoryQuery object.
Returns¶
HistoryProof
: A HistoryProof composed of a list of proof elements that can be ingested.
pg_getInstalledPredicatePlugins¶
Description¶
Returns the list of predicates installed by the client.
Returns¶
string[]
: Address of each predicate for which the client has an installed plugin.