Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysterium-tequilapi

Package Overview
Dependencies
Maintainers
5
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysterium-tequilapi

Api library to control mysterium client and node

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126
increased by240.54%
Maintainers
5
Weekly downloads
 
Created
Source

Mysterium Tequilapi

npm version

a library to control mysterium_client and myst from mysteriumnetwork/node

Installation

npm i mysterium-tequilapi

Usage

ES6 module
import TequilapiClientFactory, { TEQUILAPI_URL } from 'mysterium-tequilapi'
const factory = new TequilapiClientFactory(TEQUILAPI_URL)
const client = factory.build(factory.buildAdapter())
client.identitiesList().then((identities) => {
  console.log(identities)
})

Output:

{"identities":[{"id":"0xf2732f2100d19d74b1b5484037ebf6c13736d1bc"}]}
node.js require syntax
const Tequilapi = require("mysterium-tequilapi")
const factory = new Tequilapi.default(Tequilapi.TEQUILAPI_URL)
const client = factory.build(factory.buildAdapter())

client.healthCheck().then((res) => {
  console.log(res)
})

Output:

{ "uptime":"75h23m14.658120675s",
  "process":19857,
  "version":"0.2.3",
  "buildInfo": {
    "commit":"91840225277923a61de2bf5683a24532ee638559",
    "branch":"0.2.3",
    "buildNumber":"1389"
  }
}

Client object fulfills the following interface:

interface TequilapiClient {
  healthCheck (timeout: ?number): Promise<NodeHealthcheckDTO>,
  stop (): Promise<void>,

  identitiesList (): Promise<Array<IdentityDTO>>,
  identityCreate (passphrase: string): Promise<IdentityDTO>,
  identityUnlock (id: string, passphrase: string): Promise<void>,
  identityRegistration (id: string): Promise<IdentityRegistrationDTO>,

  findProposals (query: ?ProposalsQuery): Promise<Array<ProposalDTO>>,

  connectionCreate (request: ConnectionRequest, timeout: ?number): Promise<ConnectionStatusDTO>,
  connectionStatus (): Promise<ConnectionStatusDTO>,
  connectionCancel (): Promise<void>,
  connectionIP (timeout: ?number): Promise<ConnectionIPDTO>,
  connectionStatistics (): Promise<ConnectionStatisticsDTO>,
  location (timeout: ?number): Promise<ConsumerLocationDTO>
}

Contribution

Run CI checks:

npm run ci

After modifying TS files run:

npm run prepack && npm run generate:flow

Docs

API docs are available tequilapi.mysterium.network

Authors

Keywords

FAQs

Package last updated on 05 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc