Пример #1
0
        public WalletMonitor(string seedPublicKey)
        {
            SeedBitcoinExtPubKey = new BitcoinExtPubKey(seedPublicKey);
            _network             = SeedBitcoinExtPubKey.Network;
            _qBitNinjaClient     = new QBitNinjaClient(_network);

            var walletName = KeyGenerator.GetUniqueKey(12);
            var wallet     = _qBitNinjaClient.GetWalletClient(walletName);

            wallet.CreateIfNotExists().Wait();

            _keySet = wallet.GetKeySetClient("main");

            // ReSharper disable once CoVariantArrayConversion
            _keySet.CreateIfNotExists(new[] { SeedBitcoinExtPubKey.ExtPubKey }).Wait();

            //var foo = wallet.GetBalanceSummary().Result;
            //var balance = foo.UnConfirmed.Amount.ToDecimal(MoneyUnit.BTC);
            //Console.WriteLine(balance);

            //for (uint i = 0; i < 10; i++)
            //{
            //    Console.WriteLine(SeedBitcoinExtPubKey.ExtPubKey.Derive(i).GetWif(_network).ScriptPubKey.GetDestinationAddress(_network));
            //}

            //foreach (var addr in wallet.GetAddresses().Result)
            //{
            //    Console.WriteLine(addr.Address);
            //}
        }
Пример #2
0
        public Transaction AsTransaction(NBitcoin.Network n)
        {
            var t = Transaction.Create(n);

            t.FromBytes(this.AsArray());
            return(t);
        }
Пример #3
0
        internal TransactionInfo(IEnumerable <Coin> spentCoins, IEnumerable <Coin> receivedCoins, Network network,
                                 string transactionId, bool confirmed, decimal fee)
        {
            _network = Convert.ToNBitcoinNetwork(network);

            _spentCoins    = new List <ICoin>();
            _receivedCoins = new List <ICoin>();
            foreach (var coin in spentCoins)
            {
                _spentCoins.Add(coin);
            }
            foreach (var coin in receivedCoins)
            {
                _receivedCoins.Add(coin);
            }

            Id        = transactionId;
            Confirmed = confirmed;
            Fee       = fee;

            AllInOutsAdded =
                FillInOutInfoList(out _inputs, _spentCoins)
                &&
                FillInOutInfoList(out _outputs, _receivedCoins);
        }
Пример #4
0
 public BroadcasterDelegatesHolder(IBroadcaster broadcaster, NBitcoin.Network n)
 {
     _broadcaster          = broadcaster ?? throw new ArgumentNullException(nameof(broadcaster));
     _n                    = n ?? throw new ArgumentNullException(nameof(n));
     _broadcastTransaction = (ref FFITransaction ffiTx) =>
     {
         var tx = ffiTx.AsTransaction(_n);
         broadcaster.BroadcastTransaction(tx);
     };
 }
Пример #5
0
 public static ManyChannelMonitor Create(
     NBitcoin.Network network,
     IChainWatchInterface chainWatchInterface,
     IBroadcaster broadcaster,
     ILogger logger,
     IFeeEstimator feeEstimator)
 {
     return(Create(new ChainWatchInterfaceDelegatesHolder(chainWatchInterface),
                   new BroadcasterDelegatesHolder(broadcaster, network), new LoggerDelegatesHolder(logger),
                   new FeeEstimatorDelegatesHolder(feeEstimator)));
 }
Пример #6
0
 internal static Network ToHiddenBitcoinNetwork(NBitcoin.Network nNetwork)
 {
     if (nNetwork == NBitcoin.Network.Main)
     {
         return(Network.MainNet);
     }
     if (nNetwork == NBitcoin.Network.TestNet)
     {
         return(Network.TestNet);
     }
     throw new InvalidOperationException("WrongNetwork");
 }
