@polkadot/api-format
Formatters that are used by the application API interface, taking care of transparently formatting parameters (inputs) and the results (output) for requests made over the client RPC interfaces.
Usage
Installation -
npm install --save @polkadot/api-format
Index
Type aliases
Functions
Type aliases
FormatterFunction
Ƭ FormatterFunction: function
Defined in types.d.ts:7
Type declaration
▸(value: any): any
Parameters:
| Param | Type |
|---|---|
| value | any |
Returns: any
Functions
echo
▸ echo(value: any): any
Defined in echo.ts:10
A function returning any value passed to it
Parameters:
| Param | Type | Description |
|---|---|---|
| value | any |
The input value |
Returns: any
The value passed as input
format
▸ format(formatters: FormattersFunctionMap, types: Array<Param$Types>, values: Array<any>): Array<any>
Defined in format.ts:49
Parameters:
| Param | Type |
|---|---|
| formatters | FormattersFunctionMap |
| types | Array<Param$Types> |
| values | Array<any> |
Returns: Array<any>
formatInputs
▸ formatInputs(params: Params, values: Array<any>): Array<any>
Defined in input.ts:22
Parameters:
| Param | Type |
|---|---|
| params | Params |
| values | Array<any> |
Returns: Array<any>
formatOutput
▸ formatOutput(type: Param$Types, value?: any): any | null
Defined in output.ts:30
Parameters:
| Param | Type |
|---|---|
| type | Param$Types |
Optional value |
any |
Returns: any | null