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

  1. account - string: Address of the account to sign with.
  2. 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

  1. 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

  1. 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

  1. 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

  1. 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.


pg_clientVersion

Description

Returns the name and version of the client.

Returns

string: Version and name of the client in the form <name>/<version>/<os>.