Proxy API
Standard endpoints
- class blockscan.modules.proxy.Proxy[source]
- static get_proxy_block_by_number(tag: str)[source]
Get information about a block by its block number.
- Parameters
tag (str) – The target block tag.
- Returns
Information about target block, including its transactions.
- Return type
dict
- static get_proxy_block_number()[source]
Get the number of the most recent block.
- Returns
The block number.
- Return type
str
- static get_proxy_block_transaction_count_by_number(tag: str)[source]
Get the number of transactions in a specific block.
- Parameters
tag (str) – The target block tag.
- Returns
The number of txs in the block using hex base format.
- Return type
str
- static get_proxy_call(to: str, data: str)[source]
Executes a new message call immediately without creating a transaction on the block chain.
- Parameters
to (str) – Contract address to send message to.
data (str) – Message data in bytecode.
- Returns
The response to the message in hex base format.
- Return type
str
- static get_proxy_code_at(address: str)[source]
Get contract bytecode at target address, if any.
- Parameters
address (str) – Address to query for bytecode.
- Returns
The bytecode in hex base format.
- Return type
str
- static get_proxy_est_gas(from_addr: str, to_addr: str, data: str, value: str, gas_price: str, gas: str)[source]
Get gas estimate by making a dummy call/transaction that is not added to the blockchain and returns the hypothetically used gas.
- Parameters
from_addr (str) – Sender of transaction.
to_addr (str) – Receiver of transaction.
data (str) – Data of transaction.
value (str) – Value of transaction.
gas_price (str) – Gas price of transaction.
gas (str) – Gas of transaction.
- Returns
Estimated used gas for transaction.
- Return type
str
- static get_proxy_gas_price()[source]
Get current gas price in wei.
- Returns
Gas price in wei and hex base format.
- Return type
str
- static get_proxy_storage_position_at(position: str, address: str)[source]
Get the value from a storage position at a given address.
- Parameters
position (str) – Target position in hex base format.
address (str) – Target address.
- Returns
Value in hex base format.
- Return type
str
- static get_proxy_transaction_by_block_number_and_index(tag: str, index: str)[source]
Get transaction by block number and tx index.
- Parameters
tag (str) – Target block tag.
index (str) – Target tx index.
- Returns
Standard tx data, including v,r,s values.
- Return type
dict
- static get_proxy_transaction_by_hash(txhash: str)[source]
Get tx information given its hash.
- Parameters
txhash (str) – Target transaction hash.
- Returns
Standard tx data, including v,r,s values.
- Return type
dict
- static get_proxy_transaction_count(address: str)[source]
Get number of transactions sent from an address.
- Parameters
address (str) – Target address.
- Returns
Number of txs using hex base format.
- Return type
str
- static get_proxy_transaction_receipt(txhash: str)[source]
Get receipt of transaction from its hash.
- Parameters
txhash (str) – Target transaction hash.
- Returns
Transaction receipt including logs.
- Return type
dict
- static get_proxy_uncle_by_block_number_and_index(tag: str, index: str) str[source]
get information about a uncle by block number
- Parameters
tag (str) – The block number, in hex
index (str) – The position of the uncle’s index in the block, in hex
- Returns
Information about target block
- Return type
str