Skip to main content

CloseReport

Get a channel close report for a specific channel.

Example request: http://localhost:8466/v1/faraday/closereport

Source: faraday.proto

gRPC

rpc CloseReport (CloseReportRequest) returns (CloseReportResponse);

REST

HTTP MethodPath
GET /v1/faraday/closereport

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:8465'
const MACAROON_PATH = 'FARADAY_DIR/regtest/faraday.macaroon'
const TLS_PATH = 'FARADAY_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('faraday.proto', loaderOptions);
const frdrpc = grpc.loadPackageDefinition(packageDefinition).frdrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new frdrpc.FaradayServer(GRPC_HOST, creds);
let request = {
channel_point: <string>,
};
client.closeReport(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "channel_point": <string>,
// "channel_initiator": <bool>,
// "close_type": <string>,
// "close_txid": <string>,
// "open_fee": <string>,
// "close_fee": <string>,
// }

Messages

frdrpc.CloseReportRequest

Source: faraday.proto

FieldgRPC TypeREST TypeREST Placement
channel_point
stringstringquery

frdrpc.CloseReportResponse

Source: faraday.proto

FieldgRPC TypeREST Type
channel_point
stringstring
channel_initiator
boolboolean
close_type
stringstring
close_txid
stringstring
open_fee
stringstring
close_fee
stringstring