Bitcoin Forum
May 09, 2024, 09:08:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: [C#] Watch Only Bitcoin Wallet. Support SegWit and Forks (V3.2.1)  (Read 16950 times)
avatar_kiyoshi
Legendary
*
Offline Offline

Activity: 1106
Merit: 1000



View Profile
October 31, 2016, 08:58:26 PM
 #21

Nice project.
I have some suggestions here:
- maybe add a recent bitcoin price will be great.
- I want it in android version so bad Cheesy
- notification when a transaction come.
1715245708
Hero Member
*
Offline Offline

Posts: 1715245708

View Profile Personal Message (Offline)

Ignore
1715245708
Reply with quote  #2

1715245708
Report to moderator
1715245708
Hero Member
*
Offline Offline

Posts: 1715245708

View Profile Personal Message (Offline)

Ignore
1715245708
Reply with quote  #2

1715245708
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715245708
Hero Member
*
Offline Offline

Posts: 1715245708

View Profile Personal Message (Offline)

Ignore
1715245708
Reply with quote  #2

1715245708
Report to moderator
1715245708
Hero Member
*
Offline Offline

Posts: 1715245708

View Profile Personal Message (Offline)

Ignore
1715245708
Reply with quote  #2

1715245708
Report to moderator
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 01, 2016, 09:20:40 AM
 #22

Nice project.
I have some suggestions here:
- maybe add a recent bitcoin price will be great.
- I want it in android version so bad Cheesy
- notification when a transaction come.

- Already made possible from the Settings Window, using bitfinex and btc-e APIs:

- Maybe someday Wink
- This is possible with a WebSocket API which I think Blockchain.info has. So i guess that can be done but for the next version.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3472
Merit: 6125



View Profile
November 01, 2016, 10:12:34 AM
 #23

A feature that would be nice to add is when you receive a transaction, It keeps the current price and also  the real-time price. It could be really useful to know how much Bitcoin was worth it in the past and compared to now. Columns should look something like this. (also USD balance should be in the GridView) and settings should allow users to choose what currency they want (USD , EURO , etc.. )

Quote
Name | Address | Balance | USD Balance | Worth when received funds

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 01, 2016, 12:19:06 PM
 #24

A feature that would be nice to add is when you receive a transaction, It keeps the current price and also  the real-time price. It could be really useful to know how much Bitcoin was worth it in the past and compared to now. Columns should look something like this. (also USD balance should be in the GridView) and settings should allow users to choose what currency they want (USD , EURO , etc.. )

Quote
Name | Address | Balance | USD Balance | Worth when received funds


For that I am going to need access to price history of each hour or at least a medium price of days. I can't find this on Bitfinex API nor on Btc-e. Did not check any other place for price history though.

I will think about adding a new column for Balance in USD

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3472
Merit: 6125



View Profile
November 02, 2016, 06:47:38 AM
 #25

A feature that would be nice to add is when you receive a transaction, It keeps the current price and also  the real-time price. It could be really useful to know how much Bitcoin was worth it in the past and compared to now. Columns should look something like this. (also USD balance should be in the GridView) and settings should allow users to choose what currency they want (USD , EURO , etc.. )

Quote
Name | Address | Balance | USD Balance | Worth when received funds


For that I am going to need access to price history of each hour or at least a medium price of days. I can't find this on Bitfinex API nor on Btc-e. Did not check any other place for price history though.

I will think about adding a new column for Balance in USD

I don't think that's going to be needed , I explained the idea wrong , the "Worth when received funds" should be available in each transaction (If you are going to implement transactions of each address) and not the whole address as they funds are received in different periods so that make it impossible to calculate .

It's possible to make a local database (.XML or SQLite for example) , once the address you are watching receive a transaction you store the price (of that real-time in the database) , So In the GridView , when you see the transaction "Worth when received funds" should be taken from the local database and "Real time" balance should be taken from Blockchain API or somewhere else.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
November 02, 2016, 11:17:54 PM
 #26

Couple of things:  With the class https://github.com/Coding-Enthusiast/Watch-Only-Bitcoin-Wallet/blob/MVVM/WalletServices/PriceServices.cs

If  you have an enum, use it instead of a string in the get method.  Thats what its for.

Code:
public static async Task<decimal> GetPrice(ServiceNames serviceName)

Doing that will prevent the need for this.

Code:
default:
                    price = 0;
                    break;

You shouldn't really do that anyway.  The caller should be treating your method as a black box. If the service doesnt exist, throw an exception.  Don't give the user a heart attack and return a 0 price!

Using a switch statement also means you violate the open closed principal.  You should really use an Interface and have concrete types of "BitFinex" ect.  Which will enable you to mock the call in your unit tests.  Also, the convention is to name async method with async.

Code:
    public interface IPriceClient
    {
        Task<Decimal> GetPriceAsync();
    }

Code:
namespace WalletServices
{
    public class BitfinexService : ApiCall, IPriceClient
    {
        public async Task<decimal> GetPriceAsync()
        {
            JObject jResult = await GetApiResponse("https://api.bitfinex.com/v1/pubticker/btcusd");
            decimal price = (decimal)jResult["last_price"];

            return price;
        }
    }
}
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 05, 2016, 12:10:46 PM
 #27

@doof Thanks a lot for your feedback.

If  you have an enum, use it instead of a string in the get method.  Thats what its for.

I am still new to C♯ and definitely to MVVM and the reason why I did that was because I got an error in my view (MainWindow) xaml file which was unable to resolved the dependency! This and some other bugs/problems are the reason why I have not yet merged that branch.

But I like the follow up about open/closed principle after reading more about it.
So should it be like this:
In ViewModel:
Code:
....
if(//bitfinex is selected)
   IPriceClient MyClient = new BitfinexService();
else if (//some other one is selected)
   IPriceClient MyClient = new SomeOtherService();
.....
price = Myclient.GetPriceAsync();
In Services:
Code:
public class BitfinexService : ...
...
public class SomeOtherService : ...

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
November 16, 2016, 06:10:07 PM
 #28

Version 2.0.0 is complete, and will be merged as soon as I find some time to test it (It has been a busy month).

https://github.com/Coding-Enthusiast/Watch-Only-Bitcoin-Wallet/tree/MVVM

*click to view full size*

Included in this version:
  • Code is following the MVVM pattern!
  • Every bitcoin address is checked to make sure it is a valid base58 address
  • GUI changed to GridView to make Add/Edit/Remove Function easier
  • MainWindow now has hotkeys for Saving (Ctrl+S), Opening Settings (F2), Opening Help (F1)
  • Added a new option in SettingsWindow to get bitcoin price from 2 different exchanges (bitfinex and btc-e)

As always feel free to leave any suggestion, feedback, request,... here or on GitHub.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
RGBKey
Hero Member
*****
Offline Offline

Activity: 854
Merit: 658


rgbkey.github.io/pgp.txt


View Profile WWW
November 16, 2016, 11:08:15 PM
 #29

This is a nice project, I can respect your enthusiasm for coding. Remember that the more often you do it, the faster you'll get better.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
December 05, 2016, 05:27:57 AM
 #30

Fixed a bug with Price services and released version 2.0.0 by merging the MVVM branch.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
February 03, 2017, 12:23:58 PM
 #31

Released a new version (2.1.0) with so many code improvement, mostly removed the extra assemblies and now only have two main assemblies.
Also improved the SettingsWindow and its interaction.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
June 25, 2017, 08:16:33 AM
Last edit: June 25, 2017, 08:48:35 AM by Coding Enthusiast
 #32

Released version 2.2.0
  • A lot of small code improvements
  • Exceptions are handled and a couple of bugs fixed
  • The Error MessageBox is now hidden and will only appear if there is an error
  • Added a new StatusBar at the bottom of the window
  • Added a new API service for fetching balances (blockr.io)
  • The balance now has a ToolTip showing the difference each time balance is updated
  • Important: Wallet file is not stored in JSON format which makes this new version backward incompatible. This new format reduces the wallet file size a lot and is easier to use.
  • Saving is now completely automatic!

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
December 12, 2017, 06:16:55 PM
 #33

Released a small version 2.2.1 (2017-12-9)
  • Replaced blockr API with blockexplorer

Released version 2.3.0
  • Added color codes to balance column (green: increased balance, red: decreased!)

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
January 05, 2018, 06:56:44 AM
 #34

Released version 2.4.0
  • Added a new property called TransactionList and a new window for updating it and showing the balance on a given block height. This is useful for checking how much you owned when a forks like Bitcoin Cash, Bitcoin Gold,... happened.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
webling
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
January 05, 2018, 04:17:24 PM
 #35

Good job! Keep it up! Thank you for building a tool for the convenience of others Smiley
boludotron
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 10, 2018, 05:03:20 AM
 #36

Excellent project for learning.

On a side note; I have been using this web based tool to keep track of my paper wallets across multiple forks. No private keys and looks perfect on my phone. It also links out to the chain's corresponding explorer for further balance verification.

WalletChecker.com
cryptocropty
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
January 11, 2018, 03:39:27 PM
 #37

I don't want to enter the thread, but WalletChecker is missing https - therefore I would not use it. Should by easy to fix by them.
Excellent project for learning.

On a side note; I have been using this web based tool to keep track of my paper wallets across multiple forks. No private keys and looks perfect on my phone. It also links out to the chain's corresponding explorer for further balance verification.

WalletChecker.com
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
January 11, 2018, 05:08:14 PM
 #38

I have a plan to either
- add multiple wallet support, for example you can switch between your bitcoin, bitcoin cash, litecoin,... wallet each a different file with different addresses.
- or make this like a portfolio kind of thing, add something like "addressType" variable and keep everything inside one file
Then check balances from different block explorers for different chains.

Name of the project (Watch Only Bitcoin Wallet doesn't exactly go with this addition, but I think it may be a useful addition.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Emerger
Full Member
***
Offline Offline

Activity: 199
Merit: 102


View Profile
January 24, 2018, 01:06:50 PM
 #39

Cool project! It's encouraged me to install Visual Studio to try it, and follow the progress.

When checking the balance of addresses, both in fork balances and main page,  I am receiving the error "Value was either too large or too small for an Int32." Any suggestions to fix this?

Also, is there any way to import bulk addresses (if not through gui then by editing a file)?

Thanks

Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
January 25, 2018, 05:46:05 AM
 #40

When checking the balance of addresses, both in fork balances and main page,  I am receiving the error "Value was either too large or too small for an Int32." Any suggestions to fix this?
Thanks for the bug report. This commit should fix it:
https://github.com/Coding-Enthusiast/Watch-Only-Bitcoin-Wallet/commit/263665deb3ce3543fa7ab30ec46329837e25fe5c

Also, is there any way to import bulk addresses (if not through gui then by editing a file)?
Working on it. Will release soon.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: « 1 [2] 3 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!