Files
api/docs/api-format/README.md
T
Chevdor 0981a30d84 Add documentation and examples (#145)
* Add documentation

* Justification u8a decoding and json encoding (#146)

* Decode Justifications

* Json encoding for justifications

* Bump deps

* Allow extrinsic length encoding to operate on u8a[] (#148)

* Fix config and move generated doc to a subfolder

* Cleanup extrinsic encoding (#150)

* Cleanup extrinsic encoding

* Removed now-defunct type

* Add uncheckedLength encoding

* Add examples

* Ignore package-lock since we use yarn

* Cleanup examples

* Add gitbook config and some base files for the doc

* Do not make full doc mandatory for now

* Add contributing guide, polish doc and samples

* Update the deps of all samples and add yarn scripts
Fix and regenerate the doc

* Fix Contributing guide
2018-09-15 09:11:56 +02:00

3.8 KiB

polkadotjs isc style npm travis maintainability coverage dependency devDependency

@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