Socket
Socket
Sign inDemoInstall

joyso

Package Overview
Dependencies
98
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

samples/test.js

4

CHANGELOG.md
# Change Log
## v0.1.1 / 2018-09-25
### Fixed
- package.json
## v0.1.0 / 2018-09-20
### Added
- create project

4

package.json
{
"name": "joyso",
"version": "0.1.0",
"version": "0.1.1",
"description": "JOYSO API client library for trading.",
"main": "src/client.js",
"main": "src/joyso.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

@@ -12,6 +12,6 @@ # JOYSO

```JavaScript
const Joyso = require('joyso-api');
const Joyso = require('joyso');
async function start() {
const client = new Joyso({
const joyso = new Joyso({
// your private key

@@ -21,3 +21,3 @@ key: '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'

await client.connect();
await joyso.connect();
}

@@ -30,3 +30,3 @@

```JavaScript
client.subscribeOrderBook('ETH_JOY', orderBook => {
joyso.subscribeOrderBook('ETH_JOY', orderBook => {
console.log(JSON.stringify(orderBook));

@@ -65,3 +65,3 @@ });

```JavaScript
client.subscribeTrades('ETH_JOY', trades => {
joyso.subscribeTrades('ETH_JOY', trades => {
console.log(JSON.stringify(trades.slice(0, 2)));

@@ -94,3 +94,3 @@ });

```JavaScript
client.subscribeBalances(balances => {
joyso.subscribeBalances(balances => {
console.log(JSON.stringify(balances));

@@ -117,3 +117,3 @@ });

```JavaScript
client.subscribeOrders(orders => {
joyso.subscribeOrders(orders => {
console.log(JSON.stringify(orders));

@@ -151,3 +151,3 @@ });

```JavaScript
client.subscribeMyTrades(trades => {
joyso.subscribeMyTrades(trades => {
console.log(JSON.stringify(trades.slice(0, 2)));

@@ -190,3 +190,3 @@ });

```JavaScript
client.subscribeFunds(funds => {
joyso.subscribeFunds(funds => {
console.log(JSON.stringify(funds));

@@ -232,3 +232,3 @@ });

try {
let order = await client.buy({
let order = await joyso.buy({
pair: 'ETH_JOY',

@@ -275,3 +275,3 @@ price: '0.000123481',

```JavaScript
let order = await client.sell({
let order = await joyso.sell({
pair: 'ETH_JOY',

@@ -286,5 +286,5 @@ price: '0.000123481',

### trade({ pair, price, amount, fee, side })
Place selling order
Place order
```JavaScript
let order = await client.trade({
let order = await joyso.trade({
side: 'buy',

@@ -304,5 +304,5 @@ pair: 'ETH_JOY',

### withdraw({ token, amount, fee })
Place selling order
Withdraw
```JavaScript
await client.withdraw({
await joyso.withdraw({
token: 'ETH',

@@ -309,0 +309,0 @@ amount: 0.01,

const Joyso = require('../src/joyso');
async function start() {
const client = new Joyso({
const joyso = new Joyso({
// your private key

@@ -9,6 +9,6 @@ key: '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'

await client.connect();
await joyso.connect();
// subscribe order book, notify if change
client.subscribeOrderBook('ETH_JOY', orderBook => {
joyso.subscribeOrderBook('ETH_JOY', orderBook => {
console.log(JSON.stringify(orderBook));

@@ -18,3 +18,3 @@ });

// subscribe market trades, notify if change
client.subscribeTrades('ETH_JOY', trades => {
joyso.subscribeTrades('ETH_JOY', trades => {
console.log(JSON.stringify(trades.slice(0, 5)));

@@ -24,3 +24,3 @@ });

// subscribe balances, notify if change
client.subscribeBalances(balances => {
joyso.subscribeBalances(balances => {
console.log(JSON.stringify(balances));

@@ -30,3 +30,3 @@ });

// subscribe open orders, notify if change
client.subscribeOrders(orders => {
joyso.subscribeOrders(orders => {
console.log(JSON.stringify(orders));

@@ -36,3 +36,3 @@ });

// subscribe my trades, notify if change
client.subscribeMyTrades(trades => {
joyso.subscribeMyTrades(trades => {
console.log(JSON.stringify(trades));

@@ -42,3 +42,3 @@ });

// subscribe funds, notify if change
client.subscribeFunds(funds => {
joyso.subscribeFunds(funds => {
console.log(JSON.stringify(funds));

@@ -51,3 +51,3 @@ });

// place buying order
order = await client.buy({
order = await joyso.buy({
pair: 'ETH_JOY',

@@ -60,3 +60,3 @@ price: '0.000123481',

// place selling order
order = await client.sell({
order = await joyso.sell({
pair: 'ETH_JOY',

@@ -69,3 +69,3 @@ price: '0.000123481',

// or place order by trade with side
order = await client.trade({
order = await joyso.trade({
side: 'buy',

@@ -79,6 +79,6 @@ pair: 'ETH_JOY',

// cancel order
await client.cancel(363);
await joyso.cancel(363);
// withdraw
await client.withdraw({
await joyso.withdraw({
token: 'ETH',

@@ -85,0 +85,0 @@ amount: 0.01,

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc