[CI Skip] 0.17.4

This commit is contained in:
Travis CI
2018-03-19 12:22:19 +00:00
parent ac501317af
commit dbfb7349cb
8 changed files with 32 additions and 14 deletions
+19 -1
View File
@@ -2,8 +2,26 @@
Convenience functions for values from @polkadot/api-jsonrpc
- [jsonrpcParam](#jsonrpcparam) Returns a string representation of the parameter name (optional) & type.
- [jsonrpcSignature](#jsonrpcsignature) Returns a string representation of the method with inputs and outputs.
## jsonrpcParam
Returns a string representation of the parameter name (optional) & type.
```js
jsonrpcParam (param: { name?: string, type: string }): string
```
Formats the name and type into a human-readable string.
```js
import { jsonrpcParam } from '@polkadot/util';
console.log(jsonrpcParam({ name: 'dest', type: 'Address' }); // => dest: Address
```
## jsonrpcSignature
Returns a string representation of the method with inputs and outputs.
@@ -20,5 +38,5 @@ import { jsonrpcSignature } from '@polkadot/util';
console.log(jsonrpcSignature(
'test_method', [{ name: 'dest', type: 'Address' }], { type: 'Address' }
)); // => test_method (destination: Address): Address
)); // => test_method (dest: Address): Address
```