diff --git a/src/api/index.js b/src/api/index.js index c23eb7bdf0893f541548a1b4cff911bcec7628b2..ec606f044a1b7a3f40772e3df8bb57b4e34390f0 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,6 @@ import EventEmitter from 'events'; import Promise from 'bluebird'; -import Config from '../config'; +import config from '../config'; import methods from './methods'; import transports from './transports'; import {RPCError} from './transports/http' @@ -197,7 +197,7 @@ class Hive extends EventEmitter { this.transport.setOptions(options); if( options.hasOwnProperty('useTestNet') ) { - Config.set( 'address_prefix', options.useTestNet ? 'TST' : 'STM' ) + config.set( 'address_prefix', options.useTestNet ? 'TST' : 'STM' ) } if (options.hasOwnProperty('url')) @@ -408,6 +408,6 @@ class Hive extends EventEmitter { } // Export singleton instance -const hive = new Hive(Config); +const hive = new Hive(config); exports = module.exports = hive; exports.Hive = Hive; diff --git a/src/auth/serializer/src/operations.js b/src/auth/serializer/src/operations.js index 545896e9ce2fad38b99bd247cf5717a732983f17..149fdb5362ab77717fe8f0f54051f83aafc056d2 100644 --- a/src/auth/serializer/src/operations.js +++ b/src/auth/serializer/src/operations.js @@ -33,10 +33,10 @@ static_variant [ import types from "./types" import SerializerImpl from "./serializer" -import Config from "../../../config" +import config from "../../../config" -const hiveVar = Config.get("rebranded_api") ? "hive" : "steem" -const hbdVar = Config.get("rebranded_api") ? "hbd" : "sbd" +const hiveVar = config.get("rebranded_api") ? "hive" : "steem" +const hbdVar = config.get("rebranded_api") ? "hbd" : "sbd" const { //id_type, diff --git a/src/auth/serializer/src/types.js b/src/auth/serializer/src/types.js index 6e1d18e1bcb87c440773f0e3f09336a376893379..0296773a45ecf27cd9787c1379222913443a8673 100644 --- a/src/auth/serializer/src/types.js +++ b/src/auth/serializer/src/types.js @@ -10,7 +10,7 @@ const chain_types = require('./ChainTypes') import { PublicKey, Address, ecc_config } from "../../ecc" import { fromImpliedDecimal } from "./number_utils" -import Config from "../../../config.js" +import config from "../../../config.js" const Types = {} module.exports = Types @@ -132,11 +132,11 @@ Types.asset = { { case "@@000000021": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" + symbol = config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" break case "@@000000013": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" + symbol = config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" break case "@@000000037": precision = 6 @@ -252,11 +252,11 @@ Types.asset_symbol = { { case "@@000000021": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" + symbol = config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" break case "@@000000013": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" + symbol = config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" break case "@@000000037": precision = 6 diff --git a/src/formatter.js b/src/formatter.js index 261c8bffc74b4c6edb6b50208d857b77e7277b57..aee5c57237fd17163cc866cb86f1ccda4128c9e0 100644 --- a/src/formatter.js +++ b/src/formatter.js @@ -1,9 +1,9 @@ import get from "lodash/get"; import { key_utils } from "./auth/ecc"; -import Config from "./config" +import config from "./config" -const HiveVar = Config.get("rebranded_api") ? "hive" : "steem" -const HbdVar = Config.get("rebranded_api") ? "hbd" : "sbd" +const HiveVar = config.get("rebranded_api") ? "hive" : "steem" +const HbdVar = config.get("rebranded_api") ? "hbd" : "sbd" module.exports = hiveAPI => { function numberWithCommas(x) { diff --git a/test/Crypto.js b/test/Crypto.js index 4fabdbb3954990c07f6f06dee4e709586b416dab..a508bc0f51f743d52cfc37663dd78954b1f633d3 100644 --- a/test/Crypto.js +++ b/test/Crypto.js @@ -1,4 +1,4 @@ -import Config from "../src/config" +import config from "../src/config" import { Aes, PrivateKey, PublicKey, Signature } from "../src/auth/ecc" import assert from "assert" @@ -27,7 +27,7 @@ describe("steem.auth: Crypto", function() { }) describe("steem.auth: derives", ()=> { - let prefix = Config.get("address_prefix") + let prefix = config.get("address_prefix") let one_time_private = PrivateKey.fromHex("8fdfdde486f696fd7c6313325e14d3ff0c34b6e2c390d1944cbfe150f4457168") let to_public = PublicKey.fromStringOrThrow(prefix + "7vbxtK1WaZqXsiCHPcjVFBewVj8HFRd5Z5XZDpN6Pvb2dZcMqK") let secret = one_time_private.get_shared_secret( to_public )