Package Exports
- mysterium-vpn-js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mysterium-vpn-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mysterium-vpn-js
Javascript SDK for mysteriumnetwork/node
Installation
npm i mysterium-tequilapiUsage
ES6 module
import TequilapiClientFactory, { TEQUILAPI_URL } from 'mysterium-vpn-js'
const factory = new TequilapiClientFactory(TEQUILAPI_URL)
const client = factory.build(factory.buildAdapter())
client.identityList().then((identities) => {
console.log(identities)
})Output:
{"identities":[{"id":"0xf2732f2100d19d74b1b5484037ebf6c13736d1bc"}]}Node.js require syntax
const Tequilapi = require("mysterium-vpn-js")
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<NodeHealthcheck>,
stop (): Promise<void>,
identityList (): Promise<Array<Identity>>,
identityCreate (passphrase: string): Promise<Identity>,
identityUnlock (id: string, passphrase: string): Promise<void>,
identityRegistration (id: string): Promise<IdentityRegistration>,
findProposals (query: ?ProposalQuery): Promise<Array<Proposal>>,
connectionCreate (request: ConnectionRequest, timeout: ?number): Promise<ConnectionStatusResponse>,
connectionStatus (): Promise<ConnectionStatusResponse>,
connectionCancel (): Promise<void>,
connectionIp (timeout: ?number): Promise<ConnectionIp>,
connectionStatistics (): Promise<ConnectionStatistics>,
location (timeout: ?number): Promise<ConsumerLocation>
}Contributing
- Run CI build:
yarn ci