Class: Provide::Services::Goldmine

Inherits:
ApiClient
  • Object
show all
Defined in:
lib/provide-ruby/services/goldmine.rb

Instance Attribute Summary

Attributes inherited from ApiClient

#base_url, #token

Instance Method Summary collapse

Methods inherited from ApiClient

#delete, #get, #post, #put, #send_request

Constructor Details

#initialize(scheme = 'http', host, token) ⇒ Goldmine

Returns a new instance of Goldmine.



5
6
7
8
9
# File 'lib/provide-ruby/services/goldmine.rb', line 5

def initialize(scheme = 'http', host, token)
  @scheme = scheme
  @host = host
  @token = token
end

Instance Method Details

#contract_details(contract_id) ⇒ Object



15
16
17
# File 'lib/provide-ruby/services/goldmine.rb', line 15

def contract_details(contract_id)
  parse client.get "contracts/#{contract_id}"
end

#contractsObject



11
12
13
# File 'lib/provide-ruby/services/goldmine.rb', line 11

def contracts
  parse client.get 'contracts'
end

#create_token(params) ⇒ Object



39
40
41
# File 'lib/provide-ruby/services/goldmine.rb', line 39

def create_token(params)
  parse client.post 'tokens', params
end

#create_transaction(params) ⇒ Object



43
44
45
# File 'lib/provide-ruby/services/goldmine.rb', line 43

def create_transaction(params)
  parse client.post 'transactions', params
end

#create_wallet(params) ⇒ Object



67
68
69
# File 'lib/provide-ruby/services/goldmine.rb', line 67

def create_wallet(params)
  parse client.post 'wallets', params
end

#network_details(network_id) ⇒ Object



23
24
25
# File 'lib/provide-ruby/services/goldmine.rb', line 23

def network_details(network_id)
  parse client.get "networks/#{network_id}"
end

#networksObject



19
20
21
# File 'lib/provide-ruby/services/goldmine.rb', line 19

def networks
  parse client.get 'networks'
end

#pricesObject



27
28
29
# File 'lib/provide-ruby/services/goldmine.rb', line 27

def prices
  parse client.get 'prices'
end

#token_details(token_id) ⇒ Object



35
36
37
# File 'lib/provide-ruby/services/goldmine.rb', line 35

def token_details(token_id)
  parse client.get "tokens/#{token_id}"
end

#tokensObject



31
32
33
# File 'lib/provide-ruby/services/goldmine.rb', line 31

def tokens
  parse client.get 'tokens'
end

#transaction_details(tx_id) ⇒ Object



51
52
53
# File 'lib/provide-ruby/services/goldmine.rb', line 51

def transaction_details(tx_id)
  parse client.get "transactions/#{tx_id}"
end

#transactionsObject



47
48
49
# File 'lib/provide-ruby/services/goldmine.rb', line 47

def transactions
  parse client.get 'transactions'
end

#wallet_balance(wallet_id, token_id) ⇒ Object



55
56
57
# File 'lib/provide-ruby/services/goldmine.rb', line 55

def wallet_balance(wallet_id, token_id)
  parse client.get "wallets/#{wallet_id}/balances/#{token_id}"
end

#wallet_details(wallet_id) ⇒ Object



63
64
65
# File 'lib/provide-ruby/services/goldmine.rb', line 63

def wallet_details(wallet_id)
  parse client.get "wallets/#{wallet_id}"
end

#walletsObject



59
60
61
# File 'lib/provide-ruby/services/goldmine.rb', line 59

def wallets
  parse client.get 'wallets'
end