Gridcoin online wallet #3

in #gridcoin6 years ago

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

Send tab

Receive tab

Transactions tab

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

Sort:  

Great work! Thanks for doing (and opensourcing!) this.

Congratulations @sau412! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 200 upvotes. Your next target is to reach 300 upvotes.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 60085.46
ETH 2416.33
USDT 1.00
SBD 2.43