Skip to main content

RelevantBatchSnapshot

Source: auctioneerrpc/auctioneer.proto

gRPC

rpc RelevantBatchSnapshot (RelevantBatchRequest) returns (RelevantBatch);

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 = {
id: <bytes>,
accounts: <bytes>,
};
client.relevantBatchSnapshot(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "version": <uint32>,
// "id": <bytes>,
// "charged_accounts": <AccountDiff>,
// "matched_orders": <MatchedOrdersEntry>,
// "clearing_price_rate": <uint32>,
// "execution_fee": <ExecutionFee>,
// "transaction": <bytes>,
// "fee_rate_sat_per_kw": <uint64>,
// "creation_timestamp_ns": <uint64>,
// "matched_markets": <MatchedMarketsEntry>,
// }

Messages

poolrpc.RelevantBatchRequest

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST TypeREST Placement
id
bytesunknownunknown
accounts
bytes[]unknownunknown

poolrpc.RelevantBatch

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
version
uint32unknown
id
bytesunknown
charged_accounts
AccountDiff[]unknown
matched_ordersdeprecated
MatchedOrdersEntry[]unknown
clearing_price_ratedeprecated
uint32unknown
execution_fee
ExecutionFeeunknown
transaction
bytesunknown
fee_rate_sat_per_kw
uint64unknown
creation_timestamp_ns
uint64unknown
matched_markets
MatchedMarketsEntry[]unknown

Nested Messages

poolrpc.AccountDiff

FieldgRPC TypeREST Type
ending_balance
uint64unknown
ending_state
AccountStateunknown
outpoint_index
int32unknown
trader_key
bytesunknown
new_expiry
uint32unknown
new_version
uint32unknown

poolrpc.ExecutionFee

FieldgRPC TypeREST Type
base_fee
uint64string
fee_rate
uint64string

poolrpc.MatchedAsk

FieldgRPC TypeREST Type
ask
ServerAskunknown
units_filled
uint32unknown

poolrpc.MatchedBid

FieldgRPC TypeREST Type
bid
ServerBidunknown
units_filled
uint32unknown

poolrpc.MatchedMarket

FieldgRPC TypeREST Type
matched_orders
MatchedOrdersEntry[]unknown
clearing_price_rate
uint32unknown

poolrpc.MatchedMarket.MatchedOrdersEntry

FieldgRPC TypeREST Type
key
stringunknown
value
MatchedOrderunknown

poolrpc.MatchedOrder

FieldgRPC TypeREST Type
matched_bids
MatchedBid[]unknown
matched_asks
MatchedAsk[]unknown

poolrpc.NodeAddress

FieldgRPC TypeREST Type
network
stringunknown
addr
stringunknown

poolrpc.RelevantBatch.MatchedMarketsEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
MatchedMarketunknown

poolrpc.RelevantBatch.MatchedOrdersEntry

FieldgRPC TypeREST Type
key
stringunknown
value
MatchedOrderunknown

poolrpc.ServerAsk

FieldgRPC TypeREST Type
details
ServerOrderunknown
lease_duration_blocks
uint32unknown
version
uint32unknown
announcement_constraints
ChannelAnnouncementConstraintsunknown
confirmation_constraints
ChannelConfirmationConstraintsunknown

poolrpc.ServerBid

FieldgRPC TypeREST Type
details
ServerOrderunknown
lease_duration_blocks
uint32unknown
version
uint32unknown
min_node_tier
NodeTierunknown
self_chan_balance
uint64unknown
is_sidecar_channel
boolunknown
unannounced_channel
boolunknown
zero_conf_channel
boolunknown

poolrpc.ServerOrder

FieldgRPC TypeREST Type
trader_key
bytesunknown
rate_fixed
uint32unknown
amt
uint64unknown
min_chan_amt
uint64unknown
order_nonce
bytesunknown
order_sig
bytesunknown
multi_sig_key
bytesunknown
node_pub
bytesunknown
node_addr
NodeAddress[]unknown
channel_type
OrderChannelTypeunknown
max_batch_fee_rate_sat_per_kw
uint64unknown
allowed_node_ids
bytes[]unknown
not_allowed_node_ids
bytes[]unknown
auction_type
AuctionTypeunknown
is_public
boolunknown

Enums

poolrpc.AccountDiff.AccountState

NameNumber
OUTPUT_RECREATED
0
OUTPUT_DUST_EXTENDED_OFFCHAIN
1
OUTPUT_DUST_ADDED_TO_FEES
2
OUTPUT_FULLY_SPENT
3

poolrpc.AuctionType

NameNumber
AUCTION_TYPE_BTC_INBOUND_LIQUIDITY
0
AUCTION_TYPE_BTC_OUTBOUND_LIQUIDITY
1

poolrpc.ChannelAnnouncementConstraints

NameNumber
ANNOUNCEMENT_NO_PREFERENCE
0
ONLY_ANNOUNCED
1
ONLY_UNANNOUNCED
2

poolrpc.ChannelConfirmationConstraints

NameNumber
CONFIRMATION_NO_PREFERENCE
0
ONLY_CONFIRMED
1
ONLY_ZEROCONF
2

poolrpc.NodeTier

NameNumber
TIER_DEFAULT
0
TIER_0
1
TIER_1
2

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