UNPKG

@bandprotocol/bandchain.js

Version:

TypeScript library for Cosmos SDK and BandChain

41 lines (40 loc) 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LCDQueryClient = void 0; class LCDQueryClient { req; constructor({ requestClient }) { this.req = requestClient; this.proof = this.proof.bind(this); this.multiProof = this.multiProof.bind(this); this.requestCountProof = this.requestCountProof.bind(this); } /* Proof queries the proof for given request ID */ async proof(params) { const options = { params: {} }; if (typeof params?.height !== "undefined") { options.params.height = params.height; } const endpoint = `bandchain/v1/oracle/proof/${params.requestId}`; return await this.req.get(endpoint, options); } /* MultiProof queries multiple proofs for given list of request IDs */ async multiProof(params) { const options = { params: {} }; if (typeof params?.requestIds !== "undefined") { options.params.request_ids = params.requestIds; } const endpoint = `bandchain/v1/oracle/multi_proof`; return await this.req.get(endpoint, options); } /* RequestCountProof queries the count proof */ async requestCountProof(_params = {}) { const endpoint = `bandchain/v1/oracle/requests_count_proof`; return await this.req.get(endpoint); } } exports.LCDQueryClient = LCDQueryClient;