File tree Expand file tree Collapse file tree
src/integration/blockchain/shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ export interface BlockscoutTransaction {
1313}
1414
1515export interface BlockscoutTokenTransfer {
16- tx_hash : string ;
16+ transaction_hash : string ;
1717 block_number : number ;
1818 timestamp : string ;
1919 from : { hash : string } ;
2020 to : { hash : string } ;
2121 token : {
22- address : string ;
22+ address_hash : string ;
2323 symbol : string ;
2424 name : string ;
2525 decimals : string ;
Original file line number Diff line number Diff line change @@ -159,9 +159,9 @@ export abstract class CitreaBaseClient extends EvmClient {
159159 . map ( ( tx ) => ( {
160160 blockNumber : tx . block_number . toString ( ) ,
161161 timeStamp : tx . timestamp ,
162- hash : tx . tx_hash ,
162+ hash : tx . transaction_hash ,
163163 from : tx . from . hash ,
164- contractAddress : tx . token . address ,
164+ contractAddress : tx . token . address_hash ,
165165 to : tx . to . hash ,
166166 value : tx . total . value ,
167167 tokenName : tx . token . name || tx . token . symbol ,
Original file line number Diff line number Diff line change @@ -663,7 +663,11 @@ export abstract class EvmClient extends BlockchainClient {
663663 async getSwapResult ( txId : string , asset : Asset ) : Promise < number > {
664664 const receipt = await this . getTxReceipt ( txId ) ;
665665
666- const swapLog = receipt ?. logs ?. find ( ( l ) => l . address . toLowerCase ( ) === asset . chainId ) ;
666+ const walletTopic = ethers . utils . hexZeroPad ( this . walletAddress . toLowerCase ( ) , 32 ) ;
667+
668+ const swapLog = receipt ?. logs ?. find (
669+ ( l ) => l . address . toLowerCase ( ) === asset . chainId . toLowerCase ( ) && l . topics [ 2 ] ?. toLowerCase ( ) === walletTopic ,
670+ ) ;
667671 if ( ! swapLog ) throw new Error ( `Failed to get swap result for TX ${ txId } ` ) ;
668672
669673 const token = await this . getToken ( asset ) ;
You can’t perform that action at this time.
0 commit comments