CryptoAPIs SDK for all Exchanges, Bitcoin and Ethereum endpoints. You can get API key here.
$ npm install cryptoapis.io
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getAllExchanges().then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Check out CryptoAPIs documentation for more information.
apiKey
String Your API key
Get a detailed list of all supported exchanges provided by CryptoAPIs.
skip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 20;
var caClient = new CryptoApis(apiKey);
caClient.getAllExchanges(skip, limit).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get detailed list of all associated assets.
skip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 5;
var caClient = new CryptoApis(apiKey);
caClient.getAllAssets(skip, limit).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get a detailed list of all symbol mappings.
skip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 10;
var caClient = new CryptoApis(apiKey);
caClient.getAllSymbols(skip, limit).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get exchange rates between pair of requested assets.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getSpecificRate('BTC', 'USD').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get the current exchange rate between requested asset and all other assets.
baseAsset
String Base asset identifier
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getAllCurrentRates('BTC').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get full list of time periods available for requesting OHLCV data.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVPeriods().then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get OHLCV latest time-series data for requested symbol and period, returned in time descending order.
symbol
String Symbol identifier used to filter response.period
String Periodlimit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVLatestData('5bfc329f9c40a100014dc5a7', '1day', 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get OHLCV time-series data for requested symbol and period, returned in time ascending order.
symbol
String Symbol identifier used to filter response.period
String PeriodtimePeriodStart
(Number | String) Time period starttimePeriodEnd
(Number | String) Time period endlimit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVHistoricalData('5bfc329f9c40a100014dc5a7', '1day', 1542955177, 1556355177, 2).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get latest trades from all symbols up to 1 hour ago
skip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetLatestData(0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get latest trades from a specific symbol without time limitation
symbol
String Symbol identifier used to filter response.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetLatestDataBySymbol('5bfc329f9c40a100014dc5a7').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get history transactions from specific symbol, returned in time ascending order. If no start & end time is defined, your data results will be provided 24 hours back, by default.
symbol_id
String Symbol identifier used to filter response.timeStart
(Number | String) Time starttimeEnd
(Number | String) Time endskip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetHistoricalData('5bfc329f9c40a100014dc5a7', 1542955177, 1556355177, 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get latest quote updates for up to 1 hour ago.
skip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.quotesGetLatestData().then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get historical quote updates within requested time range, returned in time ascending order.
symbol_id
String Symbol identifier used to filter response.timeStart
(Number | String) Time starttimeEnd
(Number | String) Time endskip
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 100
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.quotesGetHistoricalData('5bfc329f9c40a100014dc5a7', 1532955177, 1556355177, 0, 50).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
General information about a blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinInfo('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Block endpoint gives you detail information for particular block in the blockchain.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinBlock('mainnet', 546903).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Latest Block Endpoint gives you detail information for the latest block in the blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinLatestBlock('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The default Address Endpoint strikes a general information about addresses.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinAddressInfo('mainnet', '1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateBitcoinAddress('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Address Transactions Endpoint returns all information available about a particular address, including an array of complete transactions.
network
String Network name (mainnet or testnet)address
String Bitcoin addressindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinAddressTransactions('mainnet', '3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3', 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Bitcoin Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var addresses = ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"];
caClient.createBitcoinWallet('mainnet', 'myWallet', addresses).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Bitcoin HD Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddressCount
Number Number of addresses that should be generated in new walletpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.createBitcoinHDWallet('mainnet', 'myHDWallet', 5, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List Wallets
network
String Network name (mainnet or testnet)hd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listBitcoinWallets('mainnet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinWallet('mainnet', 'myHDWallet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Add Addresses to Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.addAddressToBitcoinWallet('mainnet', 'myWallet', ['1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6']).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in Wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInBitcoinWallet('mainnet', 'myWallet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in HD Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddressCount
Number Number of addresses that should be generatedpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInBitcoinHDWallet('mainnet', 'myHDWallet', 2, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Remove Addresses from Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddress
String Address which should be deleted
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteAddressFromBitcoinWallet('mainnet', 'myWallet', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteBitcoinWallet('mainnet', 'myWallet', false).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its id.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinTransaction('mainnet', '54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its hash and index of transaction in the block.
network
String Network name (mainnet or testnet)blockHash
String Block hashindex
Number Index of the transaction in block
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinTransactionByBlockIndex('mainnet', '0000000000000000002523785a5a3a0f4a04536baf589f9c5fbf2b6273daf62b', 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Transaction Index Endpoint by Index, Limit and Block Height returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined.
network
String Network name (mainnet or testnet)blockHeight
Number Block heightindex
Number Index - start fromlimit
Number Limit - up to
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinTransactionsByBlockIndex('mainnet', 553394, 0, 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that haven’t been included in any blocks.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinUnconfirmedTransactions('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given set of transactions based on theirs hashes.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txs = ['54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21', '4ed3bbc8297b69a002ac7dc5fcf0acf01f6ffd92871c1027061a7eabc1e74623'];
caClient.bitcoinTransactionTrace('mainnet', txs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that could be mined or not.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinLatestTransactions('mainnet', 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions. By default it is for last 24 hours
network
String Network name (mainnet or testnet)txsIncluded
Boolean Whether transactions to be included in response. Default trueindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinTransactionsHistory('mainnet', true, 0, 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create transaction
network
String Network name (mainnet or testnet)inputs
Array<Object> Array of objects (see example below)outputs
Array<Object> Array of objects (see example below)fee
Object (see example below)wifs
Array<String> Array of private ECDSA keys of the addresses (see example below)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}];
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
address: "mmskWH7hG9CJNzb16JaVFJyWdgAwcVEAkz", //optional
value: 0.00023141
};
var wifs = [
"cUGddnJmuzfzpWXNwt1SRnQ8GMqZdQ1vg8BtwjG8f275pvExPzaX",
"cSEjySAREyai8eQhgoqixzmxCeSP8QtbwHxptL8ijofg68ZMjoud",
"cV2u6dqfiQthWfPixJ7ucFW5Tza1ubLr6ipM35vSTy9xGEKbCbaJ"
];
caClient.createBitcoinTransaction('testnet', inputs, outputs, fee, wifs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create HDWallet transaction
network
String Network name (mainnet or testnet)walletName
String Wallet namepassword
String Wallet passwordfee
Object (see example below)outputs
Array<Object> Array of objects (see example below)inputs
(optional) Array<Object> Array of objects (see example below)locktime
(optional) Number
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var walletName = 'myWallet';
var password = '8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32';
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}]; //optional
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
value: 0.00023141
};
var locktime = 0; //optional
caClient.createBitcoinHDWalletTransaction('testnet', walletName, password, fee, outputs, inputs, locktime).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Send Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var toSend = '02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000';
caClient.sendBitcoinTransaction('testnet', toSend).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Decode Raw Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txHex = '0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000';
caClient.decodeRawBitcoinTransaction('mainnet', txHex).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Payment
network
String Network name (mainnet or testnet)fromAddress
String Destination bitcoin addresstoAddress
String Target bitcoin addresscallbackURL
String Callback URLwalletName
String Wallet created by currentpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCreatePayment('mainnet', '12CHjjowV5koCpyMXHeYFhMQzd4KE6JUdF', '1DoAHYHRd72RBbScbr678vXhAwHPPfhY34', 'your callback url', 'myHDWallet', 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
To list your currently active payment forwarding addresses
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinListPayment('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Payment
network
String Network name (mainnet or testnet)paymentID
String Generated UUID when payment forwarding have been created
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinDeletePayment('mainnet', '1f3e4771-ce6c-4b25-805b-cc27a38e2603').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new transaction CryptoAPIs receives before it's confirmed in a block, basically, for every unconfirmed transaction.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCreateUnconfirmedTransactionWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new block.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCreateNewBlockWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Confirmed Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLtransaction
String Transaction IDconfirmations
Number Confirmations
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCreateConfirmedTransactionWebHook('mainnet', 'your callback url', '56ee588e6ac4df324d5e1cdd0fa7d58a479295bad71f3c62865f1c302e0ca2a6', 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Address Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLaddress
String Bitcoin address
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCreateAddressTransactionWebHook('mainnet', 'your callback url', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List all web hooks that you have created.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listAllBitcoinHooks('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete a WebHook by WebHook ID
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteBitcoinWebHook('mainnet', '232c9f47-ff47-401c-9681-9d854e497c8a').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
General information about Ethereum blockchain.
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumInfo('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Information for particular block in the blockchain.
network
String Network name (mainnet, ropsten or rinkeby)block
(Number | String) Block height or block hash
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumBlock('mainnet', 6873814).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Latest Block method gives you detail information for the latest block in the blockchain
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumLatestBlock('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get address information
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumAddressInfo('ropsten', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns all transactions specified by the query params: index and limit.
network
String Network name (mainnet, ropsten or rinkeby)address
String Ethereum addressindex
(optional) Number Start from. Default value is 0limit
(optional) Number Limit. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumAddressTransactions('ropsten', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate private-public key-pairs along with an associated public address.
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateEthereumAddress('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate private-public key-pairs along with an associated public address encoded in a keyfile.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateEthereumAccount('mainnet', 'kl423jkls$3kl').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its hash.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumTransaction('mainnet', '0x52afade154e72b3f9059f9a0330bd8f9c9b6ccf73f9a6ef75fa6814bf941ceae').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get ethereum transactions by block number
network
String Network name (mainnet, ropsten or rinkeby)block
String Block numberindex
(optional) Number Start from. Default value is 0limit
(optional) Number Limit. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumTransactionsByBlock('mainnet', 6878377, 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its index and block.
network
String Network name (mainnet, ropsten or rinkeby)block
(Number | String) Block height or block hashindex
(optional) Number Index of the transaction in block
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumTransactionByIndexInBlock('mainnet', 6878377, 0).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create new transaction using keystore file stored on our server. In order to use this endpoint you should have an account (keystore file) stored on our servers.
network
String Network name (mainnet, ropsten or rinkeby)from
String Input addressto
String Output addressgasPrice
Number Gas pricegasLimit
Number Gas limitvalue
Number Value to transfer (in Ether)password
String Account password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.createEthereumTransaction('ropsten', '0xc56b7f5264eb24b6b2bf2eb59184c521f0770d52', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', 21000000000, 21000, 1.12, 'kl423jkls$3kl').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create new transaction for address which is not hold on Crypto APIs servers.
network
String Network name (mainnet, ropsten or rinkeby)from
String Input addressto
String Output addressgasPrice
Number Gas pricegasLimit
Number Gas limitvalue
Number Value to transfer (in Ether)privateKey
String Private key
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.createEthereumTransactionWithPrivateKey('ropsten', '0xc56b7f5264eb24b6b2bf2eb59184c521f0770d52', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', 21000000000, 21000, 1.12, '0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Send transaction
network
String Network name (mainnet, ropsten or rinkeby)from
String Input addressto
String Output addressvalue
Number Value to transfer (in Ether)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.sendEthereumTransaction('ropsten', '0xc56b7f5264eb24b6b2bf2eb59184c521f0770d52', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', 1.12).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Push transaction
network
String Network name (mainnet, ropsten or rinkeby)signedTx
String Hex-encoded raw representation of your transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var signedTx = '0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69';
caClient.pushEthereumTransaction('ropsten', signedTx).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Estimate Transaction Gas
network
String Network name (mainnet, ropsten or rinkeby)from
String Input addressto
String Output addressvalue
Number Value to transfer (in Ether)data
(optional) String Optional data. However, if data is added it should be a valid hexadecimal number otherwise an error will be returned
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var data = '24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7';
caClient.estimateEthereumTransactionGas('ropsten', '0x7857af2143cb06ddc1dab5d7844c9402e89717cb', '0xc595B20EEC3d35E8f993d79262669F3ADb6328f7', 0.12, data).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Estimate Gas Smart Contract
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.estimateEthereumSmartContractGas('ropsten').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Deploy Smart Contract
network
String Network name (mainnet, ropsten or rinkeby)privateKey
String Private keyfrom
String Input addressgasPrice
Number Gas pricegasLimit
Number Gas limitbyteCode
String Contract bytecode - compiled to binary solidity code
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var privateKey = '4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1';
var byteCode = '0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff';
caClient.deployEthereumSmartContract('rinkeby', privateKey, '0xe7cc96ba0562dfba61a55c8dd2e162a30942f402', 21000000000, 2100000, byteCode).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get Token Balance
network
String Network name (mainnet, ropsten or rinkeby)address
String Ethereum addresscontract
String Contract address
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getEthereumAddressTokenBalance('rinkeby', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', '0xe7d553c3aab5943ec097d60535fd06f1b75db43e').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Transfer Tokens. You must use the private key or password (if it is an account stored on our servers)
network
String Network name (mainnet, ropsten or rinkeby)fromAddress
String From addresstoAddress
String To addresscontract
String Contract addressgasPrice
Number Gas pricegasLimit
Number Gas limittoken
Number The amount of tokens you would like to transferpassword
String Account password. Pass null if you use privateKeyprivateKey
String Private key
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumTransferTokens('rinkeby', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11', '0xe7d553c3aab5943ec097d60535fd06f1b75db43e', 11500000000, 60000, 115, null, '0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Payment Forwarding. You must use the private key or password (if it is an account stored on our servers)
network
String Network name (mainnet, ropsten or rinkeby)fromAddress
String From addresstoAddress
String To addresscallbackURL
String Callback URLpassword
String Account password. Pass null if you use privateKeyprivateKey
String Private key
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumCreatePayment('rinkeby', '0x195831d0fa4888c3fd577110d23ee464265c551a', '0x12b1883c01377f45ee5d7448a32b5ac1709af076', 'your callback url', null, '0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Payment Forwarding
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumDeletePayment('rinkeby', 'a2e2498a-a8e5-40a0-adb4-4b4b736c233c').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List of Forward Payments By Users
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumListPayment('rinkeby').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List of Past Forward Payments By Users
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumListPaymentHistory('rinkeby').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create WebHook triggered for every pending transaction in the Ethereum Blockchain before it's confirmed in a block, basically, for every unconfirmed transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumCreateUnconfirmedTransactionWebHook('ropsten', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create WebHook triggered for every new transaction making it into a new block
network
String Network name (mainnet, ropsten or rinkeby)callbackURL
String Callback URLtransaction
String Transaction hashconfirmations
Number Confirmations
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumCreateConfirmedTransactionWebHook('mainnet', 'your callback url', '0x87da27245076441baf7bcc6e93d328d80d11297a3a247a1ce3019168be3b7a36', 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create WebHook triggered for every new block
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumCreateNewBlockWebHook('rinkeby', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Ethereum Address Transaction WebHook
network
String Network name (mainnet, ropsten or rinkeby)callbackURL
String Callback URLaddress
String Ethereum address
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumCreateAddressTransactionWebHook('ropsten', 'your callback url', '0xe816c453a99b12bb65ea55db22a6fe70f63c2c7a').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Provides a list with all WebHooks of current user
network
String Network name (mainnet, ropsten or rinkeby)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumListAllWebHooks('ropsten').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete WebHook
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.ethereumDeleteWebHook('ropsten', '75012af1-12b6-4472-98de-a7fb5d66dba9').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
General information about a blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinInfo('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Block endpoint gives you detail information for particular block in the blockchain.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinBlock('mainnet', 546903).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Latest Block Endpoint gives you detail information for the latest block in the blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinLatestBlock('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The default Address Endpoint strikes a general information about addresses.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinAddressInfo('mainnet', '1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateLitecoinAddress('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Address Transactions Endpoint returns all information available about a particular address, including an array of complete transactions.
network
String Network name (mainnet or testnet)address
String Litecoin addressindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinAddressTransactions('mainnet', '3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3', 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Litecoin Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var addresses = ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"];
caClient.createLitecoinWallet('mainnet', 'myWallet', addresses).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Litecoin HD Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddressCount
Number Number of addresses that should be generated in new walletpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.createLitecoinHDWallet('mainnet', 'myHDWallet', 5, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List Wallets
network
String Network name (mainnet or testnet)hd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listLitecoinWallets('mainnet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinWallet('mainnet', 'myHDWallet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Add Addresses to Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.addAddressToLitecoinWallet('mainnet', 'myWallet', ['1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6']).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in Wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInLitecoinWallet('mainnet', 'myWallet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in HD Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddressCount
Number Number of addresses that should be generatedpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInLitecoinHDWallet('mainnet', 'myHDWallet', 2, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Remove Addresses from Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddress
String Address which should be deleted
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteAddressFromLitecoinWallet('mainnet', 'myWallet', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteLitecoinWallet('mainnet', 'myWallet', false).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its id.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinTransaction('mainnet', '54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its hash and index of transaction in the block.
network
String Network name (mainnet or testnet)blockHash
String Block hashindex
Number Index of the transaction in block
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinTransactionByBlockIndex('mainnet', '0000000000000000002523785a5a3a0f4a04536baf589f9c5fbf2b6273daf62b', 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Transaction Index Endpoint by Index, Limit and Block Height returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined.
network
String Network name (mainnet or testnet)blockHeight
Number Block heightindex
Number Index - start fromlimit
Number Limit - up to
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinTransactionsByBlockIndex('mainnet', 553394, 0, 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that haven’t been included in any blocks.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinUnconfirmedTransactions('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given set of transactions based on theirs hashes.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txs = ['54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21', '4ed3bbc8297b69a002ac7dc5fcf0acf01f6ffd92871c1027061a7eabc1e74623'];
caClient.litecoinTransactionTrace('mainnet', txs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that could be mined or not.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinLatestTransactions('mainnet', 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions. By default it is for last 24 hours
network
String Network name (mainnet or testnet)txsIncluded
Boolean Whether transactions to be included in response. Default trueindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getLitecoinTransactionsHistory('mainnet', true, 0, 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create transaction
network
String Network name (mainnet or testnet)inputs
Array<Object> Array of objects (see example below)outputs
Array<Object> Array of objects (see example below)fee
Object (see example below)wifs
Array<String> Array of private ECDSA keys of the addresses (see example below)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}];
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
address: "mmskWH7hG9CJNzb16JaVFJyWdgAwcVEAkz", //optional
value: 0.00023141
};
var wifs = [
"cUGddnJmuzfzpWXNwt1SRnQ8GMqZdQ1vg8BtwjG8f275pvExPzaX",
"cSEjySAREyai8eQhgoqixzmxCeSP8QtbwHxptL8ijofg68ZMjoud",
"cV2u6dqfiQthWfPixJ7ucFW5Tza1ubLr6ipM35vSTy9xGEKbCbaJ"
];
caClient.createLitecoinTransaction('testnet', inputs, outputs, fee, wifs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create HDWallet transaction
network
String Network name (mainnet or testnet)walletName
String Wallet namepassword
String Wallet passwordfee
Object (see example below)outputs
Array<Object> Array of objects (see example below)inputs
(optional) Array<Object> Array of objects (see example below)locktime
(optional) Number
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var walletName = 'myWallet';
var password = '8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32';
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}]; //optional
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
value: 0.00023141
};
var locktime = 0; //optional
caClient.createLitecoinHDWalletTransaction('testnet', walletName, password, fee, outputs, inputs, locktime).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Send Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var toSend = '02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000';
caClient.sendLitecoinTransaction('testnet', toSend).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Decode Raw Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txHex = '0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000';
caClient.decodeRawLitecoinTransaction('mainnet', txHex).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Payment
network
String Network name (mainnet or testnet)fromAddress
String Destination litecoin addresstoAddress
String Target litecoin addresscallbackURL
String Callback URLwalletName
String Wallet created by currentpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinCreatePayment('mainnet', '12CHjjowV5koCpyMXHeYFhMQzd4KE6JUdF', '1DoAHYHRd72RBbScbr678vXhAwHPPfhY34', 'your callback url', 'myHDWallet', 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
To list your currently active payment forwarding addresses
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinListPayment('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Payment
network
String Network name (mainnet or testnet)paymentID
String Generated UUID when payment forwarding have been created
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinDeletePayment('mainnet', '1f3e4771-ce6c-4b25-805b-cc27a38e2603').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new transaction CryptoAPIs receives before it's confirmed in a block, basically, for every unconfirmed transaction.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinCreateUnconfirmedTransactionWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new block.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinCreateNewBlockWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Confirmed Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLtransaction
String Transaction IDconfirmations
Number Confirmations
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinCreateConfirmedTransactionWebHook('mainnet', 'your callback url', '56ee588e6ac4df324d5e1cdd0fa7d58a479295bad71f3c62865f1c302e0ca2a6', 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Address Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLaddress
String Litecoin address
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.litecoinCreateAddressTransactionWebHook('mainnet', 'your callback url', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List all web hooks that you have created.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listAllLitecoinHooks('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete a WebHook by WebHook ID
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteLitecoinWebHook('mainnet', '232c9f47-ff47-401c-9681-9d854e497c8a').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
General information about a blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashInfo('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Block endpoint gives you detail information for particular block in the blockchain.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashBlock('mainnet', 546903).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Latest Block Endpoint gives you detail information for the latest block in the blockchain.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashLatestBlock('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The default Address Endpoint strikes a general information about addresses.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashAddressInfo('mainnet', '1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateBitcoinCashAddress('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Address Transactions Endpoint returns all information available about a particular address, including an array of complete transactions.
network
String Network name (mainnet or testnet)address
String BitcoinCash addressindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit results. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashAddressTransactions('mainnet', '3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3', 0, 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create BitcoinCash Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var addresses = ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"];
caClient.createBitcoinCashWallet('mainnet', 'myWallet', addresses).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create BitcoinCash HD Wallet
network
String Network name (mainnet or testnet)name
String Wallet nameaddressCount
Number Number of addresses that should be generated in new walletpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.createBitcoinCashHDWallet('mainnet', 'myHDWallet', 5, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List Wallets
network
String Network name (mainnet or testnet)hd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listBitcoinCashWallets('mainnet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Get Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashWallet('mainnet', 'myHDWallet', true).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Add Addresses to Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddresses
Array<String> Array of addresses that will be added to wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.addAddressToBitcoinCashWallet('mainnet', 'myWallet', ['1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6']).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in Wallet
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInBitcoinCashWallet('mainnet', 'myWallet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Generate Address in HD Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddressCount
Number Number of addresses that should be generatedpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.generateAddressInBitcoinCashHDWallet('mainnet', 'myHDWallet', 2, 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Remove Addresses from Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet nameaddress
String Address which should be deleted
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteAddressFromBitcoinCashWallet('mainnet', 'myWallet', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Wallet
network
String Network name (mainnet or testnet)walletName
String Wallet namehd
Boolean False for normal wallets, true for HD wallets
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteBitcoinCashWallet('mainnet', 'myWallet', false).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its id.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashTransaction('mainnet', '54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given transaction based on its hash and index of transaction in the block.
network
String Network name (mainnet or testnet)blockHash
String Block hashindex
Number Index of the transaction in block
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashTransactionByBlockIndex('mainnet', '0000000000000000002523785a5a3a0f4a04536baf589f9c5fbf2b6273daf62b', 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
The Transaction Index Endpoint by Index, Limit and Block Height returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined.
network
String Network name (mainnet or testnet)blockHeight
Number Block heightindex
Number Index - start fromlimit
Number Limit - up to
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashTransactionsByBlockIndex('mainnet', 553394, 0, 3).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that haven’t been included in any blocks.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashUnconfirmedTransactions('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns detailed information about a given set of transactions based on theirs hashes.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txs = ['54287345c01d64a3365166b380adf04e738ec52935f2751aead7ae60ff4fcb21', '4ed3bbc8297b69a002ac7dc5fcf0acf01f6ffd92871c1027061a7eabc1e74623'];
caClient.bitcoinCashTransactionTrace('mainnet', txs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions relayed by nodes in a blockchain that could be mined or not.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashLatestTransactions('mainnet', 10).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Returns an array of the latest transactions. By default it is for last 24 hours
network
String Network name (mainnet or testnet)txsIncluded
Boolean Whether transactions to be included in response. Default trueindex
(optional) Number Offset results. Default value is 0limit
(optional) Number Limit. Default limit is 50
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getBitcoinCashTransactionsHistory('mainnet', true, 0, 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create transaction
network
String Network name (mainnet or testnet)inputs
Array<Object> Array of objects (see example below)outputs
Array<Object> Array of objects (see example below)fee
Object (see example below)wifs
Array<String> Array of private ECDSA keys of the addresses (see example below)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}];
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
address: "mmskWH7hG9CJNzb16JaVFJyWdgAwcVEAkz", //optional
value: 0.00023141
};
var wifs = [
"cUGddnJmuzfzpWXNwt1SRnQ8GMqZdQ1vg8BtwjG8f275pvExPzaX",
"cSEjySAREyai8eQhgoqixzmxCeSP8QtbwHxptL8ijofg68ZMjoud",
"cV2u6dqfiQthWfPixJ7ucFW5Tza1ubLr6ipM35vSTy9xGEKbCbaJ"
];
caClient.createBitcoinCashTransaction('testnet', inputs, outputs, fee, wifs).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create HDWallet transaction
network
String Network name (mainnet or testnet)walletName
String Wallet namepassword
String Wallet passwordfee
Object (see example below)outputs
Array<Object> Array of objects (see example below)inputs
(optional) Array<Object> Array of objects (see example below)locktime
(optional) Number
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var walletName = 'myWallet';
var password = '8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32';
var inputs = [{
address: "2N4Peeewfgghac69z6evCAmab91oEuWmkgy",
value: 0.54
}, {
address: "2MuqsmttygX6RWkxS1MLjDgwJ2DavbG9JPu",
value: 1.0
}]; //optional
var outputs = [{
address: "2Mx93LzsoPWR8UmoJMBFnCb2KkCGt2Jg8Dd",
value: 1.54
}];
var fee = {
value: 0.00023141
};
var locktime = 0; //optional
caClient.createBitcoinCashHDWalletTransaction('testnet', walletName, password, fee, outputs, inputs, locktime).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Send Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var toSend = '02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000';
caClient.sendBitcoinCashTransaction('testnet', toSend).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Decode Raw Transaction
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
var txHex = '0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000';
caClient.decodeRawBitcoinCashTransaction('mainnet', txHex).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Payment
network
String Network name (mainnet or testnet)fromAddress
String Destination bitcoinCash addresstoAddress
String Target bitcoinCash addresscallbackURL
String Callback URLwalletName
String Wallet created by currentpassword
String Wallet password
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashCreatePayment('mainnet', '12CHjjowV5koCpyMXHeYFhMQzd4KE6JUdF', '1DoAHYHRd72RBbScbr678vXhAwHPPfhY34', 'your callback url', 'myHDWallet', 'jr9023kes%kj').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
To list your currently active payment forwarding addresses
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashListPayment('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete Payment
network
String Network name (mainnet or testnet)paymentID
String Generated UUID when payment forwarding have been created
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashDeletePayment('mainnet', '1f3e4771-ce6c-4b25-805b-cc27a38e2603').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new transaction CryptoAPIs receives before it's confirmed in a block, basically, for every unconfirmed transaction.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashCreateUnconfirmedTransactionWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Triggered for every new block.
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashCreateNewBlockWebHook('mainnet', 'your callback url').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Confirmed Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLtransaction
String Transaction IDconfirmations
Number Confirmations
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashCreateConfirmedTransactionWebHook('mainnet', 'your callback url', '56ee588e6ac4df324d5e1cdd0fa7d58a479295bad71f3c62865f1c302e0ca2a6', 5).then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Create Address Transaction WebHook
network
String Network name (mainnet or testnet)callbackURL
String Callback URLaddress
String BitcoinCash address
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.bitcoinCashCreateAddressTransactionWebHook('mainnet', 'your callback url', '1GdnJh1r3xWsst7o7JXykgGD13AF4NSmh3').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
List all web hooks that you have created.
network
String Network name (mainnet or testnet)
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.listAllBitcoinCashHooks('mainnet').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
Delete a WebHook by WebHook ID
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.deleteBitcoinCashWebHook('mainnet', '232c9f47-ff47-401c-9681-9d854e497c8a').then(function(result) {
console.log(result);
}, function(error) {
console.log(error);
});
MIT