Releases: Dexalot/dexalot-sdk-python
v0.6.0
What's Changed
Full CLOB order-type support: time-in-force, self-trade prevention, and MARKET orders across the single, batch, and cancel/replace paths — with the order-type model verified against the on-chain TradePairs contract.
CLOB order types
add_ordergains optionaltime_in_force(GTCdefault,FOK,IOC,PO; aliases likePOST_ONLYaccepted) andstp(CANCEL_TAKERdefault,CANCEL_MAKER,CANCEL_BOTH,CANCEL_NONE), replacing the previously hardcodedtype2=0/stp=0in the on-chain order struct.add_limit_order_listandcancel_add_listhonour per-orderorder_type/time_in_force/stp; addedadd_order_listas a clearer alias for the now-not-limit-only batch path.- New
dexalot_sdk.core.order_typesmodule centralises the order enums (Side,OrderType,TimeInForce,SelfTradePrevention,OrderStatus), alias-aware parsers, and combination validation; read and write paths share one integer↔label mapping so it cannot drift. type1/type2/stpenum values confirmed against the contractITradePairs.solenums.
Validators / Input handling
validate_order_comboenforces only the contract-faithful invariant — aLIMITorder requires a price — and defers per-pair allowed types, Post-Only, self-trade, and FOK rules to on-chain reverts (T-IVOT-01,T-POOA-01,T-T2PO-01,T-FOKF-01,T-STPR-01).- Self-trade-prevention input accepts both readable (
CANCEL_TAKER) and contract (CANCELTAKER) spellings.
Docs
- New "Order Types & Time-in-Force" section in the README and matching CLAUDE.md notes.
- Fixed broken documentation-site links flagged by the docs build.
Behavioural changes
time_in_forceandstpare optional and default to prior behaviour (GTC/CANCEL_TAKER/LIMIT); no existing call site changes.- MARKET orders are no longer pre-rejected for time-in-force or a supplied price — the contract ignores both for MARKET. A MARKET BUY now skips the pre-flight balance check (notional is unknown without a price) and relies on the contract; MARKET SELL and all LIMIT paths keep the check.
- Order reads label
type12/3 asSTOP/STOPLIMIT(matching the contractType1enum), but the write API accepts onlyMARKET/LIMIT, so the SDK never originates a stop order. Unrecognised enum integers render asUNKNOWN(<n>). replace_orderinherits the original order'sorder_type/time_in_force/stp(the contract'scancelReplaceOrdercarries only price and quantity); usecancel_add_listto change them.
PRs: #10
Full Changelog: v0.5.16...v0.6.0
v0.5.16
What's Changed
SDK gap-fill release — the Python mirror of TypeScript v0.5.19. Closes the read-side parity gaps: five new history/valuation methods (order history, combined transfers, token USD prices, daily + hourly price history), filterable deployment lookup, structured backend reason-code preservation in errors, a cross-SDK shape reconciliation, and a CVE dependency bump.
New methods
get_order_history(account=None, *, pair=None, status=None, limit=100, offset=0)(CLOB) — paginated per-account order history. Returns the same canonical order shape and aliases asget_open_orders. Balance-tier cached (10s).get_combined_transfers(*, symbol=None, from_ts=None, to_ts=None, limit=100, offset=0)(Transfer) — unified deposit / withdraw / transfer history aslist[Transfer](a frozen dataclass with snake_case fields normalized from the backend'sDBTransfershape).symbolis canonicalized via_normalize_user_token;limit/offsettranslate to the backend'sitemsperpage/pagenopaging andfrom_ts/to_tsto itsperiodfrom/periodtowindow. Balance-tier cached.get_token_usd_prices(env=None)(Transfer) — token→USD price map for portfolio valuation. Semi-static cached (15m).get_token_price_history(token, *, from_ts=None, to_ts=None)/get_token_hourly_price_history(token, *, from_ts=None, to_ts=None)(Transfer) — daily and hourly price series; timestamps normalized to unix seconds (ms auto-detected by magnitude), prices coerced to numbers. Static cached (1h).
Deployment lookup
get_deployment()extended withenv/contract_type/return_abifilters; each filter combination caches under its own static-tier key.
Error handling
_api_callpreserves the backend's structuredreason_code+reasonfrom REST error bodies. Failures surface"FQ-015: insufficient liquidity"instead of the generic"Request failed with status code 400". Pattern-match on the code prefix (FQ-,P-AFNE-,T-TMDQ-,RF-IMV-, …) to branch programmatically.
Cross-SDK parity
- Reconciled the gap-fill public shapes with the canonical cross-SDK spec shared with
dexalot-sdk-typescriptbefore merge (B1–B4), avoiding post-merge breaking changes:get_combined_transfers'skindkwarg renamed tosymbol;Transfer.target_env/target_chain_id/target_tx/target_tsare now nullable (_normalize_transferemitsNonefor non-crossing rows rather than""/0);source_tsstays non-null. get_combined_transfersconvertsfrom_ts/to_ts(unix seconds) to ISO-8601 before sending them to the backend, and parses inboundsource_ts/target_tsfrom ISO-8601 back to unix seconds — the endpoint rejects raw unix integers. Public API is unchanged.
Security / Dependencies
- Bumped
aiohttpto>=3.14.1(clears 8 CVEs, CVE-2026-54273..54280) and widenedcryptographyto>=48.0.1,<49(clears GHSA-537c-gmf6-5ccf; the prior<48ceiling excluded the fix). Relockeduv.lock; thepip-auditandbanditCI gates are green.
Behavioural changes
Result.fail()messages now carry the backend'sreason_code: reasoninstead of the generic status message. Code that string-matched on"Request failed with status code …"should switch to matching the reason-code prefix.- All other changes are additive — five new read methods plus a filterable
get_deployment. No public symbol that existed in v0.5.15 changed shape or was removed; thekind→symbolrename and nullabletarget_*fields are on surfaces introduced in this same release.
PRs: #9
Full Changelog: v0.5.15...v0.5.16
v0.5.15
What's Changed
Precision and security release covering CLOB, TRANSFER, and dependencies.
CLOB
- All four write paths (
add_order,add_limit_order_list,replace_order,cancel_add_list) now route amount/price encoding through Decimal-backedUtils.unit_conversion. FixesT-TMDQ-01rejections from inputs like2933.0whoseint(value * 10**18)silently truncated to2932999999999999737856. replace_ordernow applies the display-decimal precision gate it previously skipped, matching the other three write paths.- Display-decimal precision is now enforced via REJECT-with-tolerance: inputs whose precision exceeds the pair's
basedisplaydecimals/quotedisplaydecimalsreturnResult.failinstead of being silently rounded (silent rounding caused silent slippage — a stop at99.99quietly becoming99.9). A1e-10tolerance absorbs binary-float-representation noise (0.1 + 0.2, etc.). mintrade_amnt/maxtrade_amntenforced client-side as quote-token notional bounds before any on-chain submission.- Pairs whose metadata omits display decimals are now dropped at ingest with a WARNING instead of silently defaulting to 18 (which would mask contract rejections downstream).
TRANSFER
transfer_portfolio,deposit,withdraw,get_deposit_bridge_fee,transfer_tokennow use Decimal arithmetic for amount-to-wei conversion (same precision bug as CLOB).get_portfolio_balanceandget_all_portfolio_balancesnow use Decimal arithmetic for the wei-to-human display conversion, preserving precision for balances above ~2^53 wei.add_gas/remove_gasstandardized onUtils.unit_conversionfor idiom consistency.
Validators
validate_positive_floatrenamed tovalidate_positive_number; now acceptsDecimaland numericstrin addition toint/float(alias kept for one release). Callers wanting precision-exact arithmetic can passDecimal('2933')or'2933.5'.boolis explicitly rejected.
Security
- Pinned
idna >= 3.15(closes CVE-2026-45409) andurllib3 >= 2.7.0(closes PYSEC-2026-141, PYSEC-2026-142).pip-auditis clean.
Docs
- New README "Amount Precision and Display Decimals" section.
- Six new CLAUDE.md entries under "Non-Obvious Decisions" covering the precision contract.
- New
.cursor/rules/precision-decimal-arithmetic.mdcpinning the helper-usage rule for all SDK source files. - Remediation plan entries O-1 through O-8 marked Resolved.
Behavioural changes
- Inputs whose precision exceeds the pair's display decimals now return
Result.fail(...)instead of being silently rounded. Callers must round explicitly or passDecimalfor full precision. - Orders outside
[min_trade_amount, max_trade_amount]now fail in the SDK before any on-chain submission. - Pairs whose API record omits display decimals are no longer present in
client.pairs.
PR: #8
Full Changelog: v0.5.14...v0.5.15
v0.5.14
v0.5.13
What's Changed
- chore: Prepare repo for PyPi distribution by @ngurmen in #1
- docs: Add release workflow and tagging instructions by @ngurmen in #2
- feat: SDK helpers for CLOB market data and chain token balances by @ngurmen in #3
- feat: CI workflow, security gates, and Python 3.13/3.14 support by @ngurmen in #4
- chore: release 0.5.13 + tighten CI security gates by @ngurmen in #5
- build(release): upgrade pip in pypi.yml build tooling step by @ngurmen in #6
New Contributors
Full Changelog: v0.5.12...v0.5.13