@bandprotocol/bandchain.js
Version:
TypeScript library for Cosmos SDK and BandChain
101 lines (100 loc) • 3.86 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LCDQueryClient = void 0;
//@ts-nocheck
const helpers_1 = require("../../../helpers");
class LCDQueryClient {
req;
constructor({ requestClient }) {
this.req = requestClient;
this.counts = this.counts.bind(this);
this.groups = this.groups.bind(this);
this.group = this.group.bind(this);
this.members = this.members.bind(this);
this.isGrantee = this.isGrantee.bind(this);
this.dE = this.dE.bind(this);
this.pendingGroups = this.pendingGroups.bind(this);
this.pendingSignings = this.pendingSignings.bind(this);
this.signing = this.signing.bind(this);
this.signings = this.signings.bind(this);
this.params = this.params.bind(this);
}
/* Counts queries the number of existing groups and signing. */
async counts(_params = {}) {
const endpoint = `tss/v1beta1/counts`;
return await this.req.get(endpoint);
}
/* Groups queries groups details. */
async groups(params = {
pagination: undefined
}) {
const options = {
params: {}
};
if (typeof params?.pagination !== "undefined") {
(0, helpers_1.setPaginationParams)(options, params.pagination);
}
const endpoint = `tss/v1beta1/groups`;
return await this.req.get(endpoint, options);
}
/* Group queries group details from the given id. */
async group(params) {
const endpoint = `tss/v1beta1/groups/${params.groupId}`;
return await this.req.get(endpoint);
}
/* Members queries all members in this group. */
async members(params) {
const endpoint = `tss/v1beta1/groups/${params.groupId}/members`;
return await this.req.get(endpoint);
}
/* IsGrantee queries whether granter grants the grantee. */
async isGrantee(params) {
const endpoint = `tss/v1beta1/is_grantee/${params.granter}/${params.grantee}`;
return await this.req.get(endpoint);
}
/* DE queries all de for this address. */
async dE(params) {
const options = {
params: {}
};
if (typeof params?.pagination !== "undefined") {
(0, helpers_1.setPaginationParams)(options, params.pagination);
}
const endpoint = `tss/v1beta1/de_list/${params.address}`;
return await this.req.get(endpoint, options);
}
/* PendingGroups queries all pending groups that waits the given address to submit a message. */
async pendingGroups(params) {
const endpoint = `tss/v1beta1/pending_groups/${params.address}`;
return await this.req.get(endpoint);
}
/* PendingSignings queries all pending requests that waits the given address to sign a message. */
async pendingSignings(params) {
const endpoint = `tss/v1beta1/pending_signings/${params.address}`;
return await this.req.get(endpoint);
}
/* Signing queries signing details from the given id. */
async signing(params) {
const endpoint = `tss/v1beta1/signings/${params.signingId}`;
return await this.req.get(endpoint);
}
/* Signings queries signings details. */
async signings(params = {
pagination: undefined
}) {
const options = {
params: {}
};
if (typeof params?.pagination !== "undefined") {
(0, helpers_1.setPaginationParams)(options, params.pagination);
}
const endpoint = `tss/v1beta1/signings`;
return await this.req.get(endpoint, options);
}
/* Params returns all parameters of the module. */
async params(_params = {}) {
const endpoint = `tss/v1beta1/params`;
return await this.req.get(endpoint);
}
}
exports.LCDQueryClient = LCDQueryClient;