Skip to content

Swapter plugin integration#219

Open
markovo4 wants to merge 2 commits into
EdgeApp:masterfrom
markovo4:swapter-integration
Open

Swapter plugin integration#219
markovo4 wants to merge 2 commits into
EdgeApp:masterfrom
markovo4:swapter-integration

Conversation

@markovo4

Copy link
Copy Markdown

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes

  • No

Dependencies

none

Description

Added Swapter partner plugin integration.

This PR adds support for querying Swapter exchange history through the /personal/exchange/tool-history endpoint and converting Swapter transactions into standard Edge partner plugin transactions.

Changes include:

  • Added Swapter transaction cleaners
  • Added Swapter status mapping to Edge transaction statuses
  • Added paginated history fetching
  • Added retry handling for failed requests
  • Added latestIsoDate tracking to avoid duplicate transaction processing
  • Added conversion of Swapter deposit/withdrawal data into StandardTx
  • Added Swapter plugin registration with pluginId: swapter

@j0ntz

j0ntz commented Jun 24, 2026

Copy link
Copy Markdown

Tested this plugin as part of merge review.

Verification

  • tsc type-check passes for swapter.ts and queryEngine.ts (the one remaining repo type error is the pre-existing src/demo/clientUtil.ts missing clientConfig.json, unrelated to this PR).
  • eslint clean on both changed files.
  • Ran the compiled processSwapterTx against a representative tool-history transaction and asserted the output conforms to asStandardTx. Status mapping, usdValue (equivalent with the -1 sentinel), and depositAmount (actual ?? amount) all produce correct output.

One fix pushed to this branch (0aa89f5)

  • processSwapterTx computed the date with new Date(tx.time.create) and tx.time.create / 1000, which only yields correct dates if time.create is in milliseconds. If Swapter returns Unix seconds, it produced 1970 dates. Switched to smartIsoDateFromTimestamp(tx.time.create), the util the other partner plugins use, so the transform is correct whether the API sends seconds or milliseconds.
  • Added the missing CHANGELOG.md entry (the PR checklist marked "Yes" but no entry was present).

Note for the Swapter side: please confirm the tool-history time.create unit and the total/pagination semantics (page * items >= total) against live data when an API key is wired up.

markovo4 and others added 2 commits June 24, 2026 12:18
Use smartIsoDateFromTimestamp for the Swapter time.create field so the
transform produces correct dates whether the partner sends Unix seconds
or milliseconds, matching the other reports-server partner plugins. Add
the missing CHANGELOG entry for the Swapter integration.

Claude-Session: https://claude.ai/code/session_01STk8j8NcL2LgiuXRxirVn6
@j0ntz j0ntz force-pushed the swapter-integration branch from 0aa89f5 to a061fcd Compare June 24, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants