gtmtech-crypto 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac37f71c9b426807117eedd5e01ba4b376f7a986
4
- data.tar.gz: 54070153e64f80863515124853944d27c48aa1bf
3
+ metadata.gz: d8b626f33b4fe82491e97bd218f56004b19d118c
4
+ data.tar.gz: 9cd200dcdef3b12c192d2592f293abdfea01ba16
5
5
  SHA512:
6
- metadata.gz: a89f9f08904193c389d8407eecf1e6dd3974b49b5d435829af3bb9441e162763e7f5ef57636c28147f7887f7369b1ad053466bbbff8cc52e20d0b7889b0a590d
7
- data.tar.gz: 28173e4417b519b3b206814f379ee10cfd2ac7d9aa40a349eafc2033d4b5f295df25818519aa237aed14404dad90bca7947e011f14cc768782d7c243bea7342a
6
+ metadata.gz: 0011f6b6cdc9b1f24ac67a0a1390fb94e3d65f98799d9de8fd5342fdf35d8bb83f208b8698ba0bc3f6f1d26f5069fe0904bcac3f0f60ddbe9775916868adf489
7
+ data.tar.gz: d5f03f32ee6bc383f4bd75676071c352fc0f60382712868320074db4969046905ef5fd846897ac28e95f1427af9784f1a90e927666cc6554e816929a8adc75a3
data/README.md CHANGED
@@ -29,39 +29,49 @@ Usage:
29
29
  Firstly set up some accounts
30
30
 
31
31
  ```
32
- $ crypto new account --name barclays --currencies GBP --type bank
33
- $ crypto new account --name kraken --currencies GBP,BTC --type exchange
34
- $ crypto new account --name ledger --currencies BTC,ETH --type wallet
32
+ $ crypto account add --name barclays --currencies GBP --type bank
33
+ $ crypto account add --name kraken --currencies GBP,BTC --type exchange
34
+ $ crypto account add --name ledger --currencies BTC,ETH --type wallet
35
35
  ```
36
36
 
37
37
  Then trade
38
38
 
39
39
  ```
40
- $ crypto new txn --from barclays.GBP=200 --to bitbargain.GBP
41
- $ crypto new txn --from kraken.GBP=150 --to kraken.BTC=0.08
40
+ $ crypto txn add --from barclays.GBP=200 --to bitbargain.GBP
41
+ $ crypto txn add --from kraken.GBP=150 --to kraken.BTC=0.08
42
42
  ```
43
43
 
44
44
  some transactions have fees associated with them
45
45
 
46
46
  ```
47
- $ crypto new txn --from kraken.BTC=0.08 --to ledger.BTC=0.078 # implicit fees of 0.0002 BTC
48
- $ crypto new txn --from kraken.BTC=0.08 --to ledger.BTC --fees.BTC=0.002 # extra fees paid at source (kraken)
47
+ $ crypto txn add --from kraken.BTC=0.08 --to ledger.BTC=0.078 # implicit fees of 0.0002 BTC
48
+ $ crypto txn add --from kraken.BTC=0.08 --to ledger.BTC --fees.BTC=0.002 # extra fees paid at source (kraken)
49
49
  ```
50
50
 
51
51
  Output transaction history
52
52
 
53
53
  ```
54
- $ crypto list txn # all transactions
55
- $ crypto list txn --account barclays # all barclays transactions
56
- $ crypto list txn --currency BTC # all bitcoin transactions
54
+ $ crypto txn list # all transactions
55
+ $ crypto txn list --account barclays # all barclays transactions
56
+ $ crypto txn list --currency BTC # all bitcoin transactions
57
57
  ```
58
58
 
59
59
  Output pnl sheet
60
60
 
61
61
  ```
62
- $ crypto list pnl # profit-and-loss
62
+ $ crypto pnl # profit-and-loss
63
63
  ```
64
-
64
+
65
+ Profiles
66
+ ========
67
+
68
+ You can keep track of different user profiles, using the CRYPTO_PROFILE environment variable:
69
+
70
+ ```
71
+ $ export CRYPTO_PROFILE=antony
72
+
73
+ $ crypto account list
74
+ ```
65
75
 
66
76
  Building
67
77
  ========
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "gtmtech-crypto"
7
- gem.version = "0.0.3"
7
+ gem.version = "0.0.4"
8
8
  gem.description = "Simple tool for accounting of cryptocurrencies"
9
9
  gem.summary = "Simple tool for accounting of cryptocurrencies"
10
10
  gem.author = "Geoff Meakin"
@@ -1,7 +1,7 @@
1
1
  module Gtmtech
2
2
  module Crypto
3
3
 
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  DESCRIPTION = "crypto is a cli tool for simple accounting of cryptocurrencies"
6
6
 
7
7
  end
@@ -6,7 +6,11 @@ module Gtmtech
6
6
  class Data
7
7
 
8
8
  def self.load
9
- @@path = "#{ENV['HOME']}/.crypto.yaml"
9
+ if ENV['CRYPTO_PROFILE']
10
+ @@path = "#{ENV['HOME']}/.crypto.#{ENV['CRYPTO_PROFILE']}.yaml"
11
+ else
12
+ @@path = "#{ENV['HOME']}/.crypto.yaml"
13
+ end
10
14
  unless File.exist? @@path
11
15
  File.open(@@path, 'w') do |file|
12
16
  file.write("---\naccounts: {}\ntransactions: []\n")
@@ -28,6 +32,7 @@ module Gtmtech
28
32
  end
29
33
 
30
34
  def self.list_accounts
35
+ puts "Accounts for profile \"#{ENV['CRYPTO_PROFILE'] || 'main'}\":"
31
36
  printf("%-10s %-10s %-60s\n", "name", "type", "currencies")
32
37
  puts "-" * 80
33
38
  @@document[ "accounts" ].each do |name, account_info|
@@ -63,6 +68,7 @@ module Gtmtech
63
68
  end
64
69
 
65
70
  def self.list_transactions
71
+ puts "Transactions for profile \"#{ENV['CRYPTO_PROFILE'] || 'main'}\":"
66
72
  printf("%-36s %-20s %-15s %-15s %-15s %-15s\n", "id", "date", "src account", "src amount", "dest account", "dest amount")
67
73
  puts "-" * 120
68
74
  @@document[ "transactions" ].each do |id, txn|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtmtech-crypto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Meakin