Skip to content
Get started

Get user tx history

user.get_tx_history(straddress, UserGetTxHistoryParams**kwargs) -> SyncTxHistoryPage[UserTx]
GET/api/v1/users/{address}/tx-history

Get user tx history

ParametersExpand Collapse
address: str

The user account address

action: Optional[EventAction]

Optional event/tx action to filter against

One of the following:
"borrow_flash_loan"
"return_flash_loan"
"create_token_unlock"
"reclaim_token_unlock"
"liquidate"
"borrow"
"return"
"lend"
"redeem"
"deposit_collateral"
"withdraw_collateral"
"claim_war_chest"
"bond"
"unbond"
"claim_unbonded"
"claim_token_unlock"
"claim_rewards"
"cascade"
"send"
limit: Optional[int]

Maximum number of transactions to return.

Optional and defaults to 20 if missing.

formatuint16
minimum1
maximum100
prev_event_uuid: Optional[str]

Optional UUID skip parameter used for pagination.

Providing the last event UUID on a given page will return the next page beginning with the following (unseen) item.

formatuuid
sort_order: Optional[Literal["asc", "desc"]]

Changes the sort order for the returned txs.

Transactions are always sorted by event time, however the direction (e.g. newest to oldest) can be changed using this parameter.

Optional and defaults to desc if missing.

One of the following:
"asc"
"desc"
with_text: Optional[bool]

Include text variation fields

with_value: Optional[bool]

Calculate and include USD values for amounts, where applicable

ReturnsExpand Collapse
class UserTx:
account_address: str

Account address corresponding to the transaction

account_index: Optional[int]

Neptune market sub-account index. Will be set for the following event types: borrow, return, deposit_collateral, withdraw_collateral, liquidate, bond, unbond.

Otherwise the value is guaranteed to be null.

formatuint8
minimum0
maximum255
action: EventAction

Neptune event type for the given market/token contract execute call

One of the following:
"borrow_flash_loan"
"return_flash_loan"
"create_token_unlock"
"reclaim_token_unlock"
"liquidate"
"borrow"
"return"
"lend"
"redeem"
"deposit_collateral"
"withdraw_collateral"
"claim_war_chest"
"bond"
"unbond"
"claim_unbonded"
"claim_token_unlock"
"claim_rewards"
"cascade"
"send"
amount: Optional[str]

The relevant amount for the given tx/event.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

asset: AssetInfo

Asset identifiers with associated metadata

asset: AssetSpec

Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc)

id: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
classification: AssetClassification

The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.)

Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification.

While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change.

One of the following:
class Regular:
kind: Literal["regular"]
neptune_receipt_asset: Optional[AssetSpec]

Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc)

id: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
class NeptuneReceiptToken:
kind: Literal["neptune_receipt_token"]
origin_asset: AssetSpec

Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc)

id: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
class LiquidStakingToken:
kind: Literal["liquid_staking_token"]
origin_asset: Optional[AssetSpec]

Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc)

id: str
group: Literal["native", "token"]
One of the following:
"native"
"token"
group_key: str
metadata: AssetMetadata

Additional metadata for assets

decimals_denom: int

Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. 18 for INJ)

formatuint32
minimum0
decimals_display: int

Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations)

formatuint32
minimum0
name: str

Full name of the asset

symbol: str

Symbol of the asset, e.g.: NEPT INJ

symbol_denom: str

Denom symbol for the asset (e.g. inj for INJ, sat for BTC)

contract_address: str

Address for the event's corresponding contract

destination_address: Optional[str]

Destination account address. Non-null for send/transfer transactions. This field will be null for all other action types.

event_time: datetime

Event/transaction block time

formatdate-time
event_uuid: str

Internal UUID created when the transaction was first indexed by Neptune.

Primary usage for API clients is tx history pagination offsets.

NOTE: event UUIDs should not be used as a guaranteed method of uniquely identifying a transaction event over extended periods of time.

Future updates to our indexer may infrequently require a full re-index of transactions, resulting in newly generated UUIDs.

formatuuid
extra: Extra
text: Optional[ExtraText]

Human-readable field variants. Will not be null when query param with_text is true.

action: str
amount: str
event_time: str
historic_price: str
historic_value: str
value: Optional[ExtraValue]

USD values for the corresponding amounts above. Will not be null when query param with_value is true.

Note

This variant group contains an additional price field (set to the number used in value calculation).

The embedded text group will contain the text variant if with_text was specified as well.

amount: Optional[str]
extra: ExtraValueExtra
text: Optional[ExtraValueExtraText]

Human-readable variants of USD values. Will not be null when query params with_text and with_value are true.

amount: Optional[str]
price: Optional[str]

Text representation of price

price: str

Price used in value calculations

historic_price: Union[str, float, null]

The price of the associated asset at the time of the transaction.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

One of the following:
str

The price of the associated asset at the time of the transaction.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

float

The price of the associated asset at the time of the transaction.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

historic_value: Union[str, float, null]

The USD value at the time of the transaction. Derived using the amount and historical price of the associated asset.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

One of the following:
str

The USD value at the time of the transaction. Derived using the amount and historical price of the associated asset.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

float

The USD value at the time of the transaction. Derived using the amount and historical price of the associated asset.

This value will be set for all currently implemented action types. It is set as nullable for forwards compatibility for future action types which may not have an associated amount.

tx_hash: str

Transaction hash

Get user tx history

from neptune_api_v2 import NeptuneAPIV2

client = NeptuneAPIV2()
page = client.user.get_tx_history(
    address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
)
page = page.data[0]
print(page.event_uuid)
{
  "data": [
    {
      "event_uuid": "1cc81b0e-ba2f-438c-883c-05aa4db53f45",
      "event_time": "2026-04-09T23:40:09.142869763Z",
      "tx_hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "action": "borrow",
      "contract_address": "inj1nc7gjkf2mhp34a6gquhurg8qahnw5kxs5u3s4u",
      "account_address": "inj10123456789abcdef0123456789abcdef012345",
      "destination_address": null,
      "account_index": 0,
      "asset": {
        "asset": {
          "id": "native;inj",
          "group": "native",
          "group_key": "inj"
        },
        "metadata": {
          "name": "Injective",
          "symbol": "INJ",
          "symbol_denom": "inj",
          "decimals_denom": 18,
          "decimals_display": 4
        },
        "classification": {
          "kind": "regular",
          "neptune_receipt_asset": {
            "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f",
            "group": "token",
            "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f"
          }
        }
      },
      "amount": "1",
      "historic_price": "1",
      "historic_value": "1",
      "extra": {
        "text": {
          "event_time": "2026-04-09 11:40:09 PM +00:00",
          "action": "Borrow",
          "amount": "0.0000 INJ",
          "historic_price": "$1.00",
          "historic_value": "$1.00"
        },
        "value": {
          "amount": "0.000000000000000002",
          "price": "2.99835",
          "extra": {
            "text": {
              "price": "$2.99",
              "amount": "$0.00"
            }
          }
        }
      }
    }
  ],
  "count": 1,
  "error": null,
  "status": 200,
  "status_text": "200 OK"
}
{
  "data": null,
  "error": {
    "kind": "internal",
    "scope": "server",
    "message": "An unexpected error occurred"
  },
  "status": 500,
  "status_text": "500 Internal Server Error"
}
Returns Examples
{
  "data": [
    {
      "event_uuid": "1cc81b0e-ba2f-438c-883c-05aa4db53f45",
      "event_time": "2026-04-09T23:40:09.142869763Z",
      "tx_hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "action": "borrow",
      "contract_address": "inj1nc7gjkf2mhp34a6gquhurg8qahnw5kxs5u3s4u",
      "account_address": "inj10123456789abcdef0123456789abcdef012345",
      "destination_address": null,
      "account_index": 0,
      "asset": {
        "asset": {
          "id": "native;inj",
          "group": "native",
          "group_key": "inj"
        },
        "metadata": {
          "name": "Injective",
          "symbol": "INJ",
          "symbol_denom": "inj",
          "decimals_denom": 18,
          "decimals_display": 4
        },
        "classification": {
          "kind": "regular",
          "neptune_receipt_asset": {
            "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f",
            "group": "token",
            "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f"
          }
        }
      },
      "amount": "1",
      "historic_price": "1",
      "historic_value": "1",
      "extra": {
        "text": {
          "event_time": "2026-04-09 11:40:09 PM +00:00",
          "action": "Borrow",
          "amount": "0.0000 INJ",
          "historic_price": "$1.00",
          "historic_value": "$1.00"
        },
        "value": {
          "amount": "0.000000000000000002",
          "price": "2.99835",
          "extra": {
            "text": {
              "price": "$2.99",
              "amount": "$0.00"
            }
          }
        }
      }
    }
  ],
  "count": 1,
  "error": null,
  "status": 200,
  "status_text": "200 OK"
}
{
  "data": null,
  "error": {
    "kind": "internal",
    "scope": "server",
    "message": "An unexpected error occurred"
  },
  "status": 500,
  "status_text": "500 Internal Server Error"
}