Пример #7
0
        //public void xx()
        //{
        //    GeneratePrivateKey(Network.TestNet);

        //    xx(Network.TestNet);
        //}

        //public void xx(Network network)
        //{
        //    string WIF = GenerateNewPrivateKeyAndGetWIF(network);
        //    var b1 = GenerateNewDataSet(network, WIF);
        //    Write(b1);
        //    var b2 = GenerateNewDataSet(network, WIF);
        //    Write(b2);
        //    var b4 = GenerateNewDataSet(network, WIF);
        //    Write(b4);
        //}

        //public void Write(BitcoinDataSet b)
        //{
        //    Console.WriteLine(b.ToString());

        //}

        //public string GenerateNewPrivateKeyAndGetWIF()
        //{
        //    return GenerateNewPrivateKeyAndGetWIF(Network.TestNet);
        ////}

        //public string GenerateNewPrivateKeyAndGetWIF(Network network)
        //{
        //    Key privateKey = new Key();
        //    var wif = privateKey.GetWif(network);
        //    return wif.ToString();

        //}


        private static BitcoinDataSet GenerateNewDataSet(NBitcoin.Network network, string wif)
        {
            BitcoinSecret  privateKey = new BitcoinSecret(wif);
            BitcoinDataSet btds       = new BitcoinDataSet();

            btds.WIF          = privateKey.ToWif().ToString();
            btds.PublicKey    = privateKey.PubKey.ToString();
            btds.Hash         = privateKey.PubKey.Hash.ToString();
            btds.Address      = privateKey.PubKey.GetAddress(network).ToString();
            btds.ScriptPubKey = privateKey.PubKey.GetAddress(network).ScriptPubKey.ToString();
            return(btds);
        }
Пример #8
0
 public BroadcasterDelegatesHolder(IBroadcaster broadcaster, NBitcoin.Network n)
 {
     _broadcaster          = broadcaster ?? throw new ArgumentNullException(nameof(broadcaster));
     _n                    = n ?? throw new ArgumentNullException(nameof(n));
     _broadcastTransaction = (ref FFITransaction ffiTx) =>
     {
         var tx = ffiTx.AsTransaction(n);
         broadcaster.BroadcastTransaction(tx);
     };
     _handle   = GCHandle.Alloc(_broadcastTransaction);
     _disposed = false;
 }
        private static IEnumerable <ITxOutput> GetTestOutputs(PubKey pubKey, NBitcoin.Network network)
        {
            var tx = Transaction.Create(network);

            tx.Outputs.Add(new TxOut(new Money(10000L), pubKey.Hash));
            tx.Outputs.Add(new TxOut(new Money(20000L), pubKey.Hash));
            tx.Outputs.Add(new TxOut(new Money(30000L), pubKey.Hash));

            return(tx.Outputs
                   .AsCoins()
                   .Select(c => new BitcoinBasedTxOutput(c)));
        }
Пример #10
0
 private void SetNetwork(Network network)
 {
     if (network == Network.MainNet)
     {
         _network = NBitcoin.Network.Main;
     }
     else if (network == Network.TestNet)
     {
         _network = NBitcoin.Network.TestNet;
     }
     else
     {
         throw new Exception("WrongNetwork");
     }
 }
Пример #11
0
        public static ChannelManager Create(
            NBitcoin.Network nbitcoinNetwork,
            IUserConfigProvider config,
            IChainWatchInterface chainWatchInterface,
            IKeysInterface keysInterface,
            ILogger logger,
            IBroadcaster broadcaster,
            IFeeEstimator feeEstimator,
            ulong currentBlockHeight,
            ManyChannelMonitor manyChannelMonitor
            )
        {
            var c = config.GetUserConfig();

            return(Create(nbitcoinNetwork, in c, chainWatchInterface, keysInterface, logger, broadcaster, feeEstimator, currentBlockHeight, manyChannelMonitor));
        }
Пример #12
0
        public static Network ToFFINetwork(this NBitcoin.Network n)
        {
            if (n.NetworkType == NetworkType.Mainnet)
            {
                return(Network.MainNet);
            }

            if (n.NetworkType == NetworkType.Testnet)
            {
                return(Network.TestNet);
            }

            if (n.NetworkType == NetworkType.Regtest)
            {
                return(Network.RegTest);
            }

            throw new Exception($"Unknown network type {n.NetworkType}");
        }
Пример #13
0
        internal TransactionInfo(GetTransactionResponse transactionResponse, Network network)
        {
            if (transactionResponse == null)
            {
                throw new NullReferenceException("Transaction does not exists");
            }

            _network = Convert.ToNBitcoinNetwork(network);

            _spentCoins    = transactionResponse.SpentCoins;
            _receivedCoins = transactionResponse.ReceivedCoins;

            Id        = transactionResponse.TransactionId.ToString();
            Confirmed = transactionResponse.Block != null;
            Fee       = transactionResponse.Fees.ToDecimal(MoneyUnit.BTC);

            AllInOutsAdded =
                FillInOutInfoList(out _inputs, _spentCoins)
                &&
                FillInOutInfoList(out _outputs, _receivedCoins);
        }
Пример #14
0
 public Subscriber(string host, int port, Coin coin, Network network)
 {
     Host = host;
     Port = port;
     Coin = coin;
     if (Coin == Coin.Bitcoin && network == ElectrumX.Network.Mainnet)
     {
         Network = NBitcoin.Network.Main;
     }
     else if (Coin == Coin.Bitcoin && network == ElectrumX.Network.Testnet)
     {
         Network = NBitcoin.Network.TestNet;
     }
     else if (Coin == Coin.BitcoinCash && network == ElectrumX.Network.Mainnet)
     {
         Network = BCash.Instance.Mainnet;
     }
     else if (Coin == Coin.BitcoinCash && network == ElectrumX.Network.Testnet)
     {
         Network = BCash.Instance.Testnet;
     }
 }
Пример #15
0
 public Client(string host, int port, Coin coin, Network network, bool useSsl = false)
 {
     Host   = host;
     Port   = port;
     Coin   = coin;
     UseSsl = useSsl;
     if (coin == Coin.Bitcoin && network == ElectrumX.Network.Mainnet)
     {
         Network = NBitcoin.Network.Main;
     }
     else if (coin == Coin.Bitcoin && network == ElectrumX.Network.Testnet)
     {
         Network = NBitcoin.Network.TestNet;
     }
     else if (coin == Coin.BitcoinCash && network == ElectrumX.Network.Mainnet)
     {
         Network = BCash.Instance.Mainnet;
     }
     else if (coin == Coin.BitcoinCash && network == ElectrumX.Network.Testnet)
     {
         Network = BCash.Instance.Testnet;
     }
 }
Пример #16
0
        private void SetupProvisioningWindow(PKType pKType)
        {
            CardPkType       = pKType;
            CardGeneratedKey = new NBitcoin.Key();

            switch (pKType)
            {
            case PKType.BTC:
                Network = NBitcoin.Network.Main;
                break;

            case PKType.BTC_TestNet:
                Network = NBitcoin.Network.TestNet;
                break;

            case PKType.CUSTOM:
                CardGeneratedKey = null;
                Network          = null;
                break;
            }

            if (CardGeneratedKey != null)
            {
                PublicKeyTextBox.Text  = CardGeneratedKey.PubKey.GetAddress(Network).ToString();
                PrivateKeyTextBox.Text = CardGeneratedKey.GetBitcoinSecret(Network).ToWif();

                //HelperText.Text = "When setting up a Bitcoin address, a private key is automatically generated for you. You can replace the private key data with a seed phrase mnemonic or your own WIF address.";
            }
            else
            {
                PublicKeyTextBox.Text  = String.Empty;
                PrivateKeyTextBox.Text = String.Empty;

                // HelperText.Text = "Public data is not encrypted and optional. Any data may be used in the Private Key textbox, as long as it is under 96 bytes.";
            }
        }
Пример #17
0
 public ChainWatchInterfaceUtil(Network network)
 {
     Network = network ?? throw new ArgumentNullException(nameof(network));
 }
Пример #18
0
 public Block ToBlock(NBitcoin.Network n) => Block.Load(this.AsArray(), n);
Пример #19
0
 static public void GetTransaction(uint256 transactionId, NBitcoin.Network network, GetTransactionResponse response)
 {
     ObservableWWW.Get(URL(network, "transactions/" + EscapeUrlPart(transactionId.ToString()))).
     Subscribe(x => response(JsonUtility.FromJson <Models.GetTransactionResponse>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #20
0
 static public void Broadcast(Transaction transaction, NBitcoin.Network network, BroadcastResponse response)
 {
     ObservableWWW.Post(URL(network, "transactions"), transaction.ToBytes(), HEADER()).
     Subscribe(x => response(JsonUtility.FromJson <Models.BroadcastResponse>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #21
0
 static public void GetBlock(QBitNinja.Client.Models.BlockFeature blockFeature, NBitcoin.Network network, GetBlockResponse response, bool headerOnly = false, bool extended = false)
 {
     ObservableWWW.Get(URL(network, "blocks/" + EscapeUrlPart(blockFeature.ToString()) + CreateParameters("headerOnly", headerOnly, "extended", extended))).
     Subscribe(x => response(JsonUtility.FromJson <Models.GetBlockResponse>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #22
0
        // -------------------------------------------

        /*
         * Constructor
         */
        public PaymentModel(string _publicKeyAddress, NBitcoin.Network _network, decimal _amountToPay)
        {
            m_bitcoinAddress = BitcoinAddress.Create(_publicKeyAddress, _network);
            m_amountToPay    = _amountToPay;
            m_moneyToPay     = new Money(m_amountToPay, MoneyUnit.BTC);
        }
Пример #23
0
 static public void BlockHeader(QBitNinja.Client.Models.BlockFeature blockFeature, NBitcoin.Network network, BlockHeaderResponse response)
 {
     ObservableWWW.Get(URL(network, "blocks/" + EscapeUrlPart(blockFeature.ToString()) + "/header")).
     Subscribe(x => response(JsonUtility.FromJson <Models.WhatIsBlockHeader>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #24
0
 static public void GetBalance(BitcoinAddress address, NBitcoin.Network network, GetBalanceResponse response, bool includeImmature = false, bool unspentOnly = false, bool colored = true)
 {
     ObservableWWW.Get(URL(network, "balances/" + EscapeUrlPart(address.ToString()) + CreateParameters("includeImmature", includeImmature, "unspentOnly", unspentOnly, "colored", colored))).
     Subscribe(x => response(JsonUtility.FromJson <Models.BalanceModel>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #25
0
        public void NewCreateBasicSwap(uint path, params string[] seed)
        {
            List <ExtKey> keys   = new List <ExtKey>();
            Segwit        segwit = new Segwit(NBitcoin.Network.TestNet);

            for (int i = 0; i < seed.Length; i++)
            {
                var key = GetKey(path, seed[i]);
                //var address = segwit.GetP2SHAddress(key);
                keys.Add(key);
                //Console.WriteLine(address.ToString());
            }
            NBitcoin.Network _Network = NBitcoin.Network.TestNet;

            MultiSig      multi   = new MultiSig(NBitcoin.Network.TestNet);
            List <PubKey> pubKeys = new List <PubKey>();

            for (int i = 0; i < keys.Count; i++)
            {
                pubKeys.Add(keys[i].PrivateKey.PubKey);
            }
            Script pubKeyScript = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, pubKeys.ToArray());

            BitcoinAddress       address = pubKeyScript.WitHash.GetAddress(_Network);
            BitcoinScriptAddress p2sh    = address.GetScriptAddress();

            Console.WriteLine("Send money here: " + p2sh.ToString());
            REST.BlockExplorer explorer = new REST.BlockExplorer("https://testnet.blockexplorer.com/");
            var response = explorer.GetUnspent(p2sh.ToString());
            List <ExplorerUnspent> unspent      = response.Convert <List <ExplorerUnspent> >();
            List <Transaction>     transactions = new List <Transaction>();

            foreach (var item in unspent)
            {
                ExplorerResponse txResponse = explorer.GetTransaction(item.txid);
                RawFormat        format     = RawFormat.Satoshi;
                var tx = Transaction.Parse(txResponse.data, format, Network.TestNet);
                transactions.Add(tx);
            }
            //Create send transaction.

            //get redeem script
            //var redeemScript = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, pubKeys.ToArray());// multi.GetRedeemScript(2, keys.ToArray());

            Transaction received = transactions[0];
            ScriptCoin  coin     = received.Outputs.AsCoins().First().ToScriptCoin(pubKeyScript.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            //create transaction:
            BitcoinAddress     destination = BitcoinAddress.Create("2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF"); //the faucet return address
            TransactionBuilder builder     = new TransactionBuilder();

            builder.AddCoins(coin);
            builder.Send(destination, Money.Coins(1.299m));
            builder.SendFees(Money.Coins(0.001m));
            builder.SetChange(destination);
            //builder.
            var unsigned = builder.BuildTransaction(sign: false);

            var         signedA = builder.AddCoins(coin).AddKeys(keys[0].PrivateKey).SignTransaction(unsigned);
            Transaction signedB = builder.AddCoins(coin).AddKeys(keys[1].PrivateKey).SignTransaction(signedA);

            Transaction fullySigned = builder.AddCoins(coin).CombineSignatures(signedA, signedB);

            Console.WriteLine(fullySigned.ToHex());
            Console.ReadLine();
        }
Пример #26
0
        /// <summary>
        /// This method implements the Programming Blockchain code multi-signature transactions as segwit enabled.
        /// </summary>
        /// <param name="path">Path.</param>
        /// <param name="seed">Seed.</param>
        public void StepByStep(uint path, params string[] seed)
        {
            List <ExtKey> keys   = new List <ExtKey>();
            Segwit        segwit = new Segwit(NBitcoin.Network.TestNet);

            Key bob   = GetKey(path, seed[0]).PrivateKey;
            Key alice = GetKey(path, seed[1]).PrivateKey;

            for (int i = 0; i < seed.Length; i++)
            {
                var key = GetKey(path, seed[i]);
                keys.Add(key);
                //Console.WriteLine(address.ToString());
            }
            NBitcoin.Network _Network = NBitcoin.Network.TestNet;

            //MultiSig multi = new MultiSig(NBitcoin.Network.TestNet);
            List <PubKey> pubKeys = new List <PubKey>();

            for (int i = 0; i < keys.Count; i++)
            {
                pubKeys.Add(keys[i].PrivateKey.PubKey);
            }

            Console.WriteLine("Section: P2SH (Pay To Script Hash)");
            Script pubKeyScript = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, pubKeys.ToArray());

            Console.WriteLine("Generated pubKeyScript: \n\r" + pubKeyScript.ToString());
            Console.WriteLine();
            Console.WriteLine("P2SH: \t (Pay to Script Hash): Generate Payment Script");
            var paymentScript = pubKeyScript.PaymentScript;

            Console.WriteLine(paymentScript.ToString());
            Console.WriteLine();
            Console.WriteLine("Generate P2SH:\t(Pay To Script Hash) \t from scriptPubKey");
            var p2shPayToAddress = pubKeyScript.Hash.GetAddress(_Network);

            Console.WriteLine(p2shPayToAddress);
            Console.WriteLine();
            Console.WriteLine("Simulate a transaction");
            Transaction p2shReceived = new Transaction();

            p2shReceived.Outputs.Add(new TxOut(Money.Coins(1.0m), pubKeyScript.Hash)); //Warning: The payment is sent to redeemScript.Hash and not to redeemScript!
            //A script coin is used to spend when a combination of the owners want to spend the coins
            ScriptCoin p2shCoin = p2shReceived.Outputs.AsCoins().First().ToScriptCoin(pubKeyScript);

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Section: P2WSH (Pay to Witness Script Hash)");

            Console.WriteLine();
            Console.WriteLine("Simulate a fake P2WSH payment script");
            var fakeKey = new Key();

            Console.WriteLine(fakeKey.PubKey.ScriptPubKey.WitHash.ScriptPubKey);
            //Output: 0 4c55134a297baf494323fd517df5780a0b0e8f7f8f794a0ea79ab94fd4498923
            Console.WriteLine(pubKeyScript.WitHash.ScriptPubKey);
            //Output: 0 29ccc4c03f9609ff9f79b0b7d3ade093ffd7da6d37c06edc65bfb898d4aee069

            Console.WriteLine("Simulate a fake segwit transaction");
            var         addressFake      = fakeKey.PubKey.WitHash.GetAddress(_Network);
            var         p2shFake         = addressFake.GetScriptAddress();
            var         redeemScriptFake = fakeKey.PubKey.WitHash.ScriptPubKey;
            Transaction fakeReceived     = new Transaction();

            fakeReceived.Outputs.Add(new TxOut(Money.Coins(1.0m), redeemScriptFake.WitHash));
            ScriptCoin coin = fakeReceived.Outputs.AsCoins().First().ToScriptCoin(redeemScriptFake);

            Console.WriteLine("Create a script coin");
            Transaction p2wshReceived = new Transaction();

            p2wshReceived.Outputs.Add(new TxOut(Money.Coins(1.0m), pubKeyScript.WitHash));
            //This did not throw an error:
            ScriptCoin p2wshCoin = p2wshReceived.Outputs.AsCoins().First().ToScriptCoin(pubKeyScript);


            throw new NotSupportedException("P2W over P2SH is NOT Multi-sig compatible!");
            //Source: https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wpkh-address

            Console.WriteLine();
            Console.WriteLine("Section: P2W* over P2SH");
            Console.WriteLine();
            Console.WriteLine("Steps to Create a P2W* Over P2SH...");
            Console.WriteLine("\t1. Replacing the ScriptPubKey by its P2SH equivalent.");
            Console.WriteLine("\t2. The former ScriptPubKey will be placed as the only push in the scriptSig in the spending transaction");
            Console.WriteLine("\t3. All other data will be pushed in the witness of the spending transaction.");
            Console.WriteLine();
            Console.WriteLine("1. Replacing the ScriptPubKey by its P2SH equivalent.");
            //todo code to replace Script pub Key

            Console.WriteLine("Printing the ScriptPubKey: (fake)");
            Console.WriteLine(fakeKey.PubKey.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            Script fakeScriptPubKey = fakeKey.PubKey.WitHash.ScriptPubKey.Hash.ScriptPubKey;

            Console.WriteLine("Printing the ScriptPubKey: (multi-sig)");
            Console.WriteLine(pubKeyScript.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            Script multiScriptPubKey = pubKeyScript.WitHash.ScriptPubKey.Hash.ScriptPubKey;

            Console.WriteLine("Which gave us a well known P2SH scriptPubKey.");

            Console.WriteLine("Replacing the ScriptPubKey by its P2SH equivalent.");
            //Fake
            Console.WriteLine(fakeKey.PubKey.ScriptPubKey.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            //Multi sig
            Console.WriteLine(pubKeyScript.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            //OR maybe?
            //Console.WriteLine(pubKeyScript.PaymentScript.WitHash.ScriptPubKey.Hash.ScriptPubKey);
            Console.WriteLine("2. The former ScriptPubKey will be placed as the only push in the scriptSig in the spending transaction");
            //todo code to place former ScriptPubKey as the only push in the scriptSig in the spending transaction


            Console.WriteLine("3. All other data will be pushed in the witness of the spending transaction.");
            //todo code to push all other data in the witness of the spending transaction
            Transaction fake_p2w_over_p2shReceived = new Transaction();

            fakeReceived.Outputs.Add(new TxOut(Money.Coins(1.0m), redeemScriptFake.WitHash));
            Transaction p2w_Over_P2shReceived = new Transaction();

            Console.ReadLine();
        }
Пример #27
0
 public Safe(Safe safe)
 {
     _network        = safe._network;
     _seedPrivateKey = safe._seedPrivateKey;
     WalletFilePath  = safe.WalletFilePath;
 }
Пример #28
0
 static public void GetBalanceSummary(BitcoinAddress address, NBitcoin.Network network, GetBalanceSummaryResponse response, bool colored = true)
 {
     ObservableWWW.Get(URL(network, "balances/" + EscapeUrlPart(address.ToString()) + "/summary" + CreateParameters("colored", colored))).
     Subscribe(x => response(JsonUtility.FromJson <Models.BalanceSummary>(x).Result(), network),
               ex => Debug.Log("error : " + ex.Message));
 }
Пример #29
0
 public TestChainWatchInterface(Network n)
 {
     Network = n ?? throw new ArgumentNullException(nameof(n));
 }
Пример #30
0
 void GetBalanceSummaryResponse(QBitNinja.Client.Models.BalanceSummary result, NBitcoin.Network network)
 {
     UnityEngine.Debug.Log(result.Spendable.Amount);
 }