GithubHelp home page GithubHelp logo

lucianopierdona / alunajs Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.12 MB

Standardizing Crypto Trading APIs across multiple exchanges.

License: MIT License

Shell 0.01% JavaScript 0.04% TypeScript 99.94%

alunajs's Introduction

AlunaJS

171418581-c760f68c-efd9-4505-922e-bda2a7ab17c3

Install

npm install alunajs

Usage

import {
  aluna,
  IAlunaCredentialsSchema,
  IAlunaSettingsSchema,
} from 'alunajs'



const settings: IAlunaSettingsSchema = {
  // disableCache?: boolean,
  // cacheTtlInSeconds?: number,
  // disableCache?: boolean,
  // affiliateCode?: string,
  // orderAnnotation?: string,
  // referralCode?: string,
  // proxySettings?: IAlunaProxySchema,
  mappings: { XBT: 'BTC' },
}

const credentials: IAlunaCredentialsSchema = {
  key: 'xxx',,
  secret: 'yyy',
  // passphrase: 'zzz',
}



// —— public instance
const exchangePublic = aluna('bitfinex', { settings })

console.log(exchangePublic.specs)

apiPublic.symbol.list()
apiPublic.market.list()



// —— authed instance (`credentials` required)
const exchangeAuthed = aluna('bitfinex', {
  settings,
  credentials, // <- here
})

apiAuthed.key.fetchDetails()

apiAuthed.balance.list({ ... })
apiAuthed.balance.getTradableBalance({ ... })

apiAuthed.order.list({ ... })
apiAuthed.order.place({ ... })
apiAuthed.order.edit({ ... })
apiAuthed.order.cancel({ ... })

apiAuthed.position.list({ ... })
apiAuthed.position.setLeverage({ ... })
apiAuthed.position.close({ ... })

Web3

import {
  aluna,
  Web3ChainsEnum,
} from 'alunajs'

const web3 = aluna.web3(/* settings?: IAlunaSettings */)

const web3Address = '0xA8...'
const chainId = Web3ChainsEnum.ETHEREUM

web3.balance.getTotalBalance({ address })
web3.balance.list({ address })

web3.token.list({ address, chainId })

Integrations

Full list of supported exchanges here:

Getting Involved

  1. Contributing
  2. Playground
  3. Scaffolding (adding a new exchange)
  4. Unit Tests
  5. Integration Tests

License

The MIT License (MIT)

Copyright (c) 2021 Aluna.Social

alunajs's People

Contributors

torres-ssf avatar arboleya avatar lucianopierdona avatar lucianomarcospierdona avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.