public EthWallet(ILogger logger, WalletContext db, bool mainnet, string gethAddress, string gethTxScanAddress) : base(logger, db, mainnet) { this.logger = logger; // create HD wallet from seed wallet = new Wallet(Utils.ParseHexString(seedHex), PATH); // create web3 client web3 = new Web3(gethAddress); // create http client this.gethTxScanAddress = gethTxScanAddress; scanClient = new WebClient(); var netVersionTask = web3.Net.Version.SendRequestAsync(); netVersionTask.Wait(); if (mainnet) { if (netVersionTask.Result != "1") { throw new Exception("client is on wrong network"); } } if (!mainnet) { if (netVersionTask.Result != "3") { throw new Exception("client is on wrong network"); } } }
public WavWallet(ILogger logger, WalletContext db, bool mainnet, Uri nodeAddress) : base(logger, db, mainnet) { this.node = new Node(nodeAddress.ToString(), ChainId()); this.assetId = Assets.WAVES.Id; this.asset = Assets.WAVES; this.feeAsset = this.asset; }
public static bool?GetMainnet(WalletContext db) { if (db.CfgExists(MAINNET_KEY)) { return(db.CfgGetBool(MAINNET_KEY, false)); } return(null); }
public BaseWallet(ILogger logger, WalletContext db, bool mainnet) { this.logger = logger; this.db = db; this.mainnet = mainnet; CheckType(); CheckSeed(); CheckMainnet(); }
public static string GetSeed(WalletContext db) { var type = db.CfgGet(SEED_KEY); if (type != null) { return(type.Value); } return(null); }
public BaseWallet(ILogger logger, WalletContext db, bool mainnet, string type) { this.logger = logger; this.db = db; this.mainnet = mainnet; this._type_ = type; CheckType(); CheckSeed(); CheckMainnet(); }
public ZapWallet(ILogger logger, WalletContext db, bool mainNet, Uri nodeAddress) : base(logger, db, mainNet, nodeAddress) { this.assetId = "CgUrFtinLXEbJwJVjwwcppk4Vpz1nMmR3H5cQaDcUcfe"; if (IsMainnet()) { this.assetId = "9R3iLi4qGLVWKc16Tg98gmRvgg1usGEYd7SgC1W5D6HB"; } this.asset = new Asset(assetId, "Zap", 2); this.feeAsset = this.asset; }
public BtcWallet(ILogger logger, WalletContext db, bool mainnet, Uri nbxplorerAddress, bool useLegacyAddrs = false) : base(logger, db, mainnet) { this.nbxplorerAddress = nbxplorerAddress; // create extended key var network = GetNetwork(); key = new BitcoinExtKey(new ExtKey(seedHex), network); var strpubkey = $"{key.Neuter().ToString()}"; if (useLegacyAddrs) { strpubkey = strpubkey + "-[legacy]"; } pubkey = (DirectDerivationStrategy) new DerivationStrategyFactory(network).Parse(strpubkey); }
public FastWallet(ILogger logger, WalletContext db, bool mainnet, string type) : base(logger, db, mainnet, type) { System.Diagnostics.Debug.Assert(db.LazyLoading == false); }
public BaseFullWallet(ILogger logger, WalletContext db, bool mainnet) : base(logger, db, mainnet, null) { System.Diagnostics.Debug.Assert(db.LazyLoading == true); }