Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b54f829
feat: display current nonce in WalletConnect transaction advanced par…
gomesalexandre Dec 2, 2025
9ba6676
feat: massively enhance swapper-integration skill with deep research …
gomesalexandre Dec 2, 2025
42d05a6
feat: integrate Sun.io swapper for TRON blockchain
gomesalexandre Dec 2, 2025
e574713
refactor: use getInputOutputRate helper and add TRON-specific gotchas…
gomesalexandre Dec 2, 2025
3bbe0ab
fix: use TronWeb contract interface instead of triggerSmartContract
gomesalexandre Dec 2, 2025
f5c1b4a
fix: clone arrays before passing to TronWeb to avoid immutability errors
gomesalexandre Dec 2, 2025
d22626e
fix: convert TRON addresses to hex format for triggerSmartContract
gomesalexandre Dec 2, 2025
daf9514
docs: add node -e testing tip and TRON triggerSmartContract gotchas
gomesalexandre Dec 2, 2025
f6bc403
fix: use tuple with type signature and array values for SwapData struct
gomesalexandre Dec 2, 2025
d69db51
fix: pass TRON addresses as Base58 strings, not hex format
gomesalexandre Dec 2, 2025
40c99e7
fix: remove unused SUNSWAP_ROUTER_ABI import
gomesalexandre Dec 2, 2025
3057bde
debug: add extensive logging to Sun.io transaction builder
gomesalexandre Dec 2, 2025
6c89450
fix: set default address on TronWeb instance before building transaction
gomesalexandre Dec 2, 2025
35b1a6e
fix: convert TRON addresses to EVM format for tuple parameters in Tro…
gomesalexandre Dec 2, 2025
fc7eeda
fix: use correct Smart Router contract and set call_value for native …
gomesalexandre Dec 2, 2025
af21d3e
debug: add extensive JSON logging to Sun.io quote and transaction bui…
gomesalexandre Dec 2, 2025
2188b9b
debug: add wallet signing logs to track TRON address derivation
gomesalexandre Dec 2, 2025
ad408bb
fix: use hardened derivation path for TRON wallet signing
gomesalexandre Dec 2, 2025
a04b2a8
feat: implement proper TRON transaction status polling for Sun.io
gomesalexandre Dec 2, 2025
5aa44b8
fix: add TronSwapperDeps to CheckTradeStatusInput and use TxStatus enum
gomesalexandre Dec 2, 2025
a2cd6cb
fix: use tx.status directly instead of tx.ret for TRON status check
gomesalexandre Dec 2, 2025
4fa3f9a
fix: check tx.confirmations for TRON status instead of tx.status
gomesalexandre Dec 2, 2025
6e2aaf5
fix: import TxStatus enum for status polling
gomesalexandre Dec 2, 2025
11b8875
chore: remove debug console.logs from Sun.io swapper
gomesalexandre Dec 2, 2025
b473448
fix: pass assertGetTronChainAdapter to checkTradeStatus in tradeExecu…
gomesalexandre Dec 2, 2025
6f27973
fix: call TRON API directly for status to check ret.contractRet
gomesalexandre Dec 2, 2025
bca5812
feat: spank @neomaking
gomesalexandre Dec 2, 2025
57ed8a8
refactor: use toAddressNList helper instead of manual HARDENED calcul…
gomesalexandre Dec 2, 2025
a4c6860
chore: merge develop into feat_swapper_sun_io
gomesalexandre Dec 3, 2025
5d52301
feat: add TRON TRC-20 approval support for swappers
gomesalexandre Dec 3, 2025
9cdc425
fix: skip EVM contract data generation for TRON approvals
gomesalexandre Dec 3, 2025
e9e0d87
docs: update RPC URL access pattern in swapper-integration skill
gomesalexandre Dec 3, 2025
27a30e8
debug: add logging for TRON approval accountNumber issue
gomesalexandre Dec 3, 2025
2e8c655
debug: add isFetchStep and shouldFetchTradeQuotes logging
gomesalexandre Dec 3, 2025
6eb1ae0
fix: set accountNumber to 0 in Sun.io rate quotes for approval compat…
gomesalexandre Dec 3, 2025
083204c
fix: improve TRON approval broadcast error handling
gomesalexandre Dec 3, 2025
662dd4d
feat: implement TRON TRC-20 approval flow with transaction broadcast
gomesalexandre Dec 3, 2025
2f489c1
Merge remote-tracking branch 'origin/develop' into feat_swapper_sun_io
gomesalexandre Dec 3, 2025
3f8d499
chore: remove debug console.warn from TRON approval polling
gomesalexandre Dec 3, 2025
6fb19c0
refactor: remove 'as any' casts and use constants in Sun.io swapper
gomesalexandre Dec 3, 2025
6ca415b
feat: expand Sun.io DEX type coverage for better route discovery
gomesalexandre Dec 3, 2025
80b8be0
refactor: unify Sun.io rate and quote logic to eliminate duplication
gomesalexandre Dec 3, 2025
4bd9a36
fix: validate receiveAddress is defined for quote fee estimation
gomesalexandre Dec 3, 2025
6e835ed
feat: tackle @coderabbitai comments
gomesalexandre Dec 3, 2025
61a3b18
Merge branch 'develop' into feat_swapper_sun_io
gomesalexandre Dec 4, 2025
3d0a0b6
fix: temporary shitty fix to fix this shit
gomesalexandre Dec 4, 2025
34c4455
fix: implement proper TRON getTransaction with block info
gomesalexandre Dec 4, 2025
f2f34be
fix: require confirmations for TRON tx success status
gomesalexandre Dec 4, 2025
942330c
fix: restore Firefox-specific orbs.svg fallback logic
gomesalexandre Dec 4, 2025
d383d3f
revert: remove all SVG ?url additions
gomesalexandre Dec 4, 2025
704754a
chore: merge develop into fix_tron_getTransaction
gomesalexandre Dec 5, 2025
6d59044
style: apply lint fixes after merge
gomesalexandre Dec 5, 2025
c517f50
Merge branch 'develop' into fix_tron_getTransaction
NeOMakinG Dec 5, 2025
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
19 changes: 4 additions & 15 deletions packages/swapper/src/swappers/SunioSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,17 @@ export const sunioApi: SwapperApi = {
checkTradeStatus: async ({ txHash, assertGetTronChainAdapter }) => {
try {
const adapter = assertGetTronChainAdapter(tronChainId)
const rpcUrl = adapter.httpProvider.getRpcUrl()
const tx = await adapter.httpProvider.getTransaction({ txid: txHash })

const response = await fetch(`${rpcUrl}/wallet/gettransactionbyid`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ value: txHash, visible: true }),
})

