Moralis-Python-SDK

transaction API:

evm_api.transaction


get_internal_transactions

evm_api.transaction.get_internal_transactions()

Get the contents of a internal transaction by transaction hash.

Example

from moralis import evm_api

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

result = evm_api.transaction.get_internal_transactions(
    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”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
- “polygon amoy”
- “0x13882”
- “linea”
- “0xe708”
- “moonbeam”
- “0x504”
- “moonriver”
- “0x505”
- “moonbase”
- “0x507”
- “linea sepolia”
- “0xe705”
The chain to query   “eth” “eth”

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", 
    "include": "", 
}

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”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
- “polygon amoy”
- “0x13882”
- “linea”
- “0xe708”
- “moonbeam”
- “0x504”
- “moonriver”
- “0x505”
- “moonbase”
- “0x507”
- “linea sepolia”
- “0xe705”
The chain to query   “eth” “eth”
include enum[str]:
- “internal_transactions”
If the result should contain the internal transactions.   ”” ””

get_transaction_verbose

evm_api.transaction.get_transaction_verbose()

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", 
    "include": "", 
}

result = evm_api.transaction.get_transaction_verbose(
    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”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
- “polygon amoy”
- “0x13882”
- “linea”
- “0xe708”
- “moonbeam”
- “0x504”
- “moonriver”
- “0x505”
- “moonbase”
- “0x507”
- “linea sepolia”
- “0xe705”
The chain to query   “eth” “eth”
include enum[str]:
- “internal_transactions”
If the result should contain the internal transactions.   ”” ””

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": "0xcB1C1FdE09f811B294172696404e88E658659905", 
    "chain": "eth", 
    "from_block": 0, 
    "to_block": 0, 
    "from_date": "", 
    "to_date": "", 
    "cursor": "", 
    "order": "DESC", 
    "limit": 0, 
    "include": "", 
}

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   “0xcB1C1FdE09f811B294172696404e88E658659905”
chain enum[str]:
- “eth”
- “0x1”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
- “polygon amoy”
- “0x13882”
- “linea”
- “0xe708”
- “moonbeam”
- “0x504”
- “moonriver”
- “0x505”
- “moonbase”
- “0x507”
- “linea sepolia”
- “0xe705”
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 (format in seconds or datestring 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 (format in seconds or datestring 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).     ””
order enum[str]:
- “ASC”
- “DESC”
The order of the result, in ascending (ASC) or descending (DESC)   “DESC” “DESC”
limit int The desired page size of the result.     0
include enum[str]:
- “internal_transactions”
If the result should contain the internal transactions.   ”” ””

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": "0xcB1C1FdE09f811B294172696404e88E658659905", 
    "chain": "eth", 
    "from_block": 0, 
    "to_block": 0, 
    "from_date": "", 
    "to_date": "", 
    "include": "", 
    "cursor": "", 
    "order": "DESC", 
    "limit": 0, 
}

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   “0xcB1C1FdE09f811B294172696404e88E658659905”
chain enum[str]:
- “eth”
- “0x1”
- “sepolia”
- “0xaa36a7”
- “polygon”
- “0x89”
- “bsc”
- “0x38”
- “bsc testnet”
- “0x61”
- “avalanche”
- “0xa86a”
- “fantom”
- “0xfa”
- “palm”
- “0x2a15c308d”
- “cronos”
- “0x19”
- “arbitrum”
- “0xa4b1”
- “chiliz”
- “0x15b38”
- “chiliz testnet”
- “0x15b32”
- “gnosis”
- “0x64”
- “gnosis testnet”
- “0x27d8”
- “base”
- “0x2105”
- “base sepolia”
- “0x14a34”
- “optimism”
- “0xa”
- “holesky”
- “0x4268”
- “polygon amoy”
- “0x13882”
- “linea”
- “0xe708”
- “moonbeam”
- “0x504”
- “moonriver”
- “0x505”
- “moonbase”
- “0x507”
- “linea sepolia”
- “0xe705”
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 (format in seconds or datestring 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 (format in seconds or datestring accepted by momentjs)
* Provide the param ‘to_block’ or ‘to_date’
* If ‘to_date’ and ‘to_block’ are provided, ‘to_block’ will be used.
    ””
include enum[str]:
- “internal_transactions”
If the result should contain the internal transactions.   ”” ””
cursor str The cursor returned in the previous response (used for getting the next page).     ””
order enum[str]:
- “ASC”
- “DESC”
The order of the result, in ascending (ASC) or descending (DESC)   “DESC” “DESC”
limit int The desired page size of the result.     0