December 27, 2017 at 2:52 pm #5161
An beginner vb.net programmer here and wanted to know where do I start to make a desktop application to check my Account Balances without using any Browsers.
Can someone lend a helping hand where to start?
My concern is that I have no idea how to work with Json.December 28, 2017 at 7:10 am #5168
I have solved this.
Imports Newtonsoft.Json HttpWebRequest DirectCast(WebRequest.Create("https://api.jsecoin.com/server/api/balance/YourAPIHere/0/"), HttpWebRequest)December 28, 2017 at 9:44 am #5171
There is a stack overflow thread here about parsing the JSON data in VB which might help too if you want to access the individual variables.
JamesDecember 28, 2017 at 12:27 pm #5175
Thanks for the heads up. I have solve this issue.
Btw, is there plan to add more API?
Like to check if Miner is actively mining or browser crashed.December 28, 2017 at 11:20 pm #5177
Yes John is working on the developer section of the site so we will be adding some more API functions. I’ll suggest this one.December 31, 2017 at 9:32 pm #5199
Additional question, I can get the data for the Difficulty, Frequency but not hash.
Any idea why? Hash is in the same node as Diff & Freqs.
Also, Is there a way to check if the account is active mining?
So that I can check it or create an alarm when my account gets disconnected, crashed or inactive.
TY.January 1, 2018 at 8:31 am #5205
I think this is because it’s the latest block and the hash hasn’t been added yet. So at any time we are actually working with 3 blocks of data:
CurrentBlockID – open – < all transactions go here, no hashes present
BlockID-1 – closed – < closed no more transactions, pre-hash generated and sent out to miners who send back hashes for 30 seconds
BlockID-2 – final – < best hash choosen by miners and block is finalized. previousHash field written to BlockID-1 to create the chain of blocks.
So each of these blocks is 30 seconds apart and they move through this process of being setup and accepting new transaction data. Then as the block changes over the previous hash from blockID-2 is written to blockID-1 and the block is closed for any incoming transactions which get sent to a new block. At this stage a pre-hash is generated and sent out to all the miners that are currently connected. Then after another 30 seconds the hashes are collected and the lowest value hash (most leading zeros) is used to secure the blockchain and finalize the block. After this point the block can not be modified because the hash is written and the following block also contains the same hash in the previousHash field.January 1, 2018 at 9:37 am #5210
I see, so it seems its a hassle to just get the data for Hash.
I’ll remove it from my code then.
Is there a definite time when the new API will be added?
Im looking forward to see and get data if my account active or it has stopped mining.
So I can monitor it while at work.January 2, 2018 at 8:02 am #5214
I’ll work on this today for you. If all goes well I should have something working within 24 hours. I think the best way to do it would be to create a API function similar to the history command but for mining payments. So users can see the last 25 mining rewards and what time they came in. I’ll create an example script to display the JSON data too. There’s no way to connect back to the users machine and check the process or local machine conditions so seeing the last few mining rewards will at least let you know if it’s still working or not by when the last reward came in.January 2, 2018 at 9:15 am #5217
OK this is done. The API documentation has been updated with the new mining function.
I’ve also built an example script to check the mining rewards and latest balance: https://jsecoin.com/misc/checkmining.html
If anyone wants to try this you need to get your API key from the platform’s “Settings” page and set the API access level to at least “1 – read access”.
You can download the source for that file if you want to modify it or use it for reference here: https://jsecoin.com/misc/checkmining.zip
Hope that helps.