if (!response.ok) {
return createDefaultStatusResponse(txHash)
}

const tx = await response.json()

if (!tx || !tx.txID) {
if (!tx) {
return createDefaultStatusResponse(txHash)
}

const contractRet = tx.ret?.[0]?.contractRet

// Only mark as confirmed if SUCCESS AND has confirmations (in a block)
const status =
contractRet === 'SUCCESS'
contractRet === 'SUCCESS' && tx.confirmations > 0
? TxStatus.Confirmed
: contractRet === 'REVERT'
? TxStatus.Failed
Expand Down
42 changes: 30 additions & 12 deletions packages/unchained-client/src/tron/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,31 +115,49 @@ export class TronApi {
async getTransaction(params: { txid: string }): Promise<TronTx | null> {
await this.throttle()

const response = await fetch(`${this.rpcUrl}/wallet/gettransactionbyid`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ value: params.txid, visible: true }),
})

if (!response.ok) {
const [txResponse, infoResponse] = await Promise.all([
fetch(`${this.rpcUrl}/wallet/gettransactionbyid`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ value: params.txid, visible: true }),
}),
fetch(`${this.rpcUrl}/wallet/gettransactioninfobyid`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ value: params.txid, visible: true }),
}),
])

if (!txResponse.ok) {
return null
}

const tx = await response.json()
const tx = await txResponse.json()

if (!tx || !tx.txID) {
return null
}

let blockNumber = 0
let blockTimeStamp = 0
let fee = '0'

if (infoResponse.ok) {
const info = await infoResponse.json()
blockNumber = info.blockNumber || 0
blockTimeStamp = info.blockTimeStamp || 0
fee = info.fee ? String(info.fee) : '0'
}

return {
...tx,
txid: tx.txID,
blockHash: '',
blockHeight: 0,
timestamp: 0,
confirmations: 0,
blockHeight: blockNumber,
timestamp: blockTimeStamp,
confirmations: blockNumber > 0 ? 1 : 0,
value: '0',
fee: '0',
fee,
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/unchained-client/src/tron/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export interface TronTx {
raw_data_hex: string
txID: string
signature?: string[]
ret?: {
contractRet?: 'SUCCESS' | 'REVERT' | string
fee?: number
}[]
}

type TRC20Token = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SplashScreen/SplashScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Center, Circle, Spinner } from '@chakra-ui/react'
import { isFirefox } from 'react-device-detect'

import Orbs from '@/assets/orbs.svg?url'
import Orbs from '@/assets/orbs.svg'
import OrbsStatic from '@/assets/orbs-static.png'
import { FoxIcon } from '@/components/Icons/FoxIcon'
import { Page } from '@/components/Layout/Page'
Expand Down