Update sideshift plugin with new optional API fields#218
Conversation
Code reviewFound 3 issues:
edge-reports-server/src/partners/sideshift.ts Lines 373 to 375 in d461bee
edge-reports-server/src/queryEngine.ts Lines 187 to 198 in d461bee
edge-reports-server/src/partners/sideshift.ts Lines 160 to 173 in d461bee 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
Addressed the review findings above (fixup commits pushed):
|
18bdef5 to
e85ca8c
Compare
Sideshift's API now returns optional settledAt, deposit/settle contract addresses, deposit/settle hashes, and deposit/settle EVM chain IDs. Capture these in the asSideshiftTx cleaner and wire depositTxid/payoutTxid from the new deposit/settle hashes. The remaining new fields are available on rawTx. Recreates #208 (external fork PR) onto current master.
e85ca8c to
3efce41
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3efce41. Configure here.
| // their wallet), not the customer's own deposit transaction. The API | ||
| // exposes no better field, so treat this as an order reference, not a | ||
| // pointer to the customer's on-chain payment. | ||
| depositTxid: tx.depositHash, |
There was a problem hiding this comment.
Wrong hash in depositTxid
Medium Severity
depositTxid is set from tx.depositHash, which on EVM, TRON, Aptos, Sui, NEAR, and Algorand is SideShift’s internal sweep (deposit contract → their wallet), not the customer’s deposit. Other plugins treat depositTxid as the customer pay-in hash, so consumers tracing the user’s on-chain payment follow the wrong transaction for those networks. Leaving it unset was more accurate than storing a misleading hash.
Reviewed by Cursor Bugbot for commit 3efce41. Configure here.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
Recreates external fork PR #208 ("Update sideshift plugin") on a fresh branch off current
master. The original PR is from a fork (popfendi) and is in aCONFLICTINGstate becausemasterevolved since it was opened (theStandardTxshape and theasSideshiftTxcleaner both gained fields). This re-applies the partner's change cleanly onto currentmaster.Sideshift's API now returns additional optional fields:
settledAt,depositContractAddress,settleContractAddress,depositHash,settleHash,depositEvmChainId,settleEvmChainId. This change:asSideshiftTxcleaner (asOptional).depositTxidfromtx.depositHashandpayoutTxidfromtx.settleHashinprocessSideshiftTx.Per the partner's note, the remaining new fields (contract addresses, EVM chain IDs,
settledAt) are intentionally captured onrawTxfor use where needed and are not yet mapped toStandardTxoutput.Asana: https://app.asana.com/0/1215088146871429/1214638405678783
Testing
npm run build.types(tsc),npm run build.lib, andnpm run build.distpass with the change (verified locally vianpm run prepare; only thesetupstep, which requires a live CouchDB, could not run in the agent sandbox).Note
Medium Risk
Reporting semantics change (txids now populated from partner hashes) with a documented caveat that deposit hashes may not be customer payments; existing Couch txs may be rewritten when hashes arrive on re-query.
Overview
Extends the SideShift partner integration for new optional API fields (
depositHash,settleHash, contract addresses, EVM chain IDs,settledAt) and wiresdepositTxid/payoutTxidfrom the hash fields instead of leaving them unset.depositEvmChainId/settleEvmChainIduseasMaybe(asNumber)so bad encodings do not fail an entire query window. Contract addresses andsettledAtstay onrawTxonly for now. A code comment notes thatdepositHashmay be SideShift’s internal sweep tx, not the user’s deposit, on several chain types.The query engine’s
checkUpdateTxnow treatsdepositTxidandpayoutTxidas updatable fields so Couch documents refresh when hashes appear or change on later polls.Reviewed by Cursor Bugbot for commit 3efce41. Bugbot is set up for automated code reviews on this repo. Configure here.