Skip to main content

RevenueReport

Get a pairwise revenue report for a channel.

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

Source: faraday.proto

gRPC

rpc RevenueReport (RevenueReportRequest) returns (RevenueReportResponse);

REST

HTTP MethodPath
GET /v1/faraday/revenue

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 = {
chan_points: <string>,
start_time: <uint64>,
end_time: <uint64>,
};
client.revenueReport(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "reports": <RevenueReport>,
// }

Messages

frdrpc.RevenueReportRequest

Source: faraday.proto

FieldgRPC TypeREST TypeREST Placement
chan_points
string[]arrayquery
start_time
uint64stringquery
end_time
uint64stringquery

frdrpc.RevenueReportResponse

Source: faraday.proto

FieldgRPC TypeREST Type
reports
RevenueReport[]array

Nested Messages

frdrpc.PairReport

FieldgRPC TypeREST Type
amount_outgoing_msat
int64string
fees_outgoing_msat
int64string
amount_incoming_msat
int64string
fees_incoming_msat
int64string

frdrpc.RevenueReport

FieldgRPC TypeREST Type
target_channel
stringstring
pair_reports
PairReportsEntry[]object

frdrpc.RevenueReport.PairReportsEntry

FieldgRPC TypeREST Type
key
stringunknown
value
PairReportunknown