Skip to main content

SubscribeRfqEventNtfns

SubscribeRfqEventNtfns is used to subscribe to RFQ events.

Source: rfqrpc/rfq.proto

gRPC

info

This is a server-streaming RPC

rpc SubscribeRfqEventNtfns (SubscribeRfqEventNtfnsRequest) returns (stream RfqEvent);

REST

HTTP MethodPath
POST /v1/taproot-assets/rfq/ntfs

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 = {};
let call = client.subscribeRfqEventNtfns(request);
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.
});
// Console output:
// {
// "peer_accepted_buy_quote": <PeerAcceptedBuyQuoteEvent>,
// "peer_accepted_sell_quote": <PeerAcceptedSellQuoteEvent>,
// "accept_htlc": <AcceptHtlcEvent>,
// }

Messages

rfqrpc.SubscribeRfqEventNtfnsRequest

Source: rfqrpc/rfq.proto

note

This request has no parameters.

rfqrpc.RfqEvent

Source: rfqrpc/rfq.proto

FieldgRPC TypeREST Type
peer_accepted_buy_quote
PeerAcceptedBuyQuoteEventobject
peer_accepted_sell_quote
PeerAcceptedSellQuoteEventobject
accept_htlc
AcceptHtlcEventobject

Nested Messages

rfqrpc.AcceptHtlcEvent

FieldgRPC TypeREST Type
timestamp
uint64string
scid
uint64string

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

FieldgRPC TypeREST Type
timestamp
uint64string
peer_accepted_buy_quote
PeerAcceptedBuyQuoteobject

rfqrpc.PeerAcceptedSellQuote

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

rfqrpc.PeerAcceptedSellQuoteEvent

FieldgRPC TypeREST Type
timestamp
uint64string
peer_accepted_sell_quote
PeerAcceptedSellQuoteobject