Skip to main content

SubscribeSidecar

Source: auctioneerrpc/auctioneer.proto

gRPC

info

This is a bidirectional-streaming RPC

rpc SubscribeSidecar (stream ClientAuctionMessage) returns (stream ServerAuctionMessage);

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 = {
commit: <AccountCommitment>,
subscribe: <AccountSubscription>,
accept: <OrderMatchAccept>,
reject: <OrderMatchReject>,
sign: <OrderMatchSign>,
recover: <AccountRecovery>,
};
let call = client.subscribeSidecar({});
call.on('data', function(response) {
// A response was received from the server.
console.log(response);
});
call.on('status', function(status) {
// The current status of the stream.
});
call.on('end', function() {
// The server has closed the stream.
});
call.write(request);
// Console output:
// {
// "challenge": <ServerChallenge>,
// "success": <SubscribeSuccess>,
// "error": <SubscribeError>,
// "prepare": <OrderMatchPrepare>,
// "sign": <OrderMatchSignBegin>,
// "finalize": <OrderMatchFinalize>,
// "account": <AuctionAccount>,
// }

Messages

poolrpc.ClientAuctionMessage

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST TypeREST Placement
commit
AccountCommitmentunknownunknown
subscribe
AccountSubscriptionunknownunknown
accept
OrderMatchAcceptunknownunknown
reject
OrderMatchRejectunknownunknown
sign
OrderMatchSignunknownunknown
recover
AccountRecoveryunknownunknown

poolrpc.ServerAuctionMessage

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
challenge
ServerChallengeunknown
success
SubscribeSuccessunknown
error
SubscribeErrorunknown
prepare
OrderMatchPrepareunknown
sign
OrderMatchSignBeginunknown
finalize
OrderMatchFinalizeunknown
account
AuctionAccountunknown

Nested Messages

poolrpc.AccountCommitment

FieldgRPC TypeREST Type
commit_hash
bytesunknown
batch_version
uint32unknown

poolrpc.AccountDiff

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

poolrpc.AccountRecovery

FieldgRPC TypeREST Type
trader_key
bytesunknown

poolrpc.AccountSubscription

FieldgRPC TypeREST Type
trader_key
bytesunknown
commit_nonce
bytesunknown
auth_sig
bytesunknown

poolrpc.AuctionAccount

FieldgRPC TypeREST Type
value
uint64unknown
expiry
uint32unknown
trader_key
bytesunknown
auctioneer_key
bytesunknown
batch_key
bytesunknown
state
AuctionAccountStateunknown
height_hint
uint32unknown
outpoint
OutPointunknown
latest_tx
bytesunknown
version
uint32unknown

poolrpc.ChannelInfo

FieldgRPC TypeREST Type
type
ChannelTypeunknown
local_node_key
bytesunknown
remote_node_key
bytesunknown
local_payment_base_point
bytesunknown
remote_payment_base_point
bytesunknown

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.OrderMatchAccept

FieldgRPC TypeREST Type
batch_id
bytesunknown

poolrpc.OrderMatchFinalize

FieldgRPC TypeREST Type
batch_id
bytesunknown
batch_txid
bytesunknown

poolrpc.OrderMatchPrepare

FieldgRPC TypeREST Type
matched_ordersdeprecated
MatchedOrdersEntry[]unknown
clearing_price_ratedeprecated
uint32unknown
charged_accounts
AccountDiff[]unknown
execution_fee
ExecutionFeeunknown
batch_transaction
bytesunknown
fee_rate_sat_per_kw
uint64unknown
fee_rebate_sat
uint64unknown
batch_id
bytesunknown
batch_version
uint32unknown
matched_markets
MatchedMarketsEntry[]unknown
batch_height_hint
uint32unknown

poolrpc.OrderMatchPrepare.MatchedMarketsEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
MatchedMarketunknown

poolrpc.OrderMatchPrepare.MatchedOrdersEntry

FieldgRPC TypeREST Type
key
stringunknown
value
MatchedOrderunknown

poolrpc.OrderMatchReject

FieldgRPC TypeREST Type
batch_id
bytesunknown
reason
stringunknown
reason_code
RejectReasonunknown
rejected_orders
RejectedOrdersEntry[]unknown

poolrpc.OrderMatchReject.RejectedOrdersEntry

FieldgRPC TypeREST Type
key
stringunknown
value
OrderRejectunknown

poolrpc.OrderMatchSign

FieldgRPC TypeREST Type
batch_id
bytesunknown
account_sigs
AccountSigsEntry[]unknown
channel_infos
ChannelInfosEntry[]unknown
trader_nonces
TraderNoncesEntry[]unknown

poolrpc.OrderMatchSign.AccountSigsEntry

FieldgRPC TypeREST Type
key
stringunknown
value
bytesunknown

poolrpc.OrderMatchSign.ChannelInfosEntry

FieldgRPC TypeREST Type
key
stringunknown
value
ChannelInfounknown

poolrpc.OrderMatchSign.TraderNoncesEntry

FieldgRPC TypeREST Type
key
stringunknown
value
bytesunknown

poolrpc.OrderMatchSignBegin

FieldgRPC TypeREST Type
batch_id
bytesunknown
server_nonces
ServerNoncesEntry[]unknown
prev_outputs
TxOut[]unknown

poolrpc.OrderMatchSignBegin.ServerNoncesEntry

FieldgRPC TypeREST Type
key
stringunknown
value
bytesunknown

poolrpc.OrderReject

FieldgRPC TypeREST Type
reason
stringunknown
reason_code
OrderRejectReasonunknown

poolrpc.OutPoint

FieldgRPC TypeREST Type
txid
bytesstring
output_index
uint32integer

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.ServerChallenge

FieldgRPC TypeREST Type
challenge
bytesunknown
commit_hash
bytesunknown

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

poolrpc.SubscribeError

FieldgRPC TypeREST Type
error
stringunknown
error_code
Errorunknown
trader_key
bytesunknown
account_reservation
AuctionAccountunknown

poolrpc.SubscribeSuccess

FieldgRPC TypeREST Type
trader_key
bytesunknown

poolrpc.TxOut

FieldgRPC TypeREST Type
value
uint64unknown
pk_script
bytesunknown

Enums

poolrpc.AccountDiff.AccountState

NameNumber
OUTPUT_RECREATED
0
OUTPUT_DUST_EXTENDED_OFFCHAIN
1
OUTPUT_DUST_ADDED_TO_FEES
2
OUTPUT_FULLY_SPENT
3

poolrpc.AuctionAccountState

NameNumber
STATE_PENDING_OPEN
0
STATE_OPEN
1
STATE_EXPIRED
2
STATE_PENDING_UPDATE
3
STATE_CLOSED
4
STATE_PENDING_BATCH
5
STATE_EXPIRED_PENDING_UPDATE
6

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.ChannelType

NameNumber
TWEAKLESS
0
ANCHORS
1
SCRIPT_ENFORCED_LEASE
2
SIMPLE_TAPROOT
3

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

poolrpc.OrderMatchReject.RejectReason

NameNumber
UNKNOWN
0
SERVER_MISBEHAVIOR
1
BATCH_VERSION_MISMATCH
2
PARTIAL_REJECT
3

poolrpc.OrderReject.OrderRejectReason

NameNumber
DUPLICATE_PEER
0
CHANNEL_FUNDING_FAILED
1

poolrpc.SubscribeError.Error

NameNumber
UNKNOWN
0
SERVER_SHUTDOWN
1
ACCOUNT_DOES_NOT_EXIST
2
INCOMPLETE_ACCOUNT_RESERVATION
3