npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

swyftxwrapper.js

v1.4.0

Published

A JavaScript wrapper for the Swyftx Cryptocurrency trading platform API

Downloads

0

Readme

swyftxwrapper.js

swyftxwrapper.js is a JavaScript wrapper for the Australian Cryptocurrency trading platform Swyftx's API.

Note

Please be aware, this package is still in development and does not currently support all endpoints, but it aims to in the near future.

Please scroll towards the bottom of this page to find a list of all of the currently supported endpoints.

If you're having trouble with some of the parameters for specific functions, you can refer to the Swyftx API docs. There is also a Method Reference page that has an ordering guide. All methods will be added to the reference soon.

Since the Swyftx API is still in beta, it is subject to change at any time and the documentation may not always be up to date. Due to this, some of the endpoints in this wrapper may break from time to time, but I aim to fix any breaking changes as quickly as I can. If you notice an issue, feel free to raise it on Github

stonks

Installation

npm install swyftxwrapper.js

Usage

To use the package, simply require it and instantiate with your API key. Make sure to generate an access token before making any calls.

In depth endpoint guide - Method Reference

const Swyftx = require("swyftxwrapper.js");

const swyftx = new Swyftx("YOUR_API_KEY");

const main = async () => {
  await swyftx.generateRefreshToken();

  //Make any calls to the API you'd like... for example
  const liteCoinData = await swyftx.getBasicInfo("LTC");
  console.log(liteCoinData);
}

main();

For DEMO use, simply set demo to true when instantiating the wrapper

const swyftx = Swyftx("YOUR_API_KEY", demo=true);

Rate Limiting - Turning on autoWaitOnRateLimit will cause the client to retry requests when rate limited until they go through.

const swyftx = Swytfy("YOUR_API_KEY", demo=false, autoWaitOnRateLimit=true)

Example Usage

Assuming wrapper has been instantiated as swyftx

For a comprehensive ordering guide, please click here

Change Profile Settings

const newProfileSettings = {
  "data": {
    "favouriteAsset": {
      "assetId": 3,
      "favStatus": true
    },
    "analyticsOptOut": true,
    "toggleSMSRecovery": true
  }
}

const response = await swyftx.setAccountSettings(newProfileSettings);
console.log(response);

Place a Market Buy Order

//NOTE that the default buy/sell currency is USD.

//Below is equivalent to 'buy $500 USD worth of Doge coin at the market price'
const response = await swyftx.instantBuy("DOGE", 500);

//To specify the amount in terms of the coin being bought and not fiat, set fiat=false
//Below is equivalent to 'buy 500 Doge coin at the market price'
const reponse = await swyftx.instantBuy("DOGE", 500, fiat=false);

Get Comparative CoinSpot Prices

const response = await swyftx.compareExchange("coinspot");
console.log(response);

Get Latest Messages From Inbox

const response = await swyftx.getLatestMessages(limit=100);
console.log(response);

Get Detailed Info About a Specific Coin

const response = await swyftx.getDetailedInfo("LTC");
console.log(response);

Endpoints Supported

Authentication

  • Refresh Access Token ✅
  • Logout ✅
  • Get Scope ✅
  • Get Keys ✅
  • Revoke Key ✅
  • Revoke All Keys ✅

Addresses

None of the Addresses endpoints are supported in the current version, though this may change in the future.

Account

  • Get Profile ✅
  • Account Settings ✅
  • Get Verification Info ✅
  • Get GreenId Verification Info ❌
  • Start Email Verification ✅
  • Check Email Verification Status ✅
  • Check Phone Verification Status
  • Start Phone Verification ✅
  • Get Affiliation Info ✅
  • Get Account Balances ✅
  • Set Currency ✅
  • Get Statistics ✅
  • Get Progress ✅
  • Get Promotions ✅
  • Get Tax Report ✅

Charts

  • Get Bar Chart ✅
  • Get Latest Bars ✅
  • Get Chart Settings ✅
  • Get Resolve Symbol ✅

Charts v2

Not included in the wrapper as this part of the API is deprecated.

Funds

  • Request Withdrawal ✅
  • Check Withdrawal Permissions ✅

History

  • Get Currency Withdraw History ✅
  • Get Currency Deposit History ✅
  • Get All Withdraw History ✅
  • Get All Deposit History ✅
  • Get History ✅
  • Get Affiliate Payout History ✅

Limits

  • Withdrawal Limits ✅

Markets

  • Get Live Rates ✅
  • Get Market Assets ✅
  • Get Basic Info ✅
  • Get Detailed Info ✅

Orders

  • Get Pair Exchange Rate ✅
  • Place Order ✅
  • Dust Order ✅
  • Cancel Order ✅
  • Get Orders ✅

Recurring Orders

  • Get Recurring Orders ✅
  • Get Recurring Order Stats ✅
  • Create Recurring Order ✅
  • Delete Recurring Order ✅

Compare

  • Get Comparison ✅

Messages

  • Get Latest Messages ✅
  • Get Latest Announcements ✅