[CI Skip] 0.17.4
This commit is contained in:
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user