Skip to content

Commit

Permalink
fix lnbridge request
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Oct 17, 2023
1 parent 66c8920 commit d486ed6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/apps/src/bridges/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export abstract class BaseBridge {
}
}

isLnBridge() {
return false;
}

getLogo() {
return this.logo;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/apps/src/bridges/lnbridge-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion packages/apps/src/components/transfer-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d486ed6

Please sign in to comment.