1.0.4 • Published 4 years ago

rfinex-api v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Rfinex Exchange Api

A wrapper for the Rfinex APIs. Uses promises. For more information on the API and parameters for requests visit https://github.com/rfinex/open-docs

Usage/Example

API that does not require signature

    const rfinex = require('rfinex-api');
    // Or you can 'import rfinex from "rfinex-api"'

    const rfinexApi = new rfinex({
        isAbroad: false // Whether it is abroad
    });
    
    rfinexApi.getMarkets().then(data=>{
        console.log(data)
    });

    rfinexApi.getTickers().then(data=>{
        console.log(data)
    });

    rfinexApi.getTickerByMarket('btccnst').then(data=>{
        console.log(data)
    });

    rfinexApi.getRecentTransaction({ market:'btccnst', limit:10 }).then(data=>{
        console.log(data)
    });

    rfinexApi.getDepth({ market:'btccnst', limit:10 }).then(data=>{
        console.log(data)
    });

API that needs to be signed

    const rfinex = require('rfinex-api');
    // Or you can 'import rfinex from "rfinex-api"'

    const rfinexApi = new rfinex({
        isAbroad: false, // Whether it is abroad
        accessKey: 'Vkh2oguappHsnjSVvFQUGGsTSz9WD9uEjtsavoLT', // access key
        secretKey: 'sN3AsANwlPaTSa1uNVk5QaXjdH7gc57lwUXM1W8d', // secret key
    });

    rfinexApi.getUserInfo().then(data=>{
        console.log(data)
    });

    rfinexApi.getMyAccount().then(data=>{
        console.log(data)
    });

    rfinexApi.getMyAccountByCurrency('btc').then(data=>{
        console.log(data)
    });

    rfinexApi.sell({ market:'btccnst', volume:'1', price:'10000' }).then(data=>{
        console.log(data)
    });

    rfinexApi.buy({ market:'btccnst', volume:'1', price:'10000' }).then(data=>{
        console.log(data)
    });

    rfinexApi.sendMultiOrders({
        market: 'btccnst',
        orders: [
            {
                price: '10000',
                volume: '1',
                side: 'buy'
            },
            {
                price: '10000',
                volume: '1',
                side: 'sell'
            }
        ]
    }).then(data=>{
        console.log(data)
    });

    rfinexApi.getOrdersByMarket({
        market:'btccnst',
        state: 'done',
        limit: 10,
    }).then(data=>{
        console.log(data)
    });

    rfinexApi.getOrderById('1').then(data=>{
        console.log(data)
    });

    rfinexApi.cancelOrderById('1').then(data=>{
        console.log(data)
    });

    rfinexApi.cancelOrderIds(['1','2']).then(data=>{
        console.log(data)
    });

    rfinexApi.cancelAllOrdersByMarket('btccnst').then(data=>{
        console.log(data)
    });

Recommend

Developed based on Typescript, in order to get the best development experience, you should use Visual Studio Code as the IDE.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago