Skip to main content

BatchSnapshot

Source: auctioneerrpc/auctioneer.proto

gRPC

rpc BatchSnapshot (BatchSnapshotRequest) returns (BatchSnapshotResponse);

Code Samples

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

const GRPC_HOST = 'localhost:12010'
const MACAROON_PATH = 'POOL_DIR/regtest/pool.macaroon'
const TLS_PATH = 'POOL_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('auctioneerrpc/auctioneer.proto', loaderOptions);
const poolrpc = grpc.loadPackageDefinition(packageDefinition).poolrpc;
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 poolrpc.ChannelAuctioneer(GRPC_HOST, creds);
let request = {
batch_id: <bytes>,
};
client.batchSnapshot(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "version": <uint32>,
// "batch_id": <bytes>,
// "prev_batch_id": <bytes>,
// "clearing_price_rate": <uint32>,
// "matched_orders": <MatchedOrderSnapshot>,
// "batch_tx_id": <string>,
// "batch_tx": <bytes>,
// "batch_tx_fee_rate_sat_per_kw": <uint64>,
// "creation_timestamp_ns": <uint64>,
// "matched_markets": <MatchedMarketsEntry>,
// }

Messages

poolrpc.BatchSnapshotRequest

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST TypeREST Placement
batch_id
bytesstringquery

poolrpc.BatchSnapshotResponse

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
version
uint32integer
batch_id
bytesstring
prev_batch_id
bytesstring
clearing_price_ratedeprecated
uint32integer
matched_ordersdeprecated
MatchedOrderSnapshot[]array
batch_tx_id
stringstring
batch_tx
bytesstring
batch_tx_fee_rate_sat_per_kw
uint64string
creation_timestamp_ns
uint64string
matched_markets
MatchedMarketsEntry[]object

Nested Messages

poolrpc.AskSnapshot

FieldgRPC TypeREST Type
version
uint32integer
lease_duration_blocks
uint32integer
rate_fixed
uint32integer
chan_type
OrderChannelTypestring

poolrpc.BatchSnapshotResponse.MatchedMarketsEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
MatchedMarketSnapshotunknown

poolrpc.BidSnapshot

FieldgRPC TypeREST Type
version
uint32integer
lease_duration_blocks
uint32integer
rate_fixed
uint32integer
chan_type
OrderChannelTypestring

poolrpc.MatchedMarketSnapshot

FieldgRPC TypeREST Type
matched_orders
MatchedOrderSnapshot[]array
clearing_price_rate
uint32integer

poolrpc.MatchedOrderSnapshot

FieldgRPC TypeREST Type
ask
AskSnapshotobject
bid
BidSnapshotobject
matching_rate
uint32integer
total_sats_cleared
uint64string
units_matched
uint32integer

Enums

poolrpc.OrderChannelType

NameNumber
ORDER_CHANNEL_TYPE_UNKNOWN
0
ORDER_CHANNEL_TYPE_PEER_DEPENDENT
1
ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED
2
ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT
3