How to deposit, withdraw, transfer coins...
Hi Chris,
I want to create an app where I can keep track of my cryptocurrencies.
This is what I have right now:
- Coins (can have many wallets)
- name
- symbol
- Wallets (belongs_to coin)(has_many transactions)
- coin_id
- name
- wtype (Type of wallet, Hardware, Exchange, Local, …)
- address
- balance
- description
- Transactions(belong_to wallet)
- date
- txid (Transaction ID) this should be generated when the transaction is saved to the DB. (SecureRandom.hex 32)
- wallet_id
- txtype (Transaction Type: Deposit, Withdraw, Transfer)
- amount
- amount_currency
- description
- old_balance (should take the actual balance from the wallet)
- new_balance (should calculate the new balance old_balance + amount)
The creation of coins and wallets is no problem.
Im stuck at the transaction part, the deposit and withdraw part.
Where would you put the deposit, withdraw and the transfer methods?
If you need more infos, let me know.
Benny