当前位置: 首页 > 软件库 > Web3 > 开源货币/比特币 >

crypto-exchange

授权协议 MIT License
开发语言 Python
所属分类 Web3、 开源货币/比特币
软件类型 开源软件
地区 不详
投 递 者 苗征
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

crypto-exchange

Pulls together list of crypto exchanges to interact with their API's in a uniform fashion.

The goal of this project is to be able to interact with a number of different cryptocurrency exchange markets with one standardized package.

Available Exchanges

  • Binance
  • Bitfinex
  • Bitstamp
  • Bittrex
  • BTC-e shutdown
  • GDAX
  • Gemini
  • Kraken
  • Liqui
  • Poloniex
  • Yunbi

Usage

  • NOTE: Pairs are expected to be in the format BASE_QUOTE
  • All methods return a promise with the result passed.

Top Level

Exchange List

List of all available exchanges from the package:

const Exchanges = require('crypto-exchange')
  console.log(Object.keys(Exchanges))
  // [
  //   'bittrex',
  //   'gdax'
  //   'kraken',
  //   'poloniex',
  //   ...
  // ]

pairs

Quickly fetch all available pairs and which exchanges support them.

const Exchanges = require('crypto-exchange')
  Exchanges.pairs()
    .then(console.log)
  // {
  //   BTC_USD: [ 'bitfinex', 'gdax', 'gemini', 'kraken' ],
  //   LTC_USD: [ 'bitfinex', 'gdax', 'kraken' ],
  //   LTC_BTC: [ 'bitfinex', 'bittrex', 'gdax', 'kraken', 'liqui', 'poloniex' ],
  //   ETH_USD: [ 'bitfinex', 'gdax', 'gemini', 'kraken' ],
  //   ETH_BTC: [ 'bitfinex', 'bittrex', 'gdax', 'gemini', 'kraken', 'liqui', 'poloniex' ],
  //   ETC_BTC: [ 'bitfinex', 'bittrex', 'kraken', 'poloniex' ],
  //   ETC_USD: [ 'bitfinex', 'kraken' ],
  //   RRT_USD: [ 'bitfinex' ],
  //   ...
  // }

assets

Quickly fetch all available assets and which exchanges support them.

const Exchanges = require('crypto-exchange')
  Exchanges.assets()
    .then(console.log)
  // {
  //   BTC: [ 'bitfinex', 'bittrex', 'gdax', 'gemini', 'kraken', 'liqui', 'poloniex' ],
  //   USD: [ 'bitfinex', 'gdax', 'gemini', 'kraken' ],
  //   LTC: [ 'bitfinex', 'bittrex', 'gdax', 'kraken', 'liqui', 'poloniex' ],
  //   ETH: [ 'bitfinex', 'bittrex', 'gdax', 'gemini', 'kraken', 'liqui', 'poloniex' ],
  //   ETC: [ 'bitfinex', 'bittrex', 'kraken', 'poloniex' ],
  //   RRT: [ 'bitfinex' ],
  //   ...
  // }

Public Methods

All public methods are both accessible via a static function and an instance method.If only working with public methods, it is not neccessary to create an instance of the exchange class (one is created internally).

Both examples call the same method:

const Exchanges = require('crypto-exchange')

  Exchanges.poloniex.ticker('BTC_USDT')
  // => Promise { <pending> }

  const poloniex = new Exchanges.poloniex(apiKeys)
  poloniex.ticker('BTC_USDT')
  // => Promise { <pending> }

ticker

Return current ticker information for a given pair on an exchange.

ticker(pairs) {
  }
Arguments
  • pairs string, array - One or more pairs to fetch the current ticker for.
Response
{
    'BTC_USD': {
      last: 2336.00001284,
      ask: 2337.9,
      bid: 2337,
      high: 2380,
      low: 2133,
      volume: 6597.97852916,
      timestamp: 1500461237647 // in milliseconds
    },
    ...
  }

assets

Returns the available assets on an exchange. If the asset is disabled/frozen, it is not included.

assets() {
  }
Response
[
    'AMP',
    'ARDR',
    'BCY',
    'BELA',
    'BLK',
    'BTC',
    ...
  ]

pairs

Returns the available pairs on an exchange.

pairs() {
  }
