Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions dexpaprika_sdk/api/pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,26 +253,30 @@ def get_ohlcv(
return [OHLCVRecord(**item) for item in data]

def get_transactions(
self,
network_id: str,
pool_address: str,
page: int = 0,
limit: int = 10,
cursor: Optional[str] = None
self,
network_id: str,
pool_address: str,
page: int = 0,
limit: int = 10,
cursor: Optional[str] = None,
from_timestamp: Optional[int] = None,
to_timestamp: Optional[int] = None
) -> TransactionsResponse:
"""
Get transactions of a pool on a network.

Args:
network_id: Network ID (e.g., "ethereum", "solana")
pool_address: Pool address or identifier
page: Page number for pagination
limit: Number of items per page
cursor: Transaction ID used for cursor-based pagination

from_timestamp: Filter transactions starting from this UNIX timestamp (inclusive). Results capped to last 7 days.
to_timestamp: Filter transactions up to this UNIX timestamp (exclusive). Must be after from_timestamp.

Returns:
Response containing a list of transactions

Raises:
ValueError: If any parameter is invalid
"""
Expand All @@ -281,11 +285,11 @@ def get_transactions(
self._validate_required("pool_address", pool_address)
self._validate_range("page", page, min_val=0)
self._validate_range("limit", limit, min_val=1, max_val=100)

# Get txs
params = {"page": page, "limit": limit, "cursor": cursor}
params = {"page": page, "limit": limit, "cursor": cursor, "from": from_timestamp, "to": to_timestamp}
params = self._clean_params(params)

data = self._get(f"/networks/{network_id}/pools/{pool_address}/transactions", params=params)
return TransactionsResponse(**data)

Expand Down
4 changes: 4 additions & 0 deletions dexpaprika_sdk/models/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class TokenDetails(BaseModel):
total_supply: Optional[float] = Field(None, description="Total supply of the token (may be None for some chains like Solana)")
description: str = Field("", description="Token description")
website: str = Field("", description="Token website URL")
telegram: str = Field("", description="Official Telegram URL for the token/project")
twitter: str = Field("", description="Official Twitter URL for the token/project")
explorer: str = Field("", description="Token explorer URL")
added_at: str = Field(..., description="When the token was added to the system")
summary: Optional[TokenSummary] = Field(None, description="Token summary metrics")
Expand All @@ -53,6 +55,8 @@ class TokenDetailsLight(BaseModel):
total_supply: Optional[float] = Field(None, description="Total supply of the token (may be None for some chains like Solana)")
description: str = Field("", description="Token description")
website: str = Field("", description="Token website URL")
telegram: str = Field("", description="Official Telegram URL for the token/project")
twitter: str = Field("", description="Official Twitter URL for the token/project")
explorer: str = Field("", description="Token explorer URL")
added_at: Optional[str] = Field(None, description="When the token was added to the system")
price_usd: Optional[float] = Field(None, description="Current price in USD")
Expand Down
Loading