switcheo-js
TypeScript icon, indicating that this package has built-in type declarations

1.3.10 • Public • Published

Switcheo JS

npm

Switcheo JS is a Javascript client library for interfacing with the Switcheo Exchange API.

As the library is written in TypeScript, TypeScript annotations are available by default.

Usage

Getting started

Import the Client object to call any available Switcheo API endpoint:

import { Client, Network } from 'switcheo-js'

const switcheo: Client = new Client({ net: Network.TestNet })

const pairs: Pairs = switcheo.listPairs()

An alternative way of accessing the functions is through the lower level api and Config objects:

import { Account, api, Config, Network } from 'switcheo-js'

const config: Config = new Config({ net: Network.TestNet, source: 'my-api' })
const params: CreateOrderParams = { ... }
const account: Account = new Account(...)

const order: Order = await api.orders.make(config, account, params)

Development

  • yarn build: "Clean and rebuild the project",
  • yarn lint: "Lint the project",
  • yarn test: "Lint and unit test the project",
  • yarn reset: "Delete all untracked files and reset the repo to the last commit",
  • yarn prepare-release: "One-step: clean, build, test, publish docs, and prep a release"

NOTE: "prepare": "yarn run build", is needed for projects targeting this lib as a git repo

Readme

Keywords

none

Package Sidebar

Install

npm i switcheo-js

Weekly Downloads

9

Version

1.3.10

License

MIT

Unpacked Size

1.15 MB

Total Files

518

Last publish

Collaborators

  • ravenxce
  • holyxiaoxin
  • henrychuahb
  • johnwong_switcheo
  • leeyikjiun
  • poopc