@@ -43,6 +43,7 @@ import { Hex } from 'viem';
4343import { privateKeyToAccount } from 'viem/accounts' ;
4444import { getCrossChainStatus } from '../src/gateway/utils/layerzero' ;
4545import { supportedChainsMapping } from '../src/gateway/utils/common' ;
46+ import { EsploraClient , GatewaySDK } from '../src' ;
4647
4748describe ( 'LayerZero Tests' , ( ) => {
4849 it . skip ( 'should get chains' , async ( ) => {
@@ -143,6 +144,28 @@ describe('LayerZero Tests', () => {
143144 console . log ( txHash ) ;
144145 } , 120000 ) ;
145146
147+ it . skip (
148+ 'fetches LayerZero orders and cross-chain swap orders correctly' ,
149+ async ( ) => {
150+ const client = new LayerZeroGatewayClient ( ) ;
151+
152+ // Case 1: Address with no cross-chain swap orders and no with gateway orders
153+ const noCrossChainSwapAddress = '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c' ;
154+ let crossChainSwapOrders = await client . getCrossChainSwapOrders ( noCrossChainSwapAddress ) ;
155+ expect ( crossChainSwapOrders . length ) . toBeGreaterThanOrEqual ( 0 ) ; // if expected
156+ let allOrders = await client . getOrders ( noCrossChainSwapAddress ) ;
157+ expect ( allOrders ) . toHaveLength ( 0 ) ;
158+
159+ // Case 2: Address that has done cross-chain swaps and gateway orders
160+ const swapAddress = '0x9BD3befca3660D38F5125C48BB21bEf3e8789787' ;
161+ crossChainSwapOrders = await client . getCrossChainSwapOrders ( swapAddress ) ;
162+ expect ( crossChainSwapOrders . length ) . toBeGreaterThanOrEqual ( 1 ) ;
163+ allOrders = await client . getOrders ( swapAddress ) ;
164+ expect ( allOrders . length ) . toBeGreaterThanOrEqual ( 1 ) ;
165+ } ,
166+ { timeout : 30000 }
167+ ) ;
168+
146169 it . skip ( 'should get an offramp quote and execute it' , async ( ) => {
147170 const client = new LayerZeroGatewayClient ( ) ;
148171 const layerZeroClient = new LayerZeroClient ( ) ;
0 commit comments