cURL
curl --request GET \ --url https://api.example.com/api/v1/trading/transactions \ --header 'Content-Type: application/json' \ --data ' { "limit": 123, "offset": 123 } '
{ "transactions": [ { "id": "<string>", "type": "<string>", "amount": 123, "balance_after": 123, "created_at": "<string>", "description": "<string>" } ], "total": 123, "limit": 123, "offset": 123 }
Get your transaction history from ledger
result = client.get_transactions(limit=50, offset=0)
Show Transaction object
DEPOSIT
WITHDRAWAL
TRADE
SETTLEMENT
from polyhush import PolyhushClient client = PolyhushClient(api_key="your-api-key") # Get first page of transactions result = client.get_transactions(limit=20, offset=0) for tx in result['transactions']: sign = "+" if tx['amount'] > 0 else "" print(f"{tx['created_at']}: {tx['type']} {sign}${tx['amount']:.2f}") print(f" {tx['description']}") print(f" Balance: ${tx['balance_after']:.2f}") print() # Get next page if result['total'] > 20: page2 = client.get_transactions(limit=20, offset=20)
{ "transactions": [ { "id": "tx_123", "type": "TRADE", "amount": -55.00, "balance_after": 945.00, "created_at": "2024-01-15T10:30:00Z", "description": "Buy 100 shares @ $0.55" }, { "id": "tx_122", "type": "SETTLEMENT", "amount": 100.00, "balance_after": 1000.00, "created_at": "2024-01-14T15:00:00Z", "description": "Settlement payout: Will BTC hit $50k?" } ], "total": 150, "limit": 50, "offset": 0 }