• User Guide
    • Security Notes
      Security Notes
    • Online/Desktop Apps
      • Account Management
        • Create Account
          Create Account
        • Log in to Account
          Log in to Account
        • Backup Seed Phrase
          Backup Seed Phrase
        • Recover Account
          Recover Account
        • Find Out Your Address
          Find Out Your Address
        • Create Personal Alias
          Create Personal Alias
        • Import From Keeper Wallet
          Import From Keeper Wallet
        • Use Ledger Nano Devices With WX Network
          Use Ledger Nano Devices With WX Network
        Account Management
      • Token Management
        • Deposit & Withdraw Tokens
          • Transactions Tab
            Transactions Tab
          Deposit & Withdraw Tokens
        • Create Token
          Create Token
        • Mass Transfer
          Mass Transfer
        • Reissue Token
          Reissue Token
        • Change Reissuable to Not Reissuable
          Change Reissuable to Not Reissuable
        • Burn Token
          Burn Token
        • Sponsored Transaction
          Sponsored Transaction
        • Sponsored Fee
          Sponsored Fee
        • Swap Tokens
          Swap Tokens
        Token Management
      • Investment Tools
        • Stake Tokens
          • How to Get XTN (Quick Guide)
            How to Get XTN (Quick Guide)
          • How to Get USDT/USDC/BTC/ETH (Quick Guide)
            How to Get USDT/USDC/BTC/ETH (Quick Guide)
          Stake Tokens
        • Lambo Investments
          Lambo Investments
        • Algorithmic Trading
          Algorithmic Trading
        Investment Tools
      • Liquidity Pools
        • How to Maximize Passive Income from Liquidity Pools?
          How to Maximize Passive Income from Liquidity Pools?
        • How to Deposit/Withdraw Tokens to/from a Liquidity Pool?
          How to Deposit/Withdraw Tokens to/from a Liquidity Pool?
        • How to Stake/Unstake LP Tokens?
          How to Stake/Unstake LP Tokens?
        • How to Claim LP Staking Reward in WX?
          How to Claim LP Staking Reward in WX?
        • How to Stake WX Token to Boost LP Staking Reward?
          How to Stake WX Token to Boost LP Staking Reward?
        • How to Claim WX Staking Reward?
          How to Claim WX Staking Reward?
        • WX Token Protocol
          WX Token Protocol
        Liquidity Pools
      • Voting
        Voting
      • Advanced Features
        • Script Transaction
          Script Transaction
        • JSON Confirmation
          JSON Confirmation
        Advanced Features
      • Start Trading on WX Network
        Start Trading on WX Network
      Online/Desktop Apps
    • Mobile Apps
      • WX Network App
        WX Network App
      • Waves.Exchange App
        • Account Management
          • Create Account
            Create Account
          • Log in to Account
            Log in to Account
          • Recover Account
            Recover Account
          • Find Out Your Address
            Find Out Your Address
          • Create Personal Alias
            Create Personal Alias
          Account Management
        • Token Management
          • Deposit & Withdraw Tokens
            Deposit & Withdraw Tokens
          • Burn Token
            Burn Token
          Token Management
        • Start Trading on WX Network
          Start Trading on WX Network
        Waves.Exchange App
      • WX Invest App
        WX Invest App
      Mobile Apps
    • Working With MetaMask in Waves Network
      Working With MetaMask in Waves Network
    • WX Referral Program
      WX Referral Program
    User Guide
  • API and Library
    • CCXT
      CCXT
    • Fees
      Fees
    • Payment API
      Payment API
    • Web Auth API
      Web Auth API
    • Gateway API
      • Deposit
        • [Deprecated] GET /v1/deposit/addresses/{currency}
          [Deprecated] GET /v1/deposit/addresses/{currency}
        • GET /v1/deposit/addresses/{currency}/{platform}
          GET /v1/deposit/addresses/{currency}/{platform}
        • GET /v1/deposit/currencies
          GET /v1/deposit/currencies
        • [Deprecated] GET /v1/deposit/currencies/{currency}
          [Deprecated] GET /v1/deposit/currencies/{currency}
        • GET /v1/deposit/currencies/{currency}/{platform}
          GET /v1/deposit/currencies/{currency}/{platform}
        • Terms of Deposit
          Terms of Deposit
        Deposit
      • Withdraw
        • [Deprecated] GET /v1/withdraw/addresses/{currency}/{address}
          [Deprecated] GET /v1/withdraw/addresses/{currency}/{address}
        • GET /v1/withdraw/addresses/{currency}/{address}/{platform}
          GET /v1/withdraw/addresses/{currency}/{address}/{platform}
        • GET /v1/withdraw/currencies
          GET /v1/withdraw/currencies
        • [Deprecated] GET /v1/withdraw/currencies/{currency}
          [Deprecated] GET /v1/withdraw/currencies/{currency}
        • GET /v1/withdraw/currencies/{currency}/{platform}
          GET /v1/withdraw/currencies/{currency}/{platform}
        • Terms of Withdrawal
          Terms of Withdrawal
        Withdraw
      • Movements History
        Movements History
      • Platforms List
        Platforms List
      • Error Codes
        Error Codes
      Gateway API
    • Access Token
      • Get Access Token in WX Network App
        Get Access Token in WX Network App
      • POST /v1/oauth2/token
        POST /v1/oauth2/token
      Access Token
    • Get Trades
      Get Trades
    • Staking Annual Percentage Yield API
      Staking Annual Percentage Yield API
    • Matcher
      • WX Network Protocol
        WX Network Protocol
      • Matcher Fee
        Matcher Fee
      • Install Matcher on Ubuntu From Deb-package
        Install Matcher on Ubuntu From Deb-package
      • Matcher Settings
        Matcher Settings
      • Matcher API
        • Order Validation
          Order Validation
        • Exchange Transation Validation
          Exchange Transation Validation
        Matcher API
      • Matcher WebSocket API
        • Errors and Debugging
          Errors and Debugging
        • Common Streams
          Common Streams
        Matcher WebSocket API
      Matcher
    API and Library
  • Glossary
    Glossary
      • English
      • Русский
      On this page
        • Getting Started
          • Installation
          • Initialization
        • Methods
          • Load Markets
          • Market Data
          • Trading
          • Other

          # CCXT for WX Network

          WX Network provides a decentralized exchange for trading different tokens between users. The important point is that users don't transfer their tokens to exchange, money remains on their accounts until matcher executes the order and publishes an exchange transaction.

          CCXT (CryptoCurrency eXchange Trading) is a JavaScript/Python/PHP library for cryptocurrency trading and quick access to market data. It supports 124 exchanges including WX Network.

          Important: Currently CCXT works only with seed-accounts. Accounts tied to email address will be supported in future.

          To avoid scam CCXT library supports only the tokens recommended for trading. You can find the IDs (AssetID) of the supported tokens in trading pairs in API (opens new window).

          The source code is available on Github: https://github.com/ccxt/ccxt (opens new window).

          For detailed information about CCXT see Manual (opens new window).

          # Getting Started

          # Installation

          JavaScript

          npm i ccxt
          

          Python

          pip install ccxt
          

          PHP

          The autoloadable version of ccxt can be installed with Packagist/Composer (PHP 5.4+).

          For more options, see the Install (opens new window) page.

          # Initialization

          Create an instance of wavesexchange class that implements WX Network API methods.

          For trading, you need to specify public key and private key of Waves account:

          1. Create an account as described in the Create Account article.
          2. At the top right corner click the account avatar and then click Settings.
          3. In the Settings window switch to the Security tab.
          4. Copy your public key and private key.

          ⚠️ Keep your private key secret, do not post or email it. The private key is only used to sign your requests locally and is not sent in requests.

          Before using other methods, preload the list of markets (trading pairs) and currencies by calling the loadMarkets() method.

          JavaScript

          const { wavesexchange } = require('ccxt');
          
          const we = new wavesexchange({
              apiKey: 'YOUR_PUBLIC_KEY',
              secret: 'YOUR_PRIVATE_KEY',
          });
          
          (async () => {
              await we.loadMarkets();
          }) ()
          

          Python

          import ccxt
          
          we = ccxt.wavesexchange({
              'apiKey': 'YOUR_PUBLIC_KEY',
              'secret': 'YOUR_PRIVATE_KEY',
          })
          
          we.load_markets()
          

          PHP

          date_default_timezone_set('UTC');
          include 'ccxt.php';
          
          $we = new \ccxt\wavesexchange (array (
              'apiKey' => 'YOUR_PUBLIC_KEY',
              'secret' => 'YOUR_PRIVATE_KEY',
          ));
          
          var_dump ($we->load_markets());
          

          If you use the public methods only, you can create the instance without keys:

          const we = new wavesexchange({
          });
          

          # Methods

          In the JavaScript version of CCXT all methods are asynchronous and return Promises (opens new window) that resolve with a decoded JSON object.

          In Python 3.5+, CCXT supports asynchronous concurrency mode with async/await syntax. The asynchronous Python version uses pure asyncio (opens new window) with aiohttp (opens new window). In async mode you have all the same properties and methods, but most methods are decorated with an async keyword. If you want to use async mode, you should link against the ccxt.async_support subpackage (see the example (opens new window) in the CCXT Manual).

          In the PHP version all API methods are synchronous.

          All methods can be called in both camelcase notation and underscore notation:

          fetchOrderBook('WAVES/XTN')
          fetch_order_book('WAVES/XTN')
          
          • Load Markets

            • loadMarkets
          • Market Data

            • fetchOrderBook
            • fetchL2OrderBook
            • fetchTicker
            • fetchTrades
            • fetchOHLCV
          • Trading

            • fetchBalance
            • createOrder
            • createLimitBuyOrder
            • createLimitSellOrder
            • cancelOrder
            • fetchOrders
            • fetchOpenOrders
            • fetchClosedOrders
            • fetchMyTrades
          • Other

            • fetchDepositAddress

          # Load Markets

          # loadMarkets

          loadMarkets([reload = true])
          

          Loads the list of all available markets and currencies from WX Network and caches the info in the .markets, .symbols, and the .currencies properties of wavesexchange info.

          The method returns the list of markets. You only need to call it once. All subsequent calls to the same method return the locally saved (cached) array of markets. If you need to force reload the list of markets, pass the reload = true flag to the same method.

          Usage

          JavaScript

          (async () => {
              await we.loadMarkets(); // Preload list of markets and currencies
          
              const currencies = we.currencies; // Dictionary of currencies
          
              const symbols = we.symbols; // Dictionary of trading pairs
          
              const wavesUsdn = we.markets['WAVES/XTN']; // Get market structure by symbol
          }) ()
          

          Python

          we.load_markets() # Preload list of markets and currencies
          
          currencies = we.currencies # Dictionary of currencies
          
          symbols = we.symbols # Dictionary of trading pairs
          
          waves_usdn = we.markets['WAVES/XTN'] # Get market structure by symbol
          

          PHP

          var_dump ($we->load_markets()); // Preload list of markets and currencies
          
          $currencies = $we->currencies; // Dictionary of currencies
          
          $symbols = $we->symbols; // Dictionary of trading pairs
          
          $waves_usdn = $we->markets['WAVES/XTN']; // Get market structure by symbol
          

          Output example

          {
            "WAVES/XTN": {
              "limits": {
                "amount": {},
                "price": {},
                "cost": {}
              },
              "precision": {
                "amount": 8,
                "price": 6
              },
              "symbol": "WAVES/XTN",
              "id": "WAVES/DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p",
              "base": "WAVES",
              "quote": "XTN",
              "baseId": "WAVES",
              "quoteId": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p",
              "info": {
                "symbol": "WAVES/XTN",
                "amountAssetID": "WAVES",
                "amountAssetName": "Waves",
                "amountAssetDecimals": 8,
                "amountAssetTotalSupply": "102091054.00000000",
                "amountAssetMaxSupply": "102091054.00000000",
                "amountAssetCirculatingSupply": "102091054.00000000",
                "priceAssetID": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p",
                "priceAssetName": "USD-N",
                "priceAssetDecimals": 6,
                "priceAssetTotalSupply": "999999999778.651398",
                "priceAssetMaxSupply": "999999999778.651398",
                "priceAssetCirculatingSupply": "13365276.476510",
                "24h_open": "1.1235",
                "24h_high": "1.1307",
                "24h_low": "1.1012",
                "24h_close": "1.13",
                "24h_vwap": "1.11756591068791",
                "24h_volume": "106629.05589757",
                "24h_priceVolume": "119164.997960",
                "timestamp": 1594017751938
              }
            },
          ...
          }
          
          Field Description
          symbol Trading pair name that is common across exchanges
          id Asset IDs on the Waves blockchain
          base Ticker of base currency (a.k.a. amount asset)
          quote Ticker of quote currency (a.k.a. price asset)
          baseId ID of amount asset
          quoteId ID of price asset
          precision Number of decimal places. See the Precision and Limits (opens new window) section in the CCXT Manual
          precision.amount Number of decimal places of amount asset
          precision.price Number of decimal places of price asset
          info Information about asset pair in WX Network format

          # Market Data

          # fetchOrderBook

          fetchOrderBook(symbol[, limit = undefined[, params = {}]])
          

          Fetches the list of orders for a particular market trading symbol. For WX Network, the order book is price-aggregated, the output is the same as of fetchL2OrderBook.

          # fetchL2OrderBook

          fetchL2OrderBook (symbol[, limit = undefined[, params = {}]])
          

          Fetches Level 2 (price-aggregated) order book for a particular symbol.

          Output example

          {
            "bids": [
              [
                1.1415,
                739.00335952
              ],
              [
                1.1401,
                119.821299
              ],
              [
                1.1394,
                931.87014129
              ],
              ....
            ],
            "asks": [
              [
                1.1474,
                28
              ],
              [
                1.1485,
                872.71515731
              ],
              [
                1.149,
                281.9881125
              ],
              ...
            ],
            "timestamp": 1593676495294,
            "datetime": "2020-07-02T07:54:55.294Z"
          }
          
          Field Description
          bids List of buy orders in [ price, amount ] format sorted by price descending
          asks List of sell orders in [ price, amount ] format sorted by price ascending
          timestamp Unix timestamp in milliseconds when WX Network generated the response
          datetime ISO-8601 datetime string with milliseconds

          Prices are in the quote currency (a.k.a. price asset). Amounts are in the base currency (a.k.a. amount asset). All numbers are floats.

          The maximum depth is 100.

          # fetchTicker

          fetchTicker (symbol[, params = {}])
          

          Fetches statistics data a particular trading pair for the last 24 hours.

          Usage

          fetchTicker('WAVES/XTN')
          

          Output example

          {
            "symbol": "WAVES/XTN",
            "high": 1.1318,
            "low": 1.1012,
            "vwap": 1.11767514038472,
            "open": 1.1253,
            "close": 1.1281,
            "last": 1.1281,
            "change": 0.0028000000000001357,
            "percentage": 0.2488225362125776,
            "average": 1.1267,
            "baseVolume": 106815.19696756,
            "quoteVolume": 119384.69026594,
            "info": {
              "__type": "pair",
              "data": {
                "firstPrice": 1.1253,
                "lastPrice": 1.1281,
                "low": 1.1012,
                "high": 1.1318,
                "weightedAveragePrice": 1.11767514038472,
                "volume": 106815.19696756,
                "quoteVolume": 119384.69026594,
                "volumeWaves": 106815.19696756,
                "txsCount": 924
              },
              "amountAsset": "WAVES",
              "priceAsset": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"
            }
          }
          
          Field Description
          symbol Trading pair name
          high The highest price
          low The lowest price
          vwap Volume weighted average price
          open Opening price
          close Price of the last trade
          last The same as close
          change Absolute change, last - open
          percentage Relative change, change / open × 100
          average Average price, (last + open) /2
          baseVolume Amount of base currency (a.k.a. amount asset) traded for last 24 hours
          quoteVolume Amount of quote currency (a.k.a. price asset) traded for last 24 hours
          info Statistics for asset pair in WX Network format

          Prices are in the quote currency (a.k.a. price asset). All numbers are floats.

          # fetchTrades

          fetchTrades(symbol[, since = undefined[, limit = undefined[, params = {}]]])
          

          Fetches exchange transactions by trading pair.

          The WX Network matcher executes orders and creates exchange transactions. Each exchange transaction contains buy order and sell order. The order can be executed by several exchange transactions. For details see the Matching Algorithm section.

          For now, you can only get the last 100 exchange transactions. If you specifу an earlier value for the since parameter, it is ignored.

          Usage

          fetchTrades('ETH/BTC')
          

          Output example

            {
              "info": {
                "__type": "transaction",
                "data": {
                  "id": "5Pbj2fyEZHANahwbLJhAcn7wJ3Q2yuug5Urta1i4vs1B",
                  "timestamp": "2020-07-02T13:25:02.069Z",
                  "height": 2132848,
                  "type": 7,
                  "version": 2,
                  "proofs": [
                    "5ENaPtB6KuAHpM5PZbW3nvcmYA1MhunCnHPB684RafbmX9VdF2T4prFub8hWPQNRUspce29GTxMMPNGD8x4KCHBA"
                  ],
                  "fee": 0.003,
                  "sender": "3PEjHv3JGjcWNpYEEkif2w8NXV4kbhnoGgu",
                  "senderPublicKey": "9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5",
                  "buyMatcherFee": 0.00299999,
                  "sellMatcherFee": 0.00299999,
                  "price": 0.02487665,
                  "amount": 0.12155697,
                  "order1": {
                    "id": "FqXxVTzDtxozRHzjj7q2mWXyZUvg9XCZ9oHFEQNTBZV7",
                    "senderPublicKey": "Au6avw8iaNj8e3F9Gwj2BR3CWNkwvADT3xvJnSocWjZV",
                    "matcherPublicKey": "9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5",
                    "assetPair": {
                      "amountAsset": "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
                      "priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
                    },
                    "orderType": "buy",
                    "price": 0.02487665,
                    "sender": "3PQznCuKfvsUeF5Jtja6cVmDeGkXes3Xbfk",
                    "amount": 0.12155706,
                    "timestamp": "2020-07-02T13:25:02.042Z",
                    "expiration": "2020-07-03T06:21:42.042Z",
                    "matcherFee": 0.003,
                    "signature": "4rRaB1kNidDwfcEoWDHr79JLJENK53QdGgAWNvf1ToSHtYAHDdvaMkxD3RKR9tBmUkBjDDFGeYfyYYJh2BWJy7Ub",
                    "matcherFeeAssetId": null
                  },
                  "order2": {
                    "id": "9on2bnrjQm6UZXBWV6gRXXdxEm2QnfHiRtpwUskC5LdW",
                    "senderPublicKey": "8hJheLKw2MFtRLmutxj5BGSfNmDrUMFGC4dciGuzscnB",
                    "matcherPublicKey": "9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5",
                    "assetPair": {
                      "amountAsset": "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
                      "priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
                    },
                    "orderType": "sell",
                    "price": 0.02487665,
                    "sender": "3P7m7XGnHd7QmV7V9av2vZ2NMRWSxjP4ZHv",
                    "amount": 0.12155706,
                    "timestamp": "2020-07-02T13:25:01.943Z",
                    "expiration": "2020-07-03T06:21:41.943Z",
                    "matcherFee": 0.003,
                    "signature": "3BRhtq1XuwM14oJbP9Qy1Xt9F3US6Kjo7qvJjFefhcnpPvm3Wo1pD6XTjHk6AxoskKLJAqD6h9HPbdRqk6TA2qM1",
                    "matcherFeeAssetId": null
                  }
                }
              },
              "timestamp": 1593696302069,
              "datetime": "2020-07-02T13:25:02.069Z",
              "symbol": "ETH/BTC",
              "id": "5Pbj2fyEZHANahwbLJhAcn7wJ3Q2yuug5Urta1i4vs1B",
              "order": "9on2bnrjQm6UZXBWV6gRXXdxEm2QnfHiRtpwUskC5LdW",
              "side": "sell",
              "price": 0.02487665,
              "amount": 0.12155697,
              "cost": 0.0030239301977505,
              "fee": {
                "cost": 0.003,
                "currency": "WAVES"
              }
            },
            ...
          ]
          
          Field Description
          info Exchange transaction in Waves blockchain format
          timestamp Unix timestamp in milliseconds
          datetime ISO-8601 datetime string with milliseconds
          symbol Trading pair name
          id Transaction ID. You can find the transaction in Waves Explorer (opens new window)
          order Sell order ID. Note: both buy and sell order matched are represented in info
          side sell
          price Float price in quote currency (a.k.a. price asset)
          amount Amount in the base currency (a.k.a. amount asset)
          cost Amount in the quote currency
          fee Transaction fee: 0.003 WAVES

          Transactions are sorted by timestamp ascending.

          # fetchOHLCV

          fetchOHLCV (symbol[, timeframe = '1m'[, since = undefined[, limit = undefined[, params = {}]]]])
          

          Fetches prices and volumes for the OHCLV (open-high-low-close-volume) candlestick chart.

          Note that the info from the last (current) candle may be incomplete until the candle is closed (until the next candle starts).

          The maximum amount of candles in response is 1440. To get historical data, use the pagination with since and limit parameters, see examples in the Pagination (opens new window) section of the CCXT Manual.

          Parameter Type Description
          symbol string Trading pair name
          timeframe string Candle interval. One of 1M, 1w, 1d, 12h, 6h, 4h, 3h, 2h, 1h, 30m, 15m, 5m, 1m. Available timeframes are also specified in the wavesexchange.timeframes property
          since string Unix timestamp in milliseconds
          limit integer Maximum number of candles in response, up to 1440

          Usage

          fetchOHLCV('WAVES/XTN', '1h', 1593561600000, 24)
          

          Output example

          [
            [
              1593561600000,
              1.1217,
              1.1241,
              1.117,
              1.1223,
              3603.75266221
            ],
            [
              1593565200000,
              1.1242,
              1.1293,
              1.1221,
              1.1293,
              698.67756469
            ],
            ...
          ]
          

          Each candle contains [ timestamp, open, high, low, close, volume ]. Prices are in the quote currency (a.k.a. price asset). Amounts are in the base currency (a.k.a. amount asset). All numbers are floats. Candles are sorted by timestamp ascending.

          # Trading

          Account keys are required for trading, see the Initialization section.

          # fetchBalance

          Fetches the amount of funds available for trading and funds locked in orders for your account.

          fetchBalance ([params = {}])
          

          Output example

          {
            "BTC": {
              "free": 0.00159392,
              "used": 0,
              "total": 0.00159392
            },
            "WEST": {
              "free": 6e-8,
              "used": 0,
              "total": 6e-8
            },
            "XTN": {
              "free": 2.3482,
              "used": 0,
              "total": 2.3482
            },
            "WAVES": {
              "free": 82.66924596,
              "used": 0.009003,
              "total": 82.67824896
            },
            "free": {
              "BTC": 0.00159392,
              "WEST": 6e-8,
              "XTN": 2.3482,
              "WAVES": 82.66924596
            },
            "used": {
              "BTC": 0,
              "WEST": 0,
              "XTN": 0,
              "WAVES": 0.009003
            },
            "total": {
              "BTC": 0.00159392,
              "WEST": 6e-8,
              "XTN": 2.3482,
              "WAVES": 82.67824896
            }
          }
          
          Field Description
          free Funds available for trading
          used Funds locked in orders
          total Total funds

          All amounts are float.

          # createOrder

          createOrder(symbol, type, side, amount, price[, params = {}])
          

          Only limit orders are supported currently.

          The WX Network fee for order execution is 0.003 WAVES, whether buying or selling, regardless of the order amount. If the order is partially executed, the fee is proportional to the executed amount.

          If account's WAVES balance is not enough, the fee is indicated in one of the assets BCH, BSV, BTC, DASH, ETH, LTC, XTN, USDT, WEST, XMR, ZEC that the account has. The exchange rates used to calculate the fee are returned by the GET /matcher/settings/rates method of Matcher API.

          Parameter Type Description
          symbol string Trading pair name
          type string Only limit
          side string buy or sell
          amount float Amount in the base currency (a.k.a. amount asset)
          price float Price in quote currency (a.k.a. price asset)

          Usage

          createOrder('WAVES/XTN', 'limit', 'buy', 0.5, 1.05)
          

          Output example

          {
            "info": {
              "version": 3,
              "id": "ANAfXHJemsaCmSvq2jszVWiFeVhnr3aiMrWPRFFMg59j",
              "sender": "3P8pGyzZL9AUuFs9YRYPDV3vm73T48ptZxs",
              "senderPublicKey": "FuChbN7t3gvW5esgARFytKNVuHSCZpXSYf1y3eDSruEN",
              "matcherPublicKey": "9cpfKN9suPNvfeUNphzxXMjcnn974eme8ZhWUjaktzU5",
              "assetPair": {
                "amountAsset": null,
                "priceAsset": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"
              },
              "orderType": "sell",
              "amount": 50000000,
              "price": 1150000,
              "timestamp": 1594634571018,
              "expiration": 1597053771018,
              "matcherFee": 300000,
              "matcherFeeAssetId": null,
              "signature": "3Gxt5xiyFn8aEK72M2QPoxSenPzfLYcyyo6pG5cZ4kABxPw9neHGScvFF3huXmcN8hFsyaaWQQfj2JdkE7F4tHJ4",
              "proofs": [
                "3Gxt5xiyFn8aEK72M2QPoxSenPzfLYcyyo6pG5cZ4kABxPw9neHGScvFF3huXmcN8hFsyaaWQQfj2JdkE7F4tHJ4"
              ]
            },
            "id": "ANAfXHJemsaCmSvq2jszVWiFeVhnr3aiMrWPRFFMg59j",
            "timestamp": 1594634571018,
            "datetime": "2020-07-13T10:02:51.018Z",
            "symbol": "WAVES/XTN",
            "type": "limit",
            "side": "sell",
            "price": 1.15,
            "amount": 0.5,
            "cost": 0.575,
            "fee": {
              "currency": "WAVES",
              "fee": 0.003
            }
          }
          
          Field Description
          info Order info in Waves blockchain format. For details see the Matcher API article
          id Order ID
          timestamp Order placing Unix timestamp in milliseconds
          datetime Order placing ISO-8601 datetime string with milliseconds
          symbol Trading pair name
          type limit
          side buy or sell
          price Price in quote currency (a.k.a. price asset)
          amount Amount in the base currency (a.k.a. amount asset)
          cost Amount in the quote currency
          fee WX Network fee

          # createLimitBuyOrder

          createLimitBuyOrder(symbol, amount, price[, params = {}])
          

          The same as createOrder with type = limit and side = buy.

          # createLimitSellOrder

          createLimitSellOrder (symbol, amount, price[, params = {}])
          

          The same as createOrder with type = limit and side = sell.

          # cancelOrder

          cancelOrder (id, [symbol[, params = {}]])
          

          Cancels order. Throws an OrderNotFound exception if the order is already closed or cancelled.

          Usage

          cancelOrder('4EEuqGMNbK25K9VeU8PT5QQePj65Z5j554yLwxemczfk')
          

          Output example

          {
            "info": {
              "success": true,
              "message": [
                [
                  {
                    "orderId": "4EEuqGMNbK25K9VeU8PT5QQePj65Z5j554yLwxemczfk",
                    "success": true,
                    "status": "OrderCanceled"
                  }
                ]
              ],
              "status": "BatchCancelCompleted"
            },
            "id": "4EEuqGMNbK25K9VeU8PT5QQePj65Z5j554yLwxemczfk",
            "symbol": "WAVES/BTC"
          }
          

          # fetchOrders

          fetchOrders(symbol[, since = undefined[, limit = undefined[, params = {}]]])
          

          Fetches orders placed by account.

          Parameter Type Description
          symbol string Trading pair name
          since string Unix timestamp in milliseconds
          limit integer Maximum number of orders in response

          You can use since and limit parameters for pagination, see examples in the Pagination (opens new window) section of the CCXT Manual.

          Usage

          fetchOrders('WAVES/XTN')
          fetchOrders('WAVES/XTN',1593550800000,20)
          

          Output example

          [
            {
              "info": {
                "id": "Bahhckt2eq9N1KgqMZS5dJf5Zfsee7MGbqAtWhwbCeXx",
                "type": "sell",
                "orderType": "limit",
                "amount": 2014233920,
                "fee": 300000,
                "price": 14894,
                "timestamp": 1584357963949,
                "filled": 2014227425,
                "filledFee": 299999,
                "feeAsset": "WAVES",
                "status": "Filled",
                "assetPair": {
                  "amountAsset": null,
                  "priceAsset": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
                },
                "avgWeighedPrice": 14894
              },
              "id": "Bahhckt2eq9N1KgqMZS5dJf5Zfsee7MGbqAtWhwbCeXx",
              "timestamp": 1584357963949,
              "datetime": "2020-03-16T11:26:03.949Z",
              "symbol": "WAVES/BTC",
              "type": "limit",
              "side": "sell",
              "price": 0.00014894,
              "amount": 20.1423392,
              "cost": 0.0030000000004479998,
              "average": 0.00014894,
              "filled": 20.14227425,
              "remaining": 0.0000649499999987313,
              "status": "closed",
              "fee": {
                "currency": "WAVES",
                "fee": 0.00299998
              }
            },
            ...
          ]
          
          Field Description
          info Order info in Waves blockchain format. For details see the Matcher API article
          id Order ID
          timestamp Order placing Unix timestamp in milliseconds
          datetime Order placing ISO-8601 datetime string with milliseconds
          symbol Trading pair name
          type limit or market
          side buy or sell
          price Price in quote currency (a.k.a. price asset)
          amount Ordered amount in the base currency (a.k.a. amount asset)
          cost Amount in the quote currency
          average Weighted average filling price in the quote currency
          filled Filled amount in the base currency
          remaining Remaining amount to fill
          status open, closed, or canceled
          fee WX Network fee for the filled amount

          Orders are sorted by timestamp ascending.

          # fetchOpenOrders

          fetchOpenOrders([symbol = undefined[, since = undefined[, limit = undefined[, params = {}]]]])
          

          Fetches open orders placed by account.

          Parameters and output are the same as the fetchOrders.

          Usage

          fetchOpenOrders()
          fetchOpenOrders('WAVES/XTN',1593550800000,20)
          

          # fetchClosedOrders

          fetchClosedOrders([symbol = undefined[, since = undefined[, limit = undefined[, params = {}]]]])
          

          Fetches closed and cancelled orders placed by account.

          Parameters and output are the same as the fetchOrders.

          # fetchMyTrades

          fetchMyTrades(symbol[, since = undefined[, limit = undefined[, params = {}]]])
          

          Fetch exchange transactions for the account by trading pair.

          Parameters and output are the same as the fetchTrades.

          For now, you can only get the last 100 exchange transactions. If you specifу an earlier value for the since parameter, it is ignored.

          # Other

          # fetchDepositAddress

          Account keys are required, see the Initialization section.

          fetchDepositAddress(code, params = {})
          

          WX Network enables transfers of cryptocurrencies between Waves and other blockchains. This method provides an address on the external blockchain corresponding to your WAVES account. When you transfers some amount of cryptocurrency to this address, your Waves account receives the amount less fee. The fee calculation is described in the Terms of Deposit article.

          The following currencies are supported: ERGO, WEST, BTC, ETH, BNT, USDT, XTN, WAVES, USDFL, FL, NSBT, USDC, LTC, BSV, BCH, XMR, ZEC, DASH, CRV.

          Usage

          fetchDepositAddress('BTC')
          

          Output example

          {
            "address": "1A76iWzNbnSftqnGEucJSM456ewGtnfAbX",
            "code": "BTC",
            "info": {
              "type": "deposit_addresses",
              "currency": {
                "type": "deposit_currency",
                "id": "BTC",
                "waves_asset_id": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
                "decimals": 8,
                "status": "active",
                "allowed_amount": {
                  "min": 0.0001,
                  "max": 1000
                },
                "fees": {
                  "flat": 0,
                  "rate": 0
                }
              },
              "deposit_addresses": [
                "1A76iWzNbnSftqnGEucJSM456ewGtnfAbX",
                "bc1qlk7km9dvedj7nq5kyduy8gsr2g5t09mq2akrp5"
              ]
            }
          }
          
          Field name Description
          code Currency name
          address Address on the external blockchain to transfer cryptocurrency and then receive the transfer to Waves account
          info.currency Terms of deposit for the currency
          API and Library
          Fees
          API and Library
          Fees