Skip to content

Commit 827a8b1

Browse files
committed
fix: code review
1 parent 8693a73 commit 827a8b1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sdk/src/gateway/layerzero.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ export class LayerZeroGatewayClient extends GatewayApiClient {
334334
finalFeeSats: baseQuote.finalFeeSats + Number(maxTokensToSwapForLayerZeroFees),
335335
};
336336
} else if (fromChain !== 'bitcoin' && toChain === 'bitcoin') {
337-
const fromChain = resolveChainName(params.fromChain);
338337
const dstEid = await this.l0Client.getEidForChain(fromChain);
339338

340339
if (!dstEid) {
@@ -385,7 +384,10 @@ export class LayerZeroGatewayClient extends GatewayApiClient {
385384
args: [sendParam, false],
386385
});
387386

388-
const gasFee = await this.getL0CreateOrderGasCost(params, sendParam, sendFees, fromChain);
387+
const gasFee =
388+
fromChain === 'mainnet'
389+
? 0n
390+
: await this.getL0CreateOrderGasCost(params, sendParam, sendFees, fromChain);
389391

390392
return {
391393
type: GatewayOrderType.CrossChainSwap,
@@ -399,8 +401,8 @@ export class LayerZeroGatewayClient extends GatewayApiClient {
399401
feeBreakdown: {
400402
nativeFee: sendFees.nativeFee,
401403
lzTokenFee: sendFees.lzTokenFee,
404+
gasFee: gasFee,
402405
},
403-
gasFee: gasFee,
404406
},
405407
};
406408
}

sdk/src/gateway/types/crosschain-swap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export type CrossChainSwapQuoteParams<T = {}> = BaseExecuteQuoteParams<T> & {
3636
export type CrossChainFeeBreakdown = {
3737
nativeFee: bigint;
3838
lzTokenFee: bigint;
39+
gasFee: bigint;
3940
};
4041

4142
export interface CrossChainSwapQuote {
4243
sourceEid: number;
4344
destinationEid: number;
4445
oftAddress: Address;
4546
feeBreakdown: CrossChainFeeBreakdown;
46-
gasFee: bigint;
4747
}

0 commit comments

Comments
 (0)