Skip to main content

SubmitOrder

Source: auctioneerrpc/auctioneer.proto

gRPC

rpc SubmitOrder (ServerSubmitOrderRequest) returns (ServerSubmitOrderResponse);

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 = {
ask: <ServerAsk>,
bid: <ServerBid>,
user_agent: <string>,
};
client.submitOrder(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "invalid_order": <InvalidOrder>,
// "accepted": <bool>,
// }

Messages

poolrpc.ServerSubmitOrderRequest

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST TypeREST Placement
ask
ServerAskunknownunknown
bid
ServerBidunknownunknown
user_agent
stringunknownunknown

poolrpc.ServerSubmitOrderResponse

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
invalid_order
InvalidOrderunknown
accepted
boolunknown

Nested Messages

poolrpc.InvalidOrder

FieldgRPC TypeREST Type
order_nonce
bytesstring
fail_reason
FailReasonstring
fail_string
stringstring

poolrpc.NodeAddress

FieldgRPC TypeREST Type
network
stringunknown
addr
stringunknown

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.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.InvalidOrder.FailReason

NameNumber
INVALID_AMT
0

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