Response
[
    'BCN_BTC',
    'BELA_BTC',
    'BLK_BTC',
    'BTCD_BTC',
    'BTM_BTC',
    ...
  ]

depth

Returns the depth of available buy and sell orders.

depth(pairs[, count = 50]) {
  }
Arguments
  • pairs string, array - One or more pairs to fetch the order book for.
  • depth number (optional) - How big of an order book to return in each direction. DEFAULT: 50
Response
{
    'ETH_BTC': {
      'asks': [
        [
          0.06773,    // price
          10.30181086 // volume
        ],
        ...
      ],
      'bids': [
        [
          0.0676,     // price
          7.59674753  // volume
        ],
        ...
      ]
    },
    ...
  }

Authenticated Methods

To use authenticated methods, you will need to pass any necessary authentication data needed from the exchange in the constructor of the exchange.

All exchanges require a minimum of 2 items:

  • key
  • secret

Special case authentication:

  • GDAX
    • passphrase

Example:

const Exchanges = require('crypto-exchange')

  let bittrex = new Exchanges.bittrex({
    key: '',
    secret: ''
  })

  let gdax = new Exchanges.gdax({
    key: '',
    secret: '',
    passphrase: ''
  })

buy/sell

Place a buy or sell order on an exchange.

buy(pair, amount[, rate[, type[, extra]]]) {
  }
Arguments
  • pair string - A pair value to trade against.
  • amount number - Number representing the amount of BASE to buy/sell.
  • rate number (optional) - Pass a specific rate of the pair to execute.
    • Only optional if exchange API allows "market orders." Must set type accordingly.
  • type string (optional) - Define type of order to execute.
    • Not all exchanges allow to change order type (i.e. market orders).
    • For exchanges that rate is required, it will default to a limit order.
  • extra object (optional) - Extra parameters that are REQUIRED by the exchange, if applicable.
Response
 

balances

Return current total, available, and pending balances for an exchange.

NOTE: Bitfinex requires a wallet type to fetch. The underlying method fetches all wallet types on request and will refresh, if called, every 2 minutes to allow immediate subsequent calls.

balances([opts]) {
  }
Arguments
  • opts object (optional) - Additional options.
    • type string (Bitfinex) - Wallet type ('deposit', 'exchange', 'trading').
Response
{
    'BTC': {
      balance: 0.0000,
      available: 0.0000,
      pending: 0.0000
    },
    ...
  }

address

Return or create a new address to which funds can be deposited.

Note: Due to how Coinbase and GDAX are intertwined, you must pass aditional authentication in order to interact with outside resources.

Note: Bitfinex requires a wallet type.

address(sym[, opts]) {
  }
Arguments
  • sym string - The asset symbol of the address to fetch.
  • opts object (optional) - Additional options.
    • auth object (Coinbase) - Secondary API authentication.
    • type string (Bitfinex) - Wallet type ('deposit', 'exchange', 'trading').
Response
"0xae89158b43000e07e76b205b870a1e34653d2668"

Donate

This project is a work in progress as I'm adding more exchanges and functions. Help support this project with a or PR!

BTC: 161kbECzKtDKfLXnC5Lwk2hgsQLtg7BNXd

ETH: 0xae89158b43000e07e76b205b870a1e34653d2668

  • java以太坊开发教程,主要是针对java和android程序员进行区块链以太坊开发的web3j详解。 python以太坊,主要是针对python工程师使用web3.py进行区块链以太坊开发的详解。 php以太坊,主要是介绍使用php进行智能合约开发交互,进行账号创建、交易、转账、代币开发以及过滤器和交易等内容。 以太坊入门教程,主要介绍智能合约与dapp应用开发,适合入门。 以太坊开发进阶教程,

  • 处理步骤 # 1、注释/etc/ssh/ssh_config # 2、修改/etc/ssh/sshd_config LogLevel INFO PermitRootLogin no AuthorizedKeysFile .ssh/authorized_keys IgnoreRhosts yes PermitEmptyPasswords no ChallengeResponseAuthe

  • crypto 模块提供了加密功能,实现了包括对 OpenSSL 的哈希、HMAC、加密、解密、签名、以及验证功能的一整套封装。 Hash 算法 Hash 类是用于创建数据哈希值的工具类。 查看 crypto 模块支持的 hash 函数:crypto.getHashes()   [ 'RSA-MD4', 'RSA-MD5', 'RSA-MDC2', 'RSA-RIPEMD160',

  • 转自:https://www.cnblogs.com/c-and-unity/articles/4552059.html node.js的crypto在0.8版本并没有改版多少,这个模块的主要功能是加密解密。 node利用 OpenSSL库来实现它的加密技术,这是因为OpenSSL已经是一个广泛被采用的加密算法。它包括了类似MD5 or SHA-1 算法,这些算法你可以利用在你的应用中。 1、我们

  • A top Australian financial regulator declared that they will adopt a new strategy in regulating cryptocurrency trading and strengthen the review of the Initial Currency Offering (ICO). On Friday, the

  • 在公开密码算法的前提下,数据的安全取决于密钥。因此,密钥的产生、销毁、交换(分发)是数据保密工作中的重要部分。 CryptoAPI密钥产生和交换函数主要有生成密钥函数CryptGenKey、派生密钥函数CryptDeriveKey、销毁密钥函数CryptDestroyKey、复制密钥函数CryptDuplicateKey、导出密钥函数CryptExportKey、导入密钥函数CryptImport

  • 浅析node.JS中的Crypto模块 包括hash算法,HMAC算法,加密算法知识,SSL协议 hash算法 1.创建hash实例 通过crypto.createHash()函数,,创建一个hash实例,但是需要调用md5,sha1,sha256,sha512算法来实现实例的创建。 const hash = crypto.createHash('md5') MD5是最常用的,但是他有一定的碰撞的

  • crypto crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypt

  • 转自:http://snoopyxdy.blog.163.com/blog/static/601174402012730105523656/ node.js的crypto在0.8版本并没有改版多少,这个模块的主要功能是加密解密。 node利用  OpenSSL库来实现它的加密技术,这是因为OpenSSL已经是一个广泛被采用的加密算法。它包括了类似MD5 or SHA-1 算法,这些算法你可以利用在

  • crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypto = req

  • 文件 以及定义 #include #include #include #define MY_ENCODING_TYPE  (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING) 当包含wincrypt.h头 文件 时,一般都需要定义#define _WIN32_WINNT 0x(具体的值),否则将得到如下错误:error C2065: undeclared identi

  • 写在前面 本章节写得差不多了,不过还需要再整理一下(TODO)。   hash例子 hash.digest([encoding]):计算摘要。encoding可以是hex、latin1或者base64。如果声明了encoding,那么返回字符串。否则,返回Buffer实例。注意,调用hash.digest()后,hash对象就作废了,再次调用就会出错。 hash.update(data[, inp

  • 前面的话 加密模块提供了 HTTP 或 HTTPS 连接过程中封装安全凭证的方法。也提供了 OpenSSL 的哈希,hmac, 加密(cipher), 解密(decipher), 签名(sign) 和 验证(verify) 方法的封装。本文将详细介绍加密crypto crypto 【crypto.setEngine(engine[, flags])】 为某些/所有 OpenSSL 函数加载并设置引

  • crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypto = req

  • crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypto = req

 相关资料
  • Overview 因为Java的Crypto API始终有点难用,SpringSide在core module中的org.springside.modules.security.utils中提供了封装。 API的出入参数都是byte[]数组,需要配合Encodes来转换成Hex或Base64存储。 Digests消息摘要 去年一轮的密码被盗风波后,使用salt并迭代N次的sha-1式密码存储已经是

  • The crypto component hosts all the implementations of cryptographic primitives we use in Libra: hashing, signing, and key derivation/generation. The NextGen directory contains implementations of crypt

  • crypto 跟加密相关的一些功能,包括安全验证等。

  • crypto 包括 attr、ecdsa、utils 子包。 attr:chaincode 属性检查校验; ecdsa:ecdsa 加密算法接口,一些 hash 和签名校验方法。 utils:提供 aes、ecdsa、x509 等方法。

  • crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypto = req

  • import "crypto" crypto包搜集了常用的密码(算法)常量。 type PublicKey type PublicKey interface{} 代表一个使用未指定算法的公钥。 type PrivateKey type PrivateKey interface{} 代表一个使用未指定算法的私钥。 type Hash type Hash uint Hash用来识别/标识另一个包里实现