Skip to main content

Terms

Source: auctioneerrpc/auctioneer.proto

gRPC

rpc Terms (TermsRequest) returns (TermsResponse);

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 = {};
client.terms(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "max_account_value": <uint64>,
// "max_order_duration_blocks": <uint32>,
// "execution_fee": <ExecutionFee>,
// "lease_durations": <LeaseDurationsEntry>,
// "next_batch_conf_target": <uint32>,
// "next_batch_fee_rate_sat_per_kw": <uint64>,
// "next_batch_clear_timestamp": <uint64>,
// "lease_duration_buckets": <LeaseDurationBucketsEntry>,
// "auto_renew_extension_blocks": <uint32>,
// }

Messages

poolrpc.TermsRequest

Source: auctioneerrpc/auctioneer.proto

note

This request has no parameters.

poolrpc.TermsResponse

Source: auctioneerrpc/auctioneer.proto

FieldgRPC TypeREST Type
max_account_value
uint64unknown
max_order_duration_blocksdeprecated
uint32unknown
execution_fee
ExecutionFeeunknown
lease_durationsdeprecated
LeaseDurationsEntry[]unknown
next_batch_conf_target
uint32unknown
next_batch_fee_rate_sat_per_kw
uint64unknown
next_batch_clear_timestamp
uint64unknown
lease_duration_buckets
LeaseDurationBucketsEntry[]unknown
auto_renew_extension_blocks
uint32unknown

Nested Messages

poolrpc.ExecutionFee

FieldgRPC TypeREST Type
base_fee
uint64string
fee_rate
uint64string

poolrpc.TermsResponse.LeaseDurationBucketsEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
DurationBucketStateunknown

poolrpc.TermsResponse.LeaseDurationsEntry

FieldgRPC TypeREST Type
key
uint32unknown
value
boolunknown

Enums

poolrpc.DurationBucketState

NameNumber
NO_MARKET
0
MARKET_CLOSED
1
ACCEPTING_ORDERS
2
MARKET_OPEN
3