mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-22 22:25:21 +01:00
chore: small changes
This commit is contained in:
parent
86152341b2
commit
5c56dd51c7
4 changed files with 34 additions and 40 deletions
|
@ -31,7 +31,7 @@ export const ChannelType = new GraphQLObjectType({
|
||||||
localBalance: { type: GraphQLInt },
|
localBalance: { type: GraphQLInt },
|
||||||
localReserve: { type: GraphQLInt },
|
localReserve: { type: GraphQLInt },
|
||||||
partnerPublicKey: { type: GraphQLString },
|
partnerPublicKey: { type: GraphQLString },
|
||||||
recieved: { type: GraphQLInt },
|
received: { type: GraphQLInt },
|
||||||
remoteBalance: { type: GraphQLInt },
|
remoteBalance: { type: GraphQLInt },
|
||||||
remoteReserve: { type: GraphQLInt },
|
remoteReserve: { type: GraphQLInt },
|
||||||
sent: { type: GraphQLInt },
|
sent: { type: GraphQLInt },
|
||||||
|
|
|
@ -5,45 +5,24 @@ import {
|
||||||
GraphQLList
|
GraphQLList
|
||||||
} from "graphql";
|
} from "graphql";
|
||||||
import { GraphQLInt } from "graphql";
|
import { GraphQLInt } from "graphql";
|
||||||
|
import { PartnerNodeType } from "./channels";
|
||||||
|
|
||||||
// TODO: INCOMPLETE TYPE
|
// TODO: INCOMPLETE TYPE
|
||||||
export const PendingChannelType = new GraphQLObjectType({
|
export const PendingChannelType = new GraphQLObjectType({
|
||||||
name: "pendingChannelType",
|
name: "pendingChannelType",
|
||||||
fields: () => {
|
fields: () => {
|
||||||
return {
|
return {
|
||||||
closeTransactionId: {
|
isActive: { type: GraphQLBoolean },
|
||||||
type: GraphQLString
|
isClosing: { type: GraphQLBoolean },
|
||||||
},
|
isOpening: { type: GraphQLBoolean },
|
||||||
isActive: {
|
localBalance: { type: GraphQLInt },
|
||||||
type: GraphQLBoolean
|
localReserve: { type: GraphQLInt },
|
||||||
},
|
partnerPublicKey: { type: GraphQLString },
|
||||||
isClosing: {
|
received: { type: GraphQLInt },
|
||||||
type: GraphQLBoolean
|
remoteBalance: { type: GraphQLInt },
|
||||||
},
|
remoteReserve: { type: GraphQLInt },
|
||||||
isOpening: {
|
sent: { type: GraphQLInt },
|
||||||
type: GraphQLBoolean
|
partnerNodeInfo: { type: PartnerNodeType }
|
||||||
},
|
|
||||||
localBalance: {
|
|
||||||
type: GraphQLInt
|
|
||||||
},
|
|
||||||
localReserve: {
|
|
||||||
type: GraphQLInt
|
|
||||||
},
|
|
||||||
partnerPublicKey: {
|
|
||||||
type: GraphQLString
|
|
||||||
},
|
|
||||||
received: {
|
|
||||||
type: GraphQLInt
|
|
||||||
},
|
|
||||||
remoteBalance: {
|
|
||||||
type: GraphQLInt
|
|
||||||
},
|
|
||||||
remoteReserve: {
|
|
||||||
type: GraphQLInt
|
|
||||||
},
|
|
||||||
sent: {
|
|
||||||
type: GraphQLInt
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -60,13 +60,13 @@ export const getChannels = {
|
||||||
isActive: channel.is_active,
|
isActive: channel.is_active,
|
||||||
isClosing: channel.is_closing,
|
isClosing: channel.is_closing,
|
||||||
isOpening: channel.is_opening,
|
isOpening: channel.is_opening,
|
||||||
isPartnerInitiated: channel.is_partner_initiated,
|
isPartnerInitiated: !channel.is_partner_initiated,
|
||||||
isPrivate: channel.is_private,
|
isPrivate: channel.is_private,
|
||||||
isStaticRemoteKey: channel.is_static_remote_key,
|
isStaticRemoteKey: channel.is_static_remote_key,
|
||||||
localBalance: channel.local_balance,
|
localBalance: channel.local_balance,
|
||||||
localReserve: channel.local_reserve,
|
localReserve: channel.local_reserve,
|
||||||
partnerPublicKey: channel.partner_public_key,
|
partnerPublicKey: channel.partner_public_key,
|
||||||
recieved: channel.received,
|
received: channel.received,
|
||||||
remoteBalance: channel.remote_balance,
|
remoteBalance: channel.remote_balance,
|
||||||
remoteReserve: channel.remote_reserve,
|
remoteReserve: channel.remote_reserve,
|
||||||
sent: channel.sent,
|
sent: channel.sent,
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import { getPendingChannels as getLnPendingChannels } from "ln-service";
|
import {
|
||||||
|
getPendingChannels as getLnPendingChannels,
|
||||||
|
getNode
|
||||||
|
} from "ln-service";
|
||||||
import { logger } from "../../../helpers/logger";
|
import { logger } from "../../../helpers/logger";
|
||||||
import { PendingChannelType } from "../../../schemaTypes/query/info/pendingChannels";
|
import { PendingChannelType } from "../../../schemaTypes/query/info/pendingChannels";
|
||||||
import { GraphQLList } from "graphql";
|
import { GraphQLList } from "graphql";
|
||||||
|
@ -35,9 +38,14 @@ export const getPendingChannels = {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const channels = pendingChannels.pending_channels.map(channel => {
|
const channels = pendingChannels.pending_channels.map(async channel => {
|
||||||
|
const nodeInfo = await getNode({
|
||||||
|
lnd,
|
||||||
|
is_omitting_channels: true,
|
||||||
|
public_key: channel.partner_public_key
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
closeTransactionId: channel.close_transaction_id,
|
|
||||||
isActive: channel.is_active,
|
isActive: channel.is_active,
|
||||||
isClosing: channel.is_closing,
|
isClosing: channel.is_closing,
|
||||||
isOpening: channel.is_opening,
|
isOpening: channel.is_opening,
|
||||||
|
@ -47,7 +55,14 @@ export const getPendingChannels = {
|
||||||
received: channel.received,
|
received: channel.received,
|
||||||
remoteBalance: channel.remote_balance,
|
remoteBalance: channel.remote_balance,
|
||||||
remoteReserve: channel.remote_reserve,
|
remoteReserve: channel.remote_reserve,
|
||||||
sent: channel.sent
|
sent: channel.sent,
|
||||||
|
partnerNodeInfo: {
|
||||||
|
alias: nodeInfo.alias,
|
||||||
|
capacity: nodeInfo.capacity,
|
||||||
|
channelCount: nodeInfo.channel_count,
|
||||||
|
color: nodeInfo.color,
|
||||||
|
lastUpdate: nodeInfo.updated_at
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return channels;
|
return channels;
|
||||||
|
|
Loading…
Add table
Reference in a new issue