JSON-RPC interfaces with documentation (#4276)
* Extended Markdown generator * Synced and extended all JSON-RPC interfaces * Fix linter errors * Format `parity_listAccounts` output in API * typo
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { inAddress, inAddresses, inData, inHex, inNumber16, inOptions } from '../../format/input';
|
||||
import { inAddress, inAddresses, inData, inHex, inNumber16, inOptions, inBlockNumber } from '../../format/input';
|
||||
import { outAccountInfo, outAddress, outAddresses, outChainStatus, outHistogram, outNumber, outPeers, outTransaction } from '../../format/output';
|
||||
|
||||
export default class Parity {
|
||||
@@ -101,6 +101,11 @@ export default class Parity {
|
||||
.execute('parity_enode');
|
||||
}
|
||||
|
||||
encryptMessage (pubkey, data) {
|
||||
return this._transport
|
||||
.execute('parity_encryptMessage', inHex(pubkey), inHex(data));
|
||||
}
|
||||
|
||||
executeUpgrade () {
|
||||
return this._transport
|
||||
.execute('parity_executeUpgrade');
|
||||
@@ -111,6 +116,17 @@ export default class Parity {
|
||||
.execute('parity_extraData');
|
||||
}
|
||||
|
||||
futureTransactions () {
|
||||
return this._transport
|
||||
.execute('parity_futureTransactions');
|
||||
}
|
||||
|
||||
gasCeilTarget () {
|
||||
return this._transport
|
||||
.execute('parity_gasCeilTarget')
|
||||
.then(outNumber);
|
||||
}
|
||||
|
||||
gasFloorTarget () {
|
||||
return this._transport
|
||||
.execute('parity_gasFloorTarget')
|
||||
@@ -156,11 +172,22 @@ export default class Parity {
|
||||
.execute('parity_killAccount', inAddress(account), password);
|
||||
}
|
||||
|
||||
listAccounts (count, offset = null, blockNumber = 'latest') {
|
||||
return this._transport
|
||||
.execute('parity_listAccounts', count, inAddress(offset), inBlockNumber(blockNumber))
|
||||
.then((accounts) => (accounts || []).map(outAddress));
|
||||
}
|
||||
|
||||
listRecentDapps () {
|
||||
return this._transport
|
||||
.execute('parity_listRecentDapps');
|
||||
}
|
||||
|
||||
listStorageKeys (address, count, hash = null, blockNumber = 'latest') {
|
||||
return this._transport
|
||||
.execute('parity_listStorageKeys', inAddress(address), count, inHex(hash), inBlockNumber(blockNumber));
|
||||
}
|
||||
|
||||
removeAddress (address) {
|
||||
return this._transport
|
||||
.execute('parity_removeAddress', inAddress(address));
|
||||
@@ -311,16 +338,31 @@ export default class Parity {
|
||||
.execute('parity_setDappsAddresses', dappId, inAddresses(addresses));
|
||||
}
|
||||
|
||||
setEngineSigner (address, password) {
|
||||
return this._transport
|
||||
.execute('parity_setEngineSigner', inAddress(address), password);
|
||||
}
|
||||
|
||||
setExtraData (data) {
|
||||
return this._transport
|
||||
.execute('parity_setExtraData', inData(data));
|
||||
}
|
||||
|
||||
setGasCeilTarget (quantity) {
|
||||
return this._transport
|
||||
.execute('parity_setGasCeilTarget', inNumber16(quantity));
|
||||
}
|
||||
|
||||
setGasFloorTarget (quantity) {
|
||||
return this._transport
|
||||
.execute('parity_setGasFloorTarget', inNumber16(quantity));
|
||||
}
|
||||
|
||||
setMaxTransactionGas (quantity) {
|
||||
return this._transport
|
||||
.execute('parity_setMaxTransactionGas', inNumber16(quantity));
|
||||
}
|
||||
|
||||
setMinGasPrice (quantity) {
|
||||
return this._transport
|
||||
.execute('parity_setMinGasPrice', inNumber16(quantity));
|
||||
|
||||
Reference in New Issue
Block a user