Add payment queryInfo RPC (#1580)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user