@bitocredit/nodejs-gateway

1.0.2 • Public • Published

Bitocredit Nodejs package

nodejs wrapper for Bitocredit API

usage

install package using npm

npm install @bitocredit/nodejs-gateway


and use package like this:

    const Bitocredit = require("@bitocredit/nodejs-gateway");
    
    const baseurl = "https://bitocredit.com/api/";
    const token = "TOKEN"; // fill your token
    
    const Gateway = new Bitocredit(baseurl , token);
    
    Gateway.createWallet("wallet_id" , "network") // replace wallet_id with your wallet id and network type
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

methods

createWallet

This method used for creating wallet for user

endpoint : https://bitocredit.com/api/create/wallet/{token}

    Gateway.createWallet("wallet_id" , "network") // replace wallet_id with your wallet id and network type
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

transactionCheck

This method used for check a transaction is confirmed or not

endpoint : https://bitocredit.com/api/transaction/check/{token}

    Gateway.transactionCheck("transaction_hash" , "wallet_address") // replace transaction_hash and wallet_address with your transaction hash and wallet address
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

transactionRecovery

This method used for check a transaction that is lost in blockchain

endpoint : https://bitocredit.com/api/transaction/recovery/{token}

    Gateway.transactionRecovery("transaction_hash") // replace transaction_hash with your transaction hash
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

transactionFee

This method used for check a transaction that is lost in blockchain

endpoint : https://bitocredit.com/api/transaction/fee/{token}

    Gateway.transactionFee()
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

transactionExample

Please only use this api for test ! it's only an example to show how the server sends data to callback after payment confirmation

endpoint : https://bitocredit.com/api/transaction/example/callback

    Gateway.transactionExample("transaction_hash") // replace transaction_hash with your transaction hash
           .then((data) => {
            console.log(data);
           })
           .catch((err) => {
            console.log(err);
           });

Dependents (0)

Package Sidebar

Install

npm i @bitocredit/nodejs-gateway

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.79 kB

Total Files

6

Last publish

Collaborators

  • rezamotahary