How to use the bitcore-lib-cash.testnet function in bitcore-lib-cash

To help you get started, we’ve selected a few bitcore-lib-cash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github monicanagent / cypherpoker.js / src / server / libs / adapters / CryptoAPIs.js View on Github external
if (network == null) {
         network = API.default.network;
         }
         var token = this.server.config.CP.API.tokens.cryptoapis;
         if ((network == "main") || (network == "livenet")) {
            network = "mainnet";
         }
         if ((network == "test") || (network == "test3")) {
            network = "testnet";
         }
         switch (network) {
            case "mainnet":
               var addressCash = new bitcoreCash.Address(address, bitcoreCash.livenet);
               break;
            case "testnet":
               var addressCash = new bitcoreCash.Address(address, bitcoreCash.testnet);
               break;
            default:
               throw (new Error("Unrecognized network \""+network+"\""));
               break;
         }
         addressCash = addressCash.toString();
         var addressCashShort = addressCash.split(":")[1];
         url = url.split("%network%").join(network).split("%address%").join(addressCashShort);
         this.server.request({
            url: url,
            method: "GET",
            json: true,
            headers: {
               "Content-Type": "application/json",
               "X-API-Key": token
              }
github monicanagent / cypherpoker.js / src / server / libs / adapters / BitcoinComAPI.js View on Github external
var url = API.urls.bitcoincom.gettxs;
         if (network == null) {
         network = API.default.network;
         }
         if ((network == "main") || (network == "mainnet") || (network == "livenet") || (network == "rest")) {
            network = "mainnet";
         }
         if ((network == "test") || (network == "test3") || (network == "testnet") || (network == "trest")) {
            network = "testnet";
         }
         switch (network) {
            case "mainnet":
               var addressCash = new bitcoreCash.Address(address, bitcoreCash.livenet);
               break;
            case "testnet":
               var addressCash = new bitcoreCash.Address(address, bitcoreCash.testnet);
               break;
            default:
               throw (new Error("Unrecognized network \""+network+"\""));
               break;
         }
         addressCash = addressCash.toString();
         if ((network == "main") || (network == "mainnet") || (network == "livenet")) {
            network = "rest";
         }
         if ((network == "test") || (network == "test3") || (network == "testnet")) {
            network = "trest";
         }
         url = url.split("%network%").join(network).split("%address%").join(addressCash);
         this.server.request({
            url: url,
            method: "GET",