Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
feat: expand LND support (#385)
Browse files Browse the repository at this point in the history
Co-authored-by: Roland Bewick <[email protected]>
  • Loading branch information
im-adithya and rolznz authored Jun 12, 2024
1 parent a3fa78f commit e3085fa
Show file tree
Hide file tree
Showing 4 changed files with 342 additions and 22 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lib/backendType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type BackendTypeConfig = {
export const backendTypeConfigs: Record<BackendType, BackendTypeConfig> = {
LND: {
hasMnemonic: false,
hasChannelManagement: false, // TODO: set to true soon
hasChannelManagement: true,
hasNodeBackup: false,
},
BREEZ: {
Expand Down
18 changes: 16 additions & 2 deletions frontend/src/screens/channels/NewChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export default function NewChannel() {
}

function NewChannelInternal({ network }: { network: Network }) {
const { data: channelPeerSuggestions } = useChannelPeerSuggestions();

const { data: _channelPeerSuggestions } = useChannelPeerSuggestions();
const navigate = useNavigate();

const [order, setOrder] = React.useState<Partial<NewChannelOrder>>({
Expand All @@ -64,6 +63,21 @@ function NewChannelInternal({ network }: { network: Network }) {
RecommendedChannelPeer | undefined
>();

const channelPeerSuggestions = React.useMemo(() => {
const customOption: RecommendedChannelPeer = {
name: "Custom",
network,
paymentMethod: "onchain",
minimumChannelSize: 0,
pubkey: "",
host: "",
image: "",
};
return _channelPeerSuggestions
? [..._channelPeerSuggestions, customOption]
: undefined;
}, [_channelPeerSuggestions, network]);

function setPaymentMethod(paymentMethod: "onchain" | "lightning") {
setOrder((current) => ({
...current,
Expand Down
Loading

0 comments on commit e3085fa

Please sign in to comment.