Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 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
e22d259
Merge branch 'develop' into feat_swapper_sun_io
NeOMakinG Dec 4, 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
Prev Previous commit
Next Next commit
fix: improve TRON approval broadcast error handling
  • Loading branch information
gomesalexandre committed Dec 3, 2025
commit 083204c5f8e47909ad7232231f52bbf548d3579d
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ export const useGetTradeQuotes = () => {
(!permit2?.isRequired && hopExecutionMetadata?.state === HopExecutionState.AwaitingSwap)
)

const shouldFetch = (
const shouldFetch =
hopExecutionMetadata?.state === HopExecutionState.AwaitingSwap &&
hopExecutionMetadata?.swap?.state === TransactionExecutionState.AwaitingConfirmation
)

console.log('[APPROVE DEBUG] isFetchStep check:', {
swapperName,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/utils/tron/approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const approveTron = async ({
throw new Error('Failed to sign TRON approval transaction')
}

// Broadcast
// Broadcast - signedTx.serialized is a JSON string
const broadcastResponse = await fetch(`${rpcUrl}/wallet/broadcasttransaction`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand All @@ -95,8 +95,8 @@ export const approveTron = async ({

const result = await broadcastResponse.json()

if (!result.result) {
throw new Error(`TRON approval broadcast failed: ${result.message || 'Unknown error'}`)
if (!result.result && !result.txid) {
throw new Error(`TRON approval broadcast failed: ${JSON.stringify(result)}`)
}

return result.txid
Expand Down
6 changes: 4 additions & 2 deletions src/react-queries/queries/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export const mutations = createMutationKeys('mutations', {
if (amountCryptoBaseUnit === undefined) throw new Error('non-undefined amount is required')
if (!wallet) throw new Error('wallet is required')
if (accountNumber === undefined) {
console.error('[APPROVE DEBUG] accountNumber is undefined! This should not happen for approval')
console.error(
'[APPROVE DEBUG] accountNumber is undefined! This should not happen for approval',
)
throw new Error('accountNumber is required')
}
if (!from) throw new Error('from is required')

const { chainId} = fromAssetId(assetId)
const { chainId } = fromAssetId(assetId)
console.log('[APPROVE DEBUG] Dispatching to:', chainId === tronChainId ? 'TRON' : 'EVM')

// Handle TRON approvals
Expand Down