From d486ed64581aa873b3899e04f2ad0be65fbe3e6d Mon Sep 17 00:00:00 2001 From: JayJay1024 Date: Tue, 17 Oct 2023 13:26:49 +0800 Subject: [PATCH] fix lnbridge request --- packages/apps/src/bridges/base.ts | 4 ++++ packages/apps/src/bridges/lnbridge-base.ts | 4 ++++ packages/apps/src/components/transfer-modal.tsx | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/apps/src/bridges/base.ts b/packages/apps/src/bridges/base.ts index 6067d01ff..a5cbdb28b 100644 --- a/packages/apps/src/bridges/base.ts +++ b/packages/apps/src/bridges/base.ts @@ -66,6 +66,10 @@ export abstract class BaseBridge { } } + isLnBridge() { + return false; + } + getLogo() { return this.logo; } diff --git a/packages/apps/src/bridges/lnbridge-base.ts b/packages/apps/src/bridges/lnbridge-base.ts index ea82a3bea..0712138b7 100644 --- a/packages/apps/src/bridges/lnbridge-base.ts +++ b/packages/apps/src/bridges/lnbridge-base.ts @@ -27,6 +27,10 @@ export class LnBridgeBase extends BaseBridge { this.estimateTime = { min: 1, max: 30 }; } + isLnBridge() { + return true; + } + async getFee(args?: { baseFee?: bigint; protocolFee?: bigint; liquidityFeeRate?: bigint; transferAmount?: bigint }) { if (this.sourceToken) { return { diff --git a/packages/apps/src/components/transfer-modal.tsx b/packages/apps/src/components/transfer-modal.tsx index 19e90afc7..d4b2fb356 100644 --- a/packages/apps/src/components/transfer-modal.tsx +++ b/packages/apps/src/components/transfer-modal.tsx @@ -40,7 +40,9 @@ export default function TransferModal({ if (sender && recipient && targetChain && bridgeClient) { try { setBusy(true); - const relayer = (await refetchRelayers()).data.sortedLnv20RelayInfos?.at(0); + const relayer = bridgeClient.isLnBridge() + ? (await refetchRelayers()).data.sortedLnv20RelayInfos?.at(0) + : undefined; const receipt = await transfer(sender, recipient, transferValue.formatted, { remoteChainId: BigInt(targetChain.id), relayer: relayer?.relayer,