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

node-coinfield-api

v0.2.3

Published

This project is designed to help you make your own projects that interact with the Coinfield API. This project seeks to have complete API coverage including private calls and Websocket.

Downloads

4

Readme

Node Coinfield API

This project is designed to help you make your own projects that interact with the Coinfield API. This project seeks to have complete API coverage including private calls and Websocket.

Coinfield

I would like to point out that this is an unofficial script as Coinfield doesn't provide anything else than their REST and SocketIO API

📓 Documentation

In an attempt to keep this Readme short and sweet, you can find a few examples on how to use Node Coinfield API below but refer to your IDE Intellisense for the complete list of calls. If you use JS instead of TS, make sure to not call any private property or method (starting with an underscore '_') to avoid unwanted behavior. All the examples below are using the await syntax but most methods and properties return a Promise so you can go with .then() syntax if you prefer.

💻 Installation

npm i node-coinfield-api --save

📜 Getting Started

Typescript

import {Coinfield} from 'node-coinfield-api';
const cf = newCoinfield(YOURAPIKEY:string,verbone:boolean)

Javascript

const Coinfield = require('node-coinfield-api').Coinfield;
const cf = new Coinfield(YOURAPIKEY:string,verbose:boolean);

REST API

Getting Server Status
await cf.status();
Get all available markets
await cf.markets();

Websocket

Subscribe to Tickers

cf.socket.subscribe.tickers();
cf.socket.listener.on('tickers',(tickers)=>{
    //Do whatever you want with the tickers here
})

Subscribe to specific market Orderbook

cf.socket.subscribe.market('xrpcad')
cf.socket.listener.on('orderbook_updates__xrpcad',(ob)=>{
    //Do whatever you want with the orderbook here
})

Subscribe to specific market trades

cf.socket.subscribe.market('xrpcad')
cf.socket.listener.on('trades_updates__xrpcad',(trades)=>{
    //Do whatever you want with the trades here
})

Development

At this point in time, implementation of the public and private calls to the REST API is completed as well as the implementation of the Websocket API. Therefore, at this point, the development will go towards optimization, fixing issues when they come and keeping the code up-to-date should Coinfield decide to update their API.

Update 2020/12/17 I've updated the API Wrapper, now compatible with Typescript, code is cleaner nad more documented. Coinfield made several changes to their API you should be aware of if you intend to contribute on this project. You should head to the Notes about vanilla API section below for more details.

☕ Keep a fellow Developer hydrated

XRPXRP: rptgFJ9E1SFMTSGQfrZWVDM6Pf5P5Ui2uk XRPETH: 0x821d8D60d43229fBFD6fcD5aD97450D1A164547f BTCBTC: 17NwZQ86HswwHLEDfBkhu6kZUoUZy4CGSG

Notes about vanilla API

Lots of comments, limitations and parameters of this wrapper differs from Coinfield API because their documentation is outdated. The error field is being deprecated. Must now use alerts Orderbook limits must now be one of these values : 1,20,50,100,150 or 200 Account endpoint now provides very sensitive information. Use carefully.

  account:{
    uid: string
    email: string,
    level: number,
    role: string,
    tz: string,
    time_zone: string,
    base_cid: string,
    base_currency: string,
    generate_account_statements: boolean,
    account_statements_enabled: boolean,
    trading_discounts_enabled: boolean,
    registration_source: string,
    referrer_uid: string|null,
    mfa_enabled: boolean,
    otp: boolean,
    terms_version: number,
    primary_terms_version: number,
    atp_terms_version: number,
    phones: {number:string}[],
    current_sign_in_ip: string,
    current_sign_in_at: string,
    last_sign_in_ip: string
    last_sign_in_at: string,
    profile: {
      status: string,
      first_name: string,
      middle_name: string,
      last_name: string,
      first_last_name: string,
      second_last_name: string,
      international_full_name: string,
      name_suffix: string,
      birthdate: string,
      gender: string,
      nationality: string,
      country: string,
      uniform_territory: any,
      address: string,
      address_line_1: string,
      address_line_2: string,
      territory: string,
      city: string,
      postcode: string,
      occupation: string,
      job_title: string,
      proof_of_address_type: string,
      proof_of_address_document: string,
      trading_skills_level: string,
      estimated_trading_volume_per_month: string,
      source_of_funds_type_type: string,
      source_of_funds_description: string,
      purpose_of_the_account: any,
      representing_someone_else: any,
      politically_exposed_person: any,
      level_6_application_submitted_at: any,
      level_6_application_method: any
    },
    documents: {type:string,number:string,expiry:string|null,date:string|null, url:string}[]
  },
  timestamp: string,
  took: string

Order enpoint actually doesn't return a trades array nor a price property nor a market property. It is unclear why the changes are not documented and you shouldn't worry about this if you plan to use this API Wrapper but if you plan on contributing or editing the source by yourself, it should be considered.

HitCount