diff --git a/src/helpers/helpers.ts b/src/helpers/helpers.ts index 8789ffa1..29a7ed04 100644 --- a/src/helpers/helpers.ts +++ b/src/helpers/helpers.ts @@ -40,7 +40,7 @@ export const getAuthLnd = (auth: string) => { // const macaroon = base64url.toBase64(encodedMacaroon); // const cert = base64url.toBase64(encodedCert); - const macaroon = base64url.toBase64(encodedMacaroon); + const macaroon = base64url.toBase64(encodedMacaroon).replace('==', ''); // console.log(encodedCert); @@ -61,7 +61,7 @@ export const getAuthLnd = (auth: string) => { export const getErrorMsg = (error: any[]): string => { const code = error[0]; const msg = error[1]; - const details = error.length > 2 ? error[2].details : ''; + const details = error.length > 2 ? error[2].err.details : ''; return JSON.stringify({ code, msg, details }); }; diff --git a/src/schemaTypes/query/info/pendingChannels.ts b/src/schemaTypes/query/info/pendingChannels.ts index d837697f..f0a7d6ec 100644 --- a/src/schemaTypes/query/info/pendingChannels.ts +++ b/src/schemaTypes/query/info/pendingChannels.ts @@ -1,28 +1,31 @@ import { - GraphQLObjectType, - GraphQLBoolean, - GraphQLString, - GraphQLList -} from "graphql"; -import { GraphQLInt } from "graphql"; -import { PartnerNodeType } from "./channels"; + GraphQLObjectType, + GraphQLBoolean, + GraphQLString, +} from 'graphql'; +import { GraphQLInt } from 'graphql'; +import { PartnerNodeType } from './channels'; // TODO: INCOMPLETE TYPE export const PendingChannelType = new GraphQLObjectType({ - name: "pendingChannelType", - fields: () => { - return { - isActive: { type: GraphQLBoolean }, - isClosing: { type: GraphQLBoolean }, - isOpening: { type: GraphQLBoolean }, - localBalance: { type: GraphQLInt }, - localReserve: { type: GraphQLInt }, - partnerPublicKey: { type: GraphQLString }, - received: { type: GraphQLInt }, - remoteBalance: { type: GraphQLInt }, - remoteReserve: { type: GraphQLInt }, - sent: { type: GraphQLInt }, - partnerNodeInfo: { type: PartnerNodeType } - }; - } + name: 'pendingChannelType', + fields: () => { + return { + closeTransactionId: { type: GraphQLString }, + isActive: { type: GraphQLBoolean }, + isClosing: { type: GraphQLBoolean }, + isOpening: { type: GraphQLBoolean }, + localBalance: { type: GraphQLInt }, + localReserve: { type: GraphQLInt }, + partnerPublicKey: { type: GraphQLString }, + received: { type: GraphQLInt }, + remoteBalance: { type: GraphQLInt }, + remoteReserve: { type: GraphQLInt }, + sent: { type: GraphQLInt }, + partnerNodeInfo: { type: PartnerNodeType }, + transactionFee: { type: GraphQLInt }, + transactionId: { type: GraphQLString }, + transactionVout: { type: GraphQLInt }, + }; + }, }); diff --git a/src/schemas/query/channels/pendingChannels.ts b/src/schemas/query/channels/pendingChannels.ts index 3ab0ab79..06d551f8 100644 --- a/src/schemas/query/channels/pendingChannels.ts +++ b/src/schemas/query/channels/pendingChannels.ts @@ -24,6 +24,9 @@ interface PendingChannelProps { remote_balance: number; remote_reserve: number; sent: number; + transaction_fee: number; + transaction_id: string; + transaction_vout: number; } export const getPendingChannels = { @@ -50,6 +53,7 @@ export const getPendingChannels = { }); return { + closeTransactionId: channel.close_transaction_id, isActive: channel.is_active, isClosing: channel.is_closing, isOpening: channel.is_opening, @@ -60,6 +64,9 @@ export const getPendingChannels = { remoteBalance: channel.remote_balance, remoteReserve: channel.remote_reserve, sent: channel.sent, + transactionFee: channel.transaction_fee, + transactionId: channel.transaction_id, + transactionVout: channel.transaction_vout, partnerNodeInfo: { alias: nodeInfo.alias, capacity: nodeInfo.capacity,