Class: SolscanApiRuby::Methods::Public
- Defined in:
- lib/solscan_api_ruby/methods/public.rb
Instance Method Summary collapse
-
#account(account) ⇒ Response, ApiError
Get overall account information, including program account, NFT metadata information.
-
#account_exportTransactions(account, type:, from_time:, to_time:) ⇒ Response, ApiError
Export transactions to CSV.
-
#account_solTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) ⇒ Response, ApiError
Get list of transactions make tokenBalance changes.
-
#account_splTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) ⇒ Response, ApiError
Get list of transactions make tokenBalance changes.
-
#account_stakeAccounts(account) ⇒ Response, ApiError
Get staking accounts of the given account.
-
#account_tokens(account) ⇒ Response, ApiError
Get token balances of the given account.
-
#account_transactions(account, before_hash: '', limit: nil) ⇒ Response, ApiError
Get list of transactions of the given account.
-
#block(block) ⇒ Response, ApiError
Detail information of given block.
-
#block_last(limit: nil) ⇒ Response, ApiError
Get last [limit] blocks.
-
#block_transactions(block, offset: nil, limit: nil) ⇒ Response, ApiError
Get block transactions.
-
#chaininfo ⇒ Response, ApiError
Blockchain overall information.
-
#market_token(token_address) ⇒ Response, ApiError
Get market information of the given token.
-
#token_holders(token_address, offset: nil, limit: nil) ⇒ Response, ApiError
Get token holders.
-
#token_list(sort_by: 'market_cap', direction: 'desc', limit: nil, offset: nil) ⇒ Response, ApiError
Get list of tokens.
-
#token_meta(token_address) ⇒ Response, ApiError
Get metadata of given token.
-
#transaction(signature) ⇒ Response, ApiError
Detail information of given transaction signature.
-
#transaction_last(limit: nil) ⇒ Response, ApiError
Get last [limit] transactions.
Methods inherited from Base
Constructor Details
This class inherits a constructor from SolscanApiRuby::Methods::Base
Instance Method Details
#account(account) ⇒ Response, ApiError
Get overall account information, including program account, NFT metadata information
202 203 204 205 206 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 202 def account(account) method = "#{__method__}/#{account}" send_request(method) end |
#account_exportTransactions(account, type:, from_time:, to_time:) ⇒ Response, ApiError
Export transactions to CSV. MaxLimit 5000 records per request
184 185 186 187 188 189 190 191 192 193 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 184 def account_exportTransactions(account, type:, from_time:, to_time:) params = {} params[:account] = account params[:type] = type params[:fromTime] = from_time params[:toTime] = to_time send_request(__method__, params: params) end |
#account_solTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) ⇒ Response, ApiError
Get list of transactions make tokenBalance changes. MaxLimit 50 records per request
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 162 def account_solTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) params = {} params[:account] = account params[:fromTime] = from_time if from_time params[:toTime] = to_time if to_time params[:offset] = offset if offset params[:limit] = limit if limit send_request(__method__, params: params) end |
#account_splTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) ⇒ Response, ApiError
Get list of transactions make tokenBalance changes. MaxLimit 50 records per request
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 139 def account_splTransfers(account, from_time: nil, to_time: nil, offset: nil, limit: nil) params = {} params[:account] = account params[:fromTime] = from_time if from_time params[:toTime] = to_time if to_time params[:offset] = offset if offset params[:limit] = limit if limit send_request(__method__, params: params) end |
#account_stakeAccounts(account) ⇒ Response, ApiError
Get staking accounts of the given account
120 121 122 123 124 125 126 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 120 def account_stakeAccounts(account) params = {} params[:account] = account if account send_request(__method__, params: params) end |
#account_tokens(account) ⇒ Response, ApiError
Get token balances of the given account
86 87 88 89 90 91 92 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 86 def account_tokens(account) params = {} params[:account] = account if account send_request(__method__, params: params) end |
#account_transactions(account, before_hash: '', limit: nil) ⇒ Response, ApiError
Get list of transactions of the given account. MaxLimit 50 records per request
103 104 105 106 107 108 109 110 111 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 103 def account_transactions(account, before_hash: '', limit: nil) params = {} params[:account] = account params[:beforeHash] = before_hash if before_hash params[:limit] = limit if limit send_request(__method__, params: params) end |
#block(block) ⇒ Response, ApiError
Detail information of given block
45 46 47 48 49 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 45 def block(block) method = "#{__method__}/#{block}" send_request(method) end |
#block_last(limit: nil) ⇒ Response, ApiError
Get last [limit] blocks
11 12 13 14 15 16 17 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 11 def block_last(limit: nil) params = {} params[:limit] = limit if limit send_request(__method__, params: params) end |
#block_transactions(block, offset: nil, limit: nil) ⇒ Response, ApiError
Get block transactions. MaxLimit 50 records per request
28 29 30 31 32 33 34 35 36 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 28 def block_transactions(block, offset: nil, limit: nil) params = {} params[:block] = block params[:offset] = offset if offset params[:limit] = limit if limit send_request(__method__, params: params) end |
#chaininfo ⇒ Response, ApiError
Blockchain overall information
287 288 289 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 287 def chaininfo send_request(__method__) end |
#market_token(token_address) ⇒ Response, ApiError
Get market information of the given token
276 277 278 279 280 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 276 def market_token(token_address) method = "#{__method__}/#{token_address}" send_request(method) end |
#token_holders(token_address, offset: nil, limit: nil) ⇒ Response, ApiError
Get token holders
218 219 220 221 222 223 224 225 226 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 218 def token_holders(token_address, offset: nil, limit: nil) params = {} params[:tokenAddress] = token_address params[:offset] = offset if offset params[:limit] = limit if limit send_request(__method__, params: params) end |
#token_list(sort_by: 'market_cap', direction: 'desc', limit: nil, offset: nil) ⇒ Response, ApiError
Get list of tokens. MaxLimit 50 records per request.
258 259 260 261 262 263 264 265 266 267 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 258 def token_list(sort_by: 'market_cap', direction: 'desc', limit: nil, offset: nil) params = {} params[:sortBy] = sort_by if sort_by params[:direction] = direction if direction params[:limit] = limit if limit params[:offset] = offset if offset send_request(__method__, params: params) end |
#token_meta(token_address) ⇒ Response, ApiError
Get metadata of given token.
235 236 237 238 239 240 241 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 235 def (token_address) params = {} params[:tokenAddress] = token_address send_request(__method__, params: params) end |
#transaction(signature) ⇒ Response, ApiError
Detail information of given transaction signature
73 74 75 76 77 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 73 def transaction(signature) method = "#{__method__}/#{signature}" send_request(method) end |
#transaction_last(limit: nil) ⇒ Response, ApiError
Get last [limit] transactions
58 59 60 61 62 63 64 |
# File 'lib/solscan_api_ruby/methods/public.rb', line 58 def transaction_last(limit: nil) params = {} params[:limit] = limit if limit send_request(__method__, params: params) end |