1.0.0-alpha.42086419 • Published 7 years ago

@iota/http-client v1.0.0-alpha.42086419

Weekly downloads
489
License
MIT
Repository
github
Last release
7 years ago

@iota/http-client

Sends commands to IRI over HTTP. Allows to create a network provider compatible with functions in @iota/core.

Installation

Install using npm:

npm install @iota/http-client

or using yarn:

yarn add @iota/http-client

API Reference

http-client.send(command, uri, apiVersion)

Fulil: Object - Response
Reject: Error - Request error

ParamTypeDefault
commandCommand
uriStringhttp://localhost:14265
apiVersionString | Number1

Sends an http request to a specified host.

Returns: Promise

http-client~send

ParamType
commandobject

Returns: object - response

http-client~setSettings

ParamTypeDefaultDescription
settingsobject{}
settings.providerstring"http://localhost:14265"Uri of IRI node
settings.apiVersionstring | number1IOTA Api version to be sent as X-IOTA-API-Version header.
settings.requestBatchSizenumber1000Number of search values per request.

http-client~createHttpClient(settings)

ParamTypeDefaultDescription
settingsobject{}
settings.providerstring"http://localhost:14265"Uri of IRI node
settings.apiVersionstring | number1IOTA Api version to be sent as X-IOTA-API-Version header.
settings.requestBatchSizenumber1000Number of search values per request.

Create an http client to access IRI http API.

Returns: Object