Gridcoin online wallet #3

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@sau412·
0.000 HBD
Gridcoin online wallet #3
Today I added tabs and more API methods.

# API methods
API working with HTTPS POST queries. There are several types of queries:
* get_balance - returns account balance
* get_price_in_btc - returns GRC price in BTC
* get_price_in_usd - returns GRC price in USD
* get_price_in_rub - returns GRC price in RUB
* get_price_in_ltc - returns GRC price in LTC
* get_price_in_xrp - returns GRC price in XRP
* get_price_in_eth - returns GRC price in ETH
* get_price_in_xlm - returns GRC price in XLM
* get_prices_all - get all prices in CSV format
* get_all_receiving_addresses - get all receiving addresses in CSV format
* get_receiving_address_by_uid - get receiving address by uid
* new_receiving_address - get new receiving address uid. Returns address uid. You should receive address status with get_receiving_address_by_uid.
* get_all_transactions - get all transactions in CSV format
* get_transaction_by_uid - get transaction data by uid
* send - send specific amount to specific address. Returns operation uid. You should check transaction status with get_transaction_by_uid.

## Sample
### get_balance
````
$ curl -d 'api_key=abcdef&method=get_balance' https://testwallet.arikado.ru/
1.40446789
````
### get_price_in_btc 
````
$ curl -d 'api_key=abcdef&method=get_price_in_btc' https://testwallet.arikado.ru/
1.5274643413978E-6
````
### get_all_receiving_addresses
````
$ curl -d 'api_key=abcdef&method=get_all_receiving_addresses' https://testwallet.arikado.ru/
1;SDR9gZ9XGwvyqt4DjP1dRRJ7B7NAnRjXcy;1.1;
2;RzUtKALfy91P6yKDq2CtoftMfWZBiWZNjA;1.23456789;
4;SAtXZMfQKL2aC34AbftAhuDE9coPHC4cKV;0;
5;SFwxGMSnwtiyMDykijnzQqCaUFZTRUceip;0;
7;S6k17qtSYikhFcvLy1doDY5QrJ1HLLoWAH;0;
````
Data is receiving_address_uid;address;received;

### new_receiving_address
````
$ curl -d 'api_key=abcdef&method=new_receiving_address' https://testwallet.arikado.ru/
9
````
We received receiving address uid: 9. Address generation takes some time (because addresses generated by schedule every minute). We can check address status with next query.

### get_receiving_address_by_uid
````
$ curl -d 'api_key=abcdef&method=get_receiving_address_by_uid&address_uid=9' https://testwallet.arikado.ru/api.php
S6fvXHVZTGRY9xbnMra7L4DGwYq72dRop7;0;
````
Data is address;received;

### send
````
$ curl -d 'api_key=abcdef&method=send&address=RySBHmppoH7uiNJUDLxurvo2k19xuyAcwr&amount=0.123' https://testwallet.arikado.ru/api.php
16
````
We reveived transaction uid: 16. Then we should check transaction status with get_transaction_by_uid.

### get_transaction_by_uid 
````
$ curl -d 'api_key=abcdef&method=get_transaction_by_uid&transaction_uid=16' https://testwallet.arikado.ru/api.php
16;0.123;RySBHmppoH7uiNJUDLxurvo2k19xuyAcwr;sent;bfec838a1a039cebeac40dfd661bcc61c8f72a144a0017ce42e17378d815c1ca;2018-11-26 17:36:07;
````
Data is uid;amount;address;status;tx_id;timestamp;

# Web interface
Nothing new here. I used scheme from my pool: tabs and ajax queries.

## Dashboard tab
![](https://cdn.steemitimages.com/DQmP3LDSRhiARnnGtwKmjacAhK4TrenMXwNC3cVwCTznh1b/%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png)

## Send tab
![](https://cdn.steemitimages.com/DQmS8MCsca9ZGCewgaBjWCgDgj4bYUb9vzjVUjDVyah6QJr/%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png)

## Receive tab
![](https://cdn.steemitimages.com/DQmYBMj28PR63FYUvMRkjfEus5KAd5uE1JL77HYJ4vw4oky/%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png)

## Transactions tab
![](https://cdn.steemitimages.com/DQmSWyX5QWckbwBEtBBiuMJhowzKzXhK4T748RerERL8LyE/%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png)

## Settings tab
Not implemended yet

# Current status
I think project is 50% done. Things to do:
* 2FA
* Settings
* Multiple languages
* Meaningful error messages
* Mail notices
* Administrator interface
* Wallet backup
* Testing

# Notes
It's ok if you register or generate addresses on test wallet. But I don't recommend you to send funds here. If you want to check receiving and sending, use small amounts, like 0.01 GRC.

# Links
* Test implementation: https://testwallet.arikado.ru/
* Github https://github.com/sau412/gridcoin_online_wallet
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,