Skip to main content

QueryPeerAcceptedQuotes

QueryPeerAcceptedQuotes is used to query for quotes that were requested by our node and have been accepted our peers.

Source: rfqrpc/rfq.proto

gRPC

rpc QueryPeerAcceptedQuotes (QueryPeerAcceptedQuotesRequest) returns (QueryPeerAcceptedQuotesResponse);

REST

HTTP MethodPath
GET /v1/taproot-assets/rfq/quotes/peeraccepted

Code Samples

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

const GRPC_HOST = 'localhost:10029'
const MACAROON_PATH = 'TAPROOT-ASSETS_DIR/regtest/taproot-assets.macaroon'
const TLS_PATH = 'TAPROOT-ASSETS_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('rfqrpc/rfq.proto', loaderOptions);
const rfqrpc = grpc.loadPackageDefinition(packageDefinition).rfqrpc;
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 rfqrpc.Rfq(GRPC_HOST, creds);
let request = {};
client.queryPeerAcceptedQuotes(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "buy_quotes": <PeerAcceptedBuyQuote>,
// "sell_quotes": <PeerAcceptedSellQuote>,
// }

Messages

rfqrpc.QueryPeerAcceptedQuotesRequest

Source: rfqrpc/rfq.proto

note

This request has no parameters.

rfqrpc.QueryPeerAcceptedQuotesResponse

Source: rfqrpc/rfq.proto

FieldgRPC TypeREST Type
buy_quotes
PeerAcceptedBuyQuote[]array
sell_quotes
PeerAcceptedSellQuote[]array

Nested Messages

rfqrpc.FixedPoint

FieldgRPC TypeREST Type
coefficient
stringstring
scale
uint32integer

rfqrpc.PeerAcceptedBuyQuote

FieldgRPC TypeREST Type
peer
stringstring
id
bytesstring
scid
uint64string
asset_amount
uint64string
ask_asset_rate
FixedPointobject
expiry
uint64string

rfqrpc.PeerAcceptedSellQuote

FieldgRPC TypeREST Type
peer
stringstring
id
bytesstring
scid
uint64string
asset_amount
uint64string
bid_asset_rate
FixedPointobject
expiry
uint64string