Moralis-Python-SDK

transaction API:

evm_api.transaction


get_transaction

evm_api.transaction.get_transaction()

Get the contents of a transaction by the given transaction hash.

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "transaction_hash": "0xdc85cb1b75fd09c2f6d001fea4aba83764193cbd7881a1fa8ccde350a5681109", 
    "chain": "eth", 
}

result = evm_api.transaction.get_transaction(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
transaction_hash str The transaction hash Yes   “0xdc85cb1b75fd09c2f6d001fea4aba83764193cbd7881a1fa8ccde350a5681109”
chain enum[str]:
- “eth”
- “0x1”
- “goerli”
- “0x5”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “mumbai”
- “0x13881”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “avalanche testnet”
- “0xa869”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “cronos testnet”
- “0x152”
- “arbitrum”
- “0xa4b1”
The chain to query   “eth” “eth”

get_wallet_transactions

evm_api.transaction.get_wallet_transactions()

Get native transactions ordered by block number in descending order.

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", 
    "chain": "eth", 
    "from_block": 0, 
    "to_block": 0, 
    "from_date": "", 
    "to_date": "", 
    "cursor": "", 
    "limit": 0, 
    "disable_total": True, 
}

result = evm_api.transaction.get_wallet_transactions(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
address str The address of the wallet Yes   “0xd8da6bf26964af9d7eed9e03e53415d37aa96045”
chain enum[str]:
- “eth”
- “0x1”
- “goerli”
- “0x5”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “mumbai”
- “0x13881”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “avalanche testnet”
- “0xa869”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “cronos testnet”
- “0x152”
- “arbitrum”
- “0xa4b1”
The chain to query   “eth” “eth”
from_block int The minimum block number from which to get the transactions
* Provide the param ‘from_block’ or ‘from_date’
* If ‘from_date’ and ‘from_block’ are provided, ‘from_block’ will be used.
    0
to_block int The maximum block number from which to get the transactions.
* Provide the param ‘to_block’ or ‘to_date’
* If ‘to_date’ and ‘to_block’ are provided, ‘to_block’ will be used.
    0
from_date str The start date from which to get the transactions (any format that is accepted by momentjs)
* Provide the param ‘from_block’ or ‘from_date’
* If ‘from_date’ and ‘from_block’ are provided, ‘from_block’ will be used.
    ””
to_date str Get the transactions up to this date (any format that is accepted by momentjs)
* Provide the param ‘to_block’ or ‘to_date’
* If ‘to_date’ and ‘to_block’ are provided, ‘to_block’ will be used.
    ””
cursor str The cursor returned in the previous response (used for getting the next page).     ””
limit int The desired page size of the result.     0
disable_total bool If the result should skip returning the total count (Improves performance).   False True

get_wallet_transactions_verbose

evm_api.transaction.get_wallet_transactions_verbose()

Get native transactions and logs ordered by block number in descending order.

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", 
    "chain": "eth", 
    "from_block": 0, 
    "to_block": 0, 
    "from_date": "", 
    "to_date": "", 
    "cursor": "", 
    "limit": 0, 
    "disable_total": True, 
}

result = evm_api.transaction.get_wallet_transactions_verbose(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
address str The address of the wallet Yes   “0xd8da6bf26964af9d7eed9e03e53415d37aa96045”
chain enum[str]:
- “eth”
- “0x1”
- “goerli”
- “0x5”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “mumbai”
- “0x13881”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “avalanche testnet”
- “0xa869”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “cronos testnet”
- “0x152”
- “arbitrum”
- “0xa4b1”
The chain to query   “eth” “eth”
from_block int The minimum block number from which to get the transactions
* Provide the param ‘from_block’ or ‘from_date’
* If ‘from_date’ and ‘from_block’ are provided, ‘from_block’ will be used.
    0
to_block int The maximum block number from which to get the transactions.
* Provide the param ‘to_block’ or ‘to_date’
* If ‘to_date’ and ‘to_block’ are provided, ‘to_block’ will be used.
    0
from_date str The start date from which to get the transactions (any format that is accepted by momentjs)
* Provide the param ‘from_block’ or ‘from_date’
* If ‘from_date’ and ‘from_block’ are provided, ‘from_block’ will be used.
    ””
to_date str Get the transactions up to this date (any format that is accepted by momentjs)
* Provide the param ‘to_block’ or ‘to_date’
* If ‘to_date’ and ‘to_block’ are provided, ‘to_block’ will be used.
    ””
cursor str The cursor returned in the previous response (used for getting the next page).     ””
limit int The desired page size of the result.     0
disable_total bool If the result should skip returning the total count (Improves performance).   False True