Class: Decommas::Api

Inherits:
Base
  • Object
show all
Defined in:
lib/decommas/api.rb

Constant Summary collapse

PAGINATION_LIMIT =
100

Class Method Summary collapse

Methods inherited from Base

#attempt

Class Method Details

.all_coins_metadataObject



52
53
54
# File 'lib/decommas/api.rb', line 52

def 
  wget("/all_coins_metadata")
end

.all_tokens_metadataObject



48
49
50
# File 'lib/decommas/api.rb', line 48

def 
  wget("/all_tokens_metadata")
end

.coins(address:, options: {}) ⇒ Object



8
9
10
# File 'lib/decommas/api.rb', line 8

def coins(address:, options: {})
  wget("/coins/#{address}", query: options)
end

.nfts(address:, options: {}) ⇒ Object



16
17
18
# File 'lib/decommas/api.rb', line 16

def nfts(address:, options: {})
  wget("/nfts/#{address}", query: options)
end

.protocols(address:, options: {}) ⇒ Object



40
41
42
# File 'lib/decommas/api.rb', line 40

def protocols(address:, options: {})
  wget("/protocols/#{address}", query: options)
end

.response_classObject



60
61
62
# File 'lib/decommas/api.rb', line 60

def response_class
  Decommas::Response::Api
end

.token_metadata(chain_name:, contract_address:) ⇒ Object



56
57
58
# File 'lib/decommas/api.rb', line 56

def (chain_name:, contract_address:)
  wget("/token_metadata/#{chain_name}/#{contract_address}")
end

.tokens(address:, options: {}) ⇒ Object



12
13
14
# File 'lib/decommas/api.rb', line 12

def tokens(address:, options: {})
  wget("/tokens/#{address}", query: options)
end

.transaction_erc20_transfers(chain_name:, tx:) ⇒ Object



44
45
46
# File 'lib/decommas/api.rb', line 44

def transaction_erc20_transfers(chain_name:, tx:)
  wget("/transaction_erc20_transfers/#{chain_name}/#{tx}")
end

.transactions(address:, limit: nil, offset: nil) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/decommas/api.rb', line 20

def transactions(address:, limit: nil, offset: nil)
  query_params = {
    "limit" => limit || PAGINATION_LIMIT,
    "offset" => (offset if offset)
  }.compact
  wget("/transactions/#{address}", query: query_params)
end

.transfers_erc20(address:, limit: nil, offset: nil) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/decommas/api.rb', line 28

def transfers_erc20(address:, limit: nil, offset: nil)
  query_params = {
    "limit" => limit || PAGINATION_LIMIT,
    "offset" => (offset if offset)
  }.compact
  wget("/transfers_erc20/#{address}", query: query_params)
end

.transfers_nft(address:, options: {}) ⇒ Object



36
37
38
# File 'lib/decommas/api.rb', line 36

def transfers_nft(address:, options: {})
  wget("/transfers_nft/#{address}", query: options)
end