Buyers

Provides methods for liquidity providers (buyers) to interact with the validator marketplace

getRFQDocumentForBuyer(rfqId: string):

Retrieve a specific RFQ by ID for the buyer

const { body: RFQ } = await api.validatorMarketPlaceBuyers.getRFQDocumentForBuyer('rfq-id-1234')

console.log(`
  RFQ id: ${RFQ.id}
  best quote: ${RFQ.best_quote}
  status: ${RFQ.status}
  settlement: ${RFQ.settlement_steps}
`)

listRFQDocumentsForBuyer(status? : 'open' | 'submitted' | 'accepted' | 'outbid' | 'rejected' | 'expired'):

List all RFQs for the buyer with an optional status filter

const { body: rfqs } = await api.validatorMarketPlaceBuyers.listRFQDocumentsForBuyer('open')

for (const rfq of rfqs) {
  console.log(`
  RFQ id: ${rfq.id}
  best quote: ${rfq.best_quote}
  status: ${rfq.status}
  settlement: ${rfq.settlement_steps}
  `)
}

submitQuote(rfqId: string, ethAmount: number):

Submit a quote for an RFQ in ETH

const rfqId = 'rfq-id-1234';
const ethAmount = 32;
const walletId = 'wallet-id-12345'

const result = await api.validatorMarketPlaceBuyers.submitQuote(rfqId, { eth_amount: ethAmount, wallet_id: walletId });

if (result.status === 201) {
  console.log('Quote submitted successfully');
}

provideEscrowHashForRFQDocument(rfqId: string, transactionHash: string):

Provide a transaction hash for an escrow deposit as part of settlement

const rfqId = 'rfq-id-1234';
const transactionHash = '0x1234567890abcdef';

const result = await api.validatorMarketPlaceBuyers.provideEscrowHashForRFQDocument(rfqId, { transaction_hash: transactionHash });

if (result.status === 200) {
  console.log('Transaction hash provided successfully');
}