Add payment queryInfo RPC (#1580)

This commit is contained in:
Jaco Greeff
2019-11-18 12:26:09 +01:00
committed by GitHub
parent dde7d49598
commit 75220eb54f
11 changed files with 79 additions and 6 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ const nextIndex: RpcMethodOpt = {
const section = 'account';
/**
* @summary Calls to retrieve system info.
* @summary Calls to account-specific information.
*/
export default {
isDeprecated: false,
+2
View File
@@ -8,6 +8,7 @@ import account from './account';
import author from './author';
import chain from './chain';
import contracts from './contracts';
import payment from './payment';
import rpc from './rpc';
import state from './state';
import system from './system';
@@ -17,6 +18,7 @@ const interfaces: Record<string, RpcSection> = {
author,
chain,
contracts,
payment,
rpc,
state,
system
+34
View File
@@ -0,0 +1,34 @@
// Copyright 2017-2019 @polkadot/jsonrpc authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { RpcMethodOpt } from './types';
import createMethod from './create/method';
import createParam from './create/param';
// NOTE order here is the same as in Rust, alphabetical below
const queryInfo: RpcMethodOpt = {
description: 'Retrieves the fee information for an encoded extrinsic',
params: [
createParam('extrinsic', 'Bytes'),
createParam('hash', 'Hash', { isOptional: true })
],
type: 'RuntimeDispatchInfo'
};
const section = 'payment';
/**
* @summary Calls to retrieve payment information.
*/
export default {
isDeprecated: false,
isHidden: false,
description: 'Methods that retrieves payment information, e.g. fee calculations',
section,
methods: {
queryInfo: createMethod(section, 'queryInfo', queryInfo)
}
};