Beispiel #1
0
        /// <summary>
        /// This will set the coin based on the currently open app. Note: this only currently works with Bitcoin based Ledger apps.
        /// </summary>
        public async Task SetCoinNumber()
        {
            var getCoinVersionResponse = await SendRequestAsync <GetCoinVersionResponse, GetCoinVersionRequest>(new GetCoinVersionRequest());

            if (!getCoinVersionResponse.IsSuccess)
            {
                HandleErrorResponse(getCoinVersionResponse);
            }

            CurrentCoin = CoinUtility.GetCoinInfo(getCoinVersionResponse.ShortCoinName);
        }
Beispiel #2
0
        public override Task <string> GetAddressAsync(IAddressPath addressPath, bool isPublicKey, bool display)
        {
            if (CoinUtility == null)
            {
                throw new ManagerException($"A {nameof(CoinUtility)} must be specified if {nameof(AddressType)} is not specified.");
            }

            var coinInfo = CoinUtility.GetCoinInfo(addressPath.CoinType);

            return(GetAddressAsync(addressPath, isPublicKey, display, coinInfo));
        }
Beispiel #3
0
        public static void Coin(string msg, Dictionary <string, Session> sessionPool, string sendIP)
        {
            SocketDataModel <UserSendObject, CoinObj> socketDataModel = Utils.DataContractJsonDeserializer <SocketDataModel <UserSendObject, CoinObj> >(msg);
            UserSendObject sendObj = socketDataModel.SendObject;
            CoinObj        coinObj = socketDataModel.Data;

            CoinUtility.GetSaleCoinerParameter();
            CoinUtility coin = new CoinUtility();

            coin.SendInit();
            coin.SendOutCoin(coinObj.Coins);
            coin.SerialClose();
        }
Beispiel #4
0
        public override Task <string> GetAddressAsync(IAddressPath addressPath, bool isPublicKey, bool display)
        {
            if (CoinUtility == null)
            {
                throw new ManagerException($"A {nameof(CoinUtility)} must be specified if {nameof(AddressType)} is not specified.");
            }

            var cointType = addressPath.AddressPathElements.Count > 1 ? addressPath.AddressPathElements[1].Value : throw new ManagerException("The first element of the address path is considered to be the coin type. This was not specified so no coin information is available. Please use an overload that specifies CoinInfo.");

            var coinInfo = CoinUtility.GetCoinInfo(cointType);

            return(GetAddressAsync(addressPath, isPublicKey, display, coinInfo));
        }
Beispiel #5
0
 public void SetCoinNumber(uint coinNumber)
 {
     CurrentCoin = CoinUtility.GetCoinInfo(coinNumber);
 }
        /// <summary>
        /// This will set the coin based on the currently open app. Note: this only currently works with Bitcoin based Ledger apps.
        /// </summary>
        public async Task SetCoinNumber()
        {
            var getCoinVersionRequest = await SendRequestAsync <GetCoinVersionResponse, GetCoinVersionRequest>(new GetCoinVersionRequest());

            CurrentCoin = CoinUtility.GetCoinInfo(getCoinVersionRequest.ShortCoinName);